Skip to content

Commit 5918be6

Browse files
Mounika-2311claude
andcommitted
feat: rename sidebar to Portal Management + add portal categories endpoint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 982a2a2 commit 5918be6

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/main/java/org/ciyex/ehr/controller/portal/PortalDocumentsController.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.ciyex.ehr.portal.repository.DocumentReviewRepository;
88
import org.ciyex.ehr.service.DocumentService;
99
import org.ciyex.ehr.service.DocumentService.DownloadResult;
10+
import org.ciyex.ehr.service.DocumentSettingsService;
1011
import org.ciyex.ehr.service.PracticeContextService;
1112
import org.ciyex.ehr.service.portal.PortalGenericResourceService;
1213
import org.ciyex.ehr.service.portal.PortalNotificationService;
@@ -48,6 +49,7 @@ public class PortalDocumentsController {
4849
private final PortalGenericResourceService portalResourceService;
4950
private final DocumentReviewRepository documentReviewRepo;
5051
private final PortalNotificationService portalNotificationService;
52+
private final DocumentSettingsService documentSettingsService;
5153

5254
@GetMapping("/my")
5355
@PreAuthorize("hasAuthority('PATIENT') or hasRole('PATIENT') or hasAuthority('SCOPE_patient/Patient.read')")
@@ -92,6 +94,23 @@ public ApiResponse<List<DocumentDto>> getMyDocuments(Authentication authenticati
9294
}
9395
}
9496

97+
@GetMapping("/categories")
98+
@PreAuthorize("hasAuthority('PATIENT') or hasRole('PATIENT') or hasAuthority('SCOPE_patient/Patient.read')")
99+
public ApiResponse<List<String>> getDocumentCategories() {
100+
try {
101+
var cats = documentSettingsService.getCategories();
102+
List<String> active = cats.stream()
103+
.filter(c -> c.isActive())
104+
.map(c -> c.getName())
105+
.toList();
106+
return ApiResponse.<List<String>>builder().success(true).data(active).build();
107+
} catch (Exception e) {
108+
log.debug("Could not load categories, using defaults: {}", e.getMessage());
109+
return ApiResponse.<List<String>>builder().success(true)
110+
.data(List.of("Clinical", "Lab", "Imaging", "Insurance", "Other")).build();
111+
}
112+
}
113+
95114
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
96115
@PreAuthorize("hasAuthority('PATIENT') or hasRole('PATIENT') or hasAuthority('SCOPE_patient/Patient.read')")
97116
public ResponseEntity<ApiResponse<DocumentDto>> uploadDocument(
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Rename "Document Management" to "Portal Management" in sidebar
2+
UPDATE menu_item
3+
SET label = 'Portal Management', item_key = 'portal-management', icon = 'ShieldCheck'
4+
WHERE id = 'b0000000-0000-0000-0000-000000000009';

0 commit comments

Comments
 (0)