UI Layer
UiControllerโ
UiController handles all browser-facing routes. It builds a SessionModel for every request โ a typed view model passed to Thymeleaf.
@GetMapping("/dashboard")
public String dashboard(HttpSession session, Model model) {
SmartLaunchContext ctx = getContext(session);
model.addAttribute("session", buildSessionModel(ctx));
model.addAttribute("patient", fhirService.loadPatient(ctx));
model.addAttribute("stats", fhirService.loadStats(ctx));
return "dashboard";
}
SessionModelโ
The SessionModel record flattens SmartLaunchContext into template-friendly fields:
| Field | Type | Description |
|---|---|---|
patientId | String | FHIR Patient ID |
patientName | String | Patient display name |
clinicianName | String | From UserProfile.name |
fhirUser | String | Practitioner reference |
needBanner | boolean | From needPatientBanner |
secondsRemaining | long | expiresAt - now() |
scopeList | List<String> | Granted scopes |
fhirBaseUrl | String | For client-side display |