Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(data-warehouse): add 4 missing tables to the Cliniko source (#118990)

Tom Owersb0b55430d73d
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
index 246d70bdf631..fabdf1c30bd2 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
@@ -2712,12 +2712,12 @@ Today (12): `appointment_types`, `attendees`, `businesses`, `group_appointments`
Diffed against: <https://docs.api.cliniko.com/_bundle/openapi.json?download>
-- [ ] `Billable items (GET /v1/billable_items)` — resolve invoice item links to service codes, catalog prices, and item categories (high)
-- [ ] `Patient cases (GET /v1/patient_cases)` — resolve appointment case links and analyze treatment episodes, session limits, and case closure (high)
-- [ ] `Contacts (GET /v1/contacts)` — resolve patient referring doctor links and compare referral performance (high)
+- [x] `Billable items (GET /v1/billable_items)` — resolve invoice item links to service codes, catalog prices, and item categories (high)
+- [x] `Patient cases (GET /v1/patient_cases)` — resolve appointment case links and analyze treatment episodes, session limits, and case closure (high)
+- [x] `Contacts (GET /v1/contacts)` — resolve patient referring doctor links and compare referral performance (high)
- [ ] `Concession types (GET /v1/concession_types)` — resolve patient concession links to discount categories (high)
- [ ] `Product suppliers (GET /v1/product_suppliers)` — resolve product supplier IDs and analyze stock by supplier (high)
-- [ ] `Users (GET /v1/users)` — resolve practitioner user links and identify staff responsible for clinic activity (high)
+- [x] `Users (GET /v1/users)` — resolve practitioner user links and identify staff responsible for clinic activity (high)
- [ ] `Referral source types (GET /v1/referral_source_types)` — resolve referral source type links to named acquisition categories (high)
- [ ] `Daily availabilities (GET /v1/daily_availabilities)` — compare recurring practitioner capacity with booked appointments to measure utilization (high)
- [ ] `Stock adjustments (GET /v1/stock_adjustments)` — explain stock changes through sales, corrections, and replenishment activity (medium)
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/cliniko/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/cliniko/canonical_descriptions.py
index d1381e528519..3ce8f6091123 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/cliniko/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/cliniko/canonical_descriptions.py
@@ -215,4 +215,70 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
notes="Free-text notes about the product.",
),
},
+ "billable_items": {
+ "description": "A billable service or item in the practice's catalog, with its default price and tax.",
+ "docs_url": "https://docs.api.cliniko.com/openapi/billable-item",
+ "columns": _columns(
+ name="Name of the billable item.",
+ item_code="Billing code for the billable item.",
+ item_type="Type of the billable item.",
+ price="Default price of the billable item.",
+ tax="Tax applied to the billable item.",
+ concession_prices="Prices of the billable item for each concession type.",
+ ),
+ },
+ "contacts": {
+ "description": "A contact outside the practice, such as a referring doctor or a third-party payer.",
+ "docs_url": "https://docs.api.cliniko.com/openapi/contact",
+ "columns": _columns(
+ title="Contact's title.",
+ first_name="Contact's first name.",
+ last_name="Contact's last name.",
+ preferred_name="Name the contact prefers to be called.",
+ company_name="Name of the contact's company.",
+ email="Contact's email address.",
+ phone_numbers="Contact's phone numbers.",
+ occupation="Contact's occupation.",
+ type="Type of the contact.",
+ doctor_type="Type of doctor, when the contact is a doctor.",
+ provider_number="Contact's provider number.",
+ city="City of the contact's address.",
+ country_code="ISO 3166-1 country code of the contact's address.",
+ notes="Free-text notes about the contact.",
+ deleted_at="Time the record was deleted, or null if not deleted.",
+ ),
+ },
+ "patient_cases": {
+ "description": "A case that groups a patient's appointments and invoices for one course of treatment or referral.",
+ "docs_url": "https://docs.api.cliniko.com/openapi/patient-case",
+ "columns": _columns(
+ name="Name of the patient case.",
+ patient="Link to the patient the case belongs to.",
+ contact="Link to the contact associated with the case, such as the referrer.",
+ attendee_ids="IDs of the attendees (appointment attendances) linked to the case.",
+ referral="Whether the case is a referral.",
+ referral_type="Type of referral for the case.",
+ issue_date="Date the case was issued.",
+ expiry_date="Date the case expires.",
+ max_sessions="Maximum number of sessions allowed for the case.",
+ max_invoiceable_amount="Maximum amount that can be invoiced against the case.",
+ closed="Whether the case is closed.",
+ closed_at="Time the case was closed, or null if still open.",
+ notes="Free-text notes about the case.",
+ ),
+ },
+ "users": {
+ "description": "A user account with access to the practice's Cliniko account.",
+ "docs_url": "https://docs.api.cliniko.com/openapi/user",
+ "columns": _columns(
+ title="User's title.",
+ first_name="User's first name.",
+ last_name="User's last name.",
+ email="User's email address.",
+ phone_numbers="User's phone numbers.",
+ role="User's role in the Cliniko account.",
+ time_zone="User's time zone.",
+ active="Whether the user is active.",
+ ),
+ },
}
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/cliniko/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/cliniko/settings.py
index b494e97f9399..9ccca3f662cc 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/cliniko/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/cliniko/settings.py
@@ -9,16 +9,20 @@ from products.warehouse_sources.backend.types import IncrementalField, Increment
ENDPOINTS = (
"appointment_types",
"attendees",
+ "billable_items",
"businesses",
+ "contacts",
"group_appointments",
"individual_appointments",
"invoice_items",
"invoices",
+ "patient_cases",
"patients",
"practitioners",
"products",
"referral_sources",
"treatment_notes",
+ "users",
)
# Every endpoint's records carry a `created_at` that never changes after creation, so it's a