- The medicine and terminology directories are now organized as compact rows, and each item links to a dynamic database-backed detail page:
Medicines: /medicine.php?id=46 Terms: /term.php?id=13 Key files: Dynamic medicine page: [public/medicine.php (line 1)](/Users/tyemeclifford/Documents/GH/workout/public/medicine.php:1) Dynamic term page: [public/term.php (line 1)](/Users/tyemeclifford/Documents/GH/workout/public/term.php:1) Shared lookup/link helpers: [app/bootstrap.php (line 1220)](/Users/tyemeclifford/Documents/GH/workout/app/bootstrap.php:1220) Reworked medicine directory: [public/nutrition.php (line 49)](/Users/tyemeclifford/Documents/GH/workout/public/nutrition.php:49) Reworked terminology page: [public/medical.php (line 64)](/Users/tyemeclifford/Documents/GH/workout/public/medical.php:64) Overflow-safe layout CSS: [public/assets/site.css (line 344)](/Users/tyemeclifford/Documents/GH/workout/public/assets/site.css:344)
This commit is contained in:
+149
-1
@@ -324,6 +324,9 @@ figcaption a {
|
||||
.site-metric-stack article,
|
||||
.signup-steps article,
|
||||
.term-table article,
|
||||
.library-row,
|
||||
.record-field,
|
||||
.empty-state,
|
||||
.admin-denied,
|
||||
.admin-stat,
|
||||
.admin-user-card,
|
||||
@@ -338,6 +341,18 @@ figcaption a {
|
||||
min-height: 190px;
|
||||
}
|
||||
|
||||
.feature-grid article,
|
||||
.detail-grid article,
|
||||
.term-table article,
|
||||
.library-row,
|
||||
.record-field,
|
||||
.empty-state,
|
||||
.source-links,
|
||||
.library-row-main {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.feature-grid span {
|
||||
display: inline-flex;
|
||||
color: var(--accent);
|
||||
@@ -390,8 +405,130 @@ figcaption a {
|
||||
.source-links a {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
max-width: 100%;
|
||||
padding: 4px 8px;
|
||||
font-size: 0.78rem;
|
||||
white-space: normal;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.library-list {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.library-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
gap: 14px;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.library-row-main {
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.library-row-main h3 {
|
||||
line-height: 1.25;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.library-row-main p,
|
||||
.record-field p,
|
||||
.empty-state p {
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.library-row-meta,
|
||||
.record-meta,
|
||||
.record-actions,
|
||||
.library-row-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.library-row-meta {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.library-row-meta span,
|
||||
.record-meta span {
|
||||
max-width: 100%;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
color: var(--muted-2);
|
||||
background: rgba(255, 255, 255, 0.035);
|
||||
padding: 5px 8px;
|
||||
font-size: 0.76rem;
|
||||
line-height: 1.25;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.library-row-actions {
|
||||
justify-content: flex-end;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.record-shell {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.record-heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 18px;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.record-heading > div:first-child {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
max-width: 820px;
|
||||
}
|
||||
|
||||
.record-heading h1 {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.record-actions {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.record-meta {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.record-detail-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.record-field {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.record-field.wide {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.record-field > span {
|
||||
color: var(--accent);
|
||||
font-size: 0.78rem;
|
||||
font-weight: 800;
|
||||
line-height: 1.2;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.library-search {
|
||||
@@ -863,13 +1000,24 @@ textarea:focus {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.library-row,
|
||||
.record-detail-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.admin-access-row,
|
||||
.admin-user-main,
|
||||
.panel-heading {
|
||||
.panel-heading,
|
||||
.record-heading {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.record-actions,
|
||||
.library-row-actions {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.admin-badges {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
+55
-35
@@ -53,6 +53,12 @@ require __DIR__ . '/partials/site-header.php';
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if (!$conditions): ?>
|
||||
<article class="empty-state">
|
||||
<h3>No conditions found.</h3>
|
||||
<p>Try another medicine, symptom, lab, or tracking term.</p>
|
||||
</article>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section class="admin-public-shell">
|
||||
@@ -60,19 +66,30 @@ require __DIR__ . '/partials/site-header.php';
|
||||
<p class="site-eyebrow">Terminology</p>
|
||||
<h2>Plain-language medical terms</h2>
|
||||
</div>
|
||||
<div class="term-table">
|
||||
<?php foreach ($terms as $term): ?>
|
||||
<article>
|
||||
<div>
|
||||
<h3><?= htmlspecialchars($term['term'], ENT_QUOTES) ?></h3>
|
||||
<span><?= htmlspecialchars($term['category'], ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
<p><?= htmlspecialchars($term['plain_language_definition'], ENT_QUOTES) ?></p>
|
||||
<p><?= htmlspecialchars($term['clinical_context'], ENT_QUOTES) ?></p>
|
||||
<a href="<?= htmlspecialchars($term['source_url'], ENT_QUOTES) ?>"><?= htmlspecialchars($term['source_name'], ENT_QUOTES) ?></a>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if (!$terms): ?>
|
||||
<article class="empty-state">
|
||||
<h3>No terms found.</h3>
|
||||
<p>Try a broader medical word, lab name, symptom, or abbreviation.</p>
|
||||
</article>
|
||||
<?php else: ?>
|
||||
<div class="library-list">
|
||||
<?php foreach ($terms as $term): ?>
|
||||
<article class="library-row">
|
||||
<div class="library-row-main">
|
||||
<h3><?= htmlspecialchars((string) $term['term'], ENT_QUOTES) ?></h3>
|
||||
<p><?= htmlspecialchars((string) $term['plain_language_definition'], ENT_QUOTES) ?></p>
|
||||
<div class="library-row-meta">
|
||||
<span><?= htmlspecialchars((string) $term['category'], ENT_QUOTES) ?></span>
|
||||
<span><?= htmlspecialchars((string) $term['source_name'], ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="library-row-actions">
|
||||
<a class="site-primary" href="<?= htmlspecialchars(term_detail_path($term), ENT_QUOTES) ?>">View term</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section class="admin-public-shell">
|
||||
@@ -80,28 +97,31 @@ require __DIR__ . '/partials/site-header.php';
|
||||
<p class="site-eyebrow">Medication catalog</p>
|
||||
<h2>Medicines with chemical, brand, RxNorm, DailyMed, and PubChem links</h2>
|
||||
</div>
|
||||
<div class="detail-grid">
|
||||
<?php foreach ($medicines as $medicine): ?>
|
||||
<article>
|
||||
<h2><?= htmlspecialchars(ucfirst($medicine['generic_name']), ENT_QUOTES) ?></h2>
|
||||
<p><strong><?= htmlspecialchars($medicine['class_name'], ENT_QUOTES) ?></strong></p>
|
||||
<p><strong>Active ingredient:</strong> <?= htmlspecialchars($medicine['active_ingredient'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
|
||||
<p><strong>Chemical name:</strong> <?= htmlspecialchars($medicine['chemical_name'] ?: $medicine['active_ingredient'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
|
||||
<p><strong>Common brands:</strong> <?= htmlspecialchars($medicine['brand_names'] ?: 'Brand names vary by market', ENT_QUOTES) ?></p>
|
||||
<p><strong>Generic/alternate names:</strong> <?= htmlspecialchars($medicine['generic_brands'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
|
||||
<p><?= htmlspecialchars($medicine['common_use'], ENT_QUOTES) ?></p>
|
||||
<p><?= htmlspecialchars($medicine['tracking_note'], ENT_QUOTES) ?></p>
|
||||
<div class="source-links">
|
||||
<a href="<?= htmlspecialchars($medicine['rxnorm_url'], ENT_QUOTES) ?>">RxNorm</a>
|
||||
<a href="<?= htmlspecialchars($medicine['pubchem_url'], ENT_QUOTES) ?>">PubChem</a>
|
||||
<a href="<?= htmlspecialchars($medicine['dailymed_url'], ENT_QUOTES) ?>">DailyMed</a>
|
||||
<a href="<?= htmlspecialchars($medicine['medlineplus_url'], ENT_QUOTES) ?>">MedlinePlus</a>
|
||||
<a href="<?= htmlspecialchars($medicine['pubmed_url'], ENT_QUOTES) ?>">PubMed</a>
|
||||
<a href="<?= htmlspecialchars($medicine['clinicaltrials_url'], ENT_QUOTES) ?>">Studies</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if (!$medicines): ?>
|
||||
<article class="empty-state">
|
||||
<h3>No medicines found.</h3>
|
||||
<p>Try a generic name, brand name, chemical name, or medication class.</p>
|
||||
</article>
|
||||
<?php else: ?>
|
||||
<div class="library-list">
|
||||
<?php foreach ($medicines as $medicine): ?>
|
||||
<article class="library-row">
|
||||
<div class="library-row-main">
|
||||
<h3><?= htmlspecialchars(ucfirst((string) $medicine['generic_name']), ENT_QUOTES) ?></h3>
|
||||
<p><?= htmlspecialchars((string) ($medicine['common_use'] ?: $medicine['tracking_note'] ?: 'Medicine reference entry.'), ENT_QUOTES) ?></p>
|
||||
<div class="library-row-meta">
|
||||
<span><?= htmlspecialchars((string) ($medicine['class_name'] ?: 'Medication'), ENT_QUOTES) ?></span>
|
||||
<span>Active: <?= htmlspecialchars((string) ($medicine['active_ingredient'] ?: $medicine['generic_name']), ENT_QUOTES) ?></span>
|
||||
<span>Brands: <?= htmlspecialchars((string) ($medicine['brand_names'] ?: 'Vary by market'), ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="library-row-actions">
|
||||
<a class="site-primary" href="<?= htmlspecialchars(medicine_detail_path($medicine), ENT_QUOTES) ?>">View medicine</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section class="admin-public-shell">
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../app/bootstrap.php';
|
||||
$pdo = app_db();
|
||||
|
||||
$medicine = find_medication_catalog_item($pdo, $_GET);
|
||||
$pageTitle = $medicine
|
||||
? ucfirst((string) $medicine['generic_name']) . ' | Medicine Detail | Neon Medical Tracker'
|
||||
: 'Medicine Not Found | Neon Medical Tracker';
|
||||
$activePage = 'medicines';
|
||||
|
||||
$relatedStudies = [];
|
||||
$referenceLinks = [];
|
||||
if ($medicine) {
|
||||
$genericName = (string) $medicine['generic_name'];
|
||||
$like = '%' . $genericName . '%';
|
||||
$relatedStudies = db_all(
|
||||
$pdo,
|
||||
"SELECT *
|
||||
FROM research_studies
|
||||
WHERE related_medicine LIKE ? OR title LIKE ? OR summary LIKE ?
|
||||
ORDER BY category, title
|
||||
LIMIT 6",
|
||||
[$like, $like, $like]
|
||||
);
|
||||
$referenceLinks = medicine_reference_links($medicine);
|
||||
} else {
|
||||
http_response_code(404);
|
||||
}
|
||||
|
||||
require __DIR__ . '/partials/site-header.php';
|
||||
?>
|
||||
<main>
|
||||
<?php if (!$medicine): ?>
|
||||
<section class="admin-public-shell record-shell">
|
||||
<p class="site-eyebrow">Medicine catalog</p>
|
||||
<h1>Medicine not found.</h1>
|
||||
<p>The requested medicine link does not match a current catalog record.</p>
|
||||
<a class="site-primary" href="/nutrition.php">Search medicines</a>
|
||||
</section>
|
||||
<?php else: ?>
|
||||
<section class="admin-public-shell record-shell">
|
||||
<div class="record-heading">
|
||||
<div>
|
||||
<p class="site-eyebrow">Medicine detail</p>
|
||||
<h1><?= htmlspecialchars(ucfirst((string) $medicine['generic_name']), ENT_QUOTES) ?></h1>
|
||||
<p><?= htmlspecialchars((string) ($medicine['common_use'] ?: 'Medicine reference entry.'), ENT_QUOTES) ?></p>
|
||||
</div>
|
||||
<div class="record-actions">
|
||||
<a class="site-primary" href="/tracker.php">Open tracker</a>
|
||||
<a class="site-secondary" href="/nutrition.php?q=<?= rawurlencode((string) $medicine['generic_name']) ?>">Catalog search</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="record-meta">
|
||||
<span><?= htmlspecialchars((string) ($medicine['class_name'] ?: 'Medication'), ENT_QUOTES) ?></span>
|
||||
<span><?= htmlspecialchars((string) ($medicine['drug_family'] ?: $medicine['source_name'] ?: 'Reference catalog'), ENT_QUOTES) ?></span>
|
||||
<span>ID <?= htmlspecialchars((string) $medicine['id'], ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="admin-public-shell">
|
||||
<div class="record-detail-grid">
|
||||
<article class="record-field">
|
||||
<span>Active Ingredient</span>
|
||||
<p><?= htmlspecialchars((string) ($medicine['active_ingredient'] ?: $medicine['generic_name']), ENT_QUOTES) ?></p>
|
||||
</article>
|
||||
<article class="record-field">
|
||||
<span>Chemical Name</span>
|
||||
<p><?= htmlspecialchars((string) ($medicine['chemical_name'] ?: $medicine['active_ingredient'] ?: $medicine['generic_name']), ENT_QUOTES) ?></p>
|
||||
</article>
|
||||
<article class="record-field">
|
||||
<span>Common Brands</span>
|
||||
<p><?= htmlspecialchars((string) ($medicine['brand_names'] ?: 'Brand names vary by market.'), ENT_QUOTES) ?></p>
|
||||
</article>
|
||||
<article class="record-field">
|
||||
<span>Generic / Alternate Names</span>
|
||||
<p><?= htmlspecialchars((string) ($medicine['generic_brands'] ?: $medicine['generic_name']), ENT_QUOTES) ?></p>
|
||||
</article>
|
||||
<article class="record-field wide">
|
||||
<span>Tracking Note</span>
|
||||
<p><?= htmlspecialchars((string) ($medicine['tracking_note'] ?: 'Track dose, frequency, route, prescriber, status, side effects, and patient-specific notes.'), ENT_QUOTES) ?></p>
|
||||
</article>
|
||||
<article class="record-field wide">
|
||||
<span>Reference Links</span>
|
||||
<div class="source-links">
|
||||
<?php foreach ($referenceLinks as $label => $url): ?>
|
||||
<a href="<?= htmlspecialchars((string) $url, ENT_QUOTES) ?>"><?= htmlspecialchars($label, ENT_QUOTES) ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php if ($relatedStudies): ?>
|
||||
<section class="admin-public-shell">
|
||||
<div class="site-section-heading">
|
||||
<p class="site-eyebrow">Research</p>
|
||||
<h2>Related NIH/NLM study links</h2>
|
||||
</div>
|
||||
<div class="library-list">
|
||||
<?php foreach ($relatedStudies as $study): ?>
|
||||
<article class="library-row">
|
||||
<div class="library-row-main">
|
||||
<h3><?= htmlspecialchars((string) $study['title'], ENT_QUOTES) ?></h3>
|
||||
<p><?= htmlspecialchars((string) $study['summary'], ENT_QUOTES) ?></p>
|
||||
<div class="library-row-meta">
|
||||
<span><?= htmlspecialchars((string) $study['category'], ENT_QUOTES) ?></span>
|
||||
<span><?= htmlspecialchars((string) $study['study_type'], ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="source-links library-row-actions">
|
||||
<a href="<?= htmlspecialchars((string) $study['source_url'], ENT_QUOTES) ?>"><?= htmlspecialchars((string) $study['nih_source'], ENT_QUOTES) ?></a>
|
||||
<a href="<?= htmlspecialchars((string) $study['pubmed_url'], ENT_QUOTES) ?>">PubMed</a>
|
||||
<a href="<?= htmlspecialchars((string) $study['clinicaltrials_url'], ENT_QUOTES) ?>">ClinicalTrials.gov</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
<?php require __DIR__ . '/partials/site-footer.php'; ?>
|
||||
+30
-20
@@ -46,27 +46,37 @@ require __DIR__ . '/partials/site-header.php';
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="detail-grid">
|
||||
<?php foreach ($medicines as $medicine): ?>
|
||||
<article>
|
||||
<h2><?= htmlspecialchars(ucfirst($medicine['generic_name']), ENT_QUOTES) ?></h2>
|
||||
<p><strong><?= htmlspecialchars($medicine['class_name'], ENT_QUOTES) ?></strong></p>
|
||||
<p><strong>Active ingredient:</strong> <?= htmlspecialchars($medicine['active_ingredient'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
|
||||
<p><strong>Chemical name:</strong> <?= htmlspecialchars($medicine['chemical_name'] ?: $medicine['active_ingredient'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
|
||||
<p><strong>Common brands:</strong> <?= htmlspecialchars($medicine['brand_names'] ?: 'Brand names vary by market', ENT_QUOTES) ?></p>
|
||||
<p><strong>Generic/alternate names:</strong> <?= htmlspecialchars($medicine['generic_brands'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
|
||||
<p><?= htmlspecialchars($medicine['common_use'], ENT_QUOTES) ?></p>
|
||||
<p><?= htmlspecialchars($medicine['tracking_note'], ENT_QUOTES) ?></p>
|
||||
<div class="source-links">
|
||||
<a href="<?= htmlspecialchars($medicine['rxnorm_url'], ENT_QUOTES) ?>">RxNorm</a>
|
||||
<a href="<?= htmlspecialchars($medicine['pubchem_url'], ENT_QUOTES) ?>">PubChem</a>
|
||||
<a href="<?= htmlspecialchars($medicine['dailymed_url'], ENT_QUOTES) ?>">DailyMed</a>
|
||||
<a href="<?= htmlspecialchars($medicine['medlineplus_url'], ENT_QUOTES) ?>">MedlinePlus</a>
|
||||
<a href="<?= htmlspecialchars($medicine['pubmed_url'], ENT_QUOTES) ?>">PubMed</a>
|
||||
<a href="<?= htmlspecialchars($medicine['clinicaltrials_url'], ENT_QUOTES) ?>">Studies</a>
|
||||
</div>
|
||||
<section class="admin-public-shell">
|
||||
<div class="site-section-heading">
|
||||
<p class="site-eyebrow">Catalog directory</p>
|
||||
<h2>Medicine records</h2>
|
||||
</div>
|
||||
|
||||
<?php if (!$medicines): ?>
|
||||
<article class="empty-state">
|
||||
<h3>No medicines found.</h3>
|
||||
<p>Try a generic name, brand name, chemical name, or medication class.</p>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<div class="library-list">
|
||||
<?php foreach ($medicines as $medicine): ?>
|
||||
<article class="library-row">
|
||||
<div class="library-row-main">
|
||||
<h3><?= htmlspecialchars(ucfirst((string) $medicine['generic_name']), ENT_QUOTES) ?></h3>
|
||||
<p><?= htmlspecialchars((string) ($medicine['common_use'] ?: $medicine['tracking_note'] ?: 'Medicine reference entry.'), ENT_QUOTES) ?></p>
|
||||
<div class="library-row-meta">
|
||||
<span><?= htmlspecialchars((string) ($medicine['class_name'] ?: 'Medication'), ENT_QUOTES) ?></span>
|
||||
<span>Active: <?= htmlspecialchars((string) ($medicine['active_ingredient'] ?: $medicine['generic_name']), ENT_QUOTES) ?></span>
|
||||
<span>Brands: <?= htmlspecialchars((string) ($medicine['brand_names'] ?: 'Vary by market'), ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="library-row-actions">
|
||||
<a class="site-primary" href="<?= htmlspecialchars(medicine_detail_path($medicine), ENT_QUOTES) ?>">View medicine</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
</main>
|
||||
<?php require __DIR__ . '/partials/site-footer.php'; ?>
|
||||
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../app/bootstrap.php';
|
||||
$pdo = app_db();
|
||||
|
||||
$term = find_medical_term_item($pdo, $_GET);
|
||||
$pageTitle = $term
|
||||
? (string) $term['term'] . ' | Medical Term | Neon Medical Tracker'
|
||||
: 'Medical Term Not Found | Neon Medical Tracker';
|
||||
$activePage = 'terminology';
|
||||
|
||||
$relatedMedicines = [];
|
||||
$relatedConditions = [];
|
||||
$relatedStudies = [];
|
||||
if ($term) {
|
||||
$related = library_search_payload(['q' => (string) $term['term'], 'limit' => 8]);
|
||||
$relatedMedicines = $related['medicationCatalog'];
|
||||
$relatedConditions = $related['medicalConditions'];
|
||||
$relatedStudies = $related['researchStudies'];
|
||||
} else {
|
||||
http_response_code(404);
|
||||
}
|
||||
|
||||
require __DIR__ . '/partials/site-header.php';
|
||||
?>
|
||||
<main>
|
||||
<?php if (!$term): ?>
|
||||
<section class="admin-public-shell record-shell">
|
||||
<p class="site-eyebrow">Medical terminology</p>
|
||||
<h1>Term not found.</h1>
|
||||
<p>The requested terminology link does not match a current database record.</p>
|
||||
<a class="site-primary" href="/medical.php">Search terminology</a>
|
||||
</section>
|
||||
<?php else: ?>
|
||||
<section class="admin-public-shell record-shell">
|
||||
<div class="record-heading">
|
||||
<div>
|
||||
<p class="site-eyebrow">Medical term</p>
|
||||
<h1><?= htmlspecialchars((string) $term['term'], ENT_QUOTES) ?></h1>
|
||||
<p><?= htmlspecialchars((string) $term['plain_language_definition'], ENT_QUOTES) ?></p>
|
||||
</div>
|
||||
<div class="record-actions">
|
||||
<a class="site-primary" href="/tracker.php">Open tracker</a>
|
||||
<a class="site-secondary" href="/medical.php?q=<?= rawurlencode((string) $term['term']) ?>">Library search</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="record-meta">
|
||||
<span><?= htmlspecialchars((string) $term['category'], ENT_QUOTES) ?></span>
|
||||
<span>ID <?= htmlspecialchars((string) $term['id'], ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="admin-public-shell">
|
||||
<div class="record-detail-grid">
|
||||
<article class="record-field wide">
|
||||
<span>Clinical Context</span>
|
||||
<p><?= htmlspecialchars((string) $term['clinical_context'], ENT_QUOTES) ?></p>
|
||||
</article>
|
||||
<article class="record-field wide">
|
||||
<span>Source</span>
|
||||
<div class="source-links">
|
||||
<a href="<?= htmlspecialchars((string) $term['source_url'], ENT_QUOTES) ?>"><?= htmlspecialchars((string) $term['source_name'], ENT_QUOTES) ?></a>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php if ($relatedConditions || $relatedMedicines || $relatedStudies): ?>
|
||||
<section class="admin-public-shell">
|
||||
<div class="site-section-heading">
|
||||
<p class="site-eyebrow">Connected records</p>
|
||||
<h2>Database matches for this term</h2>
|
||||
</div>
|
||||
<div class="library-list">
|
||||
<?php foreach ($relatedConditions as $condition): ?>
|
||||
<article class="library-row">
|
||||
<div class="library-row-main">
|
||||
<h3><?= htmlspecialchars((string) $condition['name'], ENT_QUOTES) ?></h3>
|
||||
<p><?= htmlspecialchars((string) $condition['overview'], ENT_QUOTES) ?></p>
|
||||
<div class="library-row-meta">
|
||||
<span><?= htmlspecialchars((string) $condition['category'], ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="library-row-actions">
|
||||
<a class="site-secondary" href="<?= htmlspecialchars((string) $condition['source_url'], ENT_QUOTES) ?>">Source</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php foreach ($relatedMedicines as $medicine): ?>
|
||||
<article class="library-row">
|
||||
<div class="library-row-main">
|
||||
<h3><?= htmlspecialchars(ucfirst((string) $medicine['generic_name']), ENT_QUOTES) ?></h3>
|
||||
<p><?= htmlspecialchars((string) ($medicine['common_use'] ?: $medicine['class_name']), ENT_QUOTES) ?></p>
|
||||
<div class="library-row-meta">
|
||||
<span><?= htmlspecialchars((string) ($medicine['class_name'] ?: 'Medication'), ENT_QUOTES) ?></span>
|
||||
<span><?= htmlspecialchars((string) ($medicine['brand_names'] ?: 'Brands vary'), ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="library-row-actions">
|
||||
<a class="site-secondary" href="<?= htmlspecialchars(medicine_detail_path($medicine), ENT_QUOTES) ?>">View medicine</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php foreach ($relatedStudies as $study): ?>
|
||||
<article class="library-row">
|
||||
<div class="library-row-main">
|
||||
<h3><?= htmlspecialchars((string) $study['title'], ENT_QUOTES) ?></h3>
|
||||
<p><?= htmlspecialchars((string) $study['summary'], ENT_QUOTES) ?></p>
|
||||
<div class="library-row-meta">
|
||||
<span><?= htmlspecialchars((string) $study['category'], ENT_QUOTES) ?></span>
|
||||
<span><?= htmlspecialchars((string) $study['related_medicine'], ENT_QUOTES) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="library-row-actions">
|
||||
<a class="site-secondary" href="<?= htmlspecialchars((string) $study['source_url'], ENT_QUOTES) ?>">Study link</a>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
<?php require __DIR__ . '/partials/site-footer.php'; ?>
|
||||
Reference in New Issue
Block a user