Skip to main content

BodyMap

ComplexSpecialty<co-body-map>

BodyMap marks numbered lesions on front and back body outlines, with size in millimetres, change since last visit, status and dated photos for each one.

import { BodyMap } from 'health-components';

Examples​

Back View Read Only​

Storybook

No Marks​

Storybook

Legacy Marks​

Storybook

Usage​

<BodyMap marks={[{ x: 88, y: 92, view: "front", site: "Left upper chest", size: [6, 5], prevSize: 4, prevDate: "04/02/2026", type: "biopsy", desc: "Irregular border, two colors", photos: [{ date: "10/09/2026" }] }]} />

When to use​

  • Full skin exams, mole mapping, wound and pressure injury location, injection site rotation.

When not to use​

  • Comparing photos side by side at full size: a photo viewer.
  • Wound measurements over time: a wound flowsheet.

Variants and states​

VariantWhat it is
front / backSegmentedControl with a count of marks on each side.
monitorPrimary pin, Monitor tag.
newAmber pin, New tag.
biopsyRed pin, Biopsy tag.
treatedSuccess tag.
size and changeLength by width in mm, and the earlier size and date when it has grown.
photosDated thumbnails; a camera placeholder when the image is not loaded yet; "No photos yet" when none.
selectedClick a pin: it gets a ring and its row highlights.
empty sideEmptyState for a view with no marks.

Clinical values​

Every number goes through the shared clinical value rules (CareOS.fmt and ClinicalValue from the clinical-values card): tabular digits, the unit always shown, a fixed precision per measure, the reference range in the tooltip, and H, L or critical flags. Medication amounts follow the ISMP dose style through fmt.doseNumber: rounded to the stated precision, then shown with no trailing zero (5 mg, never 5.0 mg) and a leading zero (0.5 mL). The specialty measures this card adds sit in CareOS.specialty.MEAS with their precision: lesion size whole mm. Ranges in the previews are sample values for the design system, not clinical guidance; a real deployment passes its own.

Accessibility​

  • The list repeats every mark in text with its number, so the drawing is never the only record.
  • The SVG label says which side is the patient’s left in each view.
  • Photos carry alt text with lesion number, site and date.

Do and don't​

  • Do: Number marks in the order they were found and keep the number across visits.
  • Do: Record size at every visit so growth is visible.
  • Don't: Rely on the drawing alone.
  • Don't: Drop the date from a photo.

Props​

PropTypeDefaultDescription
marksReadonlyArray<BodyMapMark>[]Marks in a 200 by 262 frame
viewBodyMapView'front'First view shown (uncontrolled)
currentViewBodyMapViewuncontrolledShown view (controlled)
onViewChange(view: BodyMapView) => voidnoneCalled when the view changes
onMarkSelect(n: number) => voidnoneCalled with the mark number when a pin is clicked
titlestring'Body map'Card title
subtitlestringnoneLine under the title (patient and date)
readOnlybooleanfalseHides Add Photo
onAddPhoto() => voidnoneAdd Photo action
rangeContextRangeContextIdthe global context, else 'outpatient'Which shared reference range flags use; the lab range on a result still wins

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-body-map>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-body-map view="…" current-view="…" [marks]="marks" (co-view-change)="onViewChange($event.detail)"></co-body-map>
KindNameDescription
property / JSON attributemarksMarks in a 200 by 262 frame; default []
attributeviewFirst view shown (uncontrolled); default 'front'
attributecurrent-view / currentViewShown view (controlled); default uncontrolled
attributetitleCard title; default 'Body map'
attributesubtitleLine under the title (patient and date); default none
attributeread-only / readOnlyHides Add Photo; default false
attributerange-context / rangeContextWhich shared reference range flags use; the lab range on a result still wins; default the global context, else 'outpatient'
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-view-changeCalled when the view changes; default none (React: onViewChange)
eventco-mark-selectCalled with the mark number when a pin is clicked; default none (React: onMarkSelect)
eventco-add-photoAdd Photo action; default none (React: onAddPhoto)