Skip to content

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id#9105

Merged
dannash100 merged 8 commits intorelease/2.47from
fix/ordering-hierarchy
Apr 15, 2026
Merged

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id#9105
dannash100 merged 8 commits intorelease/2.47from
fix/ordering-hierarchy

Conversation

@dannash100
Copy link
Copy Markdown
Contributor

@dannash100 dannash100 commented Feb 3, 2026

Changes

Children Hierarchy fields would not sort alphabetically due to an exclusion added in medication epic to avoid ambiguous include issue.

  • This fixes by making subquery
  • It does remove the joined parent being available on suggester results, but that is unused currently
  • Added tests for the special case MEDICATION_SET that the exclusion was added to account for.
  • Fixed a mispelled file

I have also loaded Hierarchy reference data into deployed environment, and tested location hierarchy and medication set suggesters

Deploys

  • Deploy to Tamanu Internal

Tests

  • Run E2E Tests

Remember to...

  • ...write or update tests
  • ...add UI screenshots and testing notes to the Linear issue
  • ...add any manual upgrade steps to the Linear issue
  • ...update the config reference, settings reference, or any relevant runbook(s)
  • ...call out additions or changes to config files for the deployment team to take note of

Note

Medium Risk
Changes how many ReferenceData suggestion endpoints filter by parentId (moving from a self-join include to an IN (subquery)), which can affect result ordering/limits across address hierarchy and other reference types. While covered by added tests, it touches a high-traffic query path and could have SQL/performance edge cases in production data.

Overview
Fixes ReferenceData suggestion sorting when using hierarchical filters by switching parentId filtering to an id IN (SELECT …) subquery and ensuring the default alphabetical order (including translated names) is still applied.

Also tightens up ID exclusion logic for medicationSet/noteType suggesters when combined with other filters, adds regression tests for parent-filtered sorting (including translations) and medication set sorting with complex includes, and makes TranslatedEnumField option generation deterministic by sorting enumValues entries before translating.

Written by Cursor Bugbot for commit 3bba737. This will update automatically on new commits. Configure here.

Cursor Bugbot reviewed your changes and found no issues for commit 36b52e3

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @dannash100, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a crucial fix for sorting inconsistencies within the application's suggestion API and UI components. It ensures that hierarchical data, such as subdivisions filtered by a parent, and medication sets are consistently presented in alphabetical order. The backend logic for parent-child relationships has been refactored to use subqueries, enhancing efficiency and clarity. Additionally, translated enum options in the UI now display in a predictable, sorted manner, improving user experience.

Highlights

  • API Sorting Fix: Implemented alphabetical sorting for suggestion API results when filtering by parent ID, including support for translated names.
  • Medication Set Sorting: Ensured medication sets are also sorted alphabetically in the suggestion API, even with complex data inclusions.
  • Backend Refactoring: Reworked the parent-child filtering mechanism in the suggestions service from an include join to a more efficient subquery, resolving potential ambiguity issues.
  • UI Enum Sorting: Added alphabetical sorting for translated enum options displayed in the UI components.
  • Comprehensive Testing: Introduced new unit tests to thoroughly validate the correct sorting behavior across various scenarios in the suggestions API.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/facility-server/tests/apiv1/Suggestions.test.js
    • Added new test cases to verify alphabetical sorting for hierarchy children when filtered by parentId.
    • Included tests to confirm correct alphabetical sorting for translated hierarchy children.
    • Added a test to ensure medication sets are sorted alphabetically even with complex includes.
  • packages/shared/src/services/suggestions/suggestions.js
    • Refactored parent-child filtering logic in the suggestions service to use a Sequelize.literal subquery for parentId filtering, replacing the previous include based approach.
    • Adjusted Op.notIn conditions for MEDICATION_SET and NOTE_TYPE to correctly combine with other baseWhere.id filters.
    • Removed the parentId related include configuration and the shouldSkipDefaultOrder property, as sorting is now handled implicitly or by default.
  • packages/ui-components/src/components/Translation/TranslatedEnumIInput.jsx
    • Applied .sort() to Object.entries(enumValues) to ensure translated enum options are displayed in alphabetical order by their keys.
Activity
  • The pull request was opened by dannash100.
  • The pull request description includes a standard template for changes, deploys, tests, and reminders, indicating it's a new submission.
  • No specific review comments or further activity have been recorded yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

gemini-code-assist[bot]

This comment was marked as outdated.

@dannash100
Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Feb 3, 2026

Skipping Bugbot: Bugbot is disabled for this repository

@dannash100
Copy link
Copy Markdown
Contributor Author

bugbot run

@dannash100 dannash100 changed the title fix(suggestions): Fix sorting on hierarchy field children fix(suggestions): 2.47 hotfix: Fix sorting on hierarchy field children Feb 3, 2026
Comment thread packages/ui-components/src/components/Translation/TranslatedEnumIInput.jsx Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 3, 2026

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 3, 2026

🍹 up on tamanu-on-k8s/bes/tamanu-on-k8s/fix-ordering-hierarchy

Pulumi report
   Updating (fix-ordering-hierarchy)

View Live: https://app.pulumi.com/bes/tamanu-on-k8s/fix-ordering-hierarchy/updates/4

Downloading plugin random-4.19.0: starting
Downloading plugin random-4.19.0: done
Installing plugin random-4.19.0: starting
Installing plugin random-4.19.0: done

@ Updating....
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running 
@ Updating.....
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running read kubernetes:core/v1:Namespace tamanu-fix-ordering-hierarchy
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running read pulumi:pulumi:StackReference bes/k8s-core/tamanu-internal-main
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Using tailscale proxy https://k8s-operator-tamanu-internal-main.tail53aef.ts.net
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running read pulumi:pulumi:StackReference bes/k8s-core/tamanu-internal-main
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running read pulumi:pulumi:StackReference bes/core/tamanu-internal
@ Updating....
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running read pulumi:pulumi:StackReference bes/core/tamanu-internal
@ Updating....
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running read kubernetes:core/v1:Namespace tamanu-fix-ordering-hierarchy
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Waiting for central-db...
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Waiting for facility-1-db...
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Waiting for facility-2-db...
~  kubernetes:apps/v1:Deployment facility-1-web updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-2-web updating (0s) [diff: ~spec]
@ Updating....
~  kubernetes:apps/v1:Deployment patient-portal-web updating (0s) [diff: ~spec]
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running read kubernetes:core/v1:ConfigMap actual-provisioning
~  kubernetes:apps/v1:Deployment central-web updating (0s) [diff: ~spec]
++ kubernetes:batch/v1:Job central-migrator creating replacement (0s) [diff: ~spec]
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Secret facility-2-db-superuser not found or not ready: Error: HTTP-Code: 404
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Message: Unknown API Status Code!
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"facility-2-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"facility-2-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Headers: {"audit-id":"2e32d3ca-cb9f-42e6-9e51-7cc4b3cebb1b","cache-control":"no-cache, private","connection":"close","content-length":"220","content-type":"application/json","date":"Mon, 02 Mar 2026 19:40:25 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Secret facility-1-db-superuser not found or not ready: Error: HTTP-Code: 404
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Message: Unknown API Status Code!
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"facility-1-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"facility-1-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Headers: {"audit-id":"9b598c3c-8fc2-4695-b796-30372ae91d82","cache-control":"no-cache, private","connection":"close","content-length":"220","content-type":"application/json","date":"Mon, 02 Mar 2026 19:40:25 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Secret central-db-superuser not found or not ready: Error: HTTP-Code: 404
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Message: Unknown API Status Code!
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"central-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"central-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running Headers: {"audit-id":"9472cba5-bdd6-445e-8bed-8b0bfcbf6c1e","cache-control":"no-cache, private","connection":"close","content-length":"214","content-type":"application/json","date":"Mon, 02 Mar 2026 19:40:25 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy running read kubernetes:core/v1:ConfigMap actual-provisioning
@ Updating....
++ kubernetes:batch/v1:Job central-migrator creating replacement (0s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (0s) [diff: ~spec]
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (0s) [diff: ~spec]
@ Updating....
++ kubernetes:batch/v1:Job central-migrator creating replacement (1s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/central-migrator-5d059471" to start
++ kubernetes:batch/v1:Job central-migrator creating replacement (1s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/central-migrator-5d059471" to succeed (Active: 1 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (0s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/facility-2-migrator-1842edab" to start
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/facility-2-migrator-1842edab" to succeed (Active: 1 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (0s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/facility-1-migrator-3017d649" to start
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/facility-1-migrator-3017d649" to succeed (Active: 1 | Succeeded: 0 | Failed: 0)
~  kubernetes:apps/v1:Deployment facility-1-web updating (3s) [diff: ~spec]; Waiting for app ReplicaSet to be available (0/1 Pods available)
~  kubernetes:apps/v1:Deployment patient-portal-web updating (2s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment patient-portal-web updating (2s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment patient-portal-web updated (2s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-web updating (3s) [diff: ~spec]; Waiting for app ReplicaSet to be available (0/1 Pods available)
~  kubernetes:apps/v1:Deployment central-web updating (2s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-web updating (2s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-web updated (2s) [diff: ~spec]; 
@ Updating.............
~  kubernetes:apps/v1:Deployment facility-1-web updating (13s) [diff: ~spec]; warning: [Pod tamanu-fix-ordering-hierarchy/facility-1-web-458dd592-7f8b899c6-4269h]: containers with unready status: [http]
~  kubernetes:apps/v1:Deployment facility-2-web updating (13s) [diff: ~spec]; warning: [Pod tamanu-fix-ordering-hierarchy/facility-2-web-c8d13185-7f6bc96b65-kx4c5]: containers with unready status: [http]
@ Updating.....
~  kubernetes:apps/v1:Deployment facility-1-web updating (14s) [diff: ~spec]; Waiting for app ReplicaSet to be available (1/2 Pods available)
~  kubernetes:apps/v1:Deployment facility-2-web updating (14s) [diff: ~spec]; Waiting for app ReplicaSet to be available (1/2 Pods available)
@ Updating...........
~  kubernetes:apps/v1:Deployment facility-1-web updating (23s) [diff: ~spec]; warning: [Pod tamanu-fix-ordering-hierarchy/facility-1-web-458dd592-7f8b899c6-th8z6]: containers with unready status: [http]
~  kubernetes:apps/v1:Deployment facility-2-web updating (23s) [diff: ~spec]; warning: [Pod tamanu-fix-ordering-hierarchy/facility-2-web-c8d13185-7f6bc96b65-fmnks]: containers with unready status: [http]
@ Updating......
~  kubernetes:apps/v1:Deployment facility-2-web updating (26s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-2-web updating (26s) [diff: ~spec]; 
@ Updating....
~  kubernetes:apps/v1:Deployment facility-2-web updated (26s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-web updating (26s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-1-web updating (26s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-web updated (26s) [diff: ~spec]; 
@ Updating..........................
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (47s) [diff: ~spec]; warning: [Pod tamanu-fix-ordering-hierarchy/facility-2-migrator-1842edab-xdhmb]: Container "migrator" completed with exit code 0
++ kubernetes:batch/v1:Job central-migrator creating replacement (49s) [diff: ~spec]; warning: [Pod tamanu-fix-ordering-hierarchy/central-migrator-5d059471-lwhbd]: Container "migrator" completed with exit code 0
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (47s) [diff: ~spec]; warning: [Pod tamanu-fix-ordering-hierarchy/facility-1-migrator-3017d649-wf26q]: Container "migrator" completed with exit code 0
@ Updating.....
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (49s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/facility-2-migrator-1842edab" to succeed (Active: 0 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job central-migrator creating replacement (51s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/central-migrator-5d059471" to succeed (Active: 0 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (49s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/facility-2-migrator-1842edab" to succeed (Active: 0 | Succeeded: 1 | Failed: 0)
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (49s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-2-migrator created replacement (49s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (49s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/facility-1-migrator-3017d649" to succeed (Active: 0 | Succeeded: 0 | Failed: 0)
+- kubernetes:batch/v1:Job facility-2-migrator replacing (0s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job facility-2-migrator replaced (0.00s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-migrator creating replacement (51s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/central-migrator-5d059471" to succeed (Active: 0 | Succeeded: 1 | Failed: 0)
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (49s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/facility-1-migrator-3017d649" to succeed (Active: 0 | Succeeded: 1 | Failed: 0)
++ kubernetes:batch/v1:Job central-migrator creating replacement (51s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (49s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-migrator created replacement (51s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-1-migrator created replacement (49s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-sync updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-2-api updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-2-tasks updating (0s) [diff: ~spec]
+- kubernetes:batch/v1:Job central-migrator replacing (0s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job central-migrator replaced (0.00s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-provisioner creating replacement (0s) [diff: ~spec]
@ Updating....
+- kubernetes:batch/v1:Job facility-1-migrator replacing (0s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job facility-1-migrator replaced (0.00s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-sync updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-1-tasks updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-1-api updating (0s) [diff: ~spec]
@ Updating....
++ kubernetes:batch/v1:Job central-provisioner creating replacement (1s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-provisioner creating replacement (1s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/central-provisioner-7de46889" to start
~  kubernetes:apps/v1:Deployment facility-2-sync updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-2-sync updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-sync updated (1s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-provisioner creating replacement (1s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/central-provisioner-7de46889" to succeed (Active: 1 | Succeeded: 0 | Failed: 0)
~  kubernetes:apps/v1:Deployment facility-2-api updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-2-api updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-api updated (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-tasks updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-2-tasks updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-tasks updated (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-sync updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-1-sync updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-sync updated (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-tasks updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-1-tasks updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-tasks updated (1s) [diff: ~spec]; 
@ Updating....
~  kubernetes:apps/v1:Deployment facility-1-api updating (2s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-1-api updating (2s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-api updated (2s) [diff: ~spec]; 
@ Updating.........
++ kubernetes:batch/v1:Job central-provisioner creating replacement (8s) [diff: ~spec]; warning: [Pod tamanu-fix-ordering-hierarchy/central-provisioner-7de46889-pql65]: Container "provisioner" completed with exit code 0
@ Updating.....
++ kubernetes:batch/v1:Job central-provisioner creating replacement (10s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/central-provisioner-7de46889" to succeed (Active: 0 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job central-provisioner creating replacement (10s) [diff: ~spec]; Waiting for Job "tamanu-fix-ordering-hierarchy/central-provisioner-7de46889" to succeed (Active: 0 | Succeeded: 1 | Failed: 0)
++ kubernetes:batch/v1:Job central-provisioner creating replacement (10s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-provisioner created replacement (10s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job central-provisioner replacing (0s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job central-provisioner replaced (0.00s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-tasks updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment central-api updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment central-fhir-refresh updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment central-fhir-resolver updating (0s) [diff: ~spec]
@ Updating....
~  kubernetes:apps/v1:Deployment central-tasks updating (0s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-tasks updating (0s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-tasks updated (0.73s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-api updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-api updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-api updated (1s) [diff: ~spec]; 
@ Updating....
~  kubernetes:apps/v1:Deployment central-fhir-refresh updating (1s) [diff: ~spec]; Waiting for app ReplicaSet to be available (0/1 Pods available)
~  kubernetes:apps/v1:Deployment central-fhir-resolver updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-fhir-resolver updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-fhir-resolver updated (1s) [diff: ~spec]; 
@ Updating.....
~  kubernetes:apps/v1:Deployment central-fhir-refresh updating (3s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-fhir-refresh updating (3s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-fhir-refresh updated (3s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-provisioner deleting original (0s) [diff: ~spec]; 
@ Updating....
-- kubernetes:batch/v1:Job central-provisioner deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-provisioner deleted original (0.48s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-1-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-2-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-1-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-1-migrator deleted original (0.44s) [diff: ~spec]; 
@ Updating....
-- kubernetes:batch/v1:Job facility-2-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-2-migrator deleted original (0.78s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-migrator deleted original (0.95s) [diff: ~spec]; 
   pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy  16 messages
Diagnostics:
 pulumi:pulumi:Stack (tamanu-on-k8s-fix-ordering-hierarchy):
   Waiting for central-db...
   Waiting for facility-1-db...
   Waiting for facility-2-db...

   Using tailscale proxy https://k8s-operator-tamanu-internal-main.tail53aef.ts.net

   Secret facility-2-db-superuser not found or not ready: Error: HTTP-Code: 404
   Message: Unknown API Status Code!
   Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"facility-2-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"facility-2-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   Headers: {"audit-id":"2e32d3ca-cb9f-42e6-9e51-7cc4b3cebb1b","cache-control":"no-cache, private","connection":"close","content-length":"220","content-type":"application/json","date":"Mon, 02 Mar 2026 19:40:25 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   Secret facility-1-db-superuser not found or not ready: Error: HTTP-Code: 404
   Message: Unknown API Status Code!
   Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"facility-1-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"facility-1-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   Headers: {"audit-id":"9b598c3c-8fc2-4695-b796-30372ae91d82","cache-control":"no-cache, private","connection":"close","content-length":"220","content-type":"application/json","date":"Mon, 02 Mar 2026 19:40:25 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   Secret central-db-superuser not found or not ready: Error: HTTP-Code: 404
   Message: Unknown API Status Code!
   Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"central-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"central-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   Headers: {"audit-id":"9472cba5-bdd6-445e-8bed-8b0bfcbf6c1e","cache-control":"no-cache, private","connection":"close","content-length":"214","content-type":"application/json","date":"Mon, 02 Mar 2026 19:40:25 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}

   [Pulumi Neo] Would you like help with these diagnostics?
   https://app.pulumi.com/bes/tamanu-on-k8s/fix-ordering-hierarchy/updates/4?explainFailure

Outputs:
   urls: {
       Central      : "https://central.fix-ordering-hierarchy.cd.tamanu.app"
       Facility- 1  : "https://facility-1.fix-ordering-hierarchy.cd.tamanu.app"
       Facility- 2  : "https://facility-2.fix-ordering-hierarchy.cd.tamanu.app"
       PatientPortal: "https://portal.fix-ordering-hierarchy.cd.tamanu.app"
   }

Resources:
   ~ 14 updated
   +-4 replaced
   18 changes. 49 unchanged

Duration: 1m14s

   

Comment thread packages/ui-components/src/components/Translation/TranslatedEnumIInput.jsx Outdated
@dannash100
Copy link
Copy Markdown
Contributor Author

bugbot run

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@dannash100 dannash100 changed the title fix(suggestions): 2.47 hotfix: Fix sorting on hierarchy field children fix(suggestions): TAMOC-388: 2.47 hotfix: Fix sorting on hierarchy field children Feb 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 5, 2026

🍹 destroy on tamanu-on-k8s/bes/tamanu-on-k8s/fix-ordering-hierarchy

Pulumi report
   Destroying (bes/fix-ordering-hierarchy)

View Live: https://app.pulumi.com/bes/tamanu-on-k8s/fix-ordering-hierarchy/updates/9

@ Destroying....
Downloading plugin random-4.19.0: starting
@ Destroying....
Downloading plugin random-4.19.0: done
Installing plugin random-4.19.0: starting
Installing plugin random-4.19.0: done

-  kubernetes:apps/v1:Deployment central-fhir-resolver deleting (0s) 
-  kubernetes:apps/v1:Deployment central-tasks deleting (0s) 
-  kubernetes:apps/v1:Deployment central-api deleting (0s) 
-  kubernetes:apps/v1:Deployment central-fhir-refresh deleting (0s) 
@ Destroying......
-  kubernetes:apps/v1:Deployment central-fhir-refresh deleting (3s) Resource scheduled for deletion
-  kubernetes:apps/v1:Deployment central-api deleting (3s) Resource scheduled for deletion
-  kubernetes:apps/v1:Deployment central-fhir-resolver deleting (3s) Resource scheduled for deletion
-  kubernetes:apps/v1:Deployment central-tasks deleting (3s) Deployment is available. Replicas: 1
-  kubernetes:apps/v1:Deployment central-tasks deleting (3s) Resource scheduled for deletion
@ Destroying....
-  kubernetes:apps/v1:Deployment central-fhir-resolver deleting (3s) 
-  kubernetes:apps/v1:Deployment central-fhir-resolver deleted (3s) 
-  kubernetes:apps/v1:Deployment central-fhir-refresh deleting (3s) 
-  kubernetes:apps/v1:Deployment central-fhir-refresh deleted (3s) 
@ Destroying.................................
-  kubernetes:apps/v1:Deployment central-tasks deleting (34s) 
-  kubernetes:apps/v1:Deployment central-tasks deleted (34s) 
-  kubernetes:apps/v1:Deployment central-api deleting (34s) 
-  kubernetes:apps/v1:Deployment central-api deleted (34s) 
-  kubernetes:apps/v1:Deployment facility-1-tasks deleting (0s) 
-  kubernetes:apps/v1:Deployment facility-2-tasks deleting (0s) 
-  kubernetes:apps/v1:Deployment facility-2-sync deleting (0s) 
-  kubernetes:batch/v1:Job central-provisioner deleting (0s) 
-  kubernetes:apps/v1:Deployment facility-2-api deleting (0s) 
-  kubernetes:apps/v1:Deployment facility-1-sync deleting (0s) 
-  kubernetes:apps/v1:Deployment facility-1-api deleting (0s) 
@ Destroying......
-  kubernetes:apps/v1:Deployment facility-2-tasks deleting (2s) 
-  kubernetes:apps/v1:Deployment facility-2-tasks deleted (2s) 
-  kubernetes:apps/v1:Deployment facility-2-sync deleting (2s) 
-  kubernetes:apps/v1:Deployment facility-2-api deleting (2s) Deployment is available. Replicas: 2
-  kubernetes:apps/v1:Deployment facility-2-api deleting (2s) Resource scheduled for deletion
-  kubernetes:apps/v1:Deployment facility-2-sync deleted (2s) 
-  kubernetes:batch/v1:Job central-provisioner deleting (3s) 
-  kubernetes:batch/v1:Job central-provisioner deleted (3s) 
-  kubernetes:apps/v1:Deployment facility-1-api deleting (3s) Resource scheduled for deletion
@ Destroying....
-  kubernetes:apps/v1:Deployment facility-1-tasks deleting (3s) Resource scheduled for deletion
-  kubernetes:apps/v1:Deployment facility-1-tasks deleting (3s) 
-  kubernetes:apps/v1:Deployment facility-1-tasks deleted (3s) 
@ Destroying....
-  kubernetes:apps/v1:Deployment facility-1-sync deleting (5s) Deployment is available. Replicas: 1
-  kubernetes:apps/v1:Deployment facility-1-sync deleting (5s) Resource scheduled for deletion
-  kubernetes:apps/v1:Deployment facility-1-sync deleting (5s) 
-  kubernetes:apps/v1:Deployment facility-1-sync deleted (5s) 
@ Destroying...............................
-  kubernetes:apps/v1:Deployment facility-2-api deleting (32s) 
-  kubernetes:apps/v1:Deployment facility-2-api deleted (32s) 
-  kubernetes:apps/v1:Deployment facility-1-api deleting (32s) 
-  kubernetes:apps/v1:Deployment facility-1-api deleted (32s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster central-db deleting (0s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster facility-1-db deleting (0s) 
-  kubernetes:batch/v1:Job facility-2-migrator deleting (0s) 
-  kubernetes:networking.k8s.io/v1:Ingress facility-1 deleting (0s) 
-  kubernetes:networking.k8s.io/v1:Ingress central deleting (0s) 
-  kubernetes:batch/v1:Job central-migrator deleting (0s) 
-  kubernetes:networking.k8s.io/v1:Ingress facility-2 deleting (0s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster facility-2-db deleting (0s) 
-  kubernetes:batch/v1:Job facility-1-migrator deleting (0s) 
@ Destroying....
-  kubernetes:batch/v1:Job facility-2-migrator deleting (1s) Resource scheduled for deletion
-  kubernetes:batch/v1:Job facility-2-migrator deleting (1s) 
-  kubernetes:batch/v1:Job facility-2-migrator deleted (1s) 
@ Destroying....
-  kubernetes:postgresql.cnpg.io/v1:Cluster central-db deleting (1s) Resource scheduled for deletion
-  kubernetes:batch/v1:Job central-migrator deleting (1s) 
-  kubernetes:batch/v1:Job central-migrator deleted (1s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster facility-1-db deleting (2s) Resource scheduled for deletion
@ Destroying....
-  kubernetes:batch/v1:Job facility-1-migrator deleting (2s) 
-  kubernetes:batch/v1:Job facility-1-migrator deleted (2s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster facility-2-db deleting (2s) Resource scheduled for deletion
@ Destroying....
-  kubernetes:networking.k8s.io/v1:Ingress facility-1 deleting (4s) 
-  kubernetes:networking.k8s.io/v1:Ingress facility-1 deleted (4s) 
-  kubernetes:networking.k8s.io/v1:Ingress central deleting (4s) 
-  kubernetes:networking.k8s.io/v1:Ingress central deleted (4s) 
@ Destroying....
-  kubernetes:networking.k8s.io/v1:Ingress facility-2 deleting (4s) 
-  kubernetes:networking.k8s.io/v1:Ingress facility-2 deleted (4s) 
@ Destroying....................................................................................................................................................................................
-  kubernetes:postgresql.cnpg.io/v1:Cluster facility-1-db deleting (182s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster facility-1-db deleted (182s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster central-db deleting (182s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster central-db deleted (182s) 
@ Destroying.....
-  kubernetes:postgresql.cnpg.io/v1:Cluster facility-2-db deleting (183s) 
-  kubernetes:postgresql.cnpg.io/v1:Cluster facility-2-db deleted (183s) 
-  kubernetes:core/v1:Secret central-raw-db deleting (0s) 
-  kubernetes:core/v1:Secret central-reporting-db deleting (0s) 
-  kubernetes:core/v1:Secret facility-2-reporting-db deleting (0s) 
-  kubernetes:core/v1:Service facility-1-web deleting (0s) 
-  kubernetes:networking.k8s.io/v1:Ingress patient-portal deleting (0s) 
-  kubernetes:core/v1:Secret facility-1-raw-db deleting (0s) 
-  kubernetes:core/v1:Secret facility-1-reporting-db deleting (0s) 
-  kubernetes:apps/v1:Deployment central-web deleting (0s) 
-  kubernetes:apps/v1:Deployment facility-1-web deleting (0s) 
-  kubernetes:core/v1:Service facility-2-web deleting (0s) 
-  kubernetes:core/v1:Secret facility-2-raw-db deleting (0s) 
-  kubernetes:apps/v1:Deployment facility-2-web deleting (0s) 
-  kubernetes:core/v1:Service central-web deleting (0s) 
@ Destroying....
-  kubernetes:networking.k8s.io/v1:Ingress patient-portal deleting (1s) 
-  kubernetes:networking.k8s.io/v1:Ingress patient-portal deleted (1s) 
-  kubernetes:core/v1:Service facility-1-web deleting (1s) 
-  kubernetes:core/v1:Service facility-1-web deleted (1s) 
@ Destroying....
-  kubernetes:core/v1:Secret facility-2-reporting-db deleting (1s) 
-  kubernetes:core/v1:Secret facility-2-reporting-db deleted (1s) 
-  kubernetes:core/v1:Secret facility-1-raw-db deleting (1s) 
-  kubernetes:core/v1:Secret facility-1-raw-db deleted (1s) 
-  kubernetes:core/v1:Secret facility-1-reporting-db deleting (1s) 
-  kubernetes:core/v1:Secret facility-1-reporting-db deleted (1s) 
-  kubernetes:core/v1:Secret central-reporting-db deleting (1s) 
-  kubernetes:core/v1:Secret central-reporting-db deleted (1s) 
-  kubernetes:core/v1:Secret central-raw-db deleting (1s) 
-  kubernetes:core/v1:Secret central-raw-db deleted (1s) 
-  kubernetes:apps/v1:Deployment central-web deleting (2s) Deployment is available. Replicas: 2
-  kubernetes:apps/v1:Deployment central-web deleting (2s) Resource scheduled for deletion
-  kubernetes:core/v1:Service facility-2-web deleting (2s) 
-  kubernetes:core/v1:Service facility-2-web deleted (2s) 
-  kubernetes:apps/v1:Deployment facility-1-web deleting (2s) Deployment is available. Replicas: 2
-  kubernetes:apps/v1:Deployment facility-1-web deleting (2s) Resource scheduled for deletion
-  kubernetes:core/v1:Secret facility-2-raw-db deleting (2s) 
-  kubernetes:core/v1:Secret facility-2-raw-db deleted (2s) 
-  kubernetes:apps/v1:Deployment facility-2-web deleting (2s) Deployment is available. Replicas: 2
-  kubernetes:apps/v1:Deployment facility-2-web deleting (2s) Resource scheduled for deletion
-  kubernetes:core/v1:Service central-web deleting (2s) 
-  kubernetes:core/v1:Service central-web deleted (2s) 
@ Destroying....
-  kubernetes:apps/v1:Deployment central-web deleting (3s) 
-  kubernetes:apps/v1:Deployment central-web deleted (3s) 
-  kubernetes:apps/v1:Deployment facility-2-web deleting (3s) 
-  kubernetes:apps/v1:Deployment facility-2-web deleted (3s) 
-  kubernetes:apps/v1:Deployment facility-1-web deleting (3s) 
-  kubernetes:apps/v1:Deployment facility-1-web deleted (3s) 
@ Destroying....
-  random:index:RandomPassword central-reporting-db deleting (0s) 
-  kubernetes:core/v1:Secret mailgun deleting (0s) 
-  kubernetes:core/v1:Secret tupaia deleting (0s) 
-  kubernetes:networking.k8s.io/v1:Ingress bare-domain deleting (0s) 
-  kubernetes:core/v1:ServiceAccount app-sa deleting (0s) 
-  kubernetes:core/v1:Secret central-db-url deleting (0s) 
-  random:index:RandomPassword facility-1-reporting-db deleting (0s) 
-  bes:tamanu:WebFrontend facility-2 deleting (0s) 
-  kubernetes:core/v1:Service patient-portal-web deleting (0s) 
-  kubernetes:core/v1:Secret bugsnag deleting (0s) 
-  bes:tamanu:WebFrontend facility-1 deleting (0s) 
-  kubernetes:core/v1:ConfigMap provisioning deleting (0s) 
-  random:index:RandomPassword facility-2-reporting-db deleting (0s) 
-  kubernetes:core/v1:Secret facility-1-db-url deleting (0s) 
-  kubernetes:core/v1:Service facility-2-sync deleting (0s) 
-  kubernetes:core/v1:Service central-api deleting (0s) 
-  random:index:RandomPassword central-reporting-db deleted (0.24s) 
@ Destroying....
-  kubernetes:core/v1:Secret mailgun deleting (1s) 
-  kubernetes:core/v1:Secret mailgun deleted (1s) 
-  random:index:RandomPassword facility-1-reporting-db deleted (1s) 
-  kubernetes:core/v1:Secret tupaia deleting (1s) 
-  kubernetes:core/v1:Secret tupaia deleted (1s) 
@ Destroying....
-  kubernetes:networking.k8s.io/v1:Ingress bare-domain deleting (1s) 
-  kubernetes:networking.k8s.io/v1:Ingress bare-domain deleted (1s) 
-  kubernetes:core/v1:Secret central-db-url deleting (1s) 
-  kubernetes:core/v1:Secret central-db-url deleted (1s) 
-  kubernetes:core/v1:Service patient-portal-web deleting (1s) 
-  kubernetes:core/v1:Service patient-portal-web deleted (1s) 
-  kubernetes:core/v1:ServiceAccount app-sa deleting (1s) 
-  kubernetes:core/v1:ServiceAccount app-sa deleted (1s) 
-  random:index:RandomPassword facility-2-reporting-db deleted (2s) 
-  kubernetes:core/v1:Secret bugsnag deleting (2s) 
-  kubernetes:core/v1:Secret bugsnag deleted (2s) 
@ Destroying....
-  kubernetes:core/v1:Secret facility-2-db-url deleting (0s) 
-  random:index:RandomPassword facility-1-raw-db deleting (0s) 
-  kubernetes:core/v1:Secret facility-1-db-url deleting (2s) 
-  kubernetes:core/v1:Secret facility-1-db-url deleted (2s) 
-  kubernetes:core/v1:ConfigMap provisioning deleting (2s) 
-  kubernetes:core/v1:ConfigMap provisioning deleted (2s) 
-  kubernetes:apps/v1:Deployment patient-portal-web deleting (0s) 
-  kubernetes:core/v1:Service facility-2-sync deleting (2s) 
-  kubernetes:core/v1:Service facility-2-sync deleted (2s) 
-  kubernetes:core/v1:Service central-api deleting (2s) 
-  kubernetes:core/v1:Service central-api deleted (2s) 
-  kubernetes:core/v1:Secret pullsecret-github deleting (0s) 
-  kubernetes:core/v1:Service facility-2-api deleting (0s) 
-  kubernetes:core/v1:ConfigMap central deleting (0s) 
@ Destroying....
-  kubernetes:core/v1:ConfigMap facility-2 deleting (0s) 
-  kubernetes:core/v1:Service facility-1-api deleting (0s) 
-  kubernetes:core/v1:ConfigMap facility-1 deleting (0s) 
-  random:index:RandomPassword facility-2-raw-db deleting (0s) 
-  kubernetes:core/v1:Service facility-1-sync deleting (0s) 
-  bes:tamanu:WebFrontend central deleting (0s) 
-  random:index:RandomPassword facility-1-raw-db deleted (1s) 
-  random:index:RandomPassword central-raw-db deleting (0s) 
@ Destroying....
-  kubernetes:core/v1:Secret facility-2-db-url deleting (2s) 
-  kubernetes:core/v1:Secret facility-2-db-url deleted (2s) 
-  kubernetes:apps/v1:Deployment patient-portal-web deleting (2s) Resource scheduled for deletion
-  random:index:RandomPassword facility-2-raw-db deleted (1s) 
@ Destroying....
-  kubernetes:core/v1:Secret pullsecret-github deleting (2s) 
-  kubernetes:core/v1:Secret pullsecret-github deleted (2s) 
-  kubernetes:core/v1:Service facility-2-api deleting (2s) 
-  kubernetes:core/v1:Service facility-2-api deleted (2s) 
-  kubernetes:core/v1:ConfigMap central deleting (2s) 
-  kubernetes:core/v1:ConfigMap central deleted (2s) 
-  kubernetes:core/v1:ConfigMap facility-2 deleting (2s) 
-  kubernetes:core/v1:ConfigMap facility-2 deleted (2s) 
-  kubernetes:apps/v1:Deployment patient-portal-web deleting (3s) 
-  kubernetes:apps/v1:Deployment patient-portal-web deleted (3s) 
-  random:index:RandomPassword central-raw-db deleted (1s) 
-  kubernetes:core/v1:Service facility-1-api deleting (2s) 
-  kubernetes:core/v1:Service facility-1-api deleted (2s) 
-  kubernetes:core/v1:ConfigMap facility-1 deleting (2s) 
-  kubernetes:core/v1:ConfigMap facility-1 deleted (2s) 
-  kubernetes:core/v1:Service facility-1-sync deleting (2s) 
-  kubernetes:core/v1:Service facility-1-sync deleted (2s) 
@ Destroying....
-  bes:tamanu:FacilityServer 2 deleting (0s) 
-  bes:tamanu:CentralServer central deleting (0s) 
-  bes:tamanu:FacilityServer 1 deleting (0s) 
-  bes:tamanu:WebFrontend patient-portal deleting (0s) 
@ Destroying.....
-  pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy deleting (0s) 
-  pulumi:pulumi:Stack tamanu-on-k8s-fix-ordering-hierarchy deleted (0.38s) 
Outputs:
 - urls: {
     - Central      : "https://central.fix-ordering-hierarchy.cd.tamanu.app"
     - Facility- 1  : "https://facility-1.fix-ordering-hierarchy.cd.tamanu.app"
     - Facility- 2  : "https://facility-2.fix-ordering-hierarchy.cd.tamanu.app"
     - PatientPortal: "https://portal.fix-ordering-hierarchy.cd.tamanu.app"
   }

Resources:
   - 67 deleted

Duration: 4m25s

The resources in the stack have been deleted, but the history and configuration associated with the stack are still maintained. 
If you want to remove the stack completely, run `pulumi stack rm bes/fix-ordering-hierarchy`.
   

@dannash100 dannash100 changed the title fix(suggestions): TAMOC-388: 2.47 hotfix: Fix sorting on hierarchy field children fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id Feb 5, 2026
@dannash100
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively addresses a sorting issue in hierarchical suggesters by replacing a JOIN with a subquery for parent ID filtering. This change prevents ambiguous column conflicts and correctly re-enables alphabetical sorting, which was previously disabled for these queries. The fix is well-supported by new tests covering sorting with both standard and translated names, as well as for complex cases like medication sets. My main feedback is a minor improvement to ensure deterministic option ordering in TranslatedEnumField, as mentioned in the pull request's goals.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@dannash100 dannash100 merged commit 233b3f2 into release/2.47 Apr 15, 2026
87 checks passed
@dannash100 dannash100 deleted the fix/ordering-hierarchy branch April 15, 2026 22:19
dannash100 added a commit that referenced this pull request Apr 15, 2026
…ters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 15, 2026
…ters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 15, 2026
…ters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 15, 2026
…ters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 15, 2026
…ters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 15, 2026
…ters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 16, 2026
…ters with parent_id (#9576)

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 16, 2026
…ters with parent_id (#9579)

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 16, 2026
…ters with parent_id (#9578)

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 16, 2026
…ters with parent_id (#9575)

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 16, 2026
…ters with parent_id (#9577)

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
dannash100 added a commit that referenced this pull request Apr 16, 2026
…ters with parent_id (#9580)

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename
tcodling added a commit that referenced this pull request Apr 16, 2026
* release: Cut-off for release/2.53

* fix(sync): TAMOC-410: Rebuild encounter_history in sync_lookup for change_type (HOTFIX 2.53) (#9515)

fix(sync): TAMOC-410: Rebuild encounter_history in sync_lookup for change_type column (MAIN) (#9476)

* rebuild encounter_history in sync_lookup

* add comment

* fix(suggestions): 2.53 fix: don’t filter by facility from Admin Panel (#9538)

fix calls from central server

* fix(permissions): 2.53 fix: `LabTestResult`’s list permission (#9539)

* fix

* animate disclosure icon

* remove dead imports

* fix(charting): 2.53 fix: show permission denied message instead of misleading no-charts message (#9537)

fix(charting): show permission denied message instead of misleading no-charts message

When a user lacks Charting list permission, the server filters out all
chart surveys. The ChartsPane then shows "no charts available" instead
of a proper permission denied message. Wrap ChartsPane with
EncounterPaneWithPermissionCheck to match other permission-gated tabs.

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(invoicing): 2.53 fix: use invoice insurance plans in PDF header instead of legacy patient insurer (#9546)

fix(invoicing): no-issue: use invoice insurance plans in PDF header instead of legacy patient insurer

The invoice PDF header was reading the insurer name from
patient.additionalData.insurer (a legacy patient-level field) rather
than from invoice.insurancePlans (the plans actually selected on the
invoice). This caused the "Insurer" field to appear blank on printed
invoices when the legacy enablePatientInsurer setting was disabled,
even though insurance plans were visible on the web UI.

Now derives the insurer display from invoice.insurancePlans when
present, falling back to the legacy patient-level field for backward
compatibility.


Made-with: Cursor

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix(tasks): Release fix 2.53: Update task list on area change (#9548)

* Update DashboardTaskPane.jsx

* Update DashboardTaskPane.jsx

* fix: prevent race condition when changing location area

When the area changes while a location is selected, LocationInput's
handleChangeCategory calls both onGroupChange and onChange synchronously,
causing two preference mutations with stale data.

The first mutation from onLocationGroupIdChange was spreading the stale
filter including the old locationId, while the second correctly cleared it.
This created a race where the first mutation could persist invalid state.

Fixed by making onLocationGroupIdChange always clear locationId when
changing the group, ensuring both mutations write consistent state.

Applied via @cursor push command

* fix: preserve locationId during initialization when auto-detecting location group

When LocationInput auto-detects the location group for an existing location during initialization, preserve the locationId in preferences instead of stripping it. This prevents existing users with saved location filters from having their locationId silently cleared on first load.

Applied via @cursor push command

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* fix(notifications): Release fix v2.53: Filter notifications linked to sensitive data (#9557)

* filter notifications by sensitivity

* refactor: reuse ADD_SENSITIVE_FACILITY_ID_IF_APPLICABLE constant in Notification model

Replace duplicated sensitive facility SQL with the exported constant from buildEncounterLinkedLookupFilter to avoid maintenance drift.

Applied via @cursor push command

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* fix(programRegistry): 2.53: prevent survey submission from overwriting registration date (#9555)

* fix(programRegistry): no-issue: prevent survey responses from overwriting registration date

When a survey response updates an existing PatientProgramRegistration,
the registration date was unconditionally set to the survey submission
time. This only makes sense for new registrations.

Made-with: Cursor

* refactor(mobile): remove redundant getRecentOne query in writeToPatientFields

Move the existing-registration check and date logic into upsertRegistration
so the lookup happens once, matching the server-side implementation.

Made-with: Cursor

* fix(mobile): match server spread order for registration date fallback

Move submittedTime before survey data spread so a survey-provided date
overrides the fallback, consistent with the server create path.

Made-with: Cursor

* test(programRegistry): cover registration date on survey submission

Assert new registrations use endTime as date and updates do not overwrite it.

Made-with: Cursor

* fix(sync): 2.53 fix: Filter task designations from sensitive facility sync (#9533)

fix(sync): no-issue: Filter task designations from sensitive facility sync

* fix(labs): Release fix v2.53: Lab panel override edge case (#9574)

* Update LabRequestFormScreen2.jsx

* Update LabRequestFormScreen2.jsx

* fix(suggestions): TAMOC-388: 2.53 hotfix: Sorting on hierarchy suggesters with parent_id (#9580)

fix(suggestions): TAMOC-388: 2.47 hotfix: Sorting on hierarchy suggesters with parent_id (#9105)

* wip

* wip

* fix hierarchy sorting

* ya

* ya

* rename

* fix(surveyResponse): Fix release 2.53: Fix default survey code outside facility bug (#9581)

* first draft

* appropriate errors

* cleanup overengineered util

* Update SurveyResponseAnswer.ts

* Update SurveyResponseAnswer.ts

* fix(print): 2.53: fix attendant field on FSM birth certificate and use enum translations (#9571)

* fix(print): no-issue: fix attendant field on FSM birth certificate and use enum translations

The FSM birth certificate "Attendant" field was incorrectly displaying
nameOfAttendantAtBirth (free text) instead of attendantAtBirth (the
enum type e.g. Doctor/Nurse/Midwife).

Also migrates both birth notification certificates and the FSM death
certificate from getLabelFromValue with _OPTIONS constants to
getEnumTranslation with _LABELS for proper i18n support.

Registers BINARY_LABELS in the enum registry for death certificate
binary fields (autopsy, pregnant, injury at work).

Fixes the MARTIAL_STATUS typo to MARITAL_STATUS across constants,
enum registry, surveys, schema validation, and form fields.

Made-with: Cursor

* gonna do this cleanup 2

* fix(print): remove unused _OPTIONS constants from birth constants

These _OPTIONS arrays are no longer imported anywhere after migrating
certificates to use _LABELS with getEnumTranslation.
Also removes the entirely unused web/app/constants/births.js file.

Made-with: Cursor

* fix(print): 2.53: fix attendant field on FSM birth certificate and use enum translations

Made-with: Cursor

* fix(death): Release fix 2.53: Validate manner of death of form submit (#9584)

Update DeathForm.jsx

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: chris-bes <63621318+chris-bes@users.noreply.github.com>
Co-authored-by: Jasper Lai <33956381+jaskfla@users.noreply.github.com>
Co-authored-by: Daniel Nash <38335330+dannash100@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants