From e45324fde4c37f1153aa47da0f72601c61666013 Mon Sep 17 00:00:00 2001 From: Ty Clifford Date: Tue, 30 Jun 2026 16:35:27 -0400 Subject: [PATCH] =?UTF-8?q?-=20Conditions=20now=20use=20the=20same=20datab?= =?UTF-8?q?ase/detail-page=20model=20as=20medicines,=20terminology,=20and?= =?UTF-8?q?=20symptoms.=20What=20changed:=20Rebuilt=20the=20Conditions=20p?= =?UTF-8?q?age=20into=20a=20searchable=20condition=20database:=20[public/w?= =?UTF-8?q?orkouts.php=20(line=201)](/Users/tyemeclifford/Documents/GH/wor?= =?UTF-8?q?kout/public/workouts.php:1)=20Added=20dynamic=20condition=20det?= =?UTF-8?q?ail=20pages,=20e.g.=20/condition.php=3Fname=3DType%202%20Diabet?= =?UTF-8?q?es=20or=20/condition.php=3Fid=3D2:=20[public/condition.php=20(l?= =?UTF-8?q?ine=201)](/Users/tyemeclifford/Documents/GH/workout/public/cond?= =?UTF-8?q?ition.php:1)=20Added=20condition=20detail/link=20lookup=20helpe?= =?UTF-8?q?rs:=20[app/bootstrap.php=20(line=201680)](/Users/tyemeclifford/?= =?UTF-8?q?Documents/GH/workout/app/bootstrap.php:1680)=20Expanded=20the?= =?UTF-8?q?=20seeded=20condition=20catalog=20to=20203=20conditions=20with?= =?UTF-8?q?=20categories,=20tracking=20notes,=20and=20MedlinePlus=20links:?= =?UTF-8?q?=20[app/bootstrap.php=20(line=20636)](/Users/tyemeclifford/Docu?= =?UTF-8?q?ments/GH/workout/app/bootstrap.php:636)=20Updated=20combined=20?= =?UTF-8?q?medical=20search=20to=20link=20conditions=20internally=20with?= =?UTF-8?q?=20=E2=80=9CView=20condition=E2=80=9D:=20[public/medical.php=20?= =?UTF-8?q?(line=2048)](/Users/tyemeclifford/Documents/GH/workout/public/m?= =?UTF-8?q?edical.php:48)=20Updated=20related=20records=20on=20symptom/ter?= =?UTF-8?q?m=20pages=20to=20point=20to=20condition=20detail=20pages.=20Upd?= =?UTF-8?q?ated=20README=20route=20docs:=20[README.md=20(line=2021)](/User?= =?UTF-8?q?s/tyemeclifford/Documents/GH/workout/README.md:21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +- app/bootstrap.php | 241 ++++++++++++++++++++++++++++++++++++- data/health_tracker.sqlite | Bin 7258112 -> 7335936 bytes public/condition.php | 145 ++++++++++++++++++++++ public/medical.php | 29 +++-- public/symptom.php | 2 +- public/term.php | 2 +- public/workouts.php | 80 ++++++++---- 8 files changed, 462 insertions(+), 42 deletions(-) create mode 100644 public/condition.php diff --git a/README.md b/README.md index 4ad7416..9fced90 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ http://127.0.0.1:8080 ## Public Routes - `/` - public medical reference hub for medicines, symptoms, terminology, conditions, research, tracker, and admin links. -- `/workouts.php` - condition-tracking feature page. +- `/workouts.php` - searchable condition reference database. +- `/condition.php?id=1` - dynamic condition detail page backed by the SQLite catalog. - `/nutrition.php` - medicine catalog feature page. - `/medicine.php?id=46` - dynamic medicine detail page backed by the SQLite catalog. - `/symptoms.php` - searchable symptom reference database. @@ -51,7 +52,7 @@ The app seeds sample profiles, medical terminology, condition summaries, an expa - Vital logs for blood pressure, pulse, temperature, oxygen saturation, glucose, pain score, symptoms, and notes. - Lab result records with units, reference ranges, clinician/source notes, and collection dates. - Symptom journal, allergy list, appointments, and immunization records. -- Medical terminology and condition database with source links. +- Medical terminology and condition databases with source links and dynamic detail pages. - Searchable symptom database with body-system categories, tracking notes, urgency-context notes, and dynamic detail links. - Searchable medicine catalog by generic name, active ingredient, chemical name, common brand names, and generic/alternate names. - Medicine links to RxNorm, DailyMed, PubChem, MedlinePlus, PubMed, and ClinicalTrials.gov. diff --git a/app/bootstrap.php b/app/bootstrap.php index 46e774b..afed7bd 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -580,6 +580,7 @@ function seed_medical_library(PDO $pdo): void } } + seed_expanded_condition_catalog($pdo, $created); seed_medical_symptom_catalog($pdo, $created); $medicineCount = (int) $pdo->query('SELECT COUNT(*) FROM medication_catalog')->fetchColumn(); @@ -632,6 +633,207 @@ function seed_medical_library(PDO $pdo): void } } +function seed_expanded_condition_catalog(PDO $pdo, string $created): void +{ + $rows = condition_catalog_rows(); + $existing = (int) db_value($pdo, 'SELECT COUNT(*) FROM medical_conditions'); + $uniqueTarget = count(array_unique(array_map(static fn(array $row): string => strtolower($row[0]), $rows))); + if ($existing >= $uniqueTarget) { + return; + } + + $stmt = $pdo->prepare( + "INSERT INTO medical_conditions + (name, category, overview, common_tracking, source_name, source_url, created_at) + SELECT ?, ?, ?, ?, ?, ?, ? + WHERE NOT EXISTS (SELECT 1 FROM medical_conditions WHERE lower(name) = lower(?))" + ); + + $startedTransaction = !$pdo->inTransaction(); + if ($startedTransaction) { + $pdo->beginTransaction(); + } + + try { + foreach ($rows as $row) { + $stmt->execute([...$row, $created, $row[0]]); + } + + if ($startedTransaction) { + $pdo->commit(); + } + } catch (Throwable $exception) { + if ($startedTransaction && $pdo->inTransaction()) { + $pdo->rollBack(); + } + throw $exception; + } +} + +function condition_catalog_rows(): array +{ + $groups = [ + [ + 'Cardiovascular', + '{condition} is a heart, blood vessel, blood-pressure, clotting, or circulation-related condition.', + 'Track blood pressure, pulse, weight, swelling, chest symptoms, shortness of breath, medicines, labs, procedures, and care-team instructions.', + ['Hypertension', 'High Cholesterol', 'Coronary Artery Disease', 'Angina', 'Heart Attack', 'Heart Failure', 'Atrial Fibrillation', 'Arrhythmia', 'Stroke', 'Transient Ischemic Attack', 'Peripheral Artery Disease', 'Deep Vein Thrombosis', 'Pulmonary Embolism', 'Aortic Aneurysm', 'Raynaud Disease'], + ], + [ + 'Respiratory', + '{condition} is a lung, airway, breathing, or oxygen-related condition.', + 'Track cough, breathing effort, oxygen saturation, wheezing, triggers, fever, inhaler use, smoking or exposure history, and activity tolerance.', + ['Asthma', 'Chronic Obstructive Pulmonary Disease', 'Pneumonia', 'Bronchitis', 'Sleep Apnea', 'Pulmonary Fibrosis', 'Tuberculosis', 'Cystic Fibrosis', 'Pleural Effusion', 'Respiratory Syncytial Virus Infection', 'COVID-19', 'Influenza', 'Allergic Rhinitis', 'Sinusitis'], + ], + [ + 'Endocrine / metabolic', + '{condition} is a hormone, blood-sugar, thyroid, weight, or metabolism-related condition.', + 'Track glucose if relevant, A1C, weight, blood pressure, medicines, energy, thirst, urination, labs, nutrition context, and clinician goals.', + ['Type 1 Diabetes', 'Type 2 Diabetes', 'Prediabetes', 'Gestational Diabetes', 'Hypoglycemia', 'Hyperthyroidism', 'Hypothyroidism', 'Hashimoto Thyroiditis', 'Graves Disease', 'Cushing Syndrome', 'Addison Disease', 'Polycystic Ovary Syndrome', 'Obesity', 'Metabolic Syndrome', 'Vitamin D Deficiency', 'Osteoporosis'], + ], + [ + 'Digestive / liver', + '{condition} is a digestive tract, liver, gallbladder, pancreas, or bowel-related condition.', + 'Track abdominal pain location, bowel pattern, nausea, vomiting, bleeding, diet triggers, hydration, weight changes, medicines, procedures, and lab or imaging follow-up.', + ['Gastroesophageal Reflux Disease', 'Peptic Ulcer Disease', 'Gastritis', 'Irritable Bowel Syndrome', 'Crohn Disease', 'Ulcerative Colitis', 'Celiac Disease', 'Diverticulitis', 'Gallstones', 'Pancreatitis', 'Hepatitis A', 'Hepatitis B', 'Hepatitis C', 'Cirrhosis', 'Fatty Liver Disease', 'Appendicitis', 'Hemorrhoids', 'Constipation', 'Diarrhea'], + ], + [ + 'Kidney / urinary', + '{condition} is a kidney, bladder, urinary tract, or fluid-balance-related condition.', + 'Track urination pattern, pain, fever, fluid intake, urine test results, kidney labs, blood pressure, swelling, medicines, and procedure notes.', + ['Chronic Kidney Disease', 'Kidney Stones', 'Urinary Tract Infection', 'Bladder Infection', 'Kidney Infection', 'Urinary Incontinence', 'Overactive Bladder', 'Benign Prostatic Hyperplasia', 'Interstitial Cystitis', 'Glomerulonephritis', 'Nephrotic Syndrome'], + ], + [ + 'Neurologic', + '{condition} is a brain, spinal cord, nerve, movement, headache, seizure, or cognition-related condition.', + 'Track onset, symptom episodes, weakness, speech or vision changes, headaches, seizures, falls, medicines, triggers, sleep, and safety events.', + ['Migraine', 'Epilepsy', 'Multiple Sclerosis', 'Parkinson Disease', 'Alzheimer Disease', 'Dementia', 'Neuropathy', 'Bell Palsy', 'Meningitis', 'Concussion', 'Traumatic Brain Injury', 'Vertigo', 'Amyotrophic Lateral Sclerosis', 'Restless Legs Syndrome', 'Carpal Tunnel Syndrome'], + ], + [ + 'Mental health', + '{condition} is a mood, anxiety, attention, behavior, substance-use, sleep, or psychiatric condition.', + 'Track mood, sleep, appetite, concentration, safety concerns, triggers, medicines, therapy notes, substance use, and follow-up plans.', + ['Depression', 'Anxiety Disorders', 'Generalized Anxiety Disorder', 'Panic Disorder', 'Bipolar Disorder', 'Post-Traumatic Stress Disorder', 'Obsessive-Compulsive Disorder', 'Attention Deficit Hyperactivity Disorder', 'Autism Spectrum Disorder', 'Schizophrenia', 'Eating Disorders', 'Alcohol Use Disorder', 'Substance Use Disorder', 'Insomnia'], + ], + [ + 'Musculoskeletal / rheumatology', + '{condition} is a bone, joint, muscle, spine, autoimmune, or inflammation-related condition.', + 'Track pain score, stiffness, swelling, range of motion, flares, activity limits, injuries, medicines, injections, imaging, and function.', + ['Osteoarthritis', 'Rheumatoid Arthritis', 'Gout', 'Fibromyalgia', 'Lupus', 'Ankylosing Spondylitis', 'Psoriatic Arthritis', 'Bursitis', 'Tendinitis', 'Back Pain', 'Sciatica', 'Scoliosis', 'Fracture', 'Sprain', 'Carpal Tunnel Syndrome', 'Osteomyelitis'], + ], + [ + 'Skin / dermatology', + '{condition} is a skin, hair, nail, wound, allergy, or visible-tissue condition.', + 'Track location, appearance, spread, itch, pain, fever, drainage, new medicines, exposures, photos, treatment response, and recurrence.', + ['Acne', 'Eczema', 'Psoriasis', 'Rosacea', 'Hives', 'Cellulitis', 'Shingles', 'Cold Sores', 'Fungal Skin Infection', 'Warts', 'Vitiligo', 'Alopecia Areata', 'Pressure Ulcers', 'Melanoma', 'Skin Cancer', 'Seborrheic Dermatitis'], + ], + [ + 'Infectious disease', + '{condition} is an infection or infectious-disease-related condition.', + 'Track fever, symptom onset, exposures, test results, isolation guidance, medicines, completion dates, hydration, and worsening symptoms.', + ['Common Cold', 'Strep Throat', 'Mononucleosis', 'Lyme Disease', 'Sepsis', 'HIV', 'Herpes', 'Chickenpox', 'Measles', 'Mumps', 'Whooping Cough', 'Food Poisoning', 'MRSA Infection', 'C. difficile Infection'], + ], + [ + 'Blood / immune', + '{condition} is a blood, clotting, anemia, immune, or allergy-related condition.', + 'Track CBC results, bleeding or bruising, fatigue, infections, triggers, exposures, medicines, transfusions, and specialist follow-up.', + ['Anemia', 'Iron Deficiency Anemia', 'Sickle Cell Disease', 'Hemophilia', 'Thrombocytopenia', 'Leukemia', 'Lymphoma', 'Multiple Myeloma', 'Allergies', 'Anaphylaxis', 'Autoimmune Diseases', 'Immunodeficiency Disorders'], + ], + [ + 'Eye / ear / nose / throat', + '{condition} is an eye, ear, sinus, mouth, dental, hearing, or throat condition.', + 'Track pain, side affected, vision or hearing changes, discharge, fever, allergies, dental symptoms, medicines, and procedure notes.', + ['Conjunctivitis', 'Cataracts', 'Glaucoma', 'Macular Degeneration', 'Diabetic Eye Disease', 'Dry Eye', 'Ear Infection', 'Tinnitus', 'Hearing Loss', 'Tonsillitis', 'Dental Cavities', 'Gum Disease'], + ], + [ + 'Reproductive / pregnancy', + '{condition} is a reproductive, menstrual, pregnancy, breast, prostate, or sexual-health-related condition.', + 'Track cycle timing, bleeding, pelvic pain, discharge, pregnancy context, urinary symptoms, test results, medicines, and clinician instructions.', + ['Endometriosis', 'Uterine Fibroids', 'Ovarian Cysts', 'Menopause', 'Pregnancy', 'Preeclampsia', 'Breast Cancer', 'Prostate Cancer', 'Prostatitis', 'Erectile Dysfunction', 'Sexually Transmitted Infections', 'Infertility'], + ], + [ + 'Cancer / oncology', + '{condition} is a cancer, tumor, screening, treatment, or survivorship-related condition.', + 'Track diagnosis details, stage if known, treatments, side effects, labs, imaging, symptoms, appointments, medicines, and care-team plans.', + ['Lung Cancer', 'Colorectal Cancer', 'Breast Cancer', 'Prostate Cancer', 'Skin Cancer', 'Melanoma', 'Pancreatic Cancer', 'Kidney Cancer', 'Bladder Cancer', 'Thyroid Cancer', 'Ovarian Cancer', 'Cervical Cancer'], + ], + [ + 'General medicine', + '{condition} is a general medical condition or care topic that may involve multiple body systems.', + 'Track symptoms, onset, severity, medicines, vitals, labs, appointments, self-care steps, and clinician guidance.', + ['Pain and Inflammation', 'Chronic Pain', 'Fever', 'Dehydration', 'Malnutrition', 'Falls', 'Frailty', 'Medication Side Effects', 'Adverse Drug Reaction', 'Postoperative Recovery'], + ], + ]; + + $rows = []; + foreach ($groups as [$category, $overviewTemplate, $tracking, $names]) { + foreach ($names as $name) { + $rows[] = [ + $name, + $category, + str_replace('{condition}', $name, $overviewTemplate), + $tracking, + 'MedlinePlus', + condition_source_url($name), + ]; + } + } + + return $rows; +} + +function condition_source_url(string $name): string +{ + $map = [ + 'Alzheimer Disease' => 'https://medlineplus.gov/alzheimersdisease.html', + 'Anemia' => 'https://medlineplus.gov/anemia.html', + 'Anxiety Disorders' => 'https://medlineplus.gov/anxiety.html', + 'Asthma' => 'https://medlineplus.gov/asthma.html', + 'Back Pain' => 'https://medlineplus.gov/backpain.html', + 'Breast Cancer' => 'https://medlineplus.gov/breastcancer.html', + 'Chronic Kidney Disease' => 'https://medlineplus.gov/chronickidneydisease.html', + 'Chronic Obstructive Pulmonary Disease' => 'https://medlineplus.gov/copd.html', + 'COVID-19' => 'https://medlineplus.gov/covid19coronavirusdisease2019.html', + 'Depression' => 'https://medlineplus.gov/depression.html', + 'Diarrhea' => 'https://medlineplus.gov/diarrhea.html', + 'Eczema' => 'https://medlineplus.gov/eczema.html', + 'Epilepsy' => 'https://medlineplus.gov/epilepsy.html', + 'Fibromyalgia' => 'https://medlineplus.gov/fibromyalgia.html', + 'Gastroesophageal Reflux Disease' => 'https://medlineplus.gov/gerd.html', + 'Gout' => 'https://medlineplus.gov/gout.html', + 'Heart Attack' => 'https://medlineplus.gov/heartattack.html', + 'Heart Failure' => 'https://medlineplus.gov/heartfailure.html', + 'Hepatitis C' => 'https://medlineplus.gov/hepatitisc.html', + 'High Cholesterol' => 'https://medlineplus.gov/cholesterol.html', + 'HIV' => 'https://medlineplus.gov/hivaids.html', + 'Hypertension' => 'https://medlineplus.gov/highbloodpressure.html', + 'Influenza' => 'https://medlineplus.gov/flu.html', + 'Insomnia' => 'https://medlineplus.gov/insomnia.html', + 'Irritable Bowel Syndrome' => 'https://medlineplus.gov/irritablebowelsyndrome.html', + 'Kidney Stones' => 'https://medlineplus.gov/kidneystones.html', + 'Lupus' => 'https://medlineplus.gov/lupus.html', + 'Migraine' => 'https://medlineplus.gov/migraine.html', + 'Multiple Sclerosis' => 'https://medlineplus.gov/multiplesclerosis.html', + 'Obesity' => 'https://medlineplus.gov/obesity.html', + 'Osteoarthritis' => 'https://medlineplus.gov/osteoarthritis.html', + 'Osteoporosis' => 'https://medlineplus.gov/osteoporosis.html', + 'Parkinson Disease' => 'https://medlineplus.gov/parkinsonsdisease.html', + 'Pneumonia' => 'https://medlineplus.gov/pneumonia.html', + 'Pregnancy' => 'https://medlineplus.gov/pregnancy.html', + 'Psoriasis' => 'https://medlineplus.gov/psoriasis.html', + 'Rheumatoid Arthritis' => 'https://medlineplus.gov/rheumatoidarthritis.html', + 'Shingles' => 'https://medlineplus.gov/shingles.html', + 'Sickle Cell Disease' => 'https://medlineplus.gov/sicklecelldisease.html', + 'Sleep Apnea' => 'https://medlineplus.gov/sleepapnea.html', + 'Stroke' => 'https://medlineplus.gov/stroke.html', + 'Type 1 Diabetes' => 'https://medlineplus.gov/diabetestype1.html', + 'Type 2 Diabetes' => 'https://medlineplus.gov/diabetestype2.html', + 'Urinary Tract Infection' => 'https://medlineplus.gov/urinarytractinfections.html', + ]; + + return $map[$name] ?? 'https://medlineplus.gov/search/?query=' . rawurlencode($name); +} + function seed_medical_symptom_catalog(PDO $pdo, string $created): void { $rows = symptom_catalog_rows(); @@ -1475,6 +1677,11 @@ function symptom_detail_path(array $symptom): string return '/symptom.php?id=' . rawurlencode((string) ($symptom['id'] ?? '')); } +function condition_detail_path(array $condition): string +{ + return '/condition.php?id=' . rawurlencode((string) ($condition['id'] ?? '')); +} + function find_medication_catalog_item(PDO $pdo, array $query): ?array { $id = filter_var($query['id'] ?? null, FILTER_VALIDATE_INT); @@ -1529,6 +1736,29 @@ function find_medical_term_item(PDO $pdo, array $query): ?array ); } +function find_medical_condition_item(PDO $pdo, array $query): ?array +{ + $id = filter_var($query['id'] ?? null, FILTER_VALIDATE_INT); + if ($id !== false && $id > 0) { + return db_one($pdo, 'SELECT * FROM medical_conditions WHERE id = ?', [$id]); + } + + $name = trim((string) ($query['name'] ?? $query['condition'] ?? $query['q'] ?? '')); + if ($name === '') { + return null; + } + + return db_one( + $pdo, + "SELECT * + FROM medical_conditions + WHERE lower(name) = lower(?) + ORDER BY name + LIMIT 1", + [$name] + ); +} + function find_medical_symptom_item(PDO $pdo, array $query): ?array { $id = filter_var($query['id'] ?? null, FILTER_VALIDATE_INT); @@ -2029,7 +2259,7 @@ function library_search_payload(array $query): array $like = '%' . $search . '%'; $termParams = array_fill(0, 5, $like); - $conditionParams = array_fill(0, 4, $like); + $conditionParams = [...array_fill(0, 4, $like), $search, $search . '%', $like]; $symptomParams = [...array_fill(0, 8, $like), $search, $search . '%', $like]; $medicineParams = array_fill(0, 10, $like); $studyParams = array_fill(0, 6, $like); @@ -2049,7 +2279,14 @@ function library_search_payload(array $query): array $pdo, "SELECT * FROM medical_conditions WHERE name LIKE ? OR category LIKE ? OR overview LIKE ? OR common_tracking LIKE ? - ORDER BY category, name + ORDER BY + CASE + WHEN lower(name) = lower(?) THEN 0 + WHEN name LIKE ? THEN 1 + WHEN overview LIKE ? THEN 2 + ELSE 3 + END, + category, name LIMIT {$limit}", $conditionParams ), diff --git a/data/health_tracker.sqlite b/data/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YXi^{sAM4>oYvH*)OqL?Q^W&-IRz#;&ZPvBhkdi-22|HSojlWLnC|* zpTgTv4=+P8WW(@uPbL-mJCddGLNPx!Ia+;DdOlStRVx#(I#aR1=zq^w%7x-ou~M$a zr?Uee=G)Veg+JMdw9ch}xBN`~YW|*l(>6c!Z6=e8{!Pp@ew6#-5|u>~lf}{`3$jEK zl9XmiNsFYVRe~&)Hd!X^vRpc(Q@Uh@tdv#KEvsdX^hmE{WUZ`|^|C=W$|l(?TV$(j zlRnul{jx&_1R0c_vP*W$9@#5HvQPHQ0XZm#_x(m7I*pBgsoa#^te0$P+2bQ+Xzn JQhG (string) $condition['name'], 'limit' => 8]); + $relatedSymptoms = $related['medicalSymptoms']; + $relatedTerms = $related['medicalTerms']; + $relatedMedicines = $related['medicationCatalog']; + $relatedStudies = $related['researchStudies']; +} else { + http_response_code(404); +} + +require __DIR__ . '/partials/site-header.php'; +?> +
+ +
+

Condition database

+

Condition not found.

+

The requested condition link does not match a current database record.

+ Search conditions +
+ +
+
+
+

Condition detail

+

+

+
+ +
+ +
+ + ID +
+
+ +
+
+
+ Common Tracking +

+
+
+ Source + +
+
+
+ + +
+
+

Connected records

+

Database matches for this condition

+
+
+ + + + + + + + + + + + + + + +
+
+ + +
+ diff --git a/public/medical.php b/public/medical.php index b879767..0473eae 100644 --- a/public/medical.php +++ b/public/medical.php @@ -45,22 +45,29 @@ require __DIR__ . '/partials/site-header.php';
study links
-
- - - -

No conditions found.

Try another medicine, symptom, lab, or tracking term.

+ +
+ + + +
diff --git a/public/symptom.php b/public/symptom.php index c25a046..5d85c21 100644 --- a/public/symptom.php +++ b/public/symptom.php @@ -106,7 +106,7 @@ require __DIR__ . '/partials/site-header.php'; diff --git a/public/term.php b/public/term.php index 0be16d0..7cc5ffb 100644 --- a/public/term.php +++ b/public/term.php @@ -84,7 +84,7 @@ require __DIR__ . '/partials/site-header.php'; diff --git a/public/workouts.php b/public/workouts.php index 3b0b1c1..82b7335 100644 --- a/public/workouts.php +++ b/public/workouts.php @@ -4,39 +4,69 @@ declare(strict_types=1); require __DIR__ . '/../app/bootstrap.php'; $pdo = app_db(); -$pageTitle = 'Condition Tracking | Neon Medical Tracker'; +$pageTitle = 'Condition Database | Neon Medical Tracker'; $activePage = 'conditions'; -$conditions = db_all($pdo, 'SELECT * FROM medical_conditions ORDER BY category, name'); -$photo = 'https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Cycling_in_Amsterdam_%28893%29.jpg/1280px-Cycling_in_Amsterdam_%28893%29.jpg'; +$searchQuery = trim((string) ($_GET['q'] ?? '')); +$library = library_search_payload(['q' => $searchQuery, 'limit' => 500]); +$conditions = $library['medicalConditions']; +$totalConditions = (int) db_value($pdo, 'SELECT COUNT(*) FROM medical_conditions'); + require __DIR__ . '/partials/site-header.php'; ?>
-
-
-

Condition tracking

-

Track readings, symptoms, labs, and medications by condition.

-

Use structured logs for blood pressure, glucose, pain, oxygen, temperature, lab results, medications, and notes. The condition library links back to NIH/NLM patient-information sources.

- Open tracker +
+
+

Condition database

+

Search conditions by name, category, overview, and tracking context.

+

Condition entries are concise reference summaries with MedlinePlus source links. They support tracking and discussion, not diagnosis or treatment decisions.

+
+ + + +
+
-
- People cycling outdoors -
- Photo: Cycling in Amsterdam (893) - by FaceMePLS, CC BY-SA 2.0. -
-
-
- -
-

-

-

-

- MedlinePlus +
+
+

Catalog directory

+

Condition records

+
+ + +
+

No conditions found.

+

Try a diagnosis name, body system, symptom, medicine, lab, or tracking phrase.

- + +
+ + + +
+