Skip to content

Fix patient document questionnaire canonical link and title lookup#855

Open
mlaletina95 wants to merge 1 commit into
beda-software:mainfrom
mlaletina95:feat/fix-document-questionnaire-canonical
Open

Fix patient document questionnaire canonical link and title lookup#855
mlaletina95 wants to merge 1 commit into
beda-software:mainfrom
mlaletina95:feat/fix-document-questionnaire-canonical

Conversation

@mlaletina95

@mlaletina95 mlaletina95 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Save amended documents with canonical questionnaire link: on submit, prefer formData.context.questionnaire.url over the previous QuestionnaireResponse.questionnaire value (which could be a resource id).
  • Documents list title lookup: index loaded Questionnaire titles by both url and id, so legacy responses still show the correct name instead of Unknown.

Context

After amend/save, QuestionnaireResponse.questionnaire could store the Aidbox resource id (e.g. curated-ips) while the questionnaire canonical url differs (e.g. ips-curated-questionnaire). The documents table looked up titles only by one key, so the name was lost.

Test plan

  • Patient → Documents → create IPS (or any patient document)
  • Save → list shows questionnaire title, not Unknown
  • Open document → amend → save again → title still correct
  • Existing QR with questionnaire = id only → title still resolves if Questionnaire is loaded

Prefer questionnaire.url when saving amended QuestionnaireResponse, and
index document list titles by both Questionnaire url and id so legacy
responses still resolve the display name.

Co-authored-by: Cursor <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.

1 participant