feat(ui): separate findings pickers per side for bilateral zones
Bilateral zones now get distinct findings pickers (e.g. "Épaule (Gauche)" and "Épaule (Droite)") instead of one shared picker. Finding schema gains optional `side` field so pathologies are tracked per-side. PDF export groups findings by zone+side with side label in section headers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
53f62f7bf6
commit
c853c681f9
4 files changed
+45
-24
No files matched your search
@@ -384,26 +384,30 @@ export async function addObservationPage(
|
||||
const sections: Array<{ label: string; value: string }> = [
|
||||
{ label: dict['pdf.section.zones'], value: zonesText || dict['pdf.empty'] },
|
||||
]
|
||||
// Group catalog findings by their JSON zoneId so each zone gets its
|
||||
// own labelled section. Preserves first-seen order so the on-screen
|
||||
// pick order survives the export.
|
||||
const findingsByZone = new Map<string, Finding[]>()
|
||||
const findingsByZoneSide = new Map<string, Finding[]>()
|
||||
for (const f of observation.findings) {
|
||||
const list = findingsByZone.get(f.zoneId)
|
||||
const key = f.side ? `${f.zoneId}:${f.side}` : f.zoneId
|
||||
const list = findingsByZoneSide.get(key)
|
||||
if (list) {
|
||||
list.push(f)
|
||||
} else {
|
||||
findingsByZone.set(f.zoneId, [f])
|
||||
findingsByZoneSide.set(key, [f])
|
||||
}
|
||||
}
|
||||
|
||||
for (const [zoneId, group] of findingsByZone) {
|
||||
for (const [key, group] of findingsByZoneSide) {
|
||||
const zoneId = key.split(':')[0]
|
||||
const side = group[0]?.side
|
||||
const zoneTree = findingsTree?.zones[zoneId]
|
||||
const zoneName = zoneTree
|
||||
let zoneName = zoneTree
|
||||
? locale === 'en'
|
||||
? zoneTree.name_en
|
||||
: zoneTree.name_fr
|
||||
: zoneId
|
||||
if (side) {
|
||||
const sideLabel = dict[side === 'left' ? 'lateral.left' : 'lateral.right']
|
||||
zoneName = `${zoneName} (${sideLabel})`
|
||||
}
|
||||
const value = group
|
||||
.map((f) => {
|
||||
const lbl = locale === 'en' ? f.labelEnSnapshot : f.labelFrSnapshot
|
||||
|
||||
Reference in new issue
Block a user