From 14b2fc11a52200db213d81f52ace59019ac2f1c4 Mon Sep 17 00:00:00 2001 From: fbraza Date: Fri, 18 Jul 2025 14:54:43 +0200 Subject: [PATCH 01/15] chore: include specs otherwise claude cannot read them --- .gitignore | 1 - vitals/specs/coding_style.md | 112 +++++++++++++++++++++++++++++ vitals/specs/score2.md | 135 +++++++++++++++++++++++++++++++++++ 3 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 vitals/specs/coding_style.md create mode 100644 vitals/specs/score2.md diff --git a/.gitignore b/.gitignore index 390141f..dd30b9b 100755 --- a/.gitignore +++ b/.gitignore @@ -211,4 +211,3 @@ __marimo__/ CLAUDE.md AGENTS.md .aider* -specs diff --git a/vitals/specs/coding_style.md b/vitals/specs/coding_style.md new file mode 100644 index 0000000..8f32533 --- /dev/null +++ b/vitals/specs/coding_style.md @@ -0,0 +1,112 @@ +# Python Coding Style Specification + +## Core Principles + +### 1. Favor Simplicity Over Complexity +- **Always choose the simple, straightforward solution** over complex or "sophisticated" alternatives +- **Avoid over-engineering** - resist the urge to build elaborate abstractions unless clearly needed +- **No premature optimization** - especially avoid blind optimization without measurement +- **Use simple building blocks** that can be composed elegantly rather than complex features +- **Principle**: If there are two ways to solve a problem, choose the one that is easier to understand + +### 2. Clarity is Key +- **Readable code beats clever code** - optimize for the reader, not the writer +- **Use clear, descriptive names** for variables, functions, and classes +- **Format code for maximal scanning ease** - use whitespace and structure intentionally +- **Document intent and organization** with comments and docstrings where helpful +- **Reduce cognitive load** - code should express intent clearly at a glance +- **Principle**: The easier your code is to understand immediately, the better it is + +### 3. Write Pythonic Code +- **Follow Python community standards and idioms** for naming, formatting, and programming paradigms +- **Cooperate with the language** rather than fighting it +- **Leverage Python features** like generators, itertools, collections, and functional programming +- **Write code that looks like Python wrote it** - use established patterns and conventions +- **Examples of Pythonic patterns**: + - List comprehensions over explicit loops when appropriate + - Context managers (`with` statements) for resource management + - Generator expressions for memory efficiency + - `enumerate()` instead of manual indexing + - `zip()` for parallel iteration + +### 4. Don't Repeat Yourself (DRY) +- **Avoid code duplication** to make code more maintainable and extendable +- **Use functions and modules** to encapsulate common logic in single authoritative locations +- **Consider inheritance** to avoid duplicate code between related classes +- **Leverage language features** like default arguments, variable argument lists (`*args`, `**kwargs`), and parameter unpacking +- **Eliminate duplication through abstraction** - but don't abstract too early + +### 5. Focus on Readability First +- **PEP8 is a guide, not a law** - readability trumps mechanical adherence to style rules +- **Make code as easy to understand as possible** - this is the ultimate goal +- **Deliberately violate guidelines** if it makes specific code more readable +- **Consider the human reader** first when making formatting and style decisions +- **Principle**: Rules serve readability, not the other way around + +### 6. Embrace Conventions +- **Follow established conventions** to eliminate trivial decision-making +- **Use PEP8 as a baseline** but prioritize readability when there's conflict +- **Establish consistent patterns** in your codebase for common tasks: + - Variable naming patterns + - Exception handling approaches + - Logging configuration + - Import organization +- **Consistency enables focus** - familiar patterns let readers focus on logic rather than parsing + +## Specific Implementation Guidelines + +### Naming Conventions +- **Variables and functions**: `snake_case` +- **Classes**: `PascalCase` +- **Constants**: `UPPER_SNAKE_CASE` +- **Private attributes**: `_single_leading_underscore` +- **Choose descriptive names** that clearly indicate purpose and content + +### Code Structure +- **Organize imports** in this order: standard library, third-party, local imports +- **Use blank lines** to separate logical sections +- **Keep functions focused** on a single responsibility +- **Prefer composition over inheritance** when appropriate +- **Write functions that do one thing well** + +### Documentation +- **Write docstrings** for modules, classes, and functions that aren't immediately obvious +- **Use comments** to explain why, not what +- **Keep comments up to date** with code changes +- **Focus on intent** rather than implementation details + +### Error Handling +- **Use specific exception types** rather than generic `Exception` +- **Follow the "easier to ask for forgiveness than permission" (EAFP) principle** +- **Handle errors at the appropriate level** - don't catch exceptions you can't handle meaningfully + +### Performance and Optimization +- **Write clear code first** - optimize only when necessary and after measurement +- **Use appropriate data structures** for the task +- **Leverage built-in functions** and library functions when they're clearer +- **Profile before optimizing** - don't guess where bottlenecks are + +## Code Review Checklist + +When generating or reviewing Python code, ensure: +- [ ] The simplest solution that works is chosen +- [ ] Names clearly communicate purpose +- [ ] Code is easily scannable and readable +- [ ] Pythonic patterns are used appropriately +- [ ] No unnecessary duplication exists +- [ ] Conventions are followed consistently +- [ ] Comments explain intent where needed +- [ ] Error handling is appropriate +- [ ] The code would be easy for another developer to understand and maintain + +## Decision Framework + +When faced with coding choices, ask: +1. **Is this the simplest solution that works?** +2. **Will this be clear to someone reading it in 6 months?** +3. **Am I using Python idioms appropriately?** +4. **Am I duplicating logic that could be abstracted?** +5. **Does this follow our established conventions?** +6. **Is this optimized for readability?** + +The answer to all these questions should be "yes" for beautiful Python code. \ No newline at end of file diff --git a/vitals/specs/score2.md b/vitals/specs/score2.md new file mode 100644 index 0000000..20ae2c3 --- /dev/null +++ b/vitals/specs/score2.md @@ -0,0 +1,135 @@ +# CVD Risk Prediction Formula + +## Overview + +This formula calculates the 10-year risk of cardiovascular disease (CVD) using a sex-specific Cox proportional hazards model. The model incorporates multiple risk factors with specific transformations and interaction terms to provide personalized risk estimates. + +**Target Population**: European patients aged 40-69 years without prior CVD or diabetes. + +## Model Coefficients and Baseline Survival + +The model coefficients and baseline survival to calculate 10-year risk of CVD are as follows: + +| Risk Factor | Transformation | Male | Female | +|-------------|----------------|------|--------| +| Age, years | cage = (age - 60)/5 | 0.3742 | 0.4648 | +| Smoking | current = 1, other = 0 | 0.6012 | 0.7744 | +| SBP, mm Hg | csbp = (sbp - 120)/20 | 0.2777 | 0.3131 | +| Total cholesterol, mmol/L | ctchol = tchol - 6 | 0.1458 | 0.1002 | +| HDL cholesterol, mmol/L | chdl = (hdl - 1.3)/0.5 | -0.2698 | -0.2606 | +| Smoking*age interaction | smoking*cage | -0.0755 | -0.1088 | +| SBP*age interaction | csbp*cage | -0.0255 | -0.0277 | +| Total cholesterol*age interaction | ctchol*cage | -0.0281 | -0.0226 | +| HDL cholesterol*age interaction | chdl*cage | 0.0426 | 0.0613 | +| **Baseline survival** | | **0.9605** | **0.9776** | + +## Risk Calculation Formula + +The uncalibrated 10-year risk of CVD is calculated by the following: + +**10-year risk = 1 - (baseline survival)^exp(x)** + +where **x = Σ[β*(transformed variables)]** + +## Regional Calibration + +The region and sex-specific scales to calculate calibrated 10-year risk are as follows: + +| Risk Region | Male Scale 1 | Male Scale 2 | Female Scale 1 | Female Scale 2 | +|-------------|--------------|--------------|----------------|----------------| +| Low | -0.5699 | 0.7476 | -0.7380 | 0.7019 | +| Moderate | -0.1565 | 0.8009 | -0.3143 | 0.7701 | +| High | 0.3207 | 0.9360 | 0.5710 | 0.9369 | +| Very high | 0.5836 | 0.8294 | 0.9412 | 0.8329 | + +### Calibrated Risk Calculation Formula + +The calibrated 10-year risk of CVD is calculated by the following: + +**Calibrated 10-year risk, % = [1 - exp(-exp(scale1 + scale2*ln(-ln(1 - 10-year risk))))] * 100** + +### Regional Risk Classification + +- **Belgium**: Classified as a **Low Risk** region +- For initial development, use the Low Risk calibration scales: + - Males: Scale 1 = -0.5699, Scale 2 = 0.7476 + - Females: Scale 1 = -0.7380, Scale 2 = 0.7019 + +## Model Components Explained + +### Risk Factor Transformations + +1. **Age (cage)**: Centered at 60 years and scaled by 5-year intervals + - `cage = (age - 60)/5` + +2. **Smoking**: Binary indicator + - `current = 1, other = 0` + +3. **Systolic Blood Pressure (csbp)**: Centered at 120 mmHg and scaled by 20 mmHg intervals + - `csbp = (sbp - 120)/20` + +4. **Total Cholesterol (ctchol)**: Centered at 6 mmol/L + - `ctchol = tchol - 6` + +5. **HDL Cholesterol (chdl)**: Centered at 1.3 mmol/L and scaled by 0.5 mmol/L intervals + - `chdl = (hdl - 1.3)/0.5` + +### Interaction Terms + +The model includes four age interaction terms that capture how the effect of risk factors changes with age: + +1. **Smoking × Age**: `smoking × cage` +2. **SBP × Age**: `csbp × cage` +3. **Total Cholesterol × Age**: `ctchol × cage` +4. **HDL Cholesterol × Age**: `chdl × cage` + +### Sex-Specific Differences + +- **Females** generally have higher baseline survival (0.9776 vs 0.9605) +- **Smoking** has a stronger effect in females (0.7744 vs 0.6012) +- **Age** has a stronger effect in females (0.4648 vs 0.3742) +- **SBP** has a slightly stronger effect in females (0.3131 vs 0.2777) +- **HDL cholesterol** protective effect is similar between sexes + +## Implementation Workflow + +1. **Calculate uncalibrated risk** using the base formula with model coefficients +2. **Apply regional calibration** using the appropriate scales for the patient's location and sex +3. **Output calibrated percentage** as the final 10-year CVD risk estimate + +## Implementation Notes + +1. **Input Units**: + - Age: years + - SBP: mmHg + - Total cholesterol: mmol/L + - HDL cholesterol: mmol/L + - Smoking: binary (1 = current smoker, 0 = other) + +2. **Output**: 10-year CVD risk as a percentage (0-100%) + +3. **Model Type**: Cox proportional hazards model with sex-specific coefficients and regional calibration + +4. **Default Region**: Belgium (Low Risk region) for initial application development + +## Risk Stratification + +### Age-Specific Risk Categories + +#### Patients <50 years old + +- Low to moderate risk: <2.5% +- High risk: 2.5% to <7.5% +- Very high risk: ≥7.5% + +#### Patients 50-69 years old + +- Low to moderate risk: <5% +- High risk: 5% to <10% +- Very high risk: ≥10% + +### Treatment Recommendations + +- **Low to moderate risk**: Risk factor treatment plan generally not recommended. +- **High risk**: Risk factor treatment plan should be considered (i.e., blood pressure and LDL-C control). +- **Very high risk**: Risk factor treatment plan should be recommended (i.e., blood pressure and LDL-C control). From 5018c8e8dff072f567c5d6216c462e97422d14d4 Mon Sep 17 00:00:00 2001 From: fbraza Date: Fri, 18 Jul 2025 19:53:20 +0200 Subject: [PATCH 02/15] build: github action for claude code --- .github/workflows/claude.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 64a3e5b..fab4b58 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -39,26 +39,25 @@ jobs: # This is an optional setting that allows Claude to read CI results on PRs additional_permissions: | actions: read - + # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4) # model: "claude-opus-4-20250514" - + # Optional: Customize the trigger phrase (default: @claude) # trigger_phrase: "/claude" - + # Optional: Trigger when specific user is assigned to an issue # assignee_trigger: "claude-bot" - + # Optional: Allow Claude to run specific commands # allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" - + # Optional: Add custom instructions for Claude to customize its behavior for your project # custom_instructions: | # Follow our coding standards # Ensure all new code has tests # Use TypeScript for new files - + # Optional: Custom environment variables for Claude # claude_env: | # NODE_ENV: test - From 59200cb50d540695622c64890b3241af88d520de Mon Sep 17 00:00:00 2001 From: fbraza Date: Fri, 18 Jul 2025 20:03:25 +0200 Subject: [PATCH 03/15] feature: implement the score2 algorithm --- tests/inputs/test__input__patient_25.json | 35 ++++ tests/inputs/test__input__patient_26.json | 35 ++++ tests/outputs/test__output__patient_25.json | 35 ++++ tests/outputs/test__output__patient_26.json | 35 ++++ tests/test_score2.py | 28 +++ vitals/biomarkers/helpers.py | 3 +- vitals/biomarkers/schemas.py | 25 +++ vitals/score2/__init__.py | 0 vitals/score2/compute.py | 182 ++++++++++++++++++++ 9 files changed, 377 insertions(+), 1 deletion(-) create mode 100755 tests/inputs/test__input__patient_25.json create mode 100755 tests/inputs/test__input__patient_26.json create mode 100755 tests/outputs/test__output__patient_25.json create mode 100755 tests/outputs/test__output__patient_26.json create mode 100644 tests/test_score2.py create mode 100644 vitals/score2/__init__.py create mode 100644 vitals/score2/compute.py diff --git a/tests/inputs/test__input__patient_25.json b/tests/inputs/test__input__patient_25.json new file mode 100755 index 0000000..df7575a --- /dev/null +++ b/tests/inputs/test__input__patient_25.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P024-2024-024", + "sex": "female", + "timestamp": "2024-07-04T13:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 50, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 140, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.3, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } + } +} diff --git a/tests/inputs/test__input__patient_26.json b/tests/inputs/test__input__patient_26.json new file mode 100755 index 0000000..6eb6449 --- /dev/null +++ b/tests/inputs/test__input__patient_26.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P024-2024-024", + "sex": "male", + "timestamp": "2024-07-04T13:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 50, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 140, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.3, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } + } +} diff --git a/tests/outputs/test__output__patient_25.json b/tests/outputs/test__output__patient_25.json new file mode 100755 index 0000000..3c9c3e9 --- /dev/null +++ b/tests/outputs/test__output__patient_25.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P024-2024-024", + "sex": "female", + "timestamp": "2024-07-04T13:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 50, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmHg": { + "value": 140, + "unit": "mmHg" + }, + "total_cholesterol_mmol_L": { + "value": 6.3, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_L": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } + } +} diff --git a/tests/outputs/test__output__patient_26.json b/tests/outputs/test__output__patient_26.json new file mode 100755 index 0000000..0d105ac --- /dev/null +++ b/tests/outputs/test__output__patient_26.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P024-2024-024", + "sex": "male", + "timestamp": "2024-07-04T13:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 50, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmHg": { + "value": 140, + "unit": "mmHg" + }, + "total_cholesterol_mmol_L": { + "value": 6.3, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_L": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } + } +} diff --git a/tests/test_score2.py b/tests/test_score2.py new file mode 100644 index 0000000..cda022e --- /dev/null +++ b/tests/test_score2.py @@ -0,0 +1,28 @@ +from pathlib import Path + +import pytest + +from vitals.score2 import compute + +OUT_FILEPATH = Path(__file__).parent / "outputs" + + +@pytest.mark.parametrize( + "filename,expected", + [ + ("test__output__patient_25.json", (50.00, 4.34, "Low to moderate")), + ("test__output__patient_26.json", (50.00, 6.31, "High")), + ], +) +def test_phenoage(filename, expected): + # Get the actual fixture value using request.getfixturevalue + age, pred_risk, pred_risk_category = compute.cardiovascular_risk(OUT_FILEPATH / filename) + expected_age, expected_risk, expected_category = expected + + assert age == expected_age + assert pred_risk_category == expected_category + assert pytest.approx(pred_risk, abs=0.1) == expected_risk + + +if __name__ == "__main__": + pytest.main([__file__]) diff --git a/vitals/biomarkers/helpers.py b/vitals/biomarkers/helpers.py index f834dda..7029503 100755 --- a/vitals/biomarkers/helpers.py +++ b/vitals/biomarkers/helpers.py @@ -4,6 +4,7 @@ from pydantic import BaseModel Biomarkers = TypeVar("Biomarkers", bound=BaseModel) +Units = schemas.PhenoageUnits | schemas.Score2Units def format_unit_suffix(unit: str) -> str: @@ -145,7 +146,7 @@ def add_converted_biomarkers(biomarkers: dict) -> dict: def extract_biomarkers_from_json( filepath: str, biomarker_class: type[Biomarkers], - biomarker_units: schemas.PhenoageUnits, + biomarker_units: Units, ) -> Biomarkers: """ Generic function to extract biomarkers from JSON file based on a Pydantic model. diff --git a/vitals/biomarkers/schemas.py b/vitals/biomarkers/schemas.py index 9a670d0..4e49f54 100755 --- a/vitals/biomarkers/schemas.py +++ b/vitals/biomarkers/schemas.py @@ -32,3 +32,28 @@ class PhenoageMarkers(BaseModel): alkaline_phosphatase: float white_blood_cell_count: float age: float + + +# ------ SCORE2 Schemas +class Score2Units(BaseModel): + """ + The expected unit to be used for Score2 computation + """ + + age: str = "years" + systolic_blood_pressure: str = "mmHg" + total_cholesterol: str = "mmol/L" + hdl_cholesterol: str = "mmol/L" + smoking: str = "yes/no" + is_male: str = "yes/no" + + +class Score2Markers(BaseModel): + """Processed Score2 biomarkers with standardized units.""" + + age: float + systolic_blood_pressure: float + total_cholesterol: float + hdl_cholesterol: float + smoking: bool + is_male: bool diff --git a/vitals/score2/__init__.py b/vitals/score2/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vitals/score2/compute.py b/vitals/score2/compute.py new file mode 100644 index 0000000..457e08d --- /dev/null +++ b/vitals/score2/compute.py @@ -0,0 +1,182 @@ +""" +Module for computing the SCORE2 cardiovascular risk assessment. + +This module implements the SCORE2 algorithm for 10-year cardiovascular disease risk estimation +in apparently healthy individuals aged 40-69 years in Europe. +""" + +import numpy as np +from biomarkers import helpers, schemas +from pydantic import BaseModel + + +class ModelCoefficients(BaseModel): + """ + Sex-specific coefficients for the SCORE2 Cox proportional hazards model. + + These coefficients are used to calculate the 10-year risk of cardiovascular disease + based on transformed risk factors and their age interactions. + """ + + # Male coefficients + male_age: float = 0.3742 + male_smoking: float = 0.6012 + male_sbp: float = 0.2777 + male_total_cholesterol: float = 0.1458 + male_hdl_cholesterol: float = -0.2698 + + # Male interaction term coefficients + male_smoking_age: float = -0.0755 + male_sbp_age: float = -0.0255 + male_tchol_age: float = -0.0281 + male_hdl_age: float = 0.0426 + + # Female coefficients + female_age: float = 0.4648 + female_smoking: float = 0.7744 + female_sbp: float = 0.3131 + female_total_cholesterol: float = 0.1002 + female_hdl_cholesterol: float = -0.2606 + + # Female interaction term coefficients + female_smoking_age: float = -0.1088 + female_sbp_age: float = -0.0277 + female_tchol_age: float = -0.0226 + female_hdl_age: float = 0.0613 + + +class BaselineSurvival(BaseModel): + """ + Sex-specific baseline survival probabilities for the SCORE2 model. + + These values represent the 10-year survival probability for individuals + with all risk factors at their reference values. + """ + + male: float = 0.9605 + female: float = 0.9776 + + +class CalibrationScales(BaseModel): + """ + Region and sex-specific calibration scales for Belgium (Low Risk region). + + These scales are used to calibrate the uncalibrated risk estimate to match + the population-specific cardiovascular disease incidence rates. + """ + + # Male calibration scales + male_scale1: float = -0.5699 + male_scale2: float = 0.7476 + + # Female calibration scales + female_scale1: float = -0.7380 + female_scale2: float = 0.7019 + + +def cardiovascular_risk(filepath: str) -> tuple[float, float, str]: + """ + Calculate the 10-year cardiovascular disease risk using the SCORE2 algorithm. + + This function implements the SCORE2 risk assessment for apparently healthy individuals + aged 40-69 years in Europe. It uses sex-specific Cox proportional hazards model + coefficients and applies regional calibration for Belgium (Low Risk region). + + Args: + filepath: Path to JSON file containing biomarker data including age, sex, + systolic blood pressure, total cholesterol, HDL cholesterol, and smoking status. + + Returns: + A tuple containing: + - age: The patient's chronological age + - risk_percentage: The calibrated 10-year CVD risk as a percentage + - risk_category: Risk stratification category ("Low to moderate", "High", or "Very high") + + Raises: + ValueError: If invalid biomarker class is used + """ + # Extract biomarkers from JSON file + biomarkers = helpers.extract_biomarkers_from_json( + filepath=filepath, + biomarker_class=schemas.Score2Markers, + biomarker_units=schemas.Score2Units(), + ) + + if not isinstance(biomarkers, schemas.Score2Markers): + raise ValueError(f"Invalid biomarker class used: {biomarkers}") + + age = biomarkers.age + is_male = biomarkers.is_male # True for male, False for female + + # Apply transformations to biomarkers + cage = (age - 60) / 5 + smoking = float(biomarkers.smoking) # Convert bool to float (1.0 or 0.0) + csbp = (biomarkers.systolic_blood_pressure - 120) / 20 + ctchol = biomarkers.total_cholesterol - 6 + chdl = (biomarkers.hdl_cholesterol - 1.3) / 0.5 + + # Calculate interaction terms + smoking_age = smoking * cage + sbp_age = csbp * cage + tchol_age = ctchol * cage + hdl_age = chdl * cage + + # Get model coefficients + coef = ModelCoefficients() + + # Calculate linear predictor (x) based on sex + if is_male: + x = ( + coef.male_age * cage + + coef.male_smoking * smoking + + coef.male_sbp * csbp + + coef.male_total_cholesterol * ctchol + + coef.male_hdl_cholesterol * chdl + + coef.male_smoking_age * smoking_age + + coef.male_sbp_age * sbp_age + + coef.male_tchol_age * tchol_age + + coef.male_hdl_age * hdl_age + ) + baseline_survival = BaselineSurvival().male + scale1 = CalibrationScales().male_scale1 + scale2 = CalibrationScales().male_scale2 + else: + x = ( + coef.female_age * cage + + coef.female_smoking * smoking + + coef.female_sbp * csbp + + coef.female_total_cholesterol * ctchol + + coef.female_hdl_cholesterol * chdl + + coef.female_smoking_age * smoking_age + + coef.female_sbp_age * sbp_age + + coef.female_tchol_age * tchol_age + + coef.female_hdl_age * hdl_age + ) + baseline_survival = BaselineSurvival().female + scale1 = CalibrationScales().female_scale1 + scale2 = CalibrationScales().female_scale2 + + # Calculate uncalibrated risk + uncalibrated_risk = 1 - np.power(baseline_survival, np.exp(x)) + + # Apply calibration for Belgium (Low Risk region) + # Calibrated 10-year risk, % = [1 - exp(-exp(scale1 + scale2*ln(-ln(1 - 10-year risk))))] * 100 + calibrated_risk = float((1 - np.exp(-np.exp(scale1 + scale2 * np.log(-np.log(1 - uncalibrated_risk))))) * 100) + + # Determine risk category based on age + if age < 50: + if calibrated_risk < 2.5: + risk_category = "Low to moderate" + elif calibrated_risk < 7.5: + risk_category = "High" + else: + risk_category = "Very high" + else: # age 50-69 + if calibrated_risk < 5: + risk_category = "Low to moderate" + elif calibrated_risk < 10: + risk_category = "High" + else: + risk_category = "Very high" + + return (age, round(calibrated_risk, 4), risk_category) From 793a85363f9532f455358a41bb029d708e431beb Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 11:47:34 +0200 Subject: [PATCH 04/15] chore: move the specs file for the agent --- {vitals/specs => specs}/coding_style.md | 0 {vitals/specs => specs}/score2.md | 0 specs/score2_diabetes.md | 184 ++++++++++++++++++++++++ 3 files changed, 184 insertions(+) rename {vitals/specs => specs}/coding_style.md (100%) rename {vitals/specs => specs}/score2.md (100%) create mode 100644 specs/score2_diabetes.md diff --git a/vitals/specs/coding_style.md b/specs/coding_style.md similarity index 100% rename from vitals/specs/coding_style.md rename to specs/coding_style.md diff --git a/vitals/specs/score2.md b/specs/score2.md similarity index 100% rename from vitals/specs/score2.md rename to specs/score2.md diff --git a/specs/score2_diabetes.md b/specs/score2_diabetes.md new file mode 100644 index 0000000..b5ed851 --- /dev/null +++ b/specs/score2_diabetes.md @@ -0,0 +1,184 @@ +# SCORE2-Diabetes Algorithm Implementation Specification + +## Overview + +This specification is based on the FORMULA section from the SCORE2-Diabetes calculator. The model calculates 10-year risk of CVD using specific coefficients, baseline survival values, and regional calibration scales. + +## Model Coefficients Table + +The following coefficients are used to calculate 10-year risk of CVD: + +| Risk Factor | Transformation | Male | Female | +|-------------|----------------|------|--------| +| Age, years | cage = (age - 60)/5 | 0.5368 | 0.6624 | +| Smoking | current = 1, other = 0 | 0.4774 | 0.6139 | +| SBP, mm Hg | csbp = (sbp - 120)/20 | 0.1322 | 0.1421 | +| Diabetes | yes = 1, no = 0 | 0.6457 | 0.8096 | +| Total cholesterol, mmol/L | ctchol = tchol - 6 | 0.1102 | 0.1127 | +| HDL cholesterol, mmol/L | chdl = (hdl - 1.3)/0.5 | -0.1087 | -0.1568 | +| Smoking*age interaction | smoking*cage | -0.0672 | -0.1122 | +| SBP*age interaction | csbp*cage | -0.0268 | -0.0167 | +| Diabetes*age interaction | diabetes*cage | -0.0983 | -0.1272 | +| Total cholesterol*age interaction | ctchol*cage | -0.0181 | -0.0200 | +| HDL cholesterol*age interaction | chdl*cage | 0.0095 | 0.0186 | +| Age at diabetes diagnosis, years | cagediab = diabetes*(agediab - 50)/5 | -0.0998 | -0.1180 | +| HbA1c, mmol/mol | ca1c = (a1c - 31)/9.34 | 0.0955 | 0.1173 | +| eGFR | cegfr = (ln(egfr) - 4.5)/0.15 | -0.0591 | -0.0640 | +| eGFR² | cegfr² | 0.0058 | 0.0062 | +| HbA1c*age interaction | ca1c*cage | -0.0134 | -0.0196 | +| eGFR*age interaction | cegfr*cage | 0.0115 | 0.0169 | +| **Baseline survival** | | **0.9605** | **0.9776** | + +## Variable Transformations + +### Age Transformation +- `cage = (age - 60)/5` + +### Systolic Blood Pressure Transformation +- `csbp = (sbp - 120)/20` + +### Diabetes Status +- `diabetes = 1` if patient has diabetes, `0` otherwise + +### Total Cholesterol Transformation +- `ctchol = tchol - 6` + +### HDL Cholesterol Transformation +- `chdl = (hdl - 1.3)/0.5` + +### Age at Diabetes Diagnosis Transformation +- `cagediab = diabetes*(agediab - 50)/5` + +### HbA1c Transformation +- `ca1c = (a1c - 31)/9.34` + +### eGFR Transformations +- `cegfr = (ln(egfr) - 4.5)/0.15` +- `cegfr² = cegfr²` (squared term) + +### Smoking Transformation +- `smoking = 1` if current smoker, `0` otherwise + +## Initial Risk Calculation Formula + +The initial 10-year risk of CVD is calculated using: + +``` +10-year risk = [1 - (baseline survival)^exp(x)] +``` + +Where: +- `x = Σ[β*(transformed variables)]` +- The sum includes all coefficients multiplied by their corresponding transformed variables + +## Regional Calibration Scales + +The region and sex-specific scales to calculate calibrated 10-year risk are as follows: + +| Risk Region | Male Scale 1 | Male Scale 2 | Female Scale 1 | Female Scale 2 | +|-------------|--------------|--------------|----------------|----------------| +| Low | -0.5699 | 0.7476 | -0.7380 | 0.7019 | +| Moderate | -0.1565 | 0.8009 | -0.3143 | 0.7701 | +| High | 0.3207 | 0.9360 | 0.5710 | 0.9369 | +| Very high | 0.5836 | 0.8294 | 0.9412 | 0.8329 | + +## Calibrated Risk Calculation Formula + +The calibrated 10-year risk of CVD is calculated by the following: + +``` +Calibrated 10-year risk, % = [1 - exp(-exp(scale1 + scale2*ln(-ln(1 - 10-year risk))))] * 100 +``` + +Where: +- `scale1` and `scale2` are the region and sex-specific calibration values from the table above +- `10-year risk` is the initial risk calculated using the baseline survival formula + +## Linear Predictor Calculation + +The linear predictor (x) is calculated as the sum of: + +1. **Main Effects:** + - Age coefficient × cage + - Smoking coefficient × smoking + - SBP coefficient × csbp + - Diabetes coefficient × diabetes + - Total cholesterol coefficient × ctchol + - HDL cholesterol coefficient × chdl + - Age at diabetes diagnosis coefficient × cagediab + - HbA1c coefficient × ca1c + - eGFR coefficient × cegfr + - eGFR² coefficient × cegfr² + +2. **Age Interaction Terms:** + - Smoking*age coefficient × smoking × cage + - SBP*age coefficient × csbp × cage + - Diabetes*age coefficient × diabetes × cage + - Total cholesterol*age coefficient × ctchol × cage + - HDL cholesterol*age coefficient × chdl × cage + - HbA1c*age coefficient × ca1c × cage + - eGFR*age coefficient × cegfr × cage + +## Risk Stratification + +### Patients <50 years old +- **Low to moderate risk:** <2.5% +- **High risk:** 2.5% to <7.5% +- **Very high risk:** ≥7.5% + +### Patients 50-69 years old +- **Low to moderate risk:** <5% +- **High risk:** 5% to <10% +- **Very high risk:** ≥10% + +## Treatment Recommendations + +### Low to moderate risk +Risk factor treatment plan generally not recommended. + +### High risk +Risk factor treatment plan should be considered (i.e., blood pressure and LDL-C control). + +### Very high risk +Risk factor treatment plan should be recommended (i.e., blood pressure and LDL-C control, along with addition of SGLT2-i or GLP1-RA if not already taking). + +## Implementation Requirements + +### Input Parameters Required +1. Age (years) +2. Sex (Male/Female) +3. Smoking status (current smoker yes/no) +4. Systolic blood pressure (mm Hg) +5. Diabetes status (yes/no) +6. Total cholesterol (mmol/L) +7. HDL cholesterol (mmol/L) +8. Age at diabetes diagnosis (years) +9. HbA1c (mmol/mol) +10. eGFR (estimated glomerular filtration rate) +11. Geographic risk region (Low/Moderate/High/Very high) + +### Calculation Steps +1. Transform all input variables using the specified transformations +2. Calculate the linear predictor (x) using sex-specific coefficients +3. Calculate initial 10-year risk using sex-specific baseline survival +4. Apply regional calibration using the calibrated risk formula and region/sex-specific scales +5. Determine risk stratification category based on age and calculated risk percentage +6. Provide appropriate treatment recommendations based on risk category + +### Output Requirements +1. **Calibrated 10-year cardiovascular disease risk** as a percentage +2. **Risk stratification category** (Low to moderate/High/Very high) +3. **Treatment recommendation** based on risk category + +## Baseline Survival Values + +- **Male baseline survival:** 0.9605 +- **Female baseline survival:** 0.9776 + +## Notes +- All coefficients are sex-specific (different values for males and females) +- The model includes both main effects and age interaction terms +- eGFR requires both linear and quadratic terms +- Regional calibration is applied using a two-step process: initial risk calculation followed by regional calibration +- Risk stratification thresholds differ by age group (<50 vs 50-69 years) +- Treatment recommendations are tied directly to risk stratification categories From cb352bf9d14fde5c03d69887a6af730a13014f86 Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 11:56:40 +0200 Subject: [PATCH 05/15] fix: standardize import statements for package consistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Convert relative imports to absolute imports using vitals package prefix - Update imports in biomarkers, phenoage, and score2 modules - Ensure consistent import style across the codebase - Fixes #3 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- vitals/biomarkers/helpers.py | 3 ++- vitals/biomarkers/io.py | 2 +- vitals/phenoage/compute.py | 3 ++- vitals/score2/compute.py | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/vitals/biomarkers/helpers.py b/vitals/biomarkers/helpers.py index 7029503..6c0fd9c 100755 --- a/vitals/biomarkers/helpers.py +++ b/vitals/biomarkers/helpers.py @@ -1,8 +1,9 @@ from typing import TypeVar -import schemas from pydantic import BaseModel +from vitals.biomarkers import schemas + Biomarkers = TypeVar("Biomarkers", bound=BaseModel) Units = schemas.PhenoageUnits | schemas.Score2Units diff --git a/vitals/biomarkers/io.py b/vitals/biomarkers/io.py index f9ed937..8858e1b 100755 --- a/vitals/biomarkers/io.py +++ b/vitals/biomarkers/io.py @@ -1,7 +1,7 @@ import json from pathlib import Path -import helpers +from vitals.biomarkers import helpers def update(input_file: Path) -> dict: diff --git a/vitals/phenoage/compute.py b/vitals/phenoage/compute.py index eb404ad..5397876 100755 --- a/vitals/phenoage/compute.py +++ b/vitals/phenoage/compute.py @@ -1,7 +1,8 @@ import numpy as np -from biomarkers import helpers, schemas from pydantic import BaseModel +from vitals.biomarkers import helpers, schemas + class LinearModel(BaseModel): """ diff --git a/vitals/score2/compute.py b/vitals/score2/compute.py index 457e08d..107d227 100644 --- a/vitals/score2/compute.py +++ b/vitals/score2/compute.py @@ -6,9 +6,10 @@ """ import numpy as np -from biomarkers import helpers, schemas from pydantic import BaseModel +from vitals.biomarkers import helpers, schemas + class ModelCoefficients(BaseModel): """ From 1a25f488cf53d93cb17da95aff12baaf550e505a Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 12:01:09 +0200 Subject: [PATCH 06/15] fix: rename test_phenoage to test_score2 in test_score2.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #4 - The test function was incorrectly named test_phenoage when it should be test_score2 since it's testing the SCORE2 cardiovascular risk algorithm, not the PhenoAge algorithm. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- tests/test_score2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_score2.py b/tests/test_score2.py index cda022e..0d19492 100644 --- a/tests/test_score2.py +++ b/tests/test_score2.py @@ -14,7 +14,7 @@ ("test__output__patient_26.json", (50.00, 6.31, "High")), ], ) -def test_phenoage(filename, expected): +def test_score2(filename, expected): # Get the actual fixture value using request.getfixturevalue age, pred_risk, pred_risk_category = compute.cardiovascular_risk(OUT_FILEPATH / filename) expected_age, expected_risk, expected_category = expected From ffe31e01410313f2d0bf75cdd257ec5146226775 Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 13:05:11 +0200 Subject: [PATCH 07/15] test: expand SCORE2 test coverage with diverse patient profiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add test data for non-smokers (male and female patients) - Add test data for different age ranges (40, 45, 49, 50, 55, 60, 65, 69) - Include tests for all risk categories (Low to moderate, High, Very high) - Update risk value rounding to 2 decimal places for consistency - Fixes #7 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- tests/inputs/test__input__patient_27.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_28.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_29.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_30.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_31.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_32.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_33.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_34.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_35.json | 35 +++++++++++++++++++++ tests/inputs/test__input__patient_36.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_27.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_28.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_29.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_30.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_31.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_32.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_33.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_34.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_35.json | 35 +++++++++++++++++++++ tests/outputs/test__output__patient_36.json | 35 +++++++++++++++++++++ tests/test_score2.py | 10 ++++++ vitals/score2/compute.py | 2 +- 22 files changed, 711 insertions(+), 1 deletion(-) create mode 100644 tests/inputs/test__input__patient_27.json create mode 100644 tests/inputs/test__input__patient_28.json create mode 100644 tests/inputs/test__input__patient_29.json create mode 100644 tests/inputs/test__input__patient_30.json create mode 100644 tests/inputs/test__input__patient_31.json create mode 100644 tests/inputs/test__input__patient_32.json create mode 100644 tests/inputs/test__input__patient_33.json create mode 100644 tests/inputs/test__input__patient_34.json create mode 100644 tests/inputs/test__input__patient_35.json create mode 100644 tests/inputs/test__input__patient_36.json create mode 100644 tests/outputs/test__output__patient_27.json create mode 100644 tests/outputs/test__output__patient_28.json create mode 100644 tests/outputs/test__output__patient_29.json create mode 100644 tests/outputs/test__output__patient_30.json create mode 100644 tests/outputs/test__output__patient_31.json create mode 100644 tests/outputs/test__output__patient_32.json create mode 100644 tests/outputs/test__output__patient_33.json create mode 100644 tests/outputs/test__output__patient_34.json create mode 100644 tests/outputs/test__output__patient_35.json create mode 100644 tests/outputs/test__output__patient_36.json diff --git a/tests/inputs/test__input__patient_27.json b/tests/inputs/test__input__patient_27.json new file mode 100644 index 0000000..8c2f500 --- /dev/null +++ b/tests/inputs/test__input__patient_27.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P027-2024-027", + "sex": "female", + "timestamp": "2024-07-04T14:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 55, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 125, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 5.2, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.6, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_28.json b/tests/inputs/test__input__patient_28.json new file mode 100644 index 0000000..837f9c3 --- /dev/null +++ b/tests/inputs/test__input__patient_28.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P028-2024-028", + "sex": "male", + "timestamp": "2024-07-04T14:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 45, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 130, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 5.8, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.3, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_29.json b/tests/inputs/test__input__patient_29.json new file mode 100644 index 0000000..c9ded57 --- /dev/null +++ b/tests/inputs/test__input__patient_29.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P029-2024-029", + "sex": "male", + "timestamp": "2024-07-04T14:30:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 40, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 135, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.0, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.2, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_30.json b/tests/inputs/test__input__patient_30.json new file mode 100644 index 0000000..b43b9a0 --- /dev/null +++ b/tests/inputs/test__input__patient_30.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P030-2024-030", + "sex": "female", + "timestamp": "2024-07-04T14:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 60, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 145, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.5, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.5, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_31.json b/tests/inputs/test__input__patient_31.json new file mode 100644 index 0000000..0910c92 --- /dev/null +++ b/tests/inputs/test__input__patient_31.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P031-2024-031", + "sex": "male", + "timestamp": "2024-07-04T15:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 65, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 150, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 7.0, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.1, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_32.json b/tests/inputs/test__input__patient_32.json new file mode 100644 index 0000000..255d858 --- /dev/null +++ b/tests/inputs/test__input__patient_32.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P032-2024-032", + "sex": "female", + "timestamp": "2024-07-04T15:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 69, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 155, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 7.2, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.3, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_33.json b/tests/inputs/test__input__patient_33.json new file mode 100644 index 0000000..26cc61d --- /dev/null +++ b/tests/inputs/test__input__patient_33.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P033-2024-033", + "sex": "male", + "timestamp": "2024-07-04T15:30:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 49, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 138, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.1, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_34.json b/tests/inputs/test__input__patient_34.json new file mode 100644 index 0000000..f471469 --- /dev/null +++ b/tests/inputs/test__input__patient_34.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P034-2024-034", + "sex": "female", + "timestamp": "2024-07-04T15:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 50, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 120, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 4.8, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.8, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_35.json b/tests/inputs/test__input__patient_35.json new file mode 100644 index 0000000..3c06bf3 --- /dev/null +++ b/tests/inputs/test__input__patient_35.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P035-2024-035", + "sex": "male", + "timestamp": "2024-07-04T16:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 55, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 142, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.4, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.2, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/inputs/test__input__patient_36.json b/tests/inputs/test__input__patient_36.json new file mode 100644 index 0000000..d432a84 --- /dev/null +++ b/tests/inputs/test__input__patient_36.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P036-2024-036", + "sex": "female", + "timestamp": "2024-07-04T16:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age": { + "value": 45, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 132, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 5.5, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.5, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_27.json b/tests/outputs/test__output__patient_27.json new file mode 100644 index 0000000..96b5a37 --- /dev/null +++ b/tests/outputs/test__output__patient_27.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P027-2024-027", + "sex": "female", + "timestamp": "2024-07-04T14:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 55, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 125, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 5.2, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.6, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_28.json b/tests/outputs/test__output__patient_28.json new file mode 100644 index 0000000..62b9906 --- /dev/null +++ b/tests/outputs/test__output__patient_28.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P028-2024-028", + "sex": "male", + "timestamp": "2024-07-04T14:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 45, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 130, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 5.8, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.3, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_29.json b/tests/outputs/test__output__patient_29.json new file mode 100644 index 0000000..d439a63 --- /dev/null +++ b/tests/outputs/test__output__patient_29.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P029-2024-029", + "sex": "male", + "timestamp": "2024-07-04T14:30:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 40, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 135, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.0, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.2, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_30.json b/tests/outputs/test__output__patient_30.json new file mode 100644 index 0000000..77bfb0b --- /dev/null +++ b/tests/outputs/test__output__patient_30.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P030-2024-030", + "sex": "female", + "timestamp": "2024-07-04T14:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 60, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 145, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.5, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.5, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_31.json b/tests/outputs/test__output__patient_31.json new file mode 100644 index 0000000..66d115b --- /dev/null +++ b/tests/outputs/test__output__patient_31.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P031-2024-031", + "sex": "male", + "timestamp": "2024-07-04T15:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 65, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 150, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 7.0, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.1, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_32.json b/tests/outputs/test__output__patient_32.json new file mode 100644 index 0000000..83cc013 --- /dev/null +++ b/tests/outputs/test__output__patient_32.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P032-2024-032", + "sex": "female", + "timestamp": "2024-07-04T15:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 69, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 155, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 7.2, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.3, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_33.json b/tests/outputs/test__output__patient_33.json new file mode 100644 index 0000000..4220ee1 --- /dev/null +++ b/tests/outputs/test__output__patient_33.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P033-2024-033", + "sex": "male", + "timestamp": "2024-07-04T15:30:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 49, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 138, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.1, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_34.json b/tests/outputs/test__output__patient_34.json new file mode 100644 index 0000000..f2bdf7e --- /dev/null +++ b/tests/outputs/test__output__patient_34.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P034-2024-034", + "sex": "female", + "timestamp": "2024-07-04T15:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 50, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 120, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 4.8, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.8, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_35.json b/tests/outputs/test__output__patient_35.json new file mode 100644 index 0000000..5fc3658 --- /dev/null +++ b/tests/outputs/test__output__patient_35.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P035-2024-035", + "sex": "male", + "timestamp": "2024-07-04T16:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 55, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 142, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.4, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.2, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/outputs/test__output__patient_36.json b/tests/outputs/test__output__patient_36.json new file mode 100644 index 0000000..b71ddb2 --- /dev/null +++ b/tests/outputs/test__output__patient_36.json @@ -0,0 +1,35 @@ +{ + "metadata": { + "patient_id": "P036-2024-036", + "sex": "female", + "timestamp": "2024-07-04T16:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" + }, + "raw_biomarkers": { + "age_years": { + "value": 45, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 132, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 5.5, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.5, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } + } +} \ No newline at end of file diff --git a/tests/test_score2.py b/tests/test_score2.py index 0d19492..f597d59 100644 --- a/tests/test_score2.py +++ b/tests/test_score2.py @@ -12,6 +12,16 @@ [ ("test__output__patient_25.json", (50.00, 4.34, "Low to moderate")), ("test__output__patient_26.json", (50.00, 6.31, "High")), + ("test__output__patient_27.json", (55.00, 2.10, "Low to moderate")), + ("test__output__patient_28.json", (45.00, 2.40, "Low to moderate")), + ("test__output__patient_29.json", (40.00, 4.30, "High")), + ("test__output__patient_30.json", (60.00, 4.20, "Low to moderate")), + ("test__output__patient_31.json", (65.00, 14.40, "Very high")), + ("test__output__patient_32.json", (69.00, 8.40, "High")), + ("test__output__patient_33.json", (49.00, 5.70, "High")), + ("test__output__patient_34.json", (50.00, 1.20, "Low to moderate")), + ("test__output__patient_35.json", (55.00, 8.70, "High")), + ("test__output__patient_36.json", (45.00, 2.60, "High")), ], ) def test_score2(filename, expected): diff --git a/vitals/score2/compute.py b/vitals/score2/compute.py index 107d227..bc963aa 100644 --- a/vitals/score2/compute.py +++ b/vitals/score2/compute.py @@ -180,4 +180,4 @@ def cardiovascular_risk(filepath: str) -> tuple[float, float, str]: else: risk_category = "Very high" - return (age, round(calibrated_risk, 4), risk_category) + return (age, round(calibrated_risk, 2), risk_category) From d5aad2726940c1cb451624afb933902020c72253 Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 13:12:49 +0200 Subject: [PATCH 08/15] refactor: rename test directories and files for clarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename inputs/ folder to raw/ (contains raw patient data) - Rename outputs/ folder to inputs/ (contains processed model inputs) - Rename test__input__patient_XX.json to test__raw__patient_XX.json - Rename test__output__patient_XX.json to test__input__patient_XX.json - Update all code references to use new folder and file names This change better reflects the data flow: raw data → processed inputs for models 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- tests/inputs/test__input__patient_01.json | 36 +++++++++++++------ tests/inputs/test__input__patient_02.json | 36 +++++++++++++------ tests/inputs/test__input__patient_03.json | 36 +++++++++++++------ tests/inputs/test__input__patient_04.json | 36 +++++++++++++------ tests/inputs/test__input__patient_05.json | 36 +++++++++++++------ tests/inputs/test__input__patient_06.json | 36 +++++++++++++------ tests/inputs/test__input__patient_07.json | 36 +++++++++++++------ tests/inputs/test__input__patient_08.json | 36 +++++++++++++------ tests/inputs/test__input__patient_09.json | 36 +++++++++++++------ tests/inputs/test__input__patient_10.json | 36 +++++++++++++------ tests/inputs/test__input__patient_11.json | 36 +++++++++++++------ tests/inputs/test__input__patient_12.json | 36 +++++++++++++------ tests/inputs/test__input__patient_13.json | 36 +++++++++++++------ tests/inputs/test__input__patient_14.json | 36 +++++++++++++------ tests/inputs/test__input__patient_15.json | 36 +++++++++++++------ tests/inputs/test__input__patient_16.json | 36 +++++++++++++------ tests/inputs/test__input__patient_17.json | 36 +++++++++++++------ tests/inputs/test__input__patient_18.json | 36 +++++++++++++------ tests/inputs/test__input__patient_19.json | 36 +++++++++++++------ tests/inputs/test__input__patient_20.json | 36 +++++++++++++------ tests/inputs/test__input__patient_21.json | 36 +++++++++++++------ tests/inputs/test__input__patient_22.json | 36 +++++++++++++------ tests/inputs/test__input__patient_23.json | 36 +++++++++++++------ tests/inputs/test__input__patient_24.json | 36 +++++++++++++------ tests/inputs/test__input__patient_25.json | 12 +++---- tests/inputs/test__input__patient_26.json | 12 +++---- tests/inputs/test__input__patient_27.json | 12 +++---- tests/inputs/test__input__patient_28.json | 12 +++---- tests/inputs/test__input__patient_29.json | 12 +++---- tests/inputs/test__input__patient_30.json | 12 +++---- tests/inputs/test__input__patient_31.json | 12 +++---- tests/inputs/test__input__patient_32.json | 12 +++---- tests/inputs/test__input__patient_33.json | 12 +++---- tests/inputs/test__input__patient_34.json | 12 +++---- tests/inputs/test__input__patient_35.json | 12 +++---- tests/inputs/test__input__patient_36.json | 12 +++---- .../test__input__NHANES3__bioage.csv | 0 .../test__raw__patient_01.json} | 36 ++++++------------- .../test__raw__patient_02.json} | 36 ++++++------------- .../test__raw__patient_03.json} | 36 ++++++------------- .../test__raw__patient_04.json} | 36 ++++++------------- .../test__raw__patient_05.json} | 36 ++++++------------- .../test__raw__patient_06.json} | 36 ++++++------------- .../test__raw__patient_07.json} | 36 ++++++------------- .../test__raw__patient_08.json} | 36 ++++++------------- .../test__raw__patient_09.json} | 36 ++++++------------- .../test__raw__patient_10.json} | 36 ++++++------------- .../test__raw__patient_11.json} | 36 ++++++------------- .../test__raw__patient_12.json} | 36 ++++++------------- .../test__raw__patient_13.json} | 36 ++++++------------- .../test__raw__patient_14.json} | 36 ++++++------------- .../test__raw__patient_15.json} | 36 ++++++------------- .../test__raw__patient_16.json} | 36 ++++++------------- .../test__raw__patient_17.json} | 36 ++++++------------- .../test__raw__patient_18.json} | 36 ++++++------------- .../test__raw__patient_19.json} | 36 ++++++------------- .../test__raw__patient_20.json} | 36 ++++++------------- .../test__raw__patient_21.json} | 36 ++++++------------- .../test__raw__patient_22.json} | 36 ++++++------------- .../test__raw__patient_23.json} | 36 ++++++------------- .../test__raw__patient_24.json} | 36 ++++++------------- .../test__raw__patient_25.json} | 12 +++---- .../test__raw__patient_26.json} | 12 +++---- .../test__raw__patient_27.json} | 12 +++---- .../test__raw__patient_28.json} | 12 +++---- .../test__raw__patient_29.json} | 12 +++---- .../test__raw__patient_30.json} | 12 +++---- .../test__raw__patient_31.json} | 12 +++---- .../test__raw__patient_32.json} | 12 +++---- .../test__raw__patient_33.json} | 12 +++---- .../test__raw__patient_34.json} | 12 +++---- .../test__raw__patient_35.json} | 12 +++---- .../test__raw__patient_36.json} | 12 +++---- tests/test_io.py | 6 ++-- tests/test_phenoage.py | 24 ++++++------- tests/test_score2.py | 26 +++++++------- vitals/biomarkers/io.py | 6 ++-- 77 files changed, 1039 insertions(+), 1039 deletions(-) rename tests/{inputs => raw}/test__input__NHANES3__bioage.csv (100%) rename tests/{outputs/test__output__patient_01.json => raw/test__raw__patient_01.json} (56%) rename tests/{outputs/test__output__patient_02.json => raw/test__raw__patient_02.json} (55%) rename tests/{outputs/test__output__patient_03.json => raw/test__raw__patient_03.json} (56%) rename tests/{outputs/test__output__patient_04.json => raw/test__raw__patient_04.json} (56%) rename tests/{outputs/test__output__patient_05.json => raw/test__raw__patient_05.json} (56%) rename tests/{outputs/test__output__patient_06.json => raw/test__raw__patient_06.json} (56%) rename tests/{outputs/test__output__patient_07.json => raw/test__raw__patient_07.json} (56%) rename tests/{outputs/test__output__patient_08.json => raw/test__raw__patient_08.json} (56%) rename tests/{outputs/test__output__patient_09.json => raw/test__raw__patient_09.json} (56%) rename tests/{outputs/test__output__patient_10.json => raw/test__raw__patient_10.json} (56%) rename tests/{outputs/test__output__patient_11.json => raw/test__raw__patient_11.json} (56%) rename tests/{outputs/test__output__patient_12.json => raw/test__raw__patient_12.json} (56%) rename tests/{outputs/test__output__patient_13.json => raw/test__raw__patient_13.json} (56%) rename tests/{outputs/test__output__patient_14.json => raw/test__raw__patient_14.json} (56%) rename tests/{outputs/test__output__patient_15.json => raw/test__raw__patient_15.json} (56%) rename tests/{outputs/test__output__patient_16.json => raw/test__raw__patient_16.json} (56%) rename tests/{outputs/test__output__patient_17.json => raw/test__raw__patient_17.json} (56%) rename tests/{outputs/test__output__patient_18.json => raw/test__raw__patient_18.json} (56%) rename tests/{outputs/test__output__patient_19.json => raw/test__raw__patient_19.json} (56%) rename tests/{outputs/test__output__patient_20.json => raw/test__raw__patient_20.json} (56%) rename tests/{outputs/test__output__patient_21.json => raw/test__raw__patient_21.json} (56%) rename tests/{outputs/test__output__patient_22.json => raw/test__raw__patient_22.json} (56%) rename tests/{outputs/test__output__patient_23.json => raw/test__raw__patient_23.json} (56%) rename tests/{outputs/test__output__patient_24.json => raw/test__raw__patient_24.json} (56%) rename tests/{outputs/test__output__patient_25.json => raw/test__raw__patient_25.json} (75%) rename tests/{outputs/test__output__patient_26.json => raw/test__raw__patient_26.json} (75%) rename tests/{outputs/test__output__patient_27.json => raw/test__raw__patient_27.json} (75%) rename tests/{outputs/test__output__patient_28.json => raw/test__raw__patient_28.json} (75%) rename tests/{outputs/test__output__patient_29.json => raw/test__raw__patient_29.json} (75%) rename tests/{outputs/test__output__patient_30.json => raw/test__raw__patient_30.json} (75%) rename tests/{outputs/test__output__patient_31.json => raw/test__raw__patient_31.json} (75%) rename tests/{outputs/test__output__patient_32.json => raw/test__raw__patient_32.json} (75%) rename tests/{outputs/test__output__patient_33.json => raw/test__raw__patient_33.json} (75%) rename tests/{outputs/test__output__patient_34.json => raw/test__raw__patient_34.json} (75%) rename tests/{outputs/test__output__patient_35.json => raw/test__raw__patient_35.json} (75%) rename tests/{outputs/test__output__patient_36.json => raw/test__raw__patient_36.json} (75%) diff --git a/tests/inputs/test__input__patient_01.json b/tests/inputs/test__input__patient_01.json index 5253431..3ca6264 100755 --- a/tests/inputs/test__input__patient_01.json +++ b/tests/inputs/test__input__patient_01.json @@ -7,45 +7,61 @@ "laboratory": "Quest Diagnostics" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.05, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 1.17, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 70.5, "unit": "mg/dL" }, - "crp": { + "crp_mg_dl": { "value": 0.5, "unit": "mg/dL" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 40.3, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 89.1, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 11.9, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 63.5, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 6.05, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 39, "unit": "years" + }, + "glucose_mmol_l": { + "value": 3.9167, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 103.428, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 40.5, + "unit": "g/L" + }, + "crp_mg_l": { + "value": 5.0, + "unit": "mg/L" } } } diff --git a/tests/inputs/test__input__patient_02.json b/tests/inputs/test__input__patient_02.json index 5e6a9b4..2590587 100755 --- a/tests/inputs/test__input__patient_02.json +++ b/tests/inputs/test__input__patient_02.json @@ -7,45 +7,61 @@ "laboratory": "LabCorp" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.0, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.584, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 109.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_dl": { "value": 0.21, "unit": "mg/dL" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 32.35, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 92.4, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.05, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 59, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 4.95, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 40, "unit": "years" + }, + "glucose_mmol_l": { + "value": 6.0556, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 51.6256, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 40.0, + "unit": "g/L" + }, + "crp_mg_l": { + "value": 2.1, + "unit": "mg/L" } } } diff --git a/tests/inputs/test__input__patient_03.json b/tests/inputs/test__input__patient_03.json index 27fe722..ec7d846 100755 --- a/tests/inputs/test__input__patient_03.json +++ b/tests/inputs/test__input__patient_03.json @@ -7,45 +7,61 @@ "laboratory": "Mayo Clinic Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.1, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.584, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 89.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_dl": { "value": 0.21, "unit": "mg/dL" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 43.85, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 91.9, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.7, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 96, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 4.7, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 80, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.9444, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 51.6256, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 41.0, + "unit": "g/L" + }, + "crp_mg_l": { + "value": 2.1, + "unit": "mg/L" } } } diff --git a/tests/inputs/test__input__patient_04.json b/tests/inputs/test__input__patient_04.json index dc27e44..37af92e 100755 --- a/tests/inputs/test__input__patient_04.json +++ b/tests/inputs/test__input__patient_04.json @@ -7,45 +7,61 @@ "laboratory": "Northwell Health Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.4, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.776, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 89.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_dl": { "value": 0.21, "unit": "mg/dL" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 29.0, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 78.4, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.05, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 35, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.55, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 36, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.9444, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 68.5984, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 44.0, + "unit": "g/L" + }, + "crp_mg_l": { + "value": 2.1, + "unit": "mg/L" } } } diff --git a/tests/inputs/test__input__patient_05.json b/tests/inputs/test__input__patient_05.json index c5530ff..bde1c9c 100755 --- a/tests/inputs/test__input__patient_05.json +++ b/tests/inputs/test__input__patient_05.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.5, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.968, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 85.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 27.2, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 90.4, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 13.0, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 74.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.9, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 35, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.7222, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 85.5712, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 45.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_06.json b/tests/inputs/test__input__patient_06.json index 128bd7c..8cfe820 100755 --- a/tests/inputs/test__input__patient_06.json +++ b/tests/inputs/test__input__patient_06.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 3.9, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.584, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 88.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 43.7, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 66.3, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 18.1, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 84.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.05, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 42, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.8889, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 51.6256, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 39.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_07.json b/tests/inputs/test__input__patient_07.json index 145101e..dc8cd07 100755 --- a/tests/inputs/test__input__patient_07.json +++ b/tests/inputs/test__input__patient_07.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.4, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.776, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 89.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 29.0, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 78.4, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.05, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 35.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.55, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 36, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.9444, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 68.5984, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 44.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_08.json b/tests/inputs/test__input__patient_08.json index 5636060..da026d9 100755 --- a/tests/inputs/test__input__patient_08.json +++ b/tests/inputs/test__input__patient_08.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.4, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.776, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 84.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 43.15, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 93.9, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.95, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 67.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 3.85, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 31, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.6667, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 68.5984, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 44.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_09.json b/tests/inputs/test__input__patient_09.json index 805d1d7..5cb7b59 100755 --- a/tests/inputs/test__input__patient_09.json +++ b/tests/inputs/test__input__patient_09.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.3, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.872, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 89.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 26.9, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 87.95, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 13.15, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 90.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 8.15, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 32, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.9444, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 77.0848, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 43.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_10.json b/tests/inputs/test__input__patient_10.json index d03f12f..2088750 100755 --- a/tests/inputs/test__input__patient_10.json +++ b/tests/inputs/test__input__patient_10.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.5, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.584, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 76.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 36.5, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 92.05, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 13.3, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 36.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.9, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 31, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.2222, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 51.6256, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 45.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_11.json b/tests/inputs/test__input__patient_11.json index 401c427..b4da578 100755 --- a/tests/inputs/test__input__patient_11.json +++ b/tests/inputs/test__input__patient_11.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.8, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 1.064, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 77.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 34.2, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 96.6, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.2, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 69.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.05, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 32, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.2778, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 94.0576, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 48.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_12.json b/tests/inputs/test__input__patient_12.json index 5213c0f..0d44ef6 100755 --- a/tests/inputs/test__input__patient_12.json +++ b/tests/inputs/test__input__patient_12.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.3, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.776, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 79.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 40.75, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 90.95, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 13.15, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 39.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 4.7, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 33, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.3889, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 68.5984, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 43.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_13.json b/tests/inputs/test__input__patient_13.json index 5b66b68..3029523 100755 --- a/tests/inputs/test__input__patient_13.json +++ b/tests/inputs/test__input__patient_13.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.7, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.776, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 84.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 23.7, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 89.35, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 11.95, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 66.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 10.0, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 35, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.6667, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 68.5984, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 47.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_14.json b/tests/inputs/test__input__patient_14.json index e491d79..bfbf334 100755 --- a/tests/inputs/test__input__patient_14.json +++ b/tests/inputs/test__input__patient_14.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 3.9, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.776, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 94.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 9.9, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 36.5, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 91.5, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 13.6, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 68.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.55, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 43, "unit": "years" + }, + "glucose_mmol_l": { + "value": 5.2222, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 68.5984, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 39.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.99, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_15.json b/tests/inputs/test__input__patient_15.json index 27e96ea..0dd09f4 100755 --- a/tests/inputs/test__input__patient_15.json +++ b/tests/inputs/test__input__patient_15.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 3.9, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.776, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 95.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 5.5, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 27.75, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 96.35, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 13.3, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 95.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 7.45, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 47, "unit": "years" + }, + "glucose_mmol_l": { + "value": 5.2778, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 68.5984, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 39.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.55, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_16.json b/tests/inputs/test__input__patient_16.json index 6b79cc7..5228ff4 100755 --- a/tests/inputs/test__input__patient_16.json +++ b/tests/inputs/test__input__patient_16.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.1, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.68, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 88.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 31.5, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 89.75, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.85, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 73.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 6.85, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 30, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.8889, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 60.112, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 41.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_17.json b/tests/inputs/test__input__patient_17.json index 6102f91..1a5cd20 100755 --- a/tests/inputs/test__input__patient_17.json +++ b/tests/inputs/test__input__patient_17.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.5, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.968, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 101.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 40.9, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 90.7, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.45, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 85.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 4.25, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 53, "unit": "years" + }, + "glucose_mmol_l": { + "value": 5.6111, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 85.5712, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 45.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_18.json b/tests/inputs/test__input__patient_18.json index be3035e..9fd8ff5 100755 --- a/tests/inputs/test__input__patient_18.json +++ b/tests/inputs/test__input__patient_18.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.6, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.584, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 83.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 37.55, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 87.95, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.45, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 52.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.85, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 32, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.6111, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 51.6256, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 46.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_19.json b/tests/inputs/test__input__patient_19.json index 1f43989..9e6eb0e 100755 --- a/tests/inputs/test__input__patient_19.json +++ b/tests/inputs/test__input__patient_19.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 3.9, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.872, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 105.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 38.65, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 84.4, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 15.35, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 59.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 5.05, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 70, "unit": "years" + }, + "glucose_mmol_l": { + "value": 5.8333, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 77.0848, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 39.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_20.json b/tests/inputs/test__input__patient_20.json index 2344aed..1df0bcb 100755 --- a/tests/inputs/test__input__patient_20.json +++ b/tests/inputs/test__input__patient_20.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 5.0, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.68, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 71.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 29.25, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 88.75, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.7, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 91.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 4.45, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 32, "unit": "years" + }, + "glucose_mmol_l": { + "value": 3.9444, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 60.112, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 50.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_21.json b/tests/inputs/test__input__patient_21.json index e9c149d..8b4b15c 100755 --- a/tests/inputs/test__input__patient_21.json +++ b/tests/inputs/test__input__patient_21.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.5, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.872, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 86.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 31.0, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 90.1, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.3, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 55.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 6.55, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 42, "unit": "years" + }, + "glucose_mmol_l": { + "value": 4.7778, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 77.0848, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 45.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_22.json b/tests/inputs/test__input__patient_22.json index fd18929..9fd549f 100755 --- a/tests/inputs/test__input__patient_22.json +++ b/tests/inputs/test__input__patient_22.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.3, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 1.16, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 106.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 35.45, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 85.15, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 14.15, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 86.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 10.55, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 39, "unit": "years" + }, + "glucose_mmol_l": { + "value": 5.8889, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 102.544, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 43.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_23.json b/tests/inputs/test__input__patient_23.json index c0d1ebc..9d36cdf 100755 --- a/tests/inputs/test__input__patient_23.json +++ b/tests/inputs/test__input__patient_23.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.1, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.68, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 100.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 52.5, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 93.1, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 13.65, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 49.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 3.2, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 62, "unit": "years" + }, + "glucose_mmol_l": { + "value": 5.5556, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 60.112, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 41.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_24.json b/tests/inputs/test__input__patient_24.json index 329caad..41ba5bd 100755 --- a/tests/inputs/test__input__patient_24.json +++ b/tests/inputs/test__input__patient_24.json @@ -7,45 +7,61 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin": { + "albumin_g_dl": { "value": 4.4, "unit": "g/dL" }, - "creatinine": { + "creatinine_mg_dl": { "value": 0.584, "unit": "mg/dL" }, - "glucose": { + "glucose_mg_dl": { "value": 90.0, "unit": "mg/dL" }, - "crp": { + "crp_mg_l": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent": { + "lymphocyte_percent_%": { "value": 34.75, "unit": "%" }, - "mean_cell_volume": { + "mean_cell_volume_fl": { "value": 93.0, "unit": "fL" }, - "red_cell_distribution_width": { + "red_cell_distribution_width_%": { "value": 12.65, "unit": "%" }, - "alkaline_phosphatase": { + "alkaline_phosphatase_u_l": { "value": 73.0, "unit": "U/L" }, - "white_blood_cell_count": { + "white_blood_cell_count_1000_cells_ul": { "value": 7.75, "unit": "1000 cells/uL" }, - "age": { + "age_years": { "value": 41, "unit": "years" + }, + "glucose_mmol_l": { + "value": 5.0, + "unit": "mmol/L" + }, + "creatinine_umol_l": { + "value": 51.6256, + "unit": "umol/L" + }, + "albumin_g_l": { + "value": 44.0, + "unit": "g/L" + }, + "crp_mg_dl": { + "value": 0.21, + "unit": "mg/dL" } } } diff --git a/tests/inputs/test__input__patient_25.json b/tests/inputs/test__input__patient_25.json index df7575a..3c9c3e9 100755 --- a/tests/inputs/test__input__patient_25.json +++ b/tests/inputs/test__input__patient_25.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 50, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmHg": { "value": 140, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_L": { "value": 6.3, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_L": { "value": 1.4, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": false, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_26.json b/tests/inputs/test__input__patient_26.json index 6eb6449..0d105ac 100755 --- a/tests/inputs/test__input__patient_26.json +++ b/tests/inputs/test__input__patient_26.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 50, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmHg": { "value": 140, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_L": { "value": 6.3, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_L": { "value": 1.4, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": true, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_27.json b/tests/inputs/test__input__patient_27.json index 8c2f500..96b5a37 100644 --- a/tests/inputs/test__input__patient_27.json +++ b/tests/inputs/test__input__patient_27.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 55, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 125, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 5.2, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.6, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": false, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_28.json b/tests/inputs/test__input__patient_28.json index 837f9c3..62b9906 100644 --- a/tests/inputs/test__input__patient_28.json +++ b/tests/inputs/test__input__patient_28.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 45, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 130, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 5.8, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.3, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": true, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_29.json b/tests/inputs/test__input__patient_29.json index c9ded57..d439a63 100644 --- a/tests/inputs/test__input__patient_29.json +++ b/tests/inputs/test__input__patient_29.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 40, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 135, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 6.0, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.2, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": true, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_30.json b/tests/inputs/test__input__patient_30.json index b43b9a0..77bfb0b 100644 --- a/tests/inputs/test__input__patient_30.json +++ b/tests/inputs/test__input__patient_30.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 60, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 145, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 6.5, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.5, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": false, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_31.json b/tests/inputs/test__input__patient_31.json index 0910c92..66d115b 100644 --- a/tests/inputs/test__input__patient_31.json +++ b/tests/inputs/test__input__patient_31.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 65, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 150, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 7.0, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.1, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": true, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_32.json b/tests/inputs/test__input__patient_32.json index 255d858..83cc013 100644 --- a/tests/inputs/test__input__patient_32.json +++ b/tests/inputs/test__input__patient_32.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 69, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 155, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 7.2, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.3, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": false, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_33.json b/tests/inputs/test__input__patient_33.json index 26cc61d..4220ee1 100644 --- a/tests/inputs/test__input__patient_33.json +++ b/tests/inputs/test__input__patient_33.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 49, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 138, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 6.1, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.4, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": true, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_34.json b/tests/inputs/test__input__patient_34.json index f471469..f2bdf7e 100644 --- a/tests/inputs/test__input__patient_34.json +++ b/tests/inputs/test__input__patient_34.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 50, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 120, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 4.8, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.8, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": false, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_35.json b/tests/inputs/test__input__patient_35.json index 3c06bf3..5fc3658 100644 --- a/tests/inputs/test__input__patient_35.json +++ b/tests/inputs/test__input__patient_35.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 55, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 142, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 6.4, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.2, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": true, "unit": "yes/no" } diff --git a/tests/inputs/test__input__patient_36.json b/tests/inputs/test__input__patient_36.json index d432a84..b71ddb2 100644 --- a/tests/inputs/test__input__patient_36.json +++ b/tests/inputs/test__input__patient_36.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age": { + "age_years": { "value": 45, "unit": "years" }, - "smoking": { + "smoking_yes_no": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure": { + "systolic_blood_pressure_mmhg": { "value": 132, "unit": "mmHg" }, - "total_cholesterol": { + "total_cholesterol_mmol_l": { "value": 5.5, "unit": "mmol/L" }, - "hdl_cholesterol": { + "hdl_cholesterol_mmol_l": { "value": 1.5, "unit": "mmol/L" }, - "is_male": { + "is_male_yes_no": { "value": false, "unit": "yes/no" } diff --git a/tests/inputs/test__input__NHANES3__bioage.csv b/tests/raw/test__input__NHANES3__bioage.csv similarity index 100% rename from tests/inputs/test__input__NHANES3__bioage.csv rename to tests/raw/test__input__NHANES3__bioage.csv diff --git a/tests/outputs/test__output__patient_01.json b/tests/raw/test__raw__patient_01.json similarity index 56% rename from tests/outputs/test__output__patient_01.json rename to tests/raw/test__raw__patient_01.json index 3ca6264..5253431 100755 --- a/tests/outputs/test__output__patient_01.json +++ b/tests/raw/test__raw__patient_01.json @@ -7,61 +7,45 @@ "laboratory": "Quest Diagnostics" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.05, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 1.17, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 70.5, "unit": "mg/dL" }, - "crp_mg_dl": { + "crp": { "value": 0.5, "unit": "mg/dL" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 40.3, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 89.1, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 11.9, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 63.5, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 6.05, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 39, "unit": "years" - }, - "glucose_mmol_l": { - "value": 3.9167, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 103.428, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 40.5, - "unit": "g/L" - }, - "crp_mg_l": { - "value": 5.0, - "unit": "mg/L" } } } diff --git a/tests/outputs/test__output__patient_02.json b/tests/raw/test__raw__patient_02.json similarity index 55% rename from tests/outputs/test__output__patient_02.json rename to tests/raw/test__raw__patient_02.json index 2590587..5e6a9b4 100755 --- a/tests/outputs/test__output__patient_02.json +++ b/tests/raw/test__raw__patient_02.json @@ -7,61 +7,45 @@ "laboratory": "LabCorp" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.0, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.584, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 109.0, "unit": "mg/dL" }, - "crp_mg_dl": { + "crp": { "value": 0.21, "unit": "mg/dL" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 32.35, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 92.4, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.05, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 59, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 4.95, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 40, "unit": "years" - }, - "glucose_mmol_l": { - "value": 6.0556, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 51.6256, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 40.0, - "unit": "g/L" - }, - "crp_mg_l": { - "value": 2.1, - "unit": "mg/L" } } } diff --git a/tests/outputs/test__output__patient_03.json b/tests/raw/test__raw__patient_03.json similarity index 56% rename from tests/outputs/test__output__patient_03.json rename to tests/raw/test__raw__patient_03.json index ec7d846..27fe722 100755 --- a/tests/outputs/test__output__patient_03.json +++ b/tests/raw/test__raw__patient_03.json @@ -7,61 +7,45 @@ "laboratory": "Mayo Clinic Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.1, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.584, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 89.0, "unit": "mg/dL" }, - "crp_mg_dl": { + "crp": { "value": 0.21, "unit": "mg/dL" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 43.85, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 91.9, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.7, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 96, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 4.7, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 80, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.9444, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 51.6256, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 41.0, - "unit": "g/L" - }, - "crp_mg_l": { - "value": 2.1, - "unit": "mg/L" } } } diff --git a/tests/outputs/test__output__patient_04.json b/tests/raw/test__raw__patient_04.json similarity index 56% rename from tests/outputs/test__output__patient_04.json rename to tests/raw/test__raw__patient_04.json index 37af92e..dc27e44 100755 --- a/tests/outputs/test__output__patient_04.json +++ b/tests/raw/test__raw__patient_04.json @@ -7,61 +7,45 @@ "laboratory": "Northwell Health Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.4, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.776, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 89.0, "unit": "mg/dL" }, - "crp_mg_dl": { + "crp": { "value": 0.21, "unit": "mg/dL" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 29.0, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 78.4, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.05, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 35, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.55, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 36, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.9444, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 68.5984, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 44.0, - "unit": "g/L" - }, - "crp_mg_l": { - "value": 2.1, - "unit": "mg/L" } } } diff --git a/tests/outputs/test__output__patient_05.json b/tests/raw/test__raw__patient_05.json similarity index 56% rename from tests/outputs/test__output__patient_05.json rename to tests/raw/test__raw__patient_05.json index bde1c9c..c5530ff 100755 --- a/tests/outputs/test__output__patient_05.json +++ b/tests/raw/test__raw__patient_05.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.5, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.968, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 85.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 27.2, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 90.4, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 13.0, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 74.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.9, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 35, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.7222, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 85.5712, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 45.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_06.json b/tests/raw/test__raw__patient_06.json similarity index 56% rename from tests/outputs/test__output__patient_06.json rename to tests/raw/test__raw__patient_06.json index 8cfe820..128bd7c 100755 --- a/tests/outputs/test__output__patient_06.json +++ b/tests/raw/test__raw__patient_06.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 3.9, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.584, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 88.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 43.7, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 66.3, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 18.1, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 84.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.05, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 42, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.8889, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 51.6256, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 39.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_07.json b/tests/raw/test__raw__patient_07.json similarity index 56% rename from tests/outputs/test__output__patient_07.json rename to tests/raw/test__raw__patient_07.json index dc8cd07..145101e 100755 --- a/tests/outputs/test__output__patient_07.json +++ b/tests/raw/test__raw__patient_07.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.4, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.776, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 89.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 29.0, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 78.4, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.05, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 35.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.55, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 36, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.9444, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 68.5984, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 44.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_08.json b/tests/raw/test__raw__patient_08.json similarity index 56% rename from tests/outputs/test__output__patient_08.json rename to tests/raw/test__raw__patient_08.json index da026d9..5636060 100755 --- a/tests/outputs/test__output__patient_08.json +++ b/tests/raw/test__raw__patient_08.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.4, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.776, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 84.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 43.15, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 93.9, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.95, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 67.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 3.85, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 31, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.6667, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 68.5984, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 44.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_09.json b/tests/raw/test__raw__patient_09.json similarity index 56% rename from tests/outputs/test__output__patient_09.json rename to tests/raw/test__raw__patient_09.json index 5cb7b59..805d1d7 100755 --- a/tests/outputs/test__output__patient_09.json +++ b/tests/raw/test__raw__patient_09.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.3, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.872, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 89.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 26.9, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 87.95, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 13.15, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 90.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 8.15, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 32, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.9444, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 77.0848, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 43.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_10.json b/tests/raw/test__raw__patient_10.json similarity index 56% rename from tests/outputs/test__output__patient_10.json rename to tests/raw/test__raw__patient_10.json index 2088750..d03f12f 100755 --- a/tests/outputs/test__output__patient_10.json +++ b/tests/raw/test__raw__patient_10.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.5, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.584, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 76.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 36.5, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 92.05, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 13.3, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 36.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.9, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 31, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.2222, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 51.6256, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 45.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_11.json b/tests/raw/test__raw__patient_11.json similarity index 56% rename from tests/outputs/test__output__patient_11.json rename to tests/raw/test__raw__patient_11.json index b4da578..401c427 100755 --- a/tests/outputs/test__output__patient_11.json +++ b/tests/raw/test__raw__patient_11.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.8, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 1.064, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 77.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 34.2, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 96.6, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.2, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 69.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.05, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 32, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.2778, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 94.0576, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 48.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_12.json b/tests/raw/test__raw__patient_12.json similarity index 56% rename from tests/outputs/test__output__patient_12.json rename to tests/raw/test__raw__patient_12.json index 0d44ef6..5213c0f 100755 --- a/tests/outputs/test__output__patient_12.json +++ b/tests/raw/test__raw__patient_12.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.3, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.776, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 79.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 40.75, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 90.95, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 13.15, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 39.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 4.7, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 33, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.3889, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 68.5984, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 43.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_13.json b/tests/raw/test__raw__patient_13.json similarity index 56% rename from tests/outputs/test__output__patient_13.json rename to tests/raw/test__raw__patient_13.json index 3029523..5b66b68 100755 --- a/tests/outputs/test__output__patient_13.json +++ b/tests/raw/test__raw__patient_13.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.7, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.776, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 84.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 23.7, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 89.35, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 11.95, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 66.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 10.0, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 35, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.6667, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 68.5984, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 47.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_14.json b/tests/raw/test__raw__patient_14.json similarity index 56% rename from tests/outputs/test__output__patient_14.json rename to tests/raw/test__raw__patient_14.json index bfbf334..e491d79 100755 --- a/tests/outputs/test__output__patient_14.json +++ b/tests/raw/test__raw__patient_14.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 3.9, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.776, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 94.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 9.9, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 36.5, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 91.5, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 13.6, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 68.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.55, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 43, "unit": "years" - }, - "glucose_mmol_l": { - "value": 5.2222, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 68.5984, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 39.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.99, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_15.json b/tests/raw/test__raw__patient_15.json similarity index 56% rename from tests/outputs/test__output__patient_15.json rename to tests/raw/test__raw__patient_15.json index 0dd09f4..27e96ea 100755 --- a/tests/outputs/test__output__patient_15.json +++ b/tests/raw/test__raw__patient_15.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 3.9, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.776, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 95.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 5.5, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 27.75, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 96.35, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 13.3, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 95.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 7.45, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 47, "unit": "years" - }, - "glucose_mmol_l": { - "value": 5.2778, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 68.5984, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 39.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.55, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_16.json b/tests/raw/test__raw__patient_16.json similarity index 56% rename from tests/outputs/test__output__patient_16.json rename to tests/raw/test__raw__patient_16.json index 5228ff4..6b79cc7 100755 --- a/tests/outputs/test__output__patient_16.json +++ b/tests/raw/test__raw__patient_16.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.1, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.68, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 88.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 31.5, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 89.75, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.85, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 73.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 6.85, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 30, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.8889, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 60.112, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 41.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_17.json b/tests/raw/test__raw__patient_17.json similarity index 56% rename from tests/outputs/test__output__patient_17.json rename to tests/raw/test__raw__patient_17.json index 1a5cd20..6102f91 100755 --- a/tests/outputs/test__output__patient_17.json +++ b/tests/raw/test__raw__patient_17.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.5, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.968, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 101.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 40.9, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 90.7, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.45, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 85.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 4.25, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 53, "unit": "years" - }, - "glucose_mmol_l": { - "value": 5.6111, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 85.5712, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 45.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_18.json b/tests/raw/test__raw__patient_18.json similarity index 56% rename from tests/outputs/test__output__patient_18.json rename to tests/raw/test__raw__patient_18.json index 9fd8ff5..be3035e 100755 --- a/tests/outputs/test__output__patient_18.json +++ b/tests/raw/test__raw__patient_18.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.6, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.584, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 83.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 37.55, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 87.95, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.45, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 52.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.85, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 32, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.6111, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 51.6256, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 46.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_19.json b/tests/raw/test__raw__patient_19.json similarity index 56% rename from tests/outputs/test__output__patient_19.json rename to tests/raw/test__raw__patient_19.json index 9e6eb0e..1f43989 100755 --- a/tests/outputs/test__output__patient_19.json +++ b/tests/raw/test__raw__patient_19.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 3.9, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.872, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 105.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 38.65, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 84.4, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 15.35, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 59.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 5.05, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 70, "unit": "years" - }, - "glucose_mmol_l": { - "value": 5.8333, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 77.0848, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 39.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_20.json b/tests/raw/test__raw__patient_20.json similarity index 56% rename from tests/outputs/test__output__patient_20.json rename to tests/raw/test__raw__patient_20.json index 1df0bcb..2344aed 100755 --- a/tests/outputs/test__output__patient_20.json +++ b/tests/raw/test__raw__patient_20.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 5.0, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.68, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 71.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 29.25, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 88.75, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.7, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 91.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 4.45, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 32, "unit": "years" - }, - "glucose_mmol_l": { - "value": 3.9444, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 60.112, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 50.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_21.json b/tests/raw/test__raw__patient_21.json similarity index 56% rename from tests/outputs/test__output__patient_21.json rename to tests/raw/test__raw__patient_21.json index 8b4b15c..e9c149d 100755 --- a/tests/outputs/test__output__patient_21.json +++ b/tests/raw/test__raw__patient_21.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.5, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.872, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 86.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 31.0, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 90.1, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.3, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 55.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 6.55, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 42, "unit": "years" - }, - "glucose_mmol_l": { - "value": 4.7778, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 77.0848, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 45.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_22.json b/tests/raw/test__raw__patient_22.json similarity index 56% rename from tests/outputs/test__output__patient_22.json rename to tests/raw/test__raw__patient_22.json index 9fd549f..fd18929 100755 --- a/tests/outputs/test__output__patient_22.json +++ b/tests/raw/test__raw__patient_22.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.3, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 1.16, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 106.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 35.45, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 85.15, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 14.15, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 86.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 10.55, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 39, "unit": "years" - }, - "glucose_mmol_l": { - "value": 5.8889, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 102.544, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 43.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_23.json b/tests/raw/test__raw__patient_23.json similarity index 56% rename from tests/outputs/test__output__patient_23.json rename to tests/raw/test__raw__patient_23.json index 9d36cdf..c0d1ebc 100755 --- a/tests/outputs/test__output__patient_23.json +++ b/tests/raw/test__raw__patient_23.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.1, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.68, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 100.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 52.5, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 93.1, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 13.65, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 49.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 3.2, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 62, "unit": "years" - }, - "glucose_mmol_l": { - "value": 5.5556, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 60.112, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 41.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_24.json b/tests/raw/test__raw__patient_24.json similarity index 56% rename from tests/outputs/test__output__patient_24.json rename to tests/raw/test__raw__patient_24.json index 41ba5bd..329caad 100755 --- a/tests/outputs/test__output__patient_24.json +++ b/tests/raw/test__raw__patient_24.json @@ -7,61 +7,45 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "albumin_g_dl": { + "albumin": { "value": 4.4, "unit": "g/dL" }, - "creatinine_mg_dl": { + "creatinine": { "value": 0.584, "unit": "mg/dL" }, - "glucose_mg_dl": { + "glucose": { "value": 90.0, "unit": "mg/dL" }, - "crp_mg_l": { + "crp": { "value": 2.1, "unit": "mg/L" }, - "lymphocyte_percent_%": { + "lymphocyte_percent": { "value": 34.75, "unit": "%" }, - "mean_cell_volume_fl": { + "mean_cell_volume": { "value": 93.0, "unit": "fL" }, - "red_cell_distribution_width_%": { + "red_cell_distribution_width": { "value": 12.65, "unit": "%" }, - "alkaline_phosphatase_u_l": { + "alkaline_phosphatase": { "value": 73.0, "unit": "U/L" }, - "white_blood_cell_count_1000_cells_ul": { + "white_blood_cell_count": { "value": 7.75, "unit": "1000 cells/uL" }, - "age_years": { + "age": { "value": 41, "unit": "years" - }, - "glucose_mmol_l": { - "value": 5.0, - "unit": "mmol/L" - }, - "creatinine_umol_l": { - "value": 51.6256, - "unit": "umol/L" - }, - "albumin_g_l": { - "value": 44.0, - "unit": "g/L" - }, - "crp_mg_dl": { - "value": 0.21, - "unit": "mg/dL" } } } diff --git a/tests/outputs/test__output__patient_25.json b/tests/raw/test__raw__patient_25.json similarity index 75% rename from tests/outputs/test__output__patient_25.json rename to tests/raw/test__raw__patient_25.json index 3c9c3e9..df7575a 100755 --- a/tests/outputs/test__output__patient_25.json +++ b/tests/raw/test__raw__patient_25.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 50, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmHg": { + "systolic_blood_pressure": { "value": 140, "unit": "mmHg" }, - "total_cholesterol_mmol_L": { + "total_cholesterol": { "value": 6.3, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_L": { + "hdl_cholesterol": { "value": 1.4, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": false, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_26.json b/tests/raw/test__raw__patient_26.json similarity index 75% rename from tests/outputs/test__output__patient_26.json rename to tests/raw/test__raw__patient_26.json index 0d105ac..6eb6449 100755 --- a/tests/outputs/test__output__patient_26.json +++ b/tests/raw/test__raw__patient_26.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 50, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmHg": { + "systolic_blood_pressure": { "value": 140, "unit": "mmHg" }, - "total_cholesterol_mmol_L": { + "total_cholesterol": { "value": 6.3, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_L": { + "hdl_cholesterol": { "value": 1.4, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": true, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_27.json b/tests/raw/test__raw__patient_27.json similarity index 75% rename from tests/outputs/test__output__patient_27.json rename to tests/raw/test__raw__patient_27.json index 96b5a37..8c2f500 100644 --- a/tests/outputs/test__output__patient_27.json +++ b/tests/raw/test__raw__patient_27.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 55, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 125, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 5.2, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.6, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": false, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_28.json b/tests/raw/test__raw__patient_28.json similarity index 75% rename from tests/outputs/test__output__patient_28.json rename to tests/raw/test__raw__patient_28.json index 62b9906..837f9c3 100644 --- a/tests/outputs/test__output__patient_28.json +++ b/tests/raw/test__raw__patient_28.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 45, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 130, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 5.8, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.3, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": true, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_29.json b/tests/raw/test__raw__patient_29.json similarity index 75% rename from tests/outputs/test__output__patient_29.json rename to tests/raw/test__raw__patient_29.json index d439a63..c9ded57 100644 --- a/tests/outputs/test__output__patient_29.json +++ b/tests/raw/test__raw__patient_29.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 40, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 135, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 6.0, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.2, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": true, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_30.json b/tests/raw/test__raw__patient_30.json similarity index 75% rename from tests/outputs/test__output__patient_30.json rename to tests/raw/test__raw__patient_30.json index 77bfb0b..b43b9a0 100644 --- a/tests/outputs/test__output__patient_30.json +++ b/tests/raw/test__raw__patient_30.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 60, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 145, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 6.5, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.5, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": false, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_31.json b/tests/raw/test__raw__patient_31.json similarity index 75% rename from tests/outputs/test__output__patient_31.json rename to tests/raw/test__raw__patient_31.json index 66d115b..0910c92 100644 --- a/tests/outputs/test__output__patient_31.json +++ b/tests/raw/test__raw__patient_31.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 65, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 150, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 7.0, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.1, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": true, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_32.json b/tests/raw/test__raw__patient_32.json similarity index 75% rename from tests/outputs/test__output__patient_32.json rename to tests/raw/test__raw__patient_32.json index 83cc013..255d858 100644 --- a/tests/outputs/test__output__patient_32.json +++ b/tests/raw/test__raw__patient_32.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 69, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 155, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 7.2, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.3, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": false, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_33.json b/tests/raw/test__raw__patient_33.json similarity index 75% rename from tests/outputs/test__output__patient_33.json rename to tests/raw/test__raw__patient_33.json index 4220ee1..26cc61d 100644 --- a/tests/outputs/test__output__patient_33.json +++ b/tests/raw/test__raw__patient_33.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 49, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 138, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 6.1, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.4, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": true, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_34.json b/tests/raw/test__raw__patient_34.json similarity index 75% rename from tests/outputs/test__output__patient_34.json rename to tests/raw/test__raw__patient_34.json index f2bdf7e..f471469 100644 --- a/tests/outputs/test__output__patient_34.json +++ b/tests/raw/test__raw__patient_34.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 50, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": false, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 120, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 4.8, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.8, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": false, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_35.json b/tests/raw/test__raw__patient_35.json similarity index 75% rename from tests/outputs/test__output__patient_35.json rename to tests/raw/test__raw__patient_35.json index 5fc3658..3c06bf3 100644 --- a/tests/outputs/test__output__patient_35.json +++ b/tests/raw/test__raw__patient_35.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 55, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 142, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 6.4, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.2, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": true, "unit": "yes/no" } diff --git a/tests/outputs/test__output__patient_36.json b/tests/raw/test__raw__patient_36.json similarity index 75% rename from tests/outputs/test__output__patient_36.json rename to tests/raw/test__raw__patient_36.json index b71ddb2..d432a84 100644 --- a/tests/outputs/test__output__patient_36.json +++ b/tests/raw/test__raw__patient_36.json @@ -7,27 +7,27 @@ "laboratory": "NHANES Reference Labs" }, "raw_biomarkers": { - "age_years": { + "age": { "value": 45, "unit": "years" }, - "smoking_yes_no": { + "smoking": { "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmhg": { + "systolic_blood_pressure": { "value": 132, "unit": "mmHg" }, - "total_cholesterol_mmol_l": { + "total_cholesterol": { "value": 5.5, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_l": { + "hdl_cholesterol": { "value": 1.5, "unit": "mmol/L" }, - "is_male_yes_no": { + "is_male": { "value": false, "unit": "yes/no" } diff --git a/tests/test_io.py b/tests/test_io.py index ba1b2ad..d22e5f0 100755 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -5,13 +5,13 @@ from vitals.biomarkers import io -INP_FILEPATH = Path(__file__).parent / "inputs" -OUT_FILEPATH = Path(__file__).parent / "outputs" +INP_FILEPATH = Path(__file__).parent / "raw" +OUT_FILEPATH = Path(__file__).parent / "inputs" @pytest.mark.parametrize( "input_filename,output_filename", - [("test__input__patient_01.json", "test__output__patient_01.json")], + [("test__raw__patient_01.json", "test__input__patient_01.json")], ) def test_process_json_files(input_filename, output_filename): # Process files in the tests directory diff --git a/tests/test_phenoage.py b/tests/test_phenoage.py index cf062f3..d23d8ba 100755 --- a/tests/test_phenoage.py +++ b/tests/test_phenoage.py @@ -4,23 +4,23 @@ from vitals.phenoage import compute -OUT_FILEPATH = Path(__file__).parent / "outputs" +OUT_FILEPATH = Path(__file__).parent / "inputs" @pytest.mark.parametrize( "filename,expected", [ - ("test__output__patient_01.json", (39.00, 39.43, 0.43)), - ("test__output__patient_02.json", (40.00, 40.57, 0.57)), - ("test__output__patient_03.json", (80.00, 74.78, -5.22)), - ("test__output__patient_04.json", (36.00, 31.05, -4.95)), - ("test__output__patient_05.json", (35.00, 39.42, 4.42)), - ("test__output__patient_06.json", (42.00, 53.71, 11.71)), - ("test__output__patient_07.json", (36.00, 31.06, -4.94)), - ("test__output__patient_08.json", (31.00, 31.64, 0.65)), - ("test__output__patient_17.json", (53.00, 52.86, -0.14)), - ("test__output__patient_19.json", (70.00, 78.85, 8.85)), - ("test__output__patient_23.json", (62.00, 61.75, -0.25)), + ("test__input__patient_01.json", (39.00, 39.43, 0.43)), + ("test__input__patient_02.json", (40.00, 40.57, 0.57)), + ("test__input__patient_03.json", (80.00, 74.78, -5.22)), + ("test__input__patient_04.json", (36.00, 31.05, -4.95)), + ("test__input__patient_05.json", (35.00, 39.42, 4.42)), + ("test__input__patient_06.json", (42.00, 53.71, 11.71)), + ("test__input__patient_07.json", (36.00, 31.06, -4.94)), + ("test__input__patient_08.json", (31.00, 31.64, 0.65)), + ("test__input__patient_17.json", (53.00, 52.86, -0.14)), + ("test__input__patient_19.json", (70.00, 78.85, 8.85)), + ("test__input__patient_23.json", (62.00, 61.75, -0.25)), ], ) def test_phenoage(filename, expected): diff --git a/tests/test_score2.py b/tests/test_score2.py index f597d59..c1e3968 100644 --- a/tests/test_score2.py +++ b/tests/test_score2.py @@ -4,24 +4,24 @@ from vitals.score2 import compute -OUT_FILEPATH = Path(__file__).parent / "outputs" +OUT_FILEPATH = Path(__file__).parent / "inputs" @pytest.mark.parametrize( "filename,expected", [ - ("test__output__patient_25.json", (50.00, 4.34, "Low to moderate")), - ("test__output__patient_26.json", (50.00, 6.31, "High")), - ("test__output__patient_27.json", (55.00, 2.10, "Low to moderate")), - ("test__output__patient_28.json", (45.00, 2.40, "Low to moderate")), - ("test__output__patient_29.json", (40.00, 4.30, "High")), - ("test__output__patient_30.json", (60.00, 4.20, "Low to moderate")), - ("test__output__patient_31.json", (65.00, 14.40, "Very high")), - ("test__output__patient_32.json", (69.00, 8.40, "High")), - ("test__output__patient_33.json", (49.00, 5.70, "High")), - ("test__output__patient_34.json", (50.00, 1.20, "Low to moderate")), - ("test__output__patient_35.json", (55.00, 8.70, "High")), - ("test__output__patient_36.json", (45.00, 2.60, "High")), + ("test__input__patient_25.json", (50.00, 4.34, "Low to moderate")), + ("test__input__patient_26.json", (50.00, 6.31, "High")), + ("test__input__patient_27.json", (55.00, 2.10, "Low to moderate")), + ("test__input__patient_28.json", (45.00, 2.40, "Low to moderate")), + ("test__input__patient_29.json", (40.00, 4.30, "High")), + ("test__input__patient_30.json", (60.00, 4.20, "Low to moderate")), + ("test__input__patient_31.json", (65.00, 14.40, "Very high")), + ("test__input__patient_32.json", (69.00, 8.40, "High")), + ("test__input__patient_33.json", (49.00, 5.70, "High")), + ("test__input__patient_34.json", (50.00, 1.20, "Low to moderate")), + ("test__input__patient_35.json", (55.00, 8.70, "High")), + ("test__input__patient_36.json", (45.00, 2.60, "High")), ], ) def test_score2(filename, expected): diff --git a/vitals/biomarkers/io.py b/vitals/biomarkers/io.py index 8858e1b..e0d4946 100755 --- a/vitals/biomarkers/io.py +++ b/vitals/biomarkers/io.py @@ -42,11 +42,11 @@ def write(data: dict, output_file: Path) -> None: if __name__ == "__main__": # Process all JSON files in the input directory - input_dir = Path("tests/inputs") - output_dir = Path("tests/outputs") + input_dir = Path("tests/raw") + output_dir = Path("tests/inputs") for input_file in input_dir.glob("*.json"): - output_file = output_dir / input_file.name.replace("input", "output") + output_file = output_dir / input_file.name.replace("raw", "input") # Update biomarker data data = update(input_file) From aefafecb936596008b4483f7ae4e666c2ff044f1 Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 13:16:19 +0200 Subject: [PATCH 09/15] fix: standardize unit suffix casing to lowercase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change systolic_blood_pressure_mmHg to systolic_blood_pressure_mmhg - Change total_cholesterol_mmol_L to total_cholesterol_mmol_l - Change hdl_cholesterol_mmol_L to hdl_cholesterol_mmol_l Ensures consistency across all test input files by using lowercase unit suffixes 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode --- tests/inputs/test__input__patient_25.json | 6 +++--- tests/inputs/test__input__patient_26.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/inputs/test__input__patient_25.json b/tests/inputs/test__input__patient_25.json index 3c9c3e9..83f68ad 100755 --- a/tests/inputs/test__input__patient_25.json +++ b/tests/inputs/test__input__patient_25.json @@ -15,15 +15,15 @@ "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmHg": { + "systolic_blood_pressure_mmhg": { "value": 140, "unit": "mmHg" }, - "total_cholesterol_mmol_L": { + "total_cholesterol_mmol_l": { "value": 6.3, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_L": { + "hdl_cholesterol_mmol_l": { "value": 1.4, "unit": "mmol/L" }, diff --git a/tests/inputs/test__input__patient_26.json b/tests/inputs/test__input__patient_26.json index 0d105ac..ba11b32 100755 --- a/tests/inputs/test__input__patient_26.json +++ b/tests/inputs/test__input__patient_26.json @@ -15,15 +15,15 @@ "value": true, "unit": "yes/no" }, - "systolic_blood_pressure_mmHg": { + "systolic_blood_pressure_mmhg": { "value": 140, "unit": "mmHg" }, - "total_cholesterol_mmol_L": { + "total_cholesterol_mmol_l": { "value": 6.3, "unit": "mmol/L" }, - "hdl_cholesterol_mmol_L": { + "hdl_cholesterol_mmol_l": { "value": 1.4, "unit": "mmol/L" }, From eac24b4ccf2b0161c7fc6fa8b3164ee761ed5005 Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 13:28:06 +0200 Subject: [PATCH 10/15] refactor: reorganize fodlers and test files --- .../test__input__patient_01.json | 0 .../test__input__patient_02.json | 0 .../test__input__patient_03.json | 0 .../test__input__patient_04.json | 0 .../test__input__patient_05.json | 0 .../test__input__patient_06.json | 0 .../test__input__patient_07.json | 0 .../test__input__patient_08.json | 0 .../test__input__patient_09.json | 0 .../test__input__patient_10.json | 0 .../test__input__patient_11.json | 0 .../test__input__patient_12.json | 0 .../test__input__patient_13.json | 0 .../test__input__patient_14.json | 0 .../test__input__patient_15.json | 0 .../test__input__patient_16.json | 0 .../test__input__patient_17.json | 0 .../test__input__patient_18.json | 0 .../test__input__patient_19.json | 0 .../test__input__patient_20.json | 0 .../test__input__patient_21.json | 0 .../test__input__patient_22.json | 0 .../test__input__patient_23.json | 0 .../test__input__patient_24.json | 0 .../{ => score2}/test__input__patient_25.json | 0 .../{ => score2}/test__input__patient_26.json | 0 .../{ => score2}/test__input__patient_27.json | 0 .../{ => score2}/test__input__patient_28.json | 0 .../{ => score2}/test__input__patient_29.json | 0 .../{ => score2}/test__input__patient_30.json | 0 .../{ => score2}/test__input__patient_31.json | 0 .../{ => score2}/test__input__patient_32.json | 0 .../{ => score2}/test__input__patient_33.json | 0 .../{ => score2}/test__input__patient_34.json | 0 .../{ => score2}/test__input__patient_35.json | 0 .../{ => score2}/test__input__patient_36.json | 0 .../{ => phenoage}/test__raw__patient_01.json | 0 .../{ => phenoage}/test__raw__patient_02.json | 0 .../{ => phenoage}/test__raw__patient_03.json | 0 .../{ => phenoage}/test__raw__patient_04.json | 0 .../{ => phenoage}/test__raw__patient_05.json | 0 .../{ => phenoage}/test__raw__patient_06.json | 0 .../{ => phenoage}/test__raw__patient_07.json | 0 .../{ => phenoage}/test__raw__patient_08.json | 0 .../{ => phenoage}/test__raw__patient_09.json | 0 .../{ => phenoage}/test__raw__patient_10.json | 0 .../{ => phenoage}/test__raw__patient_11.json | 0 .../{ => phenoage}/test__raw__patient_12.json | 0 .../{ => phenoage}/test__raw__patient_13.json | 0 .../{ => phenoage}/test__raw__patient_14.json | 0 .../{ => phenoage}/test__raw__patient_15.json | 0 .../{ => phenoage}/test__raw__patient_16.json | 0 .../{ => phenoage}/test__raw__patient_17.json | 0 .../{ => phenoage}/test__raw__patient_18.json | 0 .../{ => phenoage}/test__raw__patient_19.json | 0 .../{ => phenoage}/test__raw__patient_20.json | 0 .../{ => phenoage}/test__raw__patient_21.json | 0 .../{ => phenoage}/test__raw__patient_22.json | 0 .../{ => phenoage}/test__raw__patient_23.json | 0 .../{ => phenoage}/test__raw__patient_24.json | 0 .../{ => score2}/test__raw__patient_25.json | 0 .../{ => score2}/test__raw__patient_26.json | 0 .../{ => score2}/test__raw__patient_27.json | 0 .../{ => score2}/test__raw__patient_28.json | 0 .../{ => score2}/test__raw__patient_29.json | 0 .../{ => score2}/test__raw__patient_30.json | 0 .../{ => score2}/test__raw__patient_31.json | 0 .../{ => score2}/test__raw__patient_32.json | 0 .../{ => score2}/test__raw__patient_33.json | 0 .../{ => score2}/test__raw__patient_34.json | 0 .../{ => score2}/test__raw__patient_35.json | 0 .../{ => score2}/test__raw__patient_36.json | 0 tests/test_io.py | 4 ++-- tests/test_phenoage.py | 2 +- tests/test_score2.py | 2 +- vitals/biomarkers/io.py | 20 +++++++++---------- 76 files changed, 14 insertions(+), 14 deletions(-) rename tests/inputs/{ => phenoage}/test__input__patient_01.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_02.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_03.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_04.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_05.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_06.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_07.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_08.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_09.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_10.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_11.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_12.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_13.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_14.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_15.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_16.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_17.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_18.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_19.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_20.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_21.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_22.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_23.json (100%) rename tests/inputs/{ => phenoage}/test__input__patient_24.json (100%) rename tests/inputs/{ => score2}/test__input__patient_25.json (100%) rename tests/inputs/{ => score2}/test__input__patient_26.json (100%) rename tests/inputs/{ => score2}/test__input__patient_27.json (100%) rename tests/inputs/{ => score2}/test__input__patient_28.json (100%) rename tests/inputs/{ => score2}/test__input__patient_29.json (100%) rename tests/inputs/{ => score2}/test__input__patient_30.json (100%) rename tests/inputs/{ => score2}/test__input__patient_31.json (100%) rename tests/inputs/{ => score2}/test__input__patient_32.json (100%) rename tests/inputs/{ => score2}/test__input__patient_33.json (100%) rename tests/inputs/{ => score2}/test__input__patient_34.json (100%) rename tests/inputs/{ => score2}/test__input__patient_35.json (100%) rename tests/inputs/{ => score2}/test__input__patient_36.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_01.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_02.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_03.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_04.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_05.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_06.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_07.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_08.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_09.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_10.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_11.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_12.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_13.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_14.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_15.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_16.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_17.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_18.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_19.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_20.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_21.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_22.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_23.json (100%) rename tests/raw/{ => phenoage}/test__raw__patient_24.json (100%) rename tests/raw/{ => score2}/test__raw__patient_25.json (100%) rename tests/raw/{ => score2}/test__raw__patient_26.json (100%) rename tests/raw/{ => score2}/test__raw__patient_27.json (100%) rename tests/raw/{ => score2}/test__raw__patient_28.json (100%) rename tests/raw/{ => score2}/test__raw__patient_29.json (100%) rename tests/raw/{ => score2}/test__raw__patient_30.json (100%) rename tests/raw/{ => score2}/test__raw__patient_31.json (100%) rename tests/raw/{ => score2}/test__raw__patient_32.json (100%) rename tests/raw/{ => score2}/test__raw__patient_33.json (100%) rename tests/raw/{ => score2}/test__raw__patient_34.json (100%) rename tests/raw/{ => score2}/test__raw__patient_35.json (100%) rename tests/raw/{ => score2}/test__raw__patient_36.json (100%) diff --git a/tests/inputs/test__input__patient_01.json b/tests/inputs/phenoage/test__input__patient_01.json similarity index 100% rename from tests/inputs/test__input__patient_01.json rename to tests/inputs/phenoage/test__input__patient_01.json diff --git a/tests/inputs/test__input__patient_02.json b/tests/inputs/phenoage/test__input__patient_02.json similarity index 100% rename from tests/inputs/test__input__patient_02.json rename to tests/inputs/phenoage/test__input__patient_02.json diff --git a/tests/inputs/test__input__patient_03.json b/tests/inputs/phenoage/test__input__patient_03.json similarity index 100% rename from tests/inputs/test__input__patient_03.json rename to tests/inputs/phenoage/test__input__patient_03.json diff --git a/tests/inputs/test__input__patient_04.json b/tests/inputs/phenoage/test__input__patient_04.json similarity index 100% rename from tests/inputs/test__input__patient_04.json rename to tests/inputs/phenoage/test__input__patient_04.json diff --git a/tests/inputs/test__input__patient_05.json b/tests/inputs/phenoage/test__input__patient_05.json similarity index 100% rename from tests/inputs/test__input__patient_05.json rename to tests/inputs/phenoage/test__input__patient_05.json diff --git a/tests/inputs/test__input__patient_06.json b/tests/inputs/phenoage/test__input__patient_06.json similarity index 100% rename from tests/inputs/test__input__patient_06.json rename to tests/inputs/phenoage/test__input__patient_06.json diff --git a/tests/inputs/test__input__patient_07.json b/tests/inputs/phenoage/test__input__patient_07.json similarity index 100% rename from tests/inputs/test__input__patient_07.json rename to tests/inputs/phenoage/test__input__patient_07.json diff --git a/tests/inputs/test__input__patient_08.json b/tests/inputs/phenoage/test__input__patient_08.json similarity index 100% rename from tests/inputs/test__input__patient_08.json rename to tests/inputs/phenoage/test__input__patient_08.json diff --git a/tests/inputs/test__input__patient_09.json b/tests/inputs/phenoage/test__input__patient_09.json similarity index 100% rename from tests/inputs/test__input__patient_09.json rename to tests/inputs/phenoage/test__input__patient_09.json diff --git a/tests/inputs/test__input__patient_10.json b/tests/inputs/phenoage/test__input__patient_10.json similarity index 100% rename from tests/inputs/test__input__patient_10.json rename to tests/inputs/phenoage/test__input__patient_10.json diff --git a/tests/inputs/test__input__patient_11.json b/tests/inputs/phenoage/test__input__patient_11.json similarity index 100% rename from tests/inputs/test__input__patient_11.json rename to tests/inputs/phenoage/test__input__patient_11.json diff --git a/tests/inputs/test__input__patient_12.json b/tests/inputs/phenoage/test__input__patient_12.json similarity index 100% rename from tests/inputs/test__input__patient_12.json rename to tests/inputs/phenoage/test__input__patient_12.json diff --git a/tests/inputs/test__input__patient_13.json b/tests/inputs/phenoage/test__input__patient_13.json similarity index 100% rename from tests/inputs/test__input__patient_13.json rename to tests/inputs/phenoage/test__input__patient_13.json diff --git a/tests/inputs/test__input__patient_14.json b/tests/inputs/phenoage/test__input__patient_14.json similarity index 100% rename from tests/inputs/test__input__patient_14.json rename to tests/inputs/phenoage/test__input__patient_14.json diff --git a/tests/inputs/test__input__patient_15.json b/tests/inputs/phenoage/test__input__patient_15.json similarity index 100% rename from tests/inputs/test__input__patient_15.json rename to tests/inputs/phenoage/test__input__patient_15.json diff --git a/tests/inputs/test__input__patient_16.json b/tests/inputs/phenoage/test__input__patient_16.json similarity index 100% rename from tests/inputs/test__input__patient_16.json rename to tests/inputs/phenoage/test__input__patient_16.json diff --git a/tests/inputs/test__input__patient_17.json b/tests/inputs/phenoage/test__input__patient_17.json similarity index 100% rename from tests/inputs/test__input__patient_17.json rename to tests/inputs/phenoage/test__input__patient_17.json diff --git a/tests/inputs/test__input__patient_18.json b/tests/inputs/phenoage/test__input__patient_18.json similarity index 100% rename from tests/inputs/test__input__patient_18.json rename to tests/inputs/phenoage/test__input__patient_18.json diff --git a/tests/inputs/test__input__patient_19.json b/tests/inputs/phenoage/test__input__patient_19.json similarity index 100% rename from tests/inputs/test__input__patient_19.json rename to tests/inputs/phenoage/test__input__patient_19.json diff --git a/tests/inputs/test__input__patient_20.json b/tests/inputs/phenoage/test__input__patient_20.json similarity index 100% rename from tests/inputs/test__input__patient_20.json rename to tests/inputs/phenoage/test__input__patient_20.json diff --git a/tests/inputs/test__input__patient_21.json b/tests/inputs/phenoage/test__input__patient_21.json similarity index 100% rename from tests/inputs/test__input__patient_21.json rename to tests/inputs/phenoage/test__input__patient_21.json diff --git a/tests/inputs/test__input__patient_22.json b/tests/inputs/phenoage/test__input__patient_22.json similarity index 100% rename from tests/inputs/test__input__patient_22.json rename to tests/inputs/phenoage/test__input__patient_22.json diff --git a/tests/inputs/test__input__patient_23.json b/tests/inputs/phenoage/test__input__patient_23.json similarity index 100% rename from tests/inputs/test__input__patient_23.json rename to tests/inputs/phenoage/test__input__patient_23.json diff --git a/tests/inputs/test__input__patient_24.json b/tests/inputs/phenoage/test__input__patient_24.json similarity index 100% rename from tests/inputs/test__input__patient_24.json rename to tests/inputs/phenoage/test__input__patient_24.json diff --git a/tests/inputs/test__input__patient_25.json b/tests/inputs/score2/test__input__patient_25.json similarity index 100% rename from tests/inputs/test__input__patient_25.json rename to tests/inputs/score2/test__input__patient_25.json diff --git a/tests/inputs/test__input__patient_26.json b/tests/inputs/score2/test__input__patient_26.json similarity index 100% rename from tests/inputs/test__input__patient_26.json rename to tests/inputs/score2/test__input__patient_26.json diff --git a/tests/inputs/test__input__patient_27.json b/tests/inputs/score2/test__input__patient_27.json similarity index 100% rename from tests/inputs/test__input__patient_27.json rename to tests/inputs/score2/test__input__patient_27.json diff --git a/tests/inputs/test__input__patient_28.json b/tests/inputs/score2/test__input__patient_28.json similarity index 100% rename from tests/inputs/test__input__patient_28.json rename to tests/inputs/score2/test__input__patient_28.json diff --git a/tests/inputs/test__input__patient_29.json b/tests/inputs/score2/test__input__patient_29.json similarity index 100% rename from tests/inputs/test__input__patient_29.json rename to tests/inputs/score2/test__input__patient_29.json diff --git a/tests/inputs/test__input__patient_30.json b/tests/inputs/score2/test__input__patient_30.json similarity index 100% rename from tests/inputs/test__input__patient_30.json rename to tests/inputs/score2/test__input__patient_30.json diff --git a/tests/inputs/test__input__patient_31.json b/tests/inputs/score2/test__input__patient_31.json similarity index 100% rename from tests/inputs/test__input__patient_31.json rename to tests/inputs/score2/test__input__patient_31.json diff --git a/tests/inputs/test__input__patient_32.json b/tests/inputs/score2/test__input__patient_32.json similarity index 100% rename from tests/inputs/test__input__patient_32.json rename to tests/inputs/score2/test__input__patient_32.json diff --git a/tests/inputs/test__input__patient_33.json b/tests/inputs/score2/test__input__patient_33.json similarity index 100% rename from tests/inputs/test__input__patient_33.json rename to tests/inputs/score2/test__input__patient_33.json diff --git a/tests/inputs/test__input__patient_34.json b/tests/inputs/score2/test__input__patient_34.json similarity index 100% rename from tests/inputs/test__input__patient_34.json rename to tests/inputs/score2/test__input__patient_34.json diff --git a/tests/inputs/test__input__patient_35.json b/tests/inputs/score2/test__input__patient_35.json similarity index 100% rename from tests/inputs/test__input__patient_35.json rename to tests/inputs/score2/test__input__patient_35.json diff --git a/tests/inputs/test__input__patient_36.json b/tests/inputs/score2/test__input__patient_36.json similarity index 100% rename from tests/inputs/test__input__patient_36.json rename to tests/inputs/score2/test__input__patient_36.json diff --git a/tests/raw/test__raw__patient_01.json b/tests/raw/phenoage/test__raw__patient_01.json similarity index 100% rename from tests/raw/test__raw__patient_01.json rename to tests/raw/phenoage/test__raw__patient_01.json diff --git a/tests/raw/test__raw__patient_02.json b/tests/raw/phenoage/test__raw__patient_02.json similarity index 100% rename from tests/raw/test__raw__patient_02.json rename to tests/raw/phenoage/test__raw__patient_02.json diff --git a/tests/raw/test__raw__patient_03.json b/tests/raw/phenoage/test__raw__patient_03.json similarity index 100% rename from tests/raw/test__raw__patient_03.json rename to tests/raw/phenoage/test__raw__patient_03.json diff --git a/tests/raw/test__raw__patient_04.json b/tests/raw/phenoage/test__raw__patient_04.json similarity index 100% rename from tests/raw/test__raw__patient_04.json rename to tests/raw/phenoage/test__raw__patient_04.json diff --git a/tests/raw/test__raw__patient_05.json b/tests/raw/phenoage/test__raw__patient_05.json similarity index 100% rename from tests/raw/test__raw__patient_05.json rename to tests/raw/phenoage/test__raw__patient_05.json diff --git a/tests/raw/test__raw__patient_06.json b/tests/raw/phenoage/test__raw__patient_06.json similarity index 100% rename from tests/raw/test__raw__patient_06.json rename to tests/raw/phenoage/test__raw__patient_06.json diff --git a/tests/raw/test__raw__patient_07.json b/tests/raw/phenoage/test__raw__patient_07.json similarity index 100% rename from tests/raw/test__raw__patient_07.json rename to tests/raw/phenoage/test__raw__patient_07.json diff --git a/tests/raw/test__raw__patient_08.json b/tests/raw/phenoage/test__raw__patient_08.json similarity index 100% rename from tests/raw/test__raw__patient_08.json rename to tests/raw/phenoage/test__raw__patient_08.json diff --git a/tests/raw/test__raw__patient_09.json b/tests/raw/phenoage/test__raw__patient_09.json similarity index 100% rename from tests/raw/test__raw__patient_09.json rename to tests/raw/phenoage/test__raw__patient_09.json diff --git a/tests/raw/test__raw__patient_10.json b/tests/raw/phenoage/test__raw__patient_10.json similarity index 100% rename from tests/raw/test__raw__patient_10.json rename to tests/raw/phenoage/test__raw__patient_10.json diff --git a/tests/raw/test__raw__patient_11.json b/tests/raw/phenoage/test__raw__patient_11.json similarity index 100% rename from tests/raw/test__raw__patient_11.json rename to tests/raw/phenoage/test__raw__patient_11.json diff --git a/tests/raw/test__raw__patient_12.json b/tests/raw/phenoage/test__raw__patient_12.json similarity index 100% rename from tests/raw/test__raw__patient_12.json rename to tests/raw/phenoage/test__raw__patient_12.json diff --git a/tests/raw/test__raw__patient_13.json b/tests/raw/phenoage/test__raw__patient_13.json similarity index 100% rename from tests/raw/test__raw__patient_13.json rename to tests/raw/phenoage/test__raw__patient_13.json diff --git a/tests/raw/test__raw__patient_14.json b/tests/raw/phenoage/test__raw__patient_14.json similarity index 100% rename from tests/raw/test__raw__patient_14.json rename to tests/raw/phenoage/test__raw__patient_14.json diff --git a/tests/raw/test__raw__patient_15.json b/tests/raw/phenoage/test__raw__patient_15.json similarity index 100% rename from tests/raw/test__raw__patient_15.json rename to tests/raw/phenoage/test__raw__patient_15.json diff --git a/tests/raw/test__raw__patient_16.json b/tests/raw/phenoage/test__raw__patient_16.json similarity index 100% rename from tests/raw/test__raw__patient_16.json rename to tests/raw/phenoage/test__raw__patient_16.json diff --git a/tests/raw/test__raw__patient_17.json b/tests/raw/phenoage/test__raw__patient_17.json similarity index 100% rename from tests/raw/test__raw__patient_17.json rename to tests/raw/phenoage/test__raw__patient_17.json diff --git a/tests/raw/test__raw__patient_18.json b/tests/raw/phenoage/test__raw__patient_18.json similarity index 100% rename from tests/raw/test__raw__patient_18.json rename to tests/raw/phenoage/test__raw__patient_18.json diff --git a/tests/raw/test__raw__patient_19.json b/tests/raw/phenoage/test__raw__patient_19.json similarity index 100% rename from tests/raw/test__raw__patient_19.json rename to tests/raw/phenoage/test__raw__patient_19.json diff --git a/tests/raw/test__raw__patient_20.json b/tests/raw/phenoage/test__raw__patient_20.json similarity index 100% rename from tests/raw/test__raw__patient_20.json rename to tests/raw/phenoage/test__raw__patient_20.json diff --git a/tests/raw/test__raw__patient_21.json b/tests/raw/phenoage/test__raw__patient_21.json similarity index 100% rename from tests/raw/test__raw__patient_21.json rename to tests/raw/phenoage/test__raw__patient_21.json diff --git a/tests/raw/test__raw__patient_22.json b/tests/raw/phenoage/test__raw__patient_22.json similarity index 100% rename from tests/raw/test__raw__patient_22.json rename to tests/raw/phenoage/test__raw__patient_22.json diff --git a/tests/raw/test__raw__patient_23.json b/tests/raw/phenoage/test__raw__patient_23.json similarity index 100% rename from tests/raw/test__raw__patient_23.json rename to tests/raw/phenoage/test__raw__patient_23.json diff --git a/tests/raw/test__raw__patient_24.json b/tests/raw/phenoage/test__raw__patient_24.json similarity index 100% rename from tests/raw/test__raw__patient_24.json rename to tests/raw/phenoage/test__raw__patient_24.json diff --git a/tests/raw/test__raw__patient_25.json b/tests/raw/score2/test__raw__patient_25.json similarity index 100% rename from tests/raw/test__raw__patient_25.json rename to tests/raw/score2/test__raw__patient_25.json diff --git a/tests/raw/test__raw__patient_26.json b/tests/raw/score2/test__raw__patient_26.json similarity index 100% rename from tests/raw/test__raw__patient_26.json rename to tests/raw/score2/test__raw__patient_26.json diff --git a/tests/raw/test__raw__patient_27.json b/tests/raw/score2/test__raw__patient_27.json similarity index 100% rename from tests/raw/test__raw__patient_27.json rename to tests/raw/score2/test__raw__patient_27.json diff --git a/tests/raw/test__raw__patient_28.json b/tests/raw/score2/test__raw__patient_28.json similarity index 100% rename from tests/raw/test__raw__patient_28.json rename to tests/raw/score2/test__raw__patient_28.json diff --git a/tests/raw/test__raw__patient_29.json b/tests/raw/score2/test__raw__patient_29.json similarity index 100% rename from tests/raw/test__raw__patient_29.json rename to tests/raw/score2/test__raw__patient_29.json diff --git a/tests/raw/test__raw__patient_30.json b/tests/raw/score2/test__raw__patient_30.json similarity index 100% rename from tests/raw/test__raw__patient_30.json rename to tests/raw/score2/test__raw__patient_30.json diff --git a/tests/raw/test__raw__patient_31.json b/tests/raw/score2/test__raw__patient_31.json similarity index 100% rename from tests/raw/test__raw__patient_31.json rename to tests/raw/score2/test__raw__patient_31.json diff --git a/tests/raw/test__raw__patient_32.json b/tests/raw/score2/test__raw__patient_32.json similarity index 100% rename from tests/raw/test__raw__patient_32.json rename to tests/raw/score2/test__raw__patient_32.json diff --git a/tests/raw/test__raw__patient_33.json b/tests/raw/score2/test__raw__patient_33.json similarity index 100% rename from tests/raw/test__raw__patient_33.json rename to tests/raw/score2/test__raw__patient_33.json diff --git a/tests/raw/test__raw__patient_34.json b/tests/raw/score2/test__raw__patient_34.json similarity index 100% rename from tests/raw/test__raw__patient_34.json rename to tests/raw/score2/test__raw__patient_34.json diff --git a/tests/raw/test__raw__patient_35.json b/tests/raw/score2/test__raw__patient_35.json similarity index 100% rename from tests/raw/test__raw__patient_35.json rename to tests/raw/score2/test__raw__patient_35.json diff --git a/tests/raw/test__raw__patient_36.json b/tests/raw/score2/test__raw__patient_36.json similarity index 100% rename from tests/raw/test__raw__patient_36.json rename to tests/raw/score2/test__raw__patient_36.json diff --git a/tests/test_io.py b/tests/test_io.py index d22e5f0..6f42c92 100755 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -5,8 +5,8 @@ from vitals.biomarkers import io -INP_FILEPATH = Path(__file__).parent / "raw" -OUT_FILEPATH = Path(__file__).parent / "inputs" +INP_FILEPATH = Path(__file__).parent / "raw" / "phenoage" +OUT_FILEPATH = Path(__file__).parent / "inputs" / "phenoage" @pytest.mark.parametrize( diff --git a/tests/test_phenoage.py b/tests/test_phenoage.py index d23d8ba..3da32da 100755 --- a/tests/test_phenoage.py +++ b/tests/test_phenoage.py @@ -4,7 +4,7 @@ from vitals.phenoage import compute -OUT_FILEPATH = Path(__file__).parent / "inputs" +OUT_FILEPATH = Path(__file__).parent / "inputs" / "phenoage" @pytest.mark.parametrize( diff --git a/tests/test_score2.py b/tests/test_score2.py index c1e3968..1f651c1 100644 --- a/tests/test_score2.py +++ b/tests/test_score2.py @@ -4,7 +4,7 @@ from vitals.score2 import compute -OUT_FILEPATH = Path(__file__).parent / "inputs" +OUT_FILEPATH = Path(__file__).parent / "inputs" / "score2" @pytest.mark.parametrize( diff --git a/vitals/biomarkers/io.py b/vitals/biomarkers/io.py index e0d4946..f1b3ff2 100755 --- a/vitals/biomarkers/io.py +++ b/vitals/biomarkers/io.py @@ -40,16 +40,16 @@ def write(data: dict, output_file: Path) -> None: print(f"Processed: file written at {output_file.name}") -if __name__ == "__main__": - # Process all JSON files in the input directory - input_dir = Path("tests/raw") - output_dir = Path("tests/inputs") +# if __name__ == "__main__": +# # Process all JSON files in the input directory +# input_dir = Path("tests/raw") +# output_dir = Path("tests/inputs") - for input_file in input_dir.glob("*.json"): - output_file = output_dir / input_file.name.replace("raw", "input") +# for input_file in input_dir.glob("*.json"): +# output_file = output_dir / input_file.name.replace("raw", "input") - # Update biomarker data - data = update(input_file) +# # Update biomarker data +# data = update(input_file) - # Write output file - write(data, output_file) +# # Write output file +# write(data, output_file) From e77d6bc57926faf12043aeb6095a890b241d70fd Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 13:56:03 +0200 Subject: [PATCH 11/15] refactor: add comprehensive hints issue #8 --- vitals/biomarkers/helpers.py | 15 +++++----- vitals/biomarkers/io.py | 5 ++-- vitals/phenoage/compute.py | 4 ++- vitals/score2/compute.py | 55 ++++++++++++++++++++---------------- 4 files changed, 44 insertions(+), 35 deletions(-) diff --git a/vitals/biomarkers/helpers.py b/vitals/biomarkers/helpers.py index 6c0fd9c..3580e07 100755 --- a/vitals/biomarkers/helpers.py +++ b/vitals/biomarkers/helpers.py @@ -1,4 +1,5 @@ -from typing import TypeVar +from pathlib import Path +from typing import Any, Callable, TypeVar from pydantic import BaseModel @@ -25,7 +26,7 @@ def format_unit_suffix(unit: str) -> str: return suffix -def update_biomarker_names(biomarkers: dict) -> dict: +def update_biomarker_names(biomarkers: dict[str, Any]) -> dict[str, Any]: """Update biomarker names to include unit suffixes. Args: @@ -49,7 +50,7 @@ def update_biomarker_names(biomarkers: dict) -> dict: def find_biomarker_value( - raw_biomarkers: dict, biomarker_name: str, expected_unit: str + raw_biomarkers: dict[str, Any], biomarker_name: str, expected_unit: str ) -> float | None: """ Find biomarker value by name prefix and expected unit. @@ -71,7 +72,7 @@ def find_biomarker_value( return None -def add_converted_biomarkers(biomarkers: dict) -> dict: +def add_converted_biomarkers(biomarkers: dict[str, Any]) -> dict[str, Any]: """Add converted biomarker entries for glucose, creatinine, albumin, and CRP. Args: @@ -84,7 +85,7 @@ def add_converted_biomarkers(biomarkers: dict) -> dict: result = biomarkers.copy() # Conversion mappings - conversions = { + conversions: dict[str, dict[str, str | Callable[[float], float]]] = { "glucose_mg_dl": { "target_name": "glucose_mmol_l", "target_unit": "mmol/L", @@ -136,7 +137,7 @@ def add_converted_biomarkers(biomarkers: dict) -> dict: # Skip if target already exists if target_name not in result: converted_value = conversion_info["conversion"](source_value) # type: ignore - result[target_name] = { + result[target_name] = { # type: ignore "value": round(converted_value, 4), "unit": conversion_info["target_unit"], } @@ -145,7 +146,7 @@ def add_converted_biomarkers(biomarkers: dict) -> dict: def extract_biomarkers_from_json( - filepath: str, + filepath: str | Path, biomarker_class: type[Biomarkers], biomarker_units: Units, ) -> Biomarkers: diff --git a/vitals/biomarkers/io.py b/vitals/biomarkers/io.py index f1b3ff2..8a22037 100755 --- a/vitals/biomarkers/io.py +++ b/vitals/biomarkers/io.py @@ -1,10 +1,11 @@ import json from pathlib import Path +from typing import Any from vitals.biomarkers import helpers -def update(input_file: Path) -> dict: +def update(input_file: Path) -> dict[str, Any]: """Process a single JSON file and create output file with converted biomarkers. Args: @@ -26,7 +27,7 @@ def update(input_file: Path) -> dict: return data -def write(data: dict, output_file: Path) -> None: +def write(data: dict[str, Any], output_file: Path) -> None: """Write biomarker data to a JSON file. Args: diff --git a/vitals/phenoage/compute.py b/vitals/phenoage/compute.py index 5397876..faf597d 100755 --- a/vitals/phenoage/compute.py +++ b/vitals/phenoage/compute.py @@ -1,3 +1,5 @@ +from pathlib import Path + import numpy as np from pydantic import BaseModel @@ -42,7 +44,7 @@ def __gompertz_mortality_model(weighted_risk_score: float) -> float: ) -def biological_age(filepath: str) -> tuple[float, float, float]: +def biological_age(filepath: str | Path) -> tuple[float, float, float]: """ The Phenoage score is calculated as a weighted (coefficients available in Levine et al 2018) linear combination of these variables, which was then transformed into units of years using 2 parametric diff --git a/vitals/score2/compute.py b/vitals/score2/compute.py index bc963aa..b78d8e0 100644 --- a/vitals/score2/compute.py +++ b/vitals/score2/compute.py @@ -5,11 +5,16 @@ in apparently healthy individuals aged 40-69 years in Europe. """ +from pathlib import Path +from typing import Literal, TypeAlias + import numpy as np from pydantic import BaseModel from vitals.biomarkers import helpers, schemas +RiskCategory: TypeAlias = Literal["Low to moderate", "High", "Very high"] + class ModelCoefficients(BaseModel): """ @@ -75,7 +80,7 @@ class CalibrationScales(BaseModel): female_scale2: float = 0.7019 -def cardiovascular_risk(filepath: str) -> tuple[float, float, str]: +def cardiovascular_risk(filepath: str | Path) -> tuple[float, float, RiskCategory]: """ Calculate the 10-year cardiovascular disease risk using the SCORE2 algorithm. @@ -106,28 +111,28 @@ def cardiovascular_risk(filepath: str) -> tuple[float, float, str]: if not isinstance(biomarkers, schemas.Score2Markers): raise ValueError(f"Invalid biomarker class used: {biomarkers}") - age = biomarkers.age - is_male = biomarkers.is_male # True for male, False for female + age: float = biomarkers.age + is_male: bool = biomarkers.is_male # True for male, False for female # Apply transformations to biomarkers - cage = (age - 60) / 5 - smoking = float(biomarkers.smoking) # Convert bool to float (1.0 or 0.0) - csbp = (biomarkers.systolic_blood_pressure - 120) / 20 - ctchol = biomarkers.total_cholesterol - 6 - chdl = (biomarkers.hdl_cholesterol - 1.3) / 0.5 + cage: float = (age - 60) / 5 + smoking: float = float(biomarkers.smoking) # Convert bool to float (1.0 or 0.0) + csbp: float = (biomarkers.systolic_blood_pressure - 120) / 20 + ctchol: float = biomarkers.total_cholesterol - 6 + chdl: float = (biomarkers.hdl_cholesterol - 1.3) / 0.5 # Calculate interaction terms - smoking_age = smoking * cage - sbp_age = csbp * cage - tchol_age = ctchol * cage - hdl_age = chdl * cage + smoking_age: float = smoking * cage + sbp_age: float = csbp * cage + tchol_age: float = ctchol * cage + hdl_age: float = chdl * cage # Get model coefficients - coef = ModelCoefficients() + coef: ModelCoefficients = ModelCoefficients() # Calculate linear predictor (x) based on sex if is_male: - x = ( + x: float = ( coef.male_age * cage + coef.male_smoking * smoking + coef.male_sbp * csbp + @@ -138,11 +143,11 @@ def cardiovascular_risk(filepath: str) -> tuple[float, float, str]: coef.male_tchol_age * tchol_age + coef.male_hdl_age * hdl_age ) - baseline_survival = BaselineSurvival().male - scale1 = CalibrationScales().male_scale1 - scale2 = CalibrationScales().male_scale2 + baseline_survival: float = BaselineSurvival().male + scale1: float = CalibrationScales().male_scale1 + scale2: float = CalibrationScales().male_scale2 else: - x = ( + x: float = ( coef.female_age * cage + coef.female_smoking * smoking + coef.female_sbp * csbp + @@ -153,28 +158,28 @@ def cardiovascular_risk(filepath: str) -> tuple[float, float, str]: coef.female_tchol_age * tchol_age + coef.female_hdl_age * hdl_age ) - baseline_survival = BaselineSurvival().female - scale1 = CalibrationScales().female_scale1 - scale2 = CalibrationScales().female_scale2 + baseline_survival: float = BaselineSurvival().female + scale1: float = CalibrationScales().female_scale1 + scale2: float = CalibrationScales().female_scale2 # Calculate uncalibrated risk - uncalibrated_risk = 1 - np.power(baseline_survival, np.exp(x)) + uncalibrated_risk: float = 1 - np.power(baseline_survival, np.exp(x)) # Apply calibration for Belgium (Low Risk region) # Calibrated 10-year risk, % = [1 - exp(-exp(scale1 + scale2*ln(-ln(1 - 10-year risk))))] * 100 - calibrated_risk = float((1 - np.exp(-np.exp(scale1 + scale2 * np.log(-np.log(1 - uncalibrated_risk))))) * 100) + calibrated_risk: float = float((1 - np.exp(-np.exp(scale1 + scale2 * np.log(-np.log(1 - uncalibrated_risk))))) * 100) # Determine risk category based on age if age < 50: if calibrated_risk < 2.5: - risk_category = "Low to moderate" + risk_category: RiskCategory = "Low to moderate" elif calibrated_risk < 7.5: risk_category = "High" else: risk_category = "Very high" else: # age 50-69 if calibrated_risk < 5: - risk_category = "Low to moderate" + risk_category: RiskCategory = "Low to moderate" elif calibrated_risk < 10: risk_category = "High" else: From 2f44ba3ff015b20dd51dc18b7f09a81b9bc5c15e Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 14:28:29 +0200 Subject: [PATCH 12/15] Fix type hint issues with TypedDict approach - Replace type ignore comments in helpers.py with proper TypedDict - Add specific return type for io.py update function - Remove type: ignore comments by using ConversionInfo TypedDict - Improve type safety and code clarity Co-authored-by: Braza Faouzi --- vitals/biomarkers/helpers.py | 15 +++++++++++---- vitals/biomarkers/io.py | 9 +++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/vitals/biomarkers/helpers.py b/vitals/biomarkers/helpers.py index 3580e07..d0dc78a 100755 --- a/vitals/biomarkers/helpers.py +++ b/vitals/biomarkers/helpers.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import Any, Callable, TypeVar +from typing import Any, Callable, TypeVar, TypedDict from pydantic import BaseModel @@ -9,6 +9,13 @@ Units = schemas.PhenoageUnits | schemas.Score2Units +class ConversionInfo(TypedDict): + """Type definition for biomarker conversion information.""" + target_name: str + target_unit: str + conversion: Callable[[float], float] + + def format_unit_suffix(unit: str) -> str: """Convert unit string to a valid suffix format. @@ -85,7 +92,7 @@ def add_converted_biomarkers(biomarkers: dict[str, Any]) -> dict[str, Any]: result = biomarkers.copy() # Conversion mappings - conversions: dict[str, dict[str, str | Callable[[float], float]]] = { + conversions: dict[str, ConversionInfo] = { "glucose_mg_dl": { "target_name": "glucose_mmol_l", "target_unit": "mmol/L", @@ -136,8 +143,8 @@ def add_converted_biomarkers(biomarkers: dict[str, Any]) -> dict[str, Any]: # Skip if target already exists if target_name not in result: - converted_value = conversion_info["conversion"](source_value) # type: ignore - result[target_name] = { # type: ignore + converted_value = conversion_info["conversion"](source_value) + result[target_name] = { "value": round(converted_value, 4), "unit": conversion_info["target_unit"], } diff --git a/vitals/biomarkers/io.py b/vitals/biomarkers/io.py index 8a22037..77196fe 100755 --- a/vitals/biomarkers/io.py +++ b/vitals/biomarkers/io.py @@ -1,11 +1,16 @@ import json from pathlib import Path -from typing import Any +from typing import Any, TypedDict from vitals.biomarkers import helpers -def update(input_file: Path) -> dict[str, Any]: +class BiomarkerData(TypedDict, total=False): + """Type definition for processed biomarker data structure.""" + raw_biomarkers: dict[str, Any] + + +def update(input_file: Path) -> BiomarkerData: """Process a single JSON file and create output file with converted biomarkers. Args: From 415ff8af90f45e042c81443eb13f55f7b772e1d7 Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 14:37:27 +0200 Subject: [PATCH 13/15] refactor: remove total=False for the BiomarkerData as cannot be None --- vitals/biomarkers/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vitals/biomarkers/io.py b/vitals/biomarkers/io.py index 77196fe..6f61ec4 100755 --- a/vitals/biomarkers/io.py +++ b/vitals/biomarkers/io.py @@ -5,7 +5,7 @@ from vitals.biomarkers import helpers -class BiomarkerData(TypedDict, total=False): +class BiomarkerData(TypedDict): """Type definition for processed biomarker data structure.""" raw_biomarkers: dict[str, Any] From 4b0fddad35f591fef6a72ecdfa359bd0ce34824c Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 14:46:54 +0200 Subject: [PATCH 14/15] fix: type hint. We are overengineering it --- vitals/biomarkers/io.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/vitals/biomarkers/io.py b/vitals/biomarkers/io.py index 6f61ec4..8a22037 100755 --- a/vitals/biomarkers/io.py +++ b/vitals/biomarkers/io.py @@ -1,16 +1,11 @@ import json from pathlib import Path -from typing import Any, TypedDict +from typing import Any from vitals.biomarkers import helpers -class BiomarkerData(TypedDict): - """Type definition for processed biomarker data structure.""" - raw_biomarkers: dict[str, Any] - - -def update(input_file: Path) -> BiomarkerData: +def update(input_file: Path) -> dict[str, Any]: """Process a single JSON file and create output file with converted biomarkers. Args: From 7b888e1f1e293608dd2125ef566de317ce435f84 Mon Sep 17 00:00:00 2001 From: fbraza Date: Sat, 19 Jul 2025 14:58:34 +0200 Subject: [PATCH 15/15] fix: mypy error --- .github/workflows/claude-code-review.yml | 19 +++-- specs/coding_style.md | 2 +- .../score2/test__input__patient_25.json | 62 ++++++++-------- .../score2/test__input__patient_26.json | 62 ++++++++-------- .../score2/test__input__patient_27.json | 64 ++++++++--------- .../score2/test__input__patient_28.json | 64 ++++++++--------- .../score2/test__input__patient_29.json | 64 ++++++++--------- .../score2/test__input__patient_30.json | 64 ++++++++--------- .../score2/test__input__patient_31.json | 64 ++++++++--------- .../score2/test__input__patient_32.json | 64 ++++++++--------- .../score2/test__input__patient_33.json | 64 ++++++++--------- .../score2/test__input__patient_34.json | 64 ++++++++--------- .../score2/test__input__patient_35.json | 64 ++++++++--------- .../score2/test__input__patient_36.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_25.json | 62 ++++++++-------- tests/raw/score2/test__raw__patient_26.json | 62 ++++++++-------- tests/raw/score2/test__raw__patient_27.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_28.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_29.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_30.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_31.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_32.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_33.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_34.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_35.json | 64 ++++++++--------- tests/raw/score2/test__raw__patient_36.json | 64 ++++++++--------- tests/test_score2.py | 4 +- vitals/biomarkers/helpers.py | 4 +- vitals/score2/compute.py | 70 +++++++++++-------- 29 files changed, 820 insertions(+), 807 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 5bf8ce5..2c3a718 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -17,14 +17,14 @@ jobs: # github.event.pull_request.user.login == 'external-contributor' || # github.event.pull_request.user.login == 'new-developer' || # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' - + runs-on: ubuntu-latest permissions: contents: read pull-requests: read issues: read id-token: write - + steps: - name: Checkout repository uses: actions/checkout@v4 @@ -39,7 +39,7 @@ jobs: # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4) # model: "claude-opus-4-20250514" - + # Direct prompt for automated review (no @claude mention needed) direct_prompt: | Please review this pull request and provide feedback on: @@ -48,12 +48,12 @@ jobs: - Performance considerations - Security concerns - Test coverage - + Be constructive and helpful in your feedback. # Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR # use_sticky_comment: true - + # Optional: Customize review based on file types # direct_prompt: | # Review this PR focusing on: @@ -61,18 +61,17 @@ jobs: # - For API endpoints: Security, input validation, and error handling # - For React components: Performance, accessibility, and best practices # - For tests: Coverage, edge cases, and test quality - + # Optional: Different prompts for different authors # direct_prompt: | - # ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' && + # ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' && # 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' || # 'Please provide a thorough code review focusing on our coding standards and best practices.' }} - + # Optional: Add specific tools for running tests or linting # allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)" - + # Optional: Skip review for certain conditions # if: | # !contains(github.event.pull_request.title, '[skip-review]') && # !contains(github.event.pull_request.title, '[WIP]') - diff --git a/specs/coding_style.md b/specs/coding_style.md index 8f32533..70dec02 100644 --- a/specs/coding_style.md +++ b/specs/coding_style.md @@ -109,4 +109,4 @@ When faced with coding choices, ask: 5. **Does this follow our established conventions?** 6. **Is this optimized for readability?** -The answer to all these questions should be "yes" for beautiful Python code. \ No newline at end of file +The answer to all these questions should be "yes" for beautiful Python code. diff --git a/tests/inputs/score2/test__input__patient_25.json b/tests/inputs/score2/test__input__patient_25.json index 83f68ad..c14c61d 100755 --- a/tests/inputs/score2/test__input__patient_25.json +++ b/tests/inputs/score2/test__input__patient_25.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P024-2024-024", - "sex": "female", - "timestamp": "2024-07-04T13:45:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 50, - "unit": "years" + "metadata": { + "patient_id": "P024-2024-024", + "sex": "female", + "timestamp": "2024-07-04T13:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 140, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 6.3, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.4, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 50, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 140, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.3, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } } - } } diff --git a/tests/inputs/score2/test__input__patient_26.json b/tests/inputs/score2/test__input__patient_26.json index ba11b32..47ca4c5 100755 --- a/tests/inputs/score2/test__input__patient_26.json +++ b/tests/inputs/score2/test__input__patient_26.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P024-2024-024", - "sex": "male", - "timestamp": "2024-07-04T13:45:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 50, - "unit": "years" + "metadata": { + "patient_id": "P024-2024-024", + "sex": "male", + "timestamp": "2024-07-04T13:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 140, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 6.3, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.4, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 50, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 140, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.3, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } } - } } diff --git a/tests/inputs/score2/test__input__patient_27.json b/tests/inputs/score2/test__input__patient_27.json index 96b5a37..23b76ea 100644 --- a/tests/inputs/score2/test__input__patient_27.json +++ b/tests/inputs/score2/test__input__patient_27.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P027-2024-027", - "sex": "female", - "timestamp": "2024-07-04T14:00:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 55, - "unit": "years" + "metadata": { + "patient_id": "P027-2024-027", + "sex": "female", + "timestamp": "2024-07-04T14:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 125, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 5.2, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.6, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 55, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 125, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 5.2, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.6, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_28.json b/tests/inputs/score2/test__input__patient_28.json index 62b9906..ef74275 100644 --- a/tests/inputs/score2/test__input__patient_28.json +++ b/tests/inputs/score2/test__input__patient_28.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P028-2024-028", - "sex": "male", - "timestamp": "2024-07-04T14:15:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 45, - "unit": "years" + "metadata": { + "patient_id": "P028-2024-028", + "sex": "male", + "timestamp": "2024-07-04T14:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 130, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 5.8, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.3, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 45, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 130, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 5.8, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.3, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_29.json b/tests/inputs/score2/test__input__patient_29.json index d439a63..3b072bc 100644 --- a/tests/inputs/score2/test__input__patient_29.json +++ b/tests/inputs/score2/test__input__patient_29.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P029-2024-029", - "sex": "male", - "timestamp": "2024-07-04T14:30:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 40, - "unit": "years" + "metadata": { + "patient_id": "P029-2024-029", + "sex": "male", + "timestamp": "2024-07-04T14:30:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 135, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 6.0, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.2, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 40, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 135, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.0, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.2, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_30.json b/tests/inputs/score2/test__input__patient_30.json index 77bfb0b..d0d551a 100644 --- a/tests/inputs/score2/test__input__patient_30.json +++ b/tests/inputs/score2/test__input__patient_30.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P030-2024-030", - "sex": "female", - "timestamp": "2024-07-04T14:45:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 60, - "unit": "years" + "metadata": { + "patient_id": "P030-2024-030", + "sex": "female", + "timestamp": "2024-07-04T14:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 145, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 6.5, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.5, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 60, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 145, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.5, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.5, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_31.json b/tests/inputs/score2/test__input__patient_31.json index 66d115b..cce3e57 100644 --- a/tests/inputs/score2/test__input__patient_31.json +++ b/tests/inputs/score2/test__input__patient_31.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P031-2024-031", - "sex": "male", - "timestamp": "2024-07-04T15:00:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 65, - "unit": "years" + "metadata": { + "patient_id": "P031-2024-031", + "sex": "male", + "timestamp": "2024-07-04T15:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 150, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 7.0, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.1, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 65, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 150, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 7.0, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.1, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_32.json b/tests/inputs/score2/test__input__patient_32.json index 83cc013..14ea302 100644 --- a/tests/inputs/score2/test__input__patient_32.json +++ b/tests/inputs/score2/test__input__patient_32.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P032-2024-032", - "sex": "female", - "timestamp": "2024-07-04T15:15:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 69, - "unit": "years" + "metadata": { + "patient_id": "P032-2024-032", + "sex": "female", + "timestamp": "2024-07-04T15:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 155, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 7.2, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.3, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 69, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 155, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 7.2, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.3, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_33.json b/tests/inputs/score2/test__input__patient_33.json index 4220ee1..f71c377 100644 --- a/tests/inputs/score2/test__input__patient_33.json +++ b/tests/inputs/score2/test__input__patient_33.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P033-2024-033", - "sex": "male", - "timestamp": "2024-07-04T15:30:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 49, - "unit": "years" + "metadata": { + "patient_id": "P033-2024-033", + "sex": "male", + "timestamp": "2024-07-04T15:30:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 138, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 6.1, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.4, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 49, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 138, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.1, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_34.json b/tests/inputs/score2/test__input__patient_34.json index f2bdf7e..41ebd11 100644 --- a/tests/inputs/score2/test__input__patient_34.json +++ b/tests/inputs/score2/test__input__patient_34.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P034-2024-034", - "sex": "female", - "timestamp": "2024-07-04T15:45:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 50, - "unit": "years" + "metadata": { + "patient_id": "P034-2024-034", + "sex": "female", + "timestamp": "2024-07-04T15:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 120, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 4.8, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.8, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 50, + "unit": "years" + }, + "smoking_yes_no": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 120, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 4.8, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.8, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_35.json b/tests/inputs/score2/test__input__patient_35.json index 5fc3658..6f111b0 100644 --- a/tests/inputs/score2/test__input__patient_35.json +++ b/tests/inputs/score2/test__input__patient_35.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P035-2024-035", - "sex": "male", - "timestamp": "2024-07-04T16:00:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 55, - "unit": "years" + "metadata": { + "patient_id": "P035-2024-035", + "sex": "male", + "timestamp": "2024-07-04T16:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 142, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 6.4, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.2, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 55, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 142, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 6.4, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.2, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/inputs/score2/test__input__patient_36.json b/tests/inputs/score2/test__input__patient_36.json index b71ddb2..4d2e48e 100644 --- a/tests/inputs/score2/test__input__patient_36.json +++ b/tests/inputs/score2/test__input__patient_36.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P036-2024-036", - "sex": "female", - "timestamp": "2024-07-04T16:15:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age_years": { - "value": 45, - "unit": "years" + "metadata": { + "patient_id": "P036-2024-036", + "sex": "female", + "timestamp": "2024-07-04T16:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking_yes_no": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure_mmhg": { - "value": 132, - "unit": "mmHg" - }, - "total_cholesterol_mmol_l": { - "value": 5.5, - "unit": "mmol/L" - }, - "hdl_cholesterol_mmol_l": { - "value": 1.5, - "unit": "mmol/L" - }, - "is_male_yes_no": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age_years": { + "value": 45, + "unit": "years" + }, + "smoking_yes_no": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure_mmhg": { + "value": 132, + "unit": "mmHg" + }, + "total_cholesterol_mmol_l": { + "value": 5.5, + "unit": "mmol/L" + }, + "hdl_cholesterol_mmol_l": { + "value": 1.5, + "unit": "mmol/L" + }, + "is_male_yes_no": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_25.json b/tests/raw/score2/test__raw__patient_25.json index df7575a..45cdeee 100755 --- a/tests/raw/score2/test__raw__patient_25.json +++ b/tests/raw/score2/test__raw__patient_25.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P024-2024-024", - "sex": "female", - "timestamp": "2024-07-04T13:45:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 50, - "unit": "years" + "metadata": { + "patient_id": "P024-2024-024", + "sex": "female", + "timestamp": "2024-07-04T13:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 140, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 6.3, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.4, - "unit": "mmol/L" - }, - "is_male": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 50, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 140, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.3, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } } - } } diff --git a/tests/raw/score2/test__raw__patient_26.json b/tests/raw/score2/test__raw__patient_26.json index 6eb6449..2872e8f 100755 --- a/tests/raw/score2/test__raw__patient_26.json +++ b/tests/raw/score2/test__raw__patient_26.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P024-2024-024", - "sex": "male", - "timestamp": "2024-07-04T13:45:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 50, - "unit": "years" + "metadata": { + "patient_id": "P024-2024-024", + "sex": "male", + "timestamp": "2024-07-04T13:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 140, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 6.3, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.4, - "unit": "mmol/L" - }, - "is_male": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 50, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 140, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.3, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } } - } } diff --git a/tests/raw/score2/test__raw__patient_27.json b/tests/raw/score2/test__raw__patient_27.json index 8c2f500..c5ea1a0 100644 --- a/tests/raw/score2/test__raw__patient_27.json +++ b/tests/raw/score2/test__raw__patient_27.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P027-2024-027", - "sex": "female", - "timestamp": "2024-07-04T14:00:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 55, - "unit": "years" + "metadata": { + "patient_id": "P027-2024-027", + "sex": "female", + "timestamp": "2024-07-04T14:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 125, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 5.2, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.6, - "unit": "mmol/L" - }, - "is_male": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 55, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 125, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 5.2, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.6, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_28.json b/tests/raw/score2/test__raw__patient_28.json index 837f9c3..2acaa03 100644 --- a/tests/raw/score2/test__raw__patient_28.json +++ b/tests/raw/score2/test__raw__patient_28.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P028-2024-028", - "sex": "male", - "timestamp": "2024-07-04T14:15:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 45, - "unit": "years" + "metadata": { + "patient_id": "P028-2024-028", + "sex": "male", + "timestamp": "2024-07-04T14:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 130, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 5.8, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.3, - "unit": "mmol/L" - }, - "is_male": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 45, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 130, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 5.8, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.3, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_29.json b/tests/raw/score2/test__raw__patient_29.json index c9ded57..f6fcf3f 100644 --- a/tests/raw/score2/test__raw__patient_29.json +++ b/tests/raw/score2/test__raw__patient_29.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P029-2024-029", - "sex": "male", - "timestamp": "2024-07-04T14:30:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 40, - "unit": "years" + "metadata": { + "patient_id": "P029-2024-029", + "sex": "male", + "timestamp": "2024-07-04T14:30:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 135, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 6.0, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.2, - "unit": "mmol/L" - }, - "is_male": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 40, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 135, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.0, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.2, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_30.json b/tests/raw/score2/test__raw__patient_30.json index b43b9a0..ca90af4 100644 --- a/tests/raw/score2/test__raw__patient_30.json +++ b/tests/raw/score2/test__raw__patient_30.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P030-2024-030", - "sex": "female", - "timestamp": "2024-07-04T14:45:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 60, - "unit": "years" + "metadata": { + "patient_id": "P030-2024-030", + "sex": "female", + "timestamp": "2024-07-04T14:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 145, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 6.5, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.5, - "unit": "mmol/L" - }, - "is_male": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 60, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 145, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.5, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.5, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_31.json b/tests/raw/score2/test__raw__patient_31.json index 0910c92..95fa65a 100644 --- a/tests/raw/score2/test__raw__patient_31.json +++ b/tests/raw/score2/test__raw__patient_31.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P031-2024-031", - "sex": "male", - "timestamp": "2024-07-04T15:00:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 65, - "unit": "years" + "metadata": { + "patient_id": "P031-2024-031", + "sex": "male", + "timestamp": "2024-07-04T15:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 150, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 7.0, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.1, - "unit": "mmol/L" - }, - "is_male": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 65, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 150, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 7.0, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.1, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_32.json b/tests/raw/score2/test__raw__patient_32.json index 255d858..9a90055 100644 --- a/tests/raw/score2/test__raw__patient_32.json +++ b/tests/raw/score2/test__raw__patient_32.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P032-2024-032", - "sex": "female", - "timestamp": "2024-07-04T15:15:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 69, - "unit": "years" + "metadata": { + "patient_id": "P032-2024-032", + "sex": "female", + "timestamp": "2024-07-04T15:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 155, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 7.2, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.3, - "unit": "mmol/L" - }, - "is_male": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 69, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 155, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 7.2, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.3, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_33.json b/tests/raw/score2/test__raw__patient_33.json index 26cc61d..9a19590 100644 --- a/tests/raw/score2/test__raw__patient_33.json +++ b/tests/raw/score2/test__raw__patient_33.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P033-2024-033", - "sex": "male", - "timestamp": "2024-07-04T15:30:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 49, - "unit": "years" + "metadata": { + "patient_id": "P033-2024-033", + "sex": "male", + "timestamp": "2024-07-04T15:30:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 138, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 6.1, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.4, - "unit": "mmol/L" - }, - "is_male": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 49, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 138, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.1, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.4, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_34.json b/tests/raw/score2/test__raw__patient_34.json index f471469..3f0153c 100644 --- a/tests/raw/score2/test__raw__patient_34.json +++ b/tests/raw/score2/test__raw__patient_34.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P034-2024-034", - "sex": "female", - "timestamp": "2024-07-04T15:45:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 50, - "unit": "years" + "metadata": { + "patient_id": "P034-2024-034", + "sex": "female", + "timestamp": "2024-07-04T15:45:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": false, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 120, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 4.8, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.8, - "unit": "mmol/L" - }, - "is_male": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 50, + "unit": "years" + }, + "smoking": { + "value": false, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 120, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 4.8, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.8, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_35.json b/tests/raw/score2/test__raw__patient_35.json index 3c06bf3..d176cae 100644 --- a/tests/raw/score2/test__raw__patient_35.json +++ b/tests/raw/score2/test__raw__patient_35.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P035-2024-035", - "sex": "male", - "timestamp": "2024-07-04T16:00:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 55, - "unit": "years" + "metadata": { + "patient_id": "P035-2024-035", + "sex": "male", + "timestamp": "2024-07-04T16:00:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 142, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 6.4, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.2, - "unit": "mmol/L" - }, - "is_male": { - "value": true, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 55, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 142, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 6.4, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.2, + "unit": "mmol/L" + }, + "is_male": { + "value": true, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/raw/score2/test__raw__patient_36.json b/tests/raw/score2/test__raw__patient_36.json index d432a84..f618344 100644 --- a/tests/raw/score2/test__raw__patient_36.json +++ b/tests/raw/score2/test__raw__patient_36.json @@ -1,35 +1,35 @@ { - "metadata": { - "patient_id": "P036-2024-036", - "sex": "female", - "timestamp": "2024-07-04T16:15:00Z", - "test_date": "2024-07-04", - "laboratory": "NHANES Reference Labs" - }, - "raw_biomarkers": { - "age": { - "value": 45, - "unit": "years" + "metadata": { + "patient_id": "P036-2024-036", + "sex": "female", + "timestamp": "2024-07-04T16:15:00Z", + "test_date": "2024-07-04", + "laboratory": "NHANES Reference Labs" }, - "smoking": { - "value": true, - "unit": "yes/no" - }, - "systolic_blood_pressure": { - "value": 132, - "unit": "mmHg" - }, - "total_cholesterol": { - "value": 5.5, - "unit": "mmol/L" - }, - "hdl_cholesterol": { - "value": 1.5, - "unit": "mmol/L" - }, - "is_male": { - "value": false, - "unit": "yes/no" + "raw_biomarkers": { + "age": { + "value": 45, + "unit": "years" + }, + "smoking": { + "value": true, + "unit": "yes/no" + }, + "systolic_blood_pressure": { + "value": 132, + "unit": "mmHg" + }, + "total_cholesterol": { + "value": 5.5, + "unit": "mmol/L" + }, + "hdl_cholesterol": { + "value": 1.5, + "unit": "mmol/L" + }, + "is_male": { + "value": false, + "unit": "yes/no" + } } - } -} \ No newline at end of file +} diff --git a/tests/test_score2.py b/tests/test_score2.py index 1f651c1..98e76ff 100644 --- a/tests/test_score2.py +++ b/tests/test_score2.py @@ -26,7 +26,9 @@ ) def test_score2(filename, expected): # Get the actual fixture value using request.getfixturevalue - age, pred_risk, pred_risk_category = compute.cardiovascular_risk(OUT_FILEPATH / filename) + age, pred_risk, pred_risk_category = compute.cardiovascular_risk( + OUT_FILEPATH / filename + ) expected_age, expected_risk, expected_category = expected assert age == expected_age diff --git a/vitals/biomarkers/helpers.py b/vitals/biomarkers/helpers.py index d0dc78a..a112320 100755 --- a/vitals/biomarkers/helpers.py +++ b/vitals/biomarkers/helpers.py @@ -1,5 +1,6 @@ +from collections.abc import Callable from pathlib import Path -from typing import Any, Callable, TypeVar, TypedDict +from typing import Any, TypedDict, TypeVar from pydantic import BaseModel @@ -11,6 +12,7 @@ class ConversionInfo(TypedDict): """Type definition for biomarker conversion information.""" + target_name: str target_unit: str conversion: Callable[[float], float] diff --git a/vitals/score2/compute.py b/vitals/score2/compute.py index b78d8e0..dc794af 100644 --- a/vitals/score2/compute.py +++ b/vitals/score2/compute.py @@ -131,55 +131,65 @@ def cardiovascular_risk(filepath: str | Path) -> tuple[float, float, RiskCategor coef: ModelCoefficients = ModelCoefficients() # Calculate linear predictor (x) based on sex + + linear_pred: float + baseline_survival: float + scale1: float + scale2: float + if is_male: - x: float = ( - coef.male_age * cage + - coef.male_smoking * smoking + - coef.male_sbp * csbp + - coef.male_total_cholesterol * ctchol + - coef.male_hdl_cholesterol * chdl + - coef.male_smoking_age * smoking_age + - coef.male_sbp_age * sbp_age + - coef.male_tchol_age * tchol_age + - coef.male_hdl_age * hdl_age + linear_pred = ( + coef.male_age * cage + + coef.male_smoking * smoking + + coef.male_sbp * csbp + + coef.male_total_cholesterol * ctchol + + coef.male_hdl_cholesterol * chdl + + coef.male_smoking_age * smoking_age + + coef.male_sbp_age * sbp_age + + coef.male_tchol_age * tchol_age + + coef.male_hdl_age * hdl_age ) - baseline_survival: float = BaselineSurvival().male - scale1: float = CalibrationScales().male_scale1 - scale2: float = CalibrationScales().male_scale2 + baseline_survival = BaselineSurvival().male + scale1 = CalibrationScales().male_scale1 + scale2 = CalibrationScales().male_scale2 else: - x: float = ( - coef.female_age * cage + - coef.female_smoking * smoking + - coef.female_sbp * csbp + - coef.female_total_cholesterol * ctchol + - coef.female_hdl_cholesterol * chdl + - coef.female_smoking_age * smoking_age + - coef.female_sbp_age * sbp_age + - coef.female_tchol_age * tchol_age + - coef.female_hdl_age * hdl_age + linear_pred = ( + coef.female_age * cage + + coef.female_smoking * smoking + + coef.female_sbp * csbp + + coef.female_total_cholesterol * ctchol + + coef.female_hdl_cholesterol * chdl + + coef.female_smoking_age * smoking_age + + coef.female_sbp_age * sbp_age + + coef.female_tchol_age * tchol_age + + coef.female_hdl_age * hdl_age ) - baseline_survival: float = BaselineSurvival().female - scale1: float = CalibrationScales().female_scale1 - scale2: float = CalibrationScales().female_scale2 + baseline_survival = BaselineSurvival().female + scale1 = CalibrationScales().female_scale1 + scale2 = CalibrationScales().female_scale2 # Calculate uncalibrated risk - uncalibrated_risk: float = 1 - np.power(baseline_survival, np.exp(x)) + uncalibrated_risk: float = 1 - np.power(baseline_survival, np.exp(linear_pred)) # Apply calibration for Belgium (Low Risk region) # Calibrated 10-year risk, % = [1 - exp(-exp(scale1 + scale2*ln(-ln(1 - 10-year risk))))] * 100 - calibrated_risk: float = float((1 - np.exp(-np.exp(scale1 + scale2 * np.log(-np.log(1 - uncalibrated_risk))))) * 100) + calibrated_risk: float = float( + (1 - np.exp(-np.exp(scale1 + scale2 * np.log(-np.log(1 - uncalibrated_risk))))) + * 100 + ) # Determine risk category based on age + risk_category: RiskCategory if age < 50: if calibrated_risk < 2.5: - risk_category: RiskCategory = "Low to moderate" + risk_category = "Low to moderate" elif calibrated_risk < 7.5: risk_category = "High" else: risk_category = "Very high" else: # age 50-69 if calibrated_risk < 5: - risk_category: RiskCategory = "Low to moderate" + risk_category = "Low to moderate" elif calibrated_risk < 10: risk_category = "High" else: