Skip to content

[Biobank] Include Visit Label in Specimen Entity#10665

Open
HenriRabalais wants to merge 3 commits into
aces:mainfrom
HenriRabalais:2026-06-19_specimen-visit-label-inclusion
Open

[Biobank] Include Visit Label in Specimen Entity#10665
HenriRabalais wants to merge 3 commits into
aces:mainfrom
HenriRabalais:2026-06-19_specimen-visit-label-inclusion

Conversation

@HenriRabalais

Copy link
Copy Markdown
Collaborator

Summary

Fixes a front-end crash when viewing a specimen whose collection session is
at a site the user doesn't have access to. The specimen is visible (the user
has access to its container site), but its session is correctly never
provisioned to the front end. The front end then tried to look up the session
label in options.sessions and read .label off undefined, throwing.

The fix provisions the session's visit label directly onto the specimen
entity, so the label can be displayed without depending on the
access-filtered session options. The hyperlink to the session is now rendered
only when the session is present in options.sessions (i.e. the user can
access it); otherwise the visit label is shown as plain text.

Changes

  • specimendao.class.inc: Added s.Visit_label as SessionLabel to the
    existing session join in the specimen select, and set it on the specimen in
    _getInstanceFromSQL.
  • specimen.class.inc: Added a sessionLabel property with
    setter/getter, and included it in jsonSerialize.
  • <display view file>: Read the visit label from specimen.sessionLabel
    instead of options.sessions[sessionId].label, and made the session link
    conditional on the session being present in options.sessions.
  • specimenForm.js: Carried sessionLabel across from the parent
    specimen in componentDidUpdate, and read the label from current instead
    of options.sessions in renderGlobalFields.

@github-actions github-actions Bot added Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code labels Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: Javascript PR or issue that update Javascript code Language: PHP PR or issue that update PHP code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant