chore: initial scaffold + design spec + implementation plan
Skeleton for Osteo Report MVP. Build passes, 7 smoke tests green, real Horse.svg + Horse_head.svg in public/species/equine/. Zod schemas are the contract; store/anatomy/pdf modules are typed stubs throwing "not implemented" awaiting implementation. Spec: docs/superpowers/specs/2026-05-18-osteo-report-mvp-design.md Plan: docs/superpowers/plans/2026-05-18-osteo-report-mvp.md (23 phases, ~70 TDD tasks) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
12a3e48fdf
commit
8ca36b5ccd
104 files changed
+12448
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const AnimalSchema = z.object({
|
||||
/** Must match a registered species id (e.g. 'equine') */
|
||||
speciesId: z.string().min(1),
|
||||
name: z.string().min(1),
|
||||
breed: z.string().optional(),
|
||||
age: z.string().optional(),
|
||||
})
|
||||
|
||||
export type Animal = z.infer<typeof AnimalSchema>
|
||||
|
||||
export const OwnerSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
})
|
||||
|
||||
export type Owner = z.infer<typeof OwnerSchema>
|
||||
@@ -0,0 +1,38 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const SeveritySchema = z.enum(['légère', 'modérée', 'sévère'])
|
||||
|
||||
export type Severity = z.infer<typeof SeveritySchema>
|
||||
|
||||
export const VertebralRegionSchema = z.enum(['C', 'T', 'L', 'S', 'Cd'])
|
||||
|
||||
export type VertebralRegion = z.infer<typeof VertebralRegionSchema>
|
||||
|
||||
export const VertebraSchema = z.object({
|
||||
region: VertebralRegionSchema,
|
||||
index: z.number().int().positive(),
|
||||
})
|
||||
|
||||
export type Vertebra = z.infer<typeof VertebraSchema>
|
||||
|
||||
export const ObservationZoneSchema = z.object({
|
||||
/** Must match data-bone-id attribute on the SVG element */
|
||||
boneId: z.string().min(1),
|
||||
/** Set when zone originates from a detail popup SVG */
|
||||
detailSourceId: z.string().optional(),
|
||||
/** Set when boneId is a spine-zone; replaces the block semantically */
|
||||
vertebrae: z.array(VertebraSchema).optional(),
|
||||
})
|
||||
|
||||
export type ObservationZone = z.infer<typeof ObservationZoneSchema>
|
||||
|
||||
export const ObservationSchema = z.object({
|
||||
id: z.string().min(1),
|
||||
zones: z.array(ObservationZoneSchema),
|
||||
pathologyIds: z.array(z.string()),
|
||||
freeTextPathologies: z.array(z.string()),
|
||||
severity: SeveritySchema.optional(),
|
||||
comment: z.string(),
|
||||
})
|
||||
|
||||
export type Observation = z.infer<typeof ObservationSchema>
|
||||
@@ -0,0 +1,47 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const PathologyCategorySchema = z.enum([
|
||||
'osseux',
|
||||
'articulaire',
|
||||
'musculaire',
|
||||
'tendino-ligamentaire',
|
||||
'fascial',
|
||||
'visceral',
|
||||
'cranio-sacre',
|
||||
'nerveux',
|
||||
'autre',
|
||||
])
|
||||
|
||||
export type PathologyCategory = z.infer<typeof PathologyCategorySchema>
|
||||
|
||||
export const PathologyRefTypeSchema = z.enum([
|
||||
'manual',
|
||||
'journal',
|
||||
'database',
|
||||
'web',
|
||||
])
|
||||
|
||||
export const PathologyRefSchema = z.object({
|
||||
type: PathologyRefTypeSchema,
|
||||
/** Human-readable citation — no raw URLs in PDF output */
|
||||
citation: z.string().min(1),
|
||||
url: z.string().url().optional(),
|
||||
})
|
||||
|
||||
export type PathologyRef = z.infer<typeof PathologyRefSchema>
|
||||
|
||||
export const PathologySchema = z.object({
|
||||
/** Stable kebab-case identifier */
|
||||
id: z.string().min(1),
|
||||
labelFr: z.string().min(1),
|
||||
description: z.string().min(1),
|
||||
category: PathologyCategorySchema,
|
||||
/** Empty array = applicable to all species */
|
||||
speciesIds: z.array(z.string()),
|
||||
/** Empty array = applicable to all zones */
|
||||
boneIds: z.array(z.string()),
|
||||
/** At least one source required */
|
||||
sources: z.array(PathologyRefSchema).min(1),
|
||||
})
|
||||
|
||||
export type Pathology = z.infer<typeof PathologySchema>
|
||||
@@ -0,0 +1,11 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const PractitionerSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
cabinet: z.string().optional(),
|
||||
contact: z.string().optional(),
|
||||
/** SIRET — 14-digit French business identifier */
|
||||
siret: z.string().optional(),
|
||||
})
|
||||
|
||||
export type Practitioner = z.infer<typeof PractitionerSchema>
|
||||
@@ -0,0 +1,30 @@
|
||||
import { z } from 'zod'
|
||||
import { PractitionerSchema } from './practitioner'
|
||||
import { AnimalSchema, OwnerSchema } from './animal'
|
||||
import { ObservationSchema } from './observation'
|
||||
|
||||
const NextAppointmentSchema = z.discriminatedUnion('kind', [
|
||||
z.object({ kind: z.literal('date'), date: z.string() }),
|
||||
z.object({ kind: z.literal('period'), text: z.string() }),
|
||||
])
|
||||
|
||||
export type NextAppointment = z.infer<typeof NextAppointmentSchema>
|
||||
|
||||
export const ReportSchema = z.object({
|
||||
/** Schema version — always 1 for MVP. Bump on breaking changes. */
|
||||
version: z.literal(1),
|
||||
id: z.string().min(1),
|
||||
/** ISO timestamp of report creation */
|
||||
createdAt: z.string(),
|
||||
/** ISO date of clinical encounter */
|
||||
date: z.string(),
|
||||
practitioner: PractitionerSchema,
|
||||
animal: AnimalSchema,
|
||||
owner: OwnerSchema,
|
||||
observations: z.array(ObservationSchema),
|
||||
conclusion: z.string(),
|
||||
recommendations: z.string(),
|
||||
nextAppointment: NextAppointmentSchema.optional(),
|
||||
})
|
||||
|
||||
export type Report = z.infer<typeof ReportSchema>
|
||||
Reference in new issue
Block a user