Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

refactor([issue-827]): share STATUS_LABELS and getCategoryForKey from clinicianReport

[._.]/ Adam Eivy213d6dc3ce4c
diff --git a/client/src/components/meatspace/BloodTestCard.jsx b/client/src/components/meatspace/BloodTestCard.jsx
index 8cc7ae5c44..9e38646cb2 100644
--- a/client/src/components/meatspace/BloodTestCard.jsx
+++ b/client/src/components/meatspace/BloodTestCard.jsx
@@ -1,4 +1,5 @@
import { REFERENCE_RANGES, getBloodValueStatus, STATUS_COLORS } from './constants';
+import { getCategoryForKey } from '../../lib/clinicianReport';
export default function BloodTestCard({ test }) {
if (!test) return null;
@@ -47,24 +48,3 @@ export default function BloodTestCard({ test }) {
</div>
);
}
-
-function getCategoryForKey(key) {
- const metabolic = [
- 'glucose', 'bun', 'creatinine', 'egfr', 'na', 'k', 'ci', 'co2',
- 'calcium', 'protein', 'albumin', 'globulin', 'a_g_ratio', 'bilirubin',
- 'bili_direct', 'alk_phos', 'sgot_ast', 'alt', 'hba1c', 'anion_gap', 'apoB'
- ];
- const lipids = ['cholesterol', 'hdl', 'ldl', 'triglycerides', 'chol_hdl_ratio', 'non_hdl_col'];
- const cbc = [
- 'wbc', 'rbc', 'hemoglobin', 'hematocrit', 'platelets',
- 'mcv', 'mch', 'mchc', 'rdw', 'mpv',
- 'neutrophils_pct', 'lymphocytes_pct', 'monocytes_pct', 'eosinophils_pct', 'basophils_pct',
- 'abs_neutrophils', 'abs_lymphocytes', 'abs_monocytes', 'abs_eosinophils', 'abs_basophils'
- ];
- const thyroid = ['tsh', 'free_t4', 'free_t3'];
- if (metabolic.includes(key)) return 'Metabolic Panel';
- if (lipids.includes(key)) return 'Lipids';
- if (cbc.includes(key)) return 'CBC';
- if (thyroid.includes(key)) return 'Thyroid';
- return 'Other';
-}
diff --git a/client/src/components/meatspace/tabs/ExportTab.jsx b/client/src/components/meatspace/tabs/ExportTab.jsx
index c554ac0924..898a22302f 100644
--- a/client/src/components/meatspace/tabs/ExportTab.jsx
+++ b/client/src/components/meatspace/tabs/ExportTab.jsx
@@ -3,12 +3,10 @@ import { Printer, ClipboardCopy, FileText } from 'lucide-react';
import * as api from '../../../services/api';
import { copyToClipboard } from '../../../lib/clipboard';
-import { buildClinicianReport, reportToMarkdown, formatRange } from '../../../lib/clinicianReport';
+import { buildClinicianReport, reportToMarkdown, formatRange, STATUS_LABELS } from '../../../lib/clinicianReport';
import { STATUS_COLORS } from '../constants';
import BrailleSpinner from '../../BrailleSpinner';
-const STATUS_LABELS = { normal: 'Normal', low: 'Low', high: 'High', unknown: '—' };
-
export default function ExportTab() {
const [report, setReport] = useState(null);
const [loading, setLoading] = useState(true);
diff --git a/client/src/lib/clinicianReport.js b/client/src/lib/clinicianReport.js
index a4c8e770d7..f98efc485f 100644
--- a/client/src/lib/clinicianReport.js
+++ b/client/src/lib/clinicianReport.js
@@ -36,7 +36,7 @@ export function getCategoryForKey(key) {
return 'Other';
}
-const STATUS_LABELS = { normal: 'Normal', low: 'Low', high: 'High', unknown: '' };
+export const STATUS_LABELS = { normal: 'Normal', low: 'Low', high: 'High', unknown: '' };
export function formatRange(range) {
if (!range) return '';