Docs: API.md + ROADMAP.md updates for the health-record overhaul
Build and Push Docker Image / build (push) Successful in 33s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jason Stedwell
2026-07-06 15:07:04 -05:00
parent f3fc01f31c
commit f7a5e8ecb8
2 changed files with 40 additions and 1 deletions
+31 -1
View File
@@ -86,19 +86,49 @@ Add a weight/health log entry.
Manage OFA clearances and veterinary records. Manage OFA clearances and veterinary records.
**Record types** (`record_type`): `ofa_clearance`, `vaccination`, `exam`, `surgery`, `medication`, `other`.
**Valid `test_type` values** (OFA clearances only): `hip_ofa`, `hip_pennhip`, `elbow_ofa`, `patella_ofa`, `heart_ofa`, `heart_echo`, `eye_caer`, `thyroid_ofa`.
> DNA is **not** a health test type — DNA panels are managed exclusively by the Genetics module (`/api/genetics`).
### `GET /dog/:dogId` ### `GET /dog/:dogId`
Get all health records for a dog. Get all health records for a dog.
### `GET /dog/:dogId/clearance-summary` ### `GET /dog/:dogId/clearance-summary`
Get GRCA core clearance status (Hip, Elbow, Heart, Eyes). Get GRCA core clearance status (Hip, Elbow, Heart, Eyes).
- **Response**: `{ summary, grca_eligible, age_eligible, chic_number }` - **Response**: `{ summary, grca_eligible, age_eligible, chic_number }`
- Only recurring tests (CAER eyes, advanced/echo cardiac) carry an `expires_at`; permanent certifications (hip, elbow, etc.) never report `expired`/`expiring_soon`.
### `GET /dog/:dogId/chic-eligible` ### `GET /dog/:dogId/chic-eligible`
Check if a dog has all required CHIC tests. Check if a dog has all required CHIC tests.
### `GET /:id`
Get a single health record.
### `POST /` ### `POST /`
Create health record. Create health record.
- **Body**: `dog_id`, `record_type`, `test_date` (required), `test_type`, `test_name`, `ofa_result`, `ofa_number`, etc. - **Body**: `dog_id`, `record_type`, `test_date` (all required), plus optional `test_type`, `test_name`, `ofa_result`, `ofa_number`, `performed_by`, `expires_at`, `result`, `next_due`, `document_url`, `notes`.
- **Validation**: `test_type`, if present, must be one of the valid values above (else `400`).
- **Note**: `performed_by` is the single clinician field (the legacy `vet_name` column is deprecated).
### `PUT /:id`
Update an existing health record. Same body as `POST /` (minus `dog_id`).
### `DELETE /:id`
Delete a health record.
- **Response**: `{ "message": "Health record deleted successfully" }`
### `POST /upload`
Upload a supporting document (PDF or image, ≤ 15 MB) and get back a URL to store in a record's `document_url`. Record-agnostic — works before the record itself is saved.
- **Form-Data**: `document` (file)
- **Response**: `{ "url": "/uploads/..." }`
### `GET /dog/:dogId/cancer-history`
Get cancer-history records for a dog.
### `POST /cancer-history`
Add a cancer-history record.
- **Body**: `dog_id`, `cancer_type` (required), `age_at_diagnosis`, `age_at_death`, `cause_of_death`, `notes`.
--- ---
+9
View File
@@ -52,6 +52,15 @@
- DNA genetic panel (PRA, ICH, NCL, DM, MD variants) - DNA genetic panel (PRA, ICH, NCL, DM, MD variants)
- Cancer lineage & longevity tracking - Cancer lineage & longevity tracking
- Breeding eligibility checker (GRCA + CHIC gates) - Breeding eligibility checker (GRCA + CHIC gates)
- **Health Record modal overhaul** (July 6, 2026):
- [x] Per-record-type field sets (OFA / vaccination / exam / surgery / medication / other)
- [x] Result options scoped to the selected test; blank default (no fabricated clearances)
- [x] Added Thyroid & Patella OFA tests; expiry only shown for recurring tests (CAER, advanced cardiac)
- [x] Date & 24-month age validation on OFA hip/elbow
- [x] Unified clinician field (`performed_by`); deprecated `vet_name`
- [x] DNA removed as a health `test_type` (owned solely by Genetics module)
- [x] Delete action on the health records list
- [x] Document upload (PDF/image) via `POST /api/health/upload`
- **v0.6.1** (March 10, 2026) - COI Direct-Relation Fix - **v0.6.1** (March 10, 2026) - COI Direct-Relation Fix
- Fixed `calculateCOI` to correctly compute coefficient for parent×offspring pairings (~25%) - Fixed `calculateCOI` to correctly compute coefficient for parent×offspring pairings (~25%)