diff --git a/public/species/equine/Horse.svg b/public/species/equine/Horse.svg index 5629ff65..71f75272 100644 --- a/public/species/equine/Horse.svg +++ b/public/species/equine/Horse.svg @@ -326,23 +326,23 @@ - Bassin / Pelvis + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres sacrales / Sacral Vertebrae + - Vertèbres lombaires / Lumbar Vertebrae + - Vertèbres sacrales / Sacral Vertebrae + @@ -351,17 +351,17 @@ - Vertèbres caudales / Coccygeal Vertebrae + - Vertèbres sacrales / Sacral Vertebrae + - Fémur / Femur + @@ -386,7 +386,7 @@ - Vertèbres lombaires / Lumbar Vertebrae + @@ -397,20 +397,20 @@ - Cage thoracique / Ribcage + - Cage thoracique / Ribcage + - Vertèbres thoraciques / Thoracic Vertebrae + @@ -433,64 +433,64 @@ - Carpe (genou ant.) / Carpus (knee) + - Radius / Radius + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae + + + + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Dents / Teeth - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae - Dents / Teeth + + + + - Dents / Teeth + - Os malaire (joue) / Malar (cheek) - Crête faciale / Facial crest - Dents / Teeth + + + - Dents / Teeth - Dents / Teeth + + @@ -509,7 +509,7 @@ - Vertèbres cervicales / Cervical Vertebrae + @@ -524,7 +524,7 @@ - Métacarpe (canon ant.) / Metacarpal (cannon) + @@ -539,62 +539,62 @@ - Vertèbres caudales / Coccygeal Vertebrae + - Vertèbres caudales / Coccygeal Vertebrae + - Vertèbres lombaires / Lumbar Vertebrae - Vertèbres lombaires / Lumbar Vertebrae + + - Vertèbres sacrales / Sacral Vertebrae - Patella (rotule) / Patella - Tibia / Tibia - Calcanéus / Calcaneus - Talus / Talus + + + + + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae - Dents / Teeth + + - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae + + + - Humérus / Humerus + - Vertèbres caudales / Coccygeal Vertebrae + - Vertèbres caudales / Coccygeal Vertebrae - Vertèbres caudales / Coccygeal Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres lombaires / Lumbar Vertebrae - Vertèbres lombaires / Lumbar Vertebrae - Vertèbres lombaires / Lumbar Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Bassin / Pelvis - Métatarse (canon post.) / Metatarsal (cannon) + + + + + + + + + + + + + + + + + @@ -616,7 +616,7 @@ - Mandibule / Mandible + @@ -630,9 +630,9 @@ - Vertèbres cervicales / Cervical Vertebrae + - Dents / Teeth + @@ -642,7 +642,7 @@ - Péroné / Fibula + @@ -655,9 +655,9 @@ - Vertèbres lombaires / Lumbar Vertebrae + - Dents / Teeth + @@ -665,7 +665,7 @@ - Os nasal / Nasal Bone + @@ -679,20 +679,26 @@ - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae + + - Scapula / Scapula + - Scapula / Scapula + - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae + + - Vertèbres cervicales / Cervical VertebraeVertèbres thoraciques / Thoracic VertebraeVertèbres lombaires / Lumbar VertebraeVertèbres sacrales / Sacral VertebraeVertèbres caudales / Coccygeal VertebraeCharnière C7-T1 (cervico-thoracique) / C7-T1 (Cervicothoracic)Charnière C7-T1 (cervico-thoracique) / C7-T1 (Cervicothoracic)Charnière T18-L1 (dorso-lombaire) / T18-L1 (Thoracolumbar)Charnière T18-L1 (dorso-lombaire) / T18-L1 (Thoracolumbar)Charnière L6-S1 (lombo-sacrée) / L6-S1 (Lumbosacral)Charnière L6-S1 (lombo-sacrée) / L6-S1 (Lumbosacral)Épaule (scapulo-humérale) / Shoulder jointÉpaule (scapulo-humérale) / Shoulder jointCoude (huméro-radial) / Elbow jointCoude (huméro-radial) / Elbow jointBoulet ant. (métacarpo-phalangien) / Fore fetlockBoulet ant. (métacarpo-phalangien) / Fore fetlockHanche (coxo-fémorale) / Hip jointHanche (coxo-fémorale) / Hip jointGrasset (fémoro-tibial) / StifleGrasset (fémoro-tibial) / StifleJarret (tarsien) / HockJarret (tarsien) / HockBoulet post. (métatarso-phalangien) / Hind fetlockBoulet post. (métatarso-phalangien) / Hind fetlockArticulation Sacro-Iliaque / Sacroiliac JointArticulation Sacro-Iliaque / Sacroiliac JointSésamoïdes ant. (boulet) / Forelimb SesamoidsSésamoïdes ant. (boulet) / Forelimb SesamoidsCrane / Head \ No newline at end of file + + + + + + +Boulet post. (métatarso-phalangien) / Hind fetlockBoulet post. (métatarso-phalangien) / Hind fetlockJarret (tarsien) / HockJarret (tarsien) / HockGrasset (fémoro-tibial) / StifleGrasset (fémoro-tibial) / StifleHanche (coxo-fémorale) / Hip jointHanche (coxo-fémorale) / Hip jointArticulation Sacro-Iliaque / Sacroiliac JointArticulation Sacro-Iliaque / Sacroiliac JointÉpaule (scapulo-humérale) / Shoulder jointÉpaule (scapulo-humérale) / Shoulder jointCoude (huméro-radial) / Elbow jointCoude (huméro-radial) / Elbow jointBoulet ant. (métacarpo-phalangien) / Fore fetlockBoulet ant. (métacarpo-phalangien) / Fore fetlockSésamoïdes ant. (boulet) / Forelimb SesamoidsSésamoïdes ant. (boulet) / Forelimb SesamoidsCharnière L6-S1 (lombo-sacrée) / L6-S1 (Lumbosacral)Charnière L6-S1 (lombo-sacrée) / L6-S1 (Lumbosacral)Charnière T18-L1 (dorso-lombaire) / T18-L1 (Thoracolumbar)Charnière T18-L1 (dorso-lombaire) / T18-L1 (Thoracolumbar)Charnière C7-T1 (cervico-thoracique) / C7-T1 (Cervicothoracic)Charnière C7-T1 (cervico-thoracique) / C7-T1 (Cervicothoracic)Vertèbres caudales / Coccygeal VertebraeVertèbres sacrales / Sacral VertebraeVertèbres lombaires / Lumbar VertebraeVertèbres thoraciques / Thoracic VertebraeVertèbres cervicales / Cervical Vertebrae🔍 Zoom: head \ No newline at end of file diff --git a/public/species/equine/Horse_head.svg b/public/species/equine/Horse_head.svg index a76fd13c..e929955f 100644 --- a/public/species/equine/Horse_head.svg +++ b/public/species/equine/Horse_head.svg @@ -326,23 +326,23 @@ - Bassin / Pelvis + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres sacrales / Sacral Vertebrae + - Vertèbres lombaires / Lumbar Vertebrae + - Vertèbres sacrales / Sacral Vertebrae + @@ -351,17 +351,17 @@ - Vertèbres caudales / Coccygeal Vertebrae + - Vertèbres sacrales / Sacral Vertebrae + - Fémur / Femur + @@ -386,7 +386,7 @@ - Vertèbres lombaires / Lumbar Vertebrae + @@ -397,20 +397,20 @@ - Cage thoracique / Ribcage + - Cage thoracique / Ribcage + - Vertèbres thoraciques / Thoracic Vertebrae + @@ -433,64 +433,64 @@ - Carpe (genou ant.) / Carpus (knee) + - Radius / Radius + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae + + + + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae + - Dents / Teeth - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae - Dents / Teeth + + + + - Dents / Teeth + - Os malaire (joue) / Malar (cheek) - Crête faciale / Facial crest - Dents / Teeth + + + - Dents / Teeth - Dents / Teeth + + @@ -509,7 +509,7 @@ - Vertèbres cervicales / Cervical Vertebrae + @@ -524,7 +524,7 @@ - Métacarpe (canon ant.) / Metacarpal (cannon) + @@ -539,62 +539,62 @@ - Vertèbres caudales / Coccygeal Vertebrae + - Vertèbres caudales / Coccygeal Vertebrae + - Vertèbres lombaires / Lumbar Vertebrae - Vertèbres lombaires / Lumbar Vertebrae + + - Vertèbres sacrales / Sacral Vertebrae - Patella (rotule) / Patella - Tibia / Tibia - Calcanéus / Calcaneus - Talus / Talus + + + + + - Vertèbres cervicales / Cervical Vertebrae + - Vertèbres cervicales / Cervical Vertebrae - Dents / Teeth + + - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae + + + - Humérus / Humerus + - Vertèbres caudales / Coccygeal Vertebrae + - Vertèbres caudales / Coccygeal Vertebrae - Vertèbres caudales / Coccygeal Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres sacrales / Sacral Vertebrae - Vertèbres lombaires / Lumbar Vertebrae - Vertèbres lombaires / Lumbar Vertebrae - Vertèbres lombaires / Lumbar Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Vertèbres thoraciques / Thoracic Vertebrae - Bassin / Pelvis - Métatarse (canon post.) / Metatarsal (cannon) + + + + + + + + + + + + + + + + + @@ -616,7 +616,7 @@ - Mandibule / Mandible + @@ -630,9 +630,9 @@ - Vertèbres cervicales / Cervical Vertebrae + - Dents / Teeth + @@ -642,7 +642,7 @@ - Péroné / Fibula + @@ -655,9 +655,9 @@ - Vertèbres lombaires / Lumbar Vertebrae + - Dents / Teeth + @@ -665,7 +665,7 @@ - Os nasal / Nasal Bone + @@ -679,20 +679,26 @@ - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae + + - Scapula / Scapula + - Scapula / Scapula + - Vertèbres cervicales / Cervical Vertebrae - Vertèbres cervicales / Cervical Vertebrae + + - Charnière C0-C1 (occipito-atloïdienne) / C0-C1 (Occipito-atlantal)Charnière C0-C1 (occipito-atloïdienne) / C0-C1 (Occipito-atlantal)Articulation Temporo-Mandibulaire (ATM) / Temporomandibular Joint (TMJ)Articulation Temporo-Mandibulaire (ATM) / Temporomandibular Joint (TMJ)Synchondrose Sphéno-Basilaire (SSB) / Spheno-Basilar Synchondrosis (SBS)Synchondrose Sphéno-Basilaire (SSB) / Spheno-Basilar Synchondrosis (SBS)Occipital / Occipital boneOccipital / Occipital bonePariétal / Parietal bonePariétal / Parietal boneFrontal / Frontal boneFrontal / Frontal boneTemporal / Temporal boneTemporal / Temporal boneSphénoïde / Sphenoid boneSphénoïde / Sphenoid boneOs hyoïde / Hyoid boneOs hyoïde / Hyoid bone \ No newline at end of file + + + + + + +Pariétal / Parietal bonePariétal / Parietal boneFrontal / Frontal boneFrontal / Frontal boneSphénoïde / SphenoidSphénoïde / SphenoidTemporel / TemporalTemporel / TemporalOccipital / OccipitalOccipital / OccipitalArticulation Temporo-Mandibulaire (ATM) / Temporomandibular Joint (TMJ)Articulation Temporo-Mandibulaire (ATM) / Temporomandibular Joint (TMJ)Synchondrose Sphéno-Basilaire (SSB) / Spheno-Basilar Synchondrosis (SBS)Synchondrose Sphéno-Basilaire (SSB) / Spheno-Basilar Synchondrosis (SBS)hyoïde / Hyoidhyoïde / HyoidCharnière C0-C1 (occipito-atloïdienne) / C0-C1 (Occipito-atlantal)Charnière C0-C1 (occipito-atloïdienne) / C0-C1 (Occipito-atlantal) \ No newline at end of file diff --git a/src/anatomy/svgConvention.ts b/src/anatomy/svgConvention.ts index c1fe09ac..727d7701 100644 --- a/src/anatomy/svgConvention.ts +++ b/src/anatomy/svgConvention.ts @@ -2,35 +2,34 @@ import { SvgConventionError } from './types' import type { Bone, BoneCategory } from './types' const VALID_CATEGORIES: readonly BoneCategory[] = [ - 'articulation', - 'charniere', - 'spine-zone', + 'articulations', + 'charni-res-vert-brales', + 'zone-colonne', + 'cadrans-du-cr-ne', 'os', - 'os-overlay', - 'head', - 'cadran-crane', ] export function isValidCategory(value: string): value is BoneCategory { return (VALID_CATEGORIES as readonly string[]).includes(value) } -function classList(el: Element): string[] { - return (el.getAttribute('class') ?? '').split(/\s+/).filter(Boolean) -} - export function validateBoneElement(el: Element): void { const boneId = el.getAttribute('data-anno-id') ?? '' - for (const attr of ['data-anno-name-fr', 'data-anno-name-en', 'data-anno-category']) { - if (!el.getAttribute(attr)) { - throw new SvgConventionError( - `Element data-anno-id="${boneId}" missing attribute ${attr}`, - boneId, - attr, - ) - } + if (!boneId) { + throw new SvgConventionError( + 'Element with missing data-anno-id', + boneId, + 'data-anno-id', + ) } const cat = el.getAttribute('data-anno-category') ?? '' + if (!cat) { + throw new SvgConventionError( + `Element data-anno-id="${boneId}" missing attribute data-anno-category`, + boneId, + 'data-anno-category', + ) + } if (!isValidCategory(cat)) { throw new SvgConventionError( `Element data-anno-id="${boneId}" has unknown data-anno-category="${cat}"`, @@ -41,72 +40,57 @@ export function validateBoneElement(el: Element): void { } /** - * A bone is interactive (clickable) if any of these is true: - * - at least one element carries the `hitbox` class (hitbox+visible pattern); - * - its category is `spine-zone` (single overlay polygon, pointer-events:all); - * - its category is `head` (single entry-point polygon for a detail SVG). + * Parses an SVG document and returns a map of `data-anno-id` → Bone. * - * Decorative elements (e.g. individual vertebrae paths, teeth, malar bone) - * carry `data-anno-id` so their colorization can be controlled by JS, but - * must NOT intercept clicks. We mark them with `pointer-events: none` and - * exclude them from the returned Bone map so the click handler ignores - * them naturally. + * Every element carrying `data-anno-id` is collected. Multiple elements + * may share the same id (hitbox + visible pattern, or layered shapes); + * they end up grouped under the same Bone with all elements in `els`. + * + * Throws `SvgConventionError` if any required attribute is missing or + * `data-anno-category` is unknown. `data-anno-name-fr/en` are optional — + * trigger-only zones (those carrying `data-anno-opens-detail`) typically + * skip them. */ -function isInteractiveBone(bone: Bone): boolean { - if (bone.hitboxEls.length > 0) return true - if (bone.category === 'spine-zone' || bone.category === 'head') return true - return false -} - export function parseSvgBones(svgRoot: SVGSVGElement): Map { - const raw = new Map() + const map = new Map() const all = svgRoot.querySelectorAll('[data-anno-id]') all.forEach((el) => { validateBoneElement(el) const id = el.getAttribute('data-anno-id') as string - const fr = el.getAttribute('data-anno-name-fr') as string - const en = el.getAttribute('data-anno-name-en') as string + const fr = el.getAttribute('data-anno-name-fr') ?? '' + const en = el.getAttribute('data-anno-name-en') ?? '' const category = el.getAttribute('data-anno-category') as BoneCategory - const opensDetail = el.getAttribute('data-anno-opens-detail') ?? undefined - const classes = classList(el) - const isHitbox = classes.includes('hitbox') + const opensDetail = + el.getAttribute('data-anno-opens-detail') ?? undefined - const existing = raw.get(id) + const existing = map.get(id) if (existing) { - if (isHitbox) existing.hitboxEls.push(el) - else existing.visibleEls.push(el) - if (opensDetail && !existing.opensDetail) existing.opensDetail = opensDetail + existing.els.push(el) + if (opensDetail && !existing.opensDetail) { + existing.opensDetail = opensDetail + } + // Prefer the first non-empty label we see. + if (!existing.fr && fr) existing.fr = fr + if (!existing.en && en) existing.en = en } else { - raw.set(id, { + map.set(id, { id, fr, en, category, opensDetail, - hitboxEls: isHitbox ? [el] : [], - visibleEls: isHitbox ? [] : [el], + els: [el], }) } }) - - const interactive = new Map() - raw.forEach((bone, id) => { - if (isInteractiveBone(bone)) { - interactive.set(id, bone) - } else { - // Decorative — make sure clicks fall through to whatever is underneath. - bone.visibleEls.forEach((el) => { - if (el instanceof SVGElement || el instanceof HTMLElement) { - el.style.pointerEvents = 'none' - } else { - el.setAttribute('pointer-events', 'none') - } - }) - } - }) - return interactive + return map } +/** + * Walks up from `event.target` to find the nearest element carrying + * `data-anno-id`. Returns null when the click did not land on an + * annotated element. + */ export function getBoneIdFromEvent(event: Event): string | null { let node = event.target as Element | null while (node && node.nodeType === 1) { diff --git a/src/anatomy/types.ts b/src/anatomy/types.ts index 547b284c..e43c30fb 100644 --- a/src/anatomy/types.ts +++ b/src/anatomy/types.ts @@ -1,27 +1,34 @@ -/** Valid data-anno-category values per the SVG convention. */ +/** + * Valid data-anno-category values per the SVG convention. + * + * Categories are scoped to the kind of anatomical structure each + * annotation represents. Adding a new value here is the only place to + * touch when the source SVGs introduce one. + */ export type BoneCategory = - | 'articulation' - | 'charniere' - | 'spine-zone' + | 'articulations' + | 'charni-res-vert-brales' + | 'zone-colonne' + | 'cadrans-du-cr-ne' | 'os' - | 'os-overlay' - | 'head' - | 'cadran-crane' -/** A logical bone as parsed from an SVG — groups hitbox + visible elements. */ +/** + * Logical annotation as parsed from an SVG. All DOM elements sharing the + * same `data-anno-id` are grouped into one Bone. `id` is the persisted + * identifier surfaced in the report JSON contract + * (`ObservationZone.boneId`); keep it stable across SVG renames. + */ export interface Bone { id: string - /** French label from data-anno-name-fr */ + /** French label from data-anno-name-fr — may be empty for opens-detail-only triggers */ fr: string - /** English label from data-anno-name-en */ + /** English label from data-anno-name-en — may be empty */ en: string category: BoneCategory /** Detail popup id from data-anno-opens-detail, if present */ opensDetail?: string - /** Elements with class containing "hitbox" */ - hitboxEls: Element[] - /** Elements with class containing "visible" */ - visibleEls: Element[] + /** All DOM elements carrying this annotation (used for colorization) */ + els: Element[] } /** Visual state applied to SVG elements for multi-observation colorization. */ diff --git a/src/app/routes/EditorRoute.tsx b/src/app/routes/EditorRoute.tsx index 032d172f..76d0f51f 100644 --- a/src/app/routes/EditorRoute.tsx +++ b/src/app/routes/EditorRoute.tsx @@ -119,7 +119,7 @@ export default function EditorRoute() { : [...activeObs.zones, newZone] updateObservation(activeIndex, { ...activeObs, zones: nextZones }) - if (!exists && bone.category === 'spine-zone') { + if (!exists && bone.category === 'zone-colonne') { setVertebraTarget(nextZones.length - 1) } } diff --git a/src/components/observation/ObservationCard.tsx b/src/components/observation/ObservationCard.tsx index 16b7eed2..b9ebc3c7 100644 --- a/src/components/observation/ObservationCard.tsx +++ b/src/components/observation/ObservationCard.tsx @@ -187,7 +187,7 @@ export default function ObservationCard({
    {observation.zones.map((z, i) => { const b = bones.get(z.boneId) - const isSpine = b?.category === 'spine-zone' + const isSpine = b?.category === 'zone-colonne' return (
  • diff --git a/src/components/observation/ObservationEditor.tsx b/src/components/observation/ObservationEditor.tsx deleted file mode 100644 index b22c4a37..00000000 --- a/src/components/observation/ObservationEditor.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import { useMemo } from 'react' -import type { Observation, ObservationZone, Vertebra } from '@/domain/schema/observation' -import type { Pathology } from '@/domain/schema/pathology' -import type { Bone } from '@/anatomy/types' -import Label from '@/components/ui/Label' -import Textarea from '@/components/ui/Textarea' -import Badge from '@/components/ui/Badge' -import PathologyPicker from './PathologyPicker' -import FreeTextPathologyInput from './FreeTextPathologyInput' -import SeveritySelector from './SeveritySelector' - -export interface ObservationEditorProps { - observation: Observation - bones: Map - speciesId: string - pathologyPool: Pathology[] - onChange: (next: Observation) => void - onOpenVertebraPicker: (zoneIndex: number) => void - onRemoveZone: (zoneIndex: number) => void -} - -function describeZone(z: ObservationZone, bones: Map): string { - const b = bones.get(z.boneId) - const label = b?.fr ?? z.boneId - if (z.vertebrae?.length) { - const vs = z.vertebrae.map((v: Vertebra) => `${v.region}${v.index}`).join(', ') - return `${label} (${vs})` - } - return label -} - -export default function ObservationEditor({ - observation, - bones, - speciesId, - pathologyPool, - onChange, - onOpenVertebraPicker, - onRemoveZone, -}: ObservationEditorProps) { - const zoneBoneIds = useMemo( - () => observation.zones.map((z) => z.boneId), - [observation.zones], - ) - - return ( -
    -
    - - {observation.zones.length === 0 ? ( -

    - Cliquez sur les zones du schéma pour les ajouter à cette observation. -

    - ) : ( -
      - {observation.zones.map((z, i) => { - const b = bones.get(z.boneId) - const isSpine = b?.category === 'spine-zone' - return ( -
    • - - {describeZone(z, bones)} - {isSpine && ( - - )} - - -
    • - ) - })} -
    - )} -
    - -
    - - onChange({ ...observation, pathologyIds: ids })} - /> -
    - -
    - - onChange({ ...observation, freeTextPathologies: items })} - /> -
    - -
    - - onChange({ ...observation, severity: s })} - /> -
    - -
    - -