Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b3a4fa6
feat(askAi): no-issue: add Ask AI chatbot feature
julianam-w Mar 29, 2026
363418d
Add AI access to config and settings
julianam-w Apr 4, 2026
3b2a212
chore: no-issue: add Ask AI planning doc and cheatsheet
julianam-w Apr 4, 2026
daae970
chore: no-issue: add Ask AI RAG ops runbook
julianam-w Apr 4, 2026
ad3aa28
chore: no-issue: update vite default proxy target to CD environment
julianam-w Apr 4, 2026
b1bc96b
chore: no-issue: remove Ask AI planning doc and cheatsheet
julianam-w Apr 4, 2026
aaee3da
Potential fix for pull request finding 'Unused variable, import, func…
julianam-w Apr 4, 2026
7dda152
Potential fix for pull request finding 'Unused variable, import, func…
julianam-w Apr 4, 2026
d99c8fc
chore: no-issue: untrack generated baml_client/ directory
julianam-w Apr 5, 2026
002a3d7
feat(askAi): no-issue: add shared router, RAG search, status endpoint…
julianam-w Apr 5, 2026
7e016fb
Potential fix for pull request finding 'Unused variable, import, func…
julianam-w Apr 5, 2026
6b2cda2
chore: no-issue: install pgvector in CI postgres setup
julianam-w Apr 5, 2026
4115e54
chore: no-issue: fix package-lock.json devOptional fields
julianam-w Apr 5, 2026
d19dac7
chore: no-issue: sort package-lock.json packages for npm compat
julianam-w Apr 5, 2026
ac97b97
chore: no-issue: regenerate dbt model for ask_ai schema
julianam-w Apr 5, 2026
adb8ba6
chore: no-issue: document ask_ai dbt model fields
julianam-w Apr 5, 2026
399c607
chore: no-issue: restore available_facilities dbt model columns
julianam-w Apr 5, 2026
0834796
chore: no-issue: add ask_ai schema dbt doc
julianam-w Apr 5, 2026
af065fe
chore: no-issue: fix relationships test arguments nesting in procedur…
julianam-w Apr 5, 2026
625f8d2
chore: no-issue: fix dbt_utils.relationships_where arguments nesting …
julianam-w Apr 5, 2026
2c32b29
chore: no-issue: update package-lock.json after rebase on main
julianam-w Apr 5, 2026
9499af8
chore: no-issue: revert accidental changes to importer test fixtures
julianam-w Apr 5, 2026
5ecb93c
chore: no-issue: fix package-lock.json devOptional and peer flags
julianam-w Apr 5, 2026
0d99fbf
chore: no-issue: update package-lock.json to match npm ci + npm i output
julianam-w Apr 5, 2026
71a0360
chore: no-issue: align package-lock.json devOptional flags with main …
julianam-w Apr 5, 2026
c57c71a
chore: no-issue: fix package-lock.json key ordering to match npm cano…
julianam-w Apr 5, 2026
550e48d
chore: no-issue: regenerate package-lock.json using Node.js 20 / npm …
julianam-w Apr 6, 2026
cdbcf50
chore: no-issue: update package-lock.json
julianam-w Apr 6, 2026
c985aac
chore: no-issue: update package-lock.json
julianam-w Apr 6, 2026
d11ffb0
chore: no-issue: restore executable permission on install-postgres-ub…
julianam-w Apr 6, 2026
6672b6b
fix(askAi): no-issue: fix RRF SQL — rank within each source before jo…
julianam-w Apr 6, 2026
9379211
perf(askAi): no-issue: pass embedding vector as bind parameter
julianam-w Apr 6, 2026
1408cc9
feat(askAi): no-issue: paginate GET /ask-ai/conversations
julianam-w Apr 6, 2026
4f0c2f2
perf(askAi): no-issue: paginate messages in GET /ask-ai/conversations…
julianam-w Apr 6, 2026
f021cc5
chore(askAi): no-issue: clarify FTS GIN index is created by the sidecar
julianam-w Apr 6, 2026
d522e10
fix(askAi): no-issue: cap ragDbCache to prevent connection pool leak
julianam-w Apr 6, 2026
a0a2014
fix(askAi): no-issue: fix TS2488 error destructuring ragDbCache itera…
julianam-w Apr 6, 2026
3c7f55c
fix(askAi): no-issue: replace @material-ui/icons with @mui/icons-mate…
julianam-w Apr 11, 2026
cc18059
chore: no-issue: update package-lock.json to restore missing react@16…
julianam-w Apr 11, 2026
eef2fbf
chore: no-issue: restore nested react@16.8.5 entries in package-lock.…
julianam-w Apr 11, 2026
11ae5e3
chore: no-issue: revert local npm install changes to package-lock.json
julianam-w Apr 11, 2026
7c0a497
chore: no-issue: restore nested react@16.8.5 entries in correct posit…
julianam-w Apr 11, 2026
27dde83
chore: no-issue: add missing express and sequelize deps to packages/s…
julianam-w Apr 11, 2026
4d94e68
fix(askAi): no-issue: lazy-load BAML client to prevent native init du…
julianam-w Apr 12, 2026
1337b5b
fix(askAi): no-issue: remove server config (local.json5) access from …
claude Apr 21, 2026
f06c844
chore: no-issue: remove ask-ai RAG ops llm docs
claude Apr 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/install-postgres-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main"
# remove existing postgresql and install desired version
sudo apt update
sudo apt remove -y postgresql\*
sudo apt install -y "postgresql-$pgversion"
sudo apt install -y "postgresql-$pgversion" "postgresql-$pgversion-pgvector"

# add postgresql binaries to path
echo "/usr/lib/postgresql/$pgversion/bin" >> $GITHUB_PATH
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dev
deploy
build
packages/*/dist
packages/shared/src/baml_src/baml_client
*.tsbuildinfo
packages/*/{src,app}/**/*.d.ts
database/docs
Expand Down
27 changes: 27 additions & 0 deletions database/model/ask_ai/conversations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% docs ask_ai__table__conversations %}
Stores Ask AI chatbot conversation threads. Each conversation belongs to a single user and groups a sequence of messages. Conversations support soft-deletion via `deleted_at` so history can be recovered. Not synced between facility and central servers.
{% enddocs %}

{% docs ask_ai__conversations__id %}
Primary key. UUID string assigned by the application.
{% enddocs %}

{% docs ask_ai__conversations__user_id %}
Foreign key to `public.users.id`. The user who owns this conversation.
{% enddocs %}

{% docs ask_ai__conversations__title %}
Optional human-readable title for the conversation. Nullable — not set until the conversation has been given a name.
{% enddocs %}

{% docs ask_ai__conversations__created_at %}
Timestamp when the conversation was created.
{% enddocs %}

{% docs ask_ai__conversations__updated_at %}
Timestamp when the conversation was last modified.
{% enddocs %}

{% docs ask_ai__conversations__deleted_at %}
Soft-delete timestamp. Null when the conversation is active. Set when the conversation is deleted, allowing recovery if needed.
{% enddocs %}
43 changes: 43 additions & 0 deletions database/model/ask_ai/conversations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 2
sources:
- name: ask_ai__tamanu
schema: ask_ai
description: "{{ doc('ask_ai__generic__schema') }}"
tables:
- name: conversations
description: "{{ doc('ask_ai__table__conversations') }}"
config:
tags: []
meta:
triggers: []
columns:
- name: id
data_type: character varying(255)
description: "{{ doc('ask_ai__conversations__id') }}"
data_tests:
- unique
- not_null
- name: user_id
data_type: character varying(255)
description: "{{ doc('ask_ai__conversations__user_id') }}"
data_tests:
- not_null
- name: title
data_type: text
description: "{{ doc('ask_ai__conversations__title') }}"
config:
meta:
masking: text
- name: created_at
data_type: timestamp with time zone
description: "{{ doc('ask_ai__conversations__created_at') }}"
data_tests:
- not_null
- name: updated_at
data_type: timestamp with time zone
description: "{{ doc('ask_ai__conversations__updated_at') }}"
data_tests:
- not_null
- name: deleted_at
data_type: timestamp with time zone
description: "{{ doc('ask_ai__conversations__deleted_at') }}"
3 changes: 3 additions & 0 deletions database/model/ask_ai/generic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs ask_ai__generic__schema %}
Contains tables for the Ask AI chatbot feature, including conversation history and messages.
{% enddocs %}
27 changes: 27 additions & 0 deletions database/model/ask_ai/messages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% docs ask_ai__table__messages %}
Stores individual messages within an Ask AI conversation. Each message is either from the user or the assistant, and together they form the conversation history sent to the LLM. Not soft-deleted — messages are permanently retained for the lifetime of the conversation. Not synced between facility and central servers.
{% enddocs %}

{% docs ask_ai__messages__id %}
Primary key. UUID string assigned by the application.
{% enddocs %}

{% docs ask_ai__messages__conversation_id %}
Foreign key to `ask_ai.conversations.id`. The conversation this message belongs to.
{% enddocs %}

{% docs ask_ai__messages__role %}
The sender of the message. Either `user` (a message typed by the logged-in user) or `assistant` (a response generated by the LLM).
{% enddocs %}

{% docs ask_ai__messages__content %}
The full text content of the message.
{% enddocs %}

{% docs ask_ai__messages__created_at %}
Timestamp when the message was created.
{% enddocs %}

{% docs ask_ai__messages__updated_at %}
Timestamp when the message was last modified.
{% enddocs %}
50 changes: 50 additions & 0 deletions database/model/ask_ai/messages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: 2
sources:
- name: ask_ai__tamanu
schema: ask_ai
description: "{{ doc('ask_ai__generic__schema') }}"
tables:
- name: messages
description: "{{ doc('ask_ai__table__messages') }}"
config:
tags: []
meta:
triggers: []
columns:
- name: id
data_type: character varying(255)
description: "{{ doc('ask_ai__messages__id') }}"
data_tests:
- unique
- not_null
- name: conversation_id
data_type: character varying(255)
description: "{{ doc('ask_ai__messages__conversation_id') }}"
data_tests:
- not_null
- name: role
data_type: text
description: "{{ doc('ask_ai__messages__role') }}"
data_tests:
- not_null
config:
meta:
masking: text
- name: content
data_type: text
description: "{{ doc('ask_ai__messages__content') }}"
data_tests:
- not_null
config:
meta:
masking: text
- name: created_at
data_type: timestamp with time zone
description: "{{ doc('ask_ai__messages__created_at') }}"
data_tests:
- not_null
- name: updated_at
data_type: timestamp with time zone
description: "{{ doc('ask_ai__messages__updated_at') }}"
data_tests:
- not_null
34 changes: 20 additions & 14 deletions database/model/public/procedures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,45 +69,51 @@ sources:
description: "{{ doc('procedures__encounter_id') }}"
data_tests:
- relationships:
to: source('tamanu', 'encounters')
field: id
arguments:
to: source('tamanu', 'encounters')
field: id
- name: location_id
data_type: character varying(255)
description: "{{ doc('procedures__location_id') }}"
data_tests:
- relationships:
to: source('tamanu', 'locations')
field: id
arguments:
to: source('tamanu', 'locations')
field: id
- name: procedure_type_id
data_type: character varying(255)
description: "{{ doc('procedures__procedure_type_id') }}"
data_tests:
- dbt_utils.relationships_where:
to: source('tamanu', 'reference_data')
field: id
to_condition: type = 'procedureType'
arguments:
to: source('tamanu', 'reference_data')
field: id
to_condition: type = 'procedureType'
- name: anaesthetic_id
data_type: character varying(255)
description: "{{ doc('procedures__anaesthetic_id') }}"
data_tests:
- dbt_utils.relationships_where:
to: source('tamanu', 'reference_data')
field: id
to_condition: type = 'drug'
arguments:
to: source('tamanu', 'reference_data')
field: id
to_condition: type = 'drug'
- name: physician_id
data_type: character varying(255)
description: "{{ doc('procedures__physician_id') }}"
data_tests:
- relationships:
to: source('tamanu', 'users')
field: id
arguments:
to: source('tamanu', 'users')
field: id
- name: anaesthetist_id
data_type: character varying(255)
description: "{{ doc('procedures__anaesthetist_id') }}"
data_tests:
- relationships:
to: source('tamanu', 'users')
field: id
arguments:
to: source('tamanu', 'users')
field: id
- name: start_time
data_type: character(19)
description: "{{ doc('procedures__start_time') }}"
Expand Down
Loading
Loading