Skip to content

[BI-2808] Update OULN indices and update code to support them#15

Open
jloux-brapi wants to merge 1 commit intodevelopfrom
feature/BI-2808
Open

[BI-2808] Update OULN indices and update code to support them#15
jloux-brapi wants to merge 1 commit intodevelopfrom
feature/BI-2808

Conversation

@jloux-brapi
Copy link

@jloux-brapi jloux-brapi commented Mar 24, 2026

Description

Story: BI-2808

  • Updated observation_unit_level_name table to have level_name, program_id, and 'level_order' be a unique key. Removed the old key on program and level name.
  • Updated the code to support this new schema.
  • Updated the code to more thoroughly support submitting levelNameDbIds instead of level name, which is the intended way to submit level names with OUs when not simply using global level names. Previously this seemed to not work the way as intended, so code was updated to make it more deterministic for each submitted level.
  • Added a new error message when level names are provided with no dbIds and the level names match against multiple level names with the same name for the program but with different level orders, instructing the user to send dbIds in this use case and from now on.

Dependencies

Testing

  • Verify that when I post a level name to BrAPI via /observationlevelnames, I am able to create level names like:
    • name=Peanut, levelOrder=0, programDbId='aca92663-3556-4495-94e8-c6c1bd90bf5c'
    • name=Peanut, levelOrder=1, programDbId= ‘aca92663-3556-4495-94e8-c6c1bd90bf5c’
  • Verify that I am met with a 409 duplicate error with a valid response when I post two level names like:
    • name=Peanut, levelOrder=0, programDbId='aca92663-3556-4495-94e8-c6c1bd90bf5c'
    • name=Peanut, levelOrder=0, programDbId='aca92663-3556-4495-94e8-c6c1bd90bf5c'
  • Verify that when I create new observation units I can match level names with dbIds provided from the observationlevelnames endpoints.
  • Verify that when I create new observation units and I provide a levelName without a levelNameDbId, if there are more than two level names with the same programId then an error is thrown telling me to provide a levelNameDbId so i can get the correct level name with the level order I expect.

Checklist:

@jloux-brapi jloux-brapi added the on hold Do not merge until this label is removed label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on hold Do not merge until this label is removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant