O3-5698: Add visit summary sections REST endpoint and SPI label/toggleable defaults#29
Open
BlessedAmrita wants to merge 2 commits into
Open
O3-5698: Add visit summary sections REST endpoint and SPI label/toggleable defaults#29BlessedAmrita wants to merge 2 commits into
BlessedAmrita wants to merge 2 commits into
Conversation
…l/toggleable defaults
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds
GET /ws/rest/v1/patientdocuments/visitSummary/sections, which lists the registered visit summary sections so an admin UI can display, toggle, and reorder them. Returns the standard REST collection shape ({ "results": [...] }), one entry per section withsectionKey,label,enabled,order, andtoggleable, sorted by effective order.The endpoint reads the same
@Autowired List<VisitSummarySection>the PDF renderer uses, so a downstream module's custom section appears automatically with no change here. Access is guarded by the coreGet Global Propertiesprivilege (section metadata is not sensitive; no new module privilege).Two additive
defaultmethods on theVisitSummarySectionSPI back this:getLabel()resolves the section's localized heading via the existing message-source mechanism, falling back to a humanized section key so downstream sections without message bundles still get a usable label.isToggleable()defaults totrue, overridden tofalseon the three always-on sections (facility header, patient info, footer) so their toggle can be locked in the UI.Missing
headingkeys for the facility header and footer sections were added to the en/fr/ar bundles (fr/ar mirror English as placeholders, matching the module's existing convention).Related
https://openmrs.atlassian.net/browse/O3-5698
Tests
Module suite green (api 120, omod including 6 new controller tests + 4 new SPI tests). Covers: every registered section listed, sorted by order, GP overrides reflected, always-on sections non-toggleable, labels resolved from the message source, and 403 on logout.