- Implemented the symptom database as a full searchable reference area, parallel to terminology.

Added:
New medical_symptoms SQLite catalog with 242 seeded symptom records, 
categories, body systems, tracking notes, urgency-context notes, search 
terms, and MedlinePlus links: [app/bootstrap.php (line 
186)](/Users/tyemeclifford/Documents/GH/workout/app/bootstrap.php:186), 
[seed logic (line 
635)](/Users/tyemeclifford/Documents/GH/workout/app/bootstrap.php:635)
New searchable symptom directory: [public/symptoms.php (line 
1)](/Users/tyemeclifford/Documents/GH/workout/public/symptoms.php:1)
New dynamic per-symptom page, e.g. /symptom.php?id=24: 
[public/symptom.php (line 
1)](/Users/tyemeclifford/Documents/GH/workout/public/symptom.php:1)
Symptom helper/link lookup functions: [app/bootstrap.php (line 
1473)](/Users/tyemeclifford/Documents/GH/workout/app/bootstrap.php:1473)
medicalSymptoms added to the combined library search/API: 
[app/bootstrap.php (line 
2024)](/Users/tyemeclifford/Documents/GH/workout/app/bootstrap.php:2024)
Symptoms added to nav, homepage, and combined medical search: 
[site-header.php (line 
27)](/Users/tyemeclifford/Documents/GH/workout/public/partials/site-header.php:27), 
[index.php (line 
11)](/Users/tyemeclifford/Documents/GH/workout/public/index.php:11), 
[medical.php (line 
13)](/Users/tyemeclifford/Documents/GH/workout/public/medical.php:13)
This commit is contained in:
Ty Clifford
2026-06-30 16:19:09 -04:00
parent b8045eb068
commit 0d492451c7
14 changed files with 638 additions and 352 deletions
+72
View File
@@ -0,0 +1,72 @@
<?php
declare(strict_types=1);
require __DIR__ . '/../app/bootstrap.php';
$pdo = app_db();
$pageTitle = 'Symptom Database | Neon Medical Tracker';
$activePage = 'symptoms';
$searchQuery = trim((string) ($_GET['q'] ?? ''));
$library = library_search_payload(['q' => $searchQuery, 'limit' => 500]);
$symptoms = $library['medicalSymptoms'];
$totalSymptoms = (int) db_value($pdo, 'SELECT COUNT(*) FROM medical_symptoms');
require __DIR__ . '/partials/site-header.php';
?>
<main>
<section class="admin-public-shell">
<div class="site-section-heading">
<p class="site-eyebrow">Symptom database</p>
<h1>Search symptoms by name, body system, tracking context, and urgency notes.</h1>
<p>These entries are reference summaries with MedlinePlus source links. They support tracking and discussion, not diagnosis or treatment decisions.</p>
</div>
<form class="library-search" method="get" action="/symptoms.php">
<label>
<span>Search symptoms</span>
<input name="q" value="<?= htmlspecialchars($searchQuery, ENT_QUOTES) ?>" placeholder="Try chest pain, rash, nausea, dizziness, urinary, sleep">
</label>
<button class="site-primary" type="submit">Search</button>
<?php if ($searchQuery !== ''): ?>
<a class="site-secondary" href="/symptoms.php">Clear</a>
<?php endif; ?>
</form>
<div class="library-stats" aria-label="Symptom result count">
<article><strong><?= count($symptoms) ?></strong><span><?= $searchQuery === '' ? 'shown of ' . number_format($totalSymptoms) . ' symptoms' : 'symptom results' ?></span></article>
</div>
</section>
<section class="admin-public-shell">
<div class="site-section-heading">
<p class="site-eyebrow">Catalog directory</p>
<h2>Symptom records</h2>
</div>
<?php if (!$symptoms): ?>
<article class="empty-state">
<h3>No symptoms found.</h3>
<p>Try a body system, symptom name, sign, or tracking phrase.</p>
</article>
<?php else: ?>
<div class="library-list">
<?php foreach ($symptoms as $symptom): ?>
<article class="library-row">
<div class="library-row-main">
<h3><?= htmlspecialchars((string) $symptom['name'], ENT_QUOTES) ?></h3>
<p><?= htmlspecialchars((string) $symptom['plain_language_description'], ENT_QUOTES) ?></p>
<div class="library-row-meta">
<span><?= htmlspecialchars((string) $symptom['category'], ENT_QUOTES) ?></span>
<span><?= htmlspecialchars((string) ($symptom['body_system'] ?: 'Symptom'), ENT_QUOTES) ?></span>
</div>
</div>
<div class="library-row-actions">
<a class="site-primary" href="<?= htmlspecialchars(symptom_detail_path($symptom), ENT_QUOTES) ?>">View symptom</a>
</div>
</article>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section>
</main>
<?php require __DIR__ . '/partials/site-footer.php'; ?>