diff --git a/tests/outputs/test__output__patient_01.json b/tests/inputs/phenoage/test__input__patient_01.json similarity index 100% rename from tests/outputs/test__output__patient_01.json rename to tests/inputs/phenoage/test__input__patient_01.json diff --git a/tests/outputs/test__output__patient_02.json b/tests/inputs/phenoage/test__input__patient_02.json similarity index 100% rename from tests/outputs/test__output__patient_02.json rename to tests/inputs/phenoage/test__input__patient_02.json diff --git a/tests/outputs/test__output__patient_03.json b/tests/inputs/phenoage/test__input__patient_03.json similarity index 100% rename from tests/outputs/test__output__patient_03.json rename to tests/inputs/phenoage/test__input__patient_03.json diff --git a/tests/outputs/test__output__patient_04.json b/tests/inputs/phenoage/test__input__patient_04.json similarity index 100% rename from tests/outputs/test__output__patient_04.json rename to tests/inputs/phenoage/test__input__patient_04.json diff --git a/tests/outputs/test__output__patient_05.json b/tests/inputs/phenoage/test__input__patient_05.json similarity index 100% rename from tests/outputs/test__output__patient_05.json rename to tests/inputs/phenoage/test__input__patient_05.json diff --git a/tests/outputs/test__output__patient_06.json b/tests/inputs/phenoage/test__input__patient_06.json similarity index 100% rename from tests/outputs/test__output__patient_06.json rename to tests/inputs/phenoage/test__input__patient_06.json diff --git a/tests/outputs/test__output__patient_07.json b/tests/inputs/phenoage/test__input__patient_07.json similarity index 100% rename from tests/outputs/test__output__patient_07.json rename to tests/inputs/phenoage/test__input__patient_07.json diff --git a/tests/outputs/test__output__patient_08.json b/tests/inputs/phenoage/test__input__patient_08.json similarity index 100% rename from tests/outputs/test__output__patient_08.json rename to tests/inputs/phenoage/test__input__patient_08.json diff --git a/tests/outputs/test__output__patient_09.json b/tests/inputs/phenoage/test__input__patient_09.json similarity index 100% rename from tests/outputs/test__output__patient_09.json rename to tests/inputs/phenoage/test__input__patient_09.json diff --git a/tests/outputs/test__output__patient_10.json b/tests/inputs/phenoage/test__input__patient_10.json similarity index 100% rename from tests/outputs/test__output__patient_10.json rename to tests/inputs/phenoage/test__input__patient_10.json diff --git a/tests/outputs/test__output__patient_11.json b/tests/inputs/phenoage/test__input__patient_11.json similarity index 100% rename from tests/outputs/test__output__patient_11.json rename to tests/inputs/phenoage/test__input__patient_11.json diff --git a/tests/outputs/test__output__patient_12.json b/tests/inputs/phenoage/test__input__patient_12.json similarity index 100% rename from tests/outputs/test__output__patient_12.json rename to tests/inputs/phenoage/test__input__patient_12.json diff --git a/tests/outputs/test__output__patient_13.json b/tests/inputs/phenoage/test__input__patient_13.json similarity index 100% rename from tests/outputs/test__output__patient_13.json rename to tests/inputs/phenoage/test__input__patient_13.json diff --git a/tests/outputs/test__output__patient_14.json b/tests/inputs/phenoage/test__input__patient_14.json similarity index 100% rename from tests/outputs/test__output__patient_14.json rename to tests/inputs/phenoage/test__input__patient_14.json diff --git a/tests/outputs/test__output__patient_15.json b/tests/inputs/phenoage/test__input__patient_15.json similarity index 100% rename from tests/outputs/test__output__patient_15.json rename to tests/inputs/phenoage/test__input__patient_15.json diff --git a/tests/outputs/test__output__patient_16.json b/tests/inputs/phenoage/test__input__patient_16.json similarity index 100% rename from tests/outputs/test__output__patient_16.json rename to tests/inputs/phenoage/test__input__patient_16.json diff --git a/tests/outputs/test__output__patient_17.json b/tests/inputs/phenoage/test__input__patient_17.json similarity index 100% rename from tests/outputs/test__output__patient_17.json rename to tests/inputs/phenoage/test__input__patient_17.json diff --git a/tests/outputs/test__output__patient_18.json b/tests/inputs/phenoage/test__input__patient_18.json similarity index 100% rename from tests/outputs/test__output__patient_18.json rename to tests/inputs/phenoage/test__input__patient_18.json diff --git a/tests/outputs/test__output__patient_19.json b/tests/inputs/phenoage/test__input__patient_19.json similarity index 100% rename from tests/outputs/test__output__patient_19.json rename to tests/inputs/phenoage/test__input__patient_19.json diff --git a/tests/outputs/test__output__patient_20.json b/tests/inputs/phenoage/test__input__patient_20.json similarity index 100% rename from tests/outputs/test__output__patient_20.json rename to tests/inputs/phenoage/test__input__patient_20.json diff --git a/tests/outputs/test__output__patient_21.json b/tests/inputs/phenoage/test__input__patient_21.json similarity index 100% rename from tests/outputs/test__output__patient_21.json rename to tests/inputs/phenoage/test__input__patient_21.json diff --git a/tests/outputs/test__output__patient_22.json b/tests/inputs/phenoage/test__input__patient_22.json similarity index 100% rename from tests/outputs/test__output__patient_22.json rename to tests/inputs/phenoage/test__input__patient_22.json diff --git a/tests/outputs/test__output__patient_23.json b/tests/inputs/phenoage/test__input__patient_23.json similarity index 100% rename from tests/outputs/test__output__patient_23.json rename to tests/inputs/phenoage/test__input__patient_23.json diff --git a/tests/outputs/test__output__patient_24.json b/tests/inputs/phenoage/test__input__patient_24.json similarity index 100% rename from tests/outputs/test__output__patient_24.json rename to tests/inputs/phenoage/test__input__patient_24.json diff --git a/tests/outputs/test__output__patient_25.json b/tests/inputs/score2/test__input__patient_25.json similarity index 84% rename from tests/outputs/test__output__patient_25.json rename to tests/inputs/score2/test__input__patient_25.json index 3c9c3e9..83f68ad 100755 --- a/tests/outputs/test__output__patient_25.json +++ b/tests/inputs/score2/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/outputs/test__output__patient_26.json b/tests/inputs/score2/test__input__patient_26.json similarity index 84% rename from tests/outputs/test__output__patient_26.json rename to tests/inputs/score2/test__input__patient_26.json index 0d105ac..ba11b32 100755 --- a/tests/outputs/test__output__patient_26.json +++ b/tests/inputs/score2/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" }, diff --git a/tests/inputs/score2/test__input__patient_27.json b/tests/inputs/score2/test__input__patient_27.json new file mode 100644 index 0000000..96b5a37 --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..62b9906 --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..d439a63 --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..77bfb0b --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..66d115b --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..83cc013 --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..4220ee1 --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..f2bdf7e --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..5fc3658 --- /dev/null +++ b/tests/inputs/score2/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_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 new file mode 100644 index 0000000..b71ddb2 --- /dev/null +++ b/tests/inputs/score2/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_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/inputs/test__input__patient_01.json b/tests/raw/phenoage/test__raw__patient_01.json similarity index 100% rename from tests/inputs/test__input__patient_01.json rename to tests/raw/phenoage/test__raw__patient_01.json diff --git a/tests/inputs/test__input__patient_02.json b/tests/raw/phenoage/test__raw__patient_02.json similarity index 100% rename from tests/inputs/test__input__patient_02.json rename to tests/raw/phenoage/test__raw__patient_02.json diff --git a/tests/inputs/test__input__patient_03.json b/tests/raw/phenoage/test__raw__patient_03.json similarity index 100% rename from tests/inputs/test__input__patient_03.json rename to tests/raw/phenoage/test__raw__patient_03.json diff --git a/tests/inputs/test__input__patient_04.json b/tests/raw/phenoage/test__raw__patient_04.json similarity index 100% rename from tests/inputs/test__input__patient_04.json rename to tests/raw/phenoage/test__raw__patient_04.json diff --git a/tests/inputs/test__input__patient_05.json b/tests/raw/phenoage/test__raw__patient_05.json similarity index 100% rename from tests/inputs/test__input__patient_05.json rename to tests/raw/phenoage/test__raw__patient_05.json diff --git a/tests/inputs/test__input__patient_06.json b/tests/raw/phenoage/test__raw__patient_06.json similarity index 100% rename from tests/inputs/test__input__patient_06.json rename to tests/raw/phenoage/test__raw__patient_06.json diff --git a/tests/inputs/test__input__patient_07.json b/tests/raw/phenoage/test__raw__patient_07.json similarity index 100% rename from tests/inputs/test__input__patient_07.json rename to tests/raw/phenoage/test__raw__patient_07.json diff --git a/tests/inputs/test__input__patient_08.json b/tests/raw/phenoage/test__raw__patient_08.json similarity index 100% rename from tests/inputs/test__input__patient_08.json rename to tests/raw/phenoage/test__raw__patient_08.json diff --git a/tests/inputs/test__input__patient_09.json b/tests/raw/phenoage/test__raw__patient_09.json similarity index 100% rename from tests/inputs/test__input__patient_09.json rename to tests/raw/phenoage/test__raw__patient_09.json diff --git a/tests/inputs/test__input__patient_10.json b/tests/raw/phenoage/test__raw__patient_10.json similarity index 100% rename from tests/inputs/test__input__patient_10.json rename to tests/raw/phenoage/test__raw__patient_10.json diff --git a/tests/inputs/test__input__patient_11.json b/tests/raw/phenoage/test__raw__patient_11.json similarity index 100% rename from tests/inputs/test__input__patient_11.json rename to tests/raw/phenoage/test__raw__patient_11.json diff --git a/tests/inputs/test__input__patient_12.json b/tests/raw/phenoage/test__raw__patient_12.json similarity index 100% rename from tests/inputs/test__input__patient_12.json rename to tests/raw/phenoage/test__raw__patient_12.json diff --git a/tests/inputs/test__input__patient_13.json b/tests/raw/phenoage/test__raw__patient_13.json similarity index 100% rename from tests/inputs/test__input__patient_13.json rename to tests/raw/phenoage/test__raw__patient_13.json diff --git a/tests/inputs/test__input__patient_14.json b/tests/raw/phenoage/test__raw__patient_14.json similarity index 100% rename from tests/inputs/test__input__patient_14.json rename to tests/raw/phenoage/test__raw__patient_14.json diff --git a/tests/inputs/test__input__patient_15.json b/tests/raw/phenoage/test__raw__patient_15.json similarity index 100% rename from tests/inputs/test__input__patient_15.json rename to tests/raw/phenoage/test__raw__patient_15.json diff --git a/tests/inputs/test__input__patient_16.json b/tests/raw/phenoage/test__raw__patient_16.json similarity index 100% rename from tests/inputs/test__input__patient_16.json rename to tests/raw/phenoage/test__raw__patient_16.json diff --git a/tests/inputs/test__input__patient_17.json b/tests/raw/phenoage/test__raw__patient_17.json similarity index 100% rename from tests/inputs/test__input__patient_17.json rename to tests/raw/phenoage/test__raw__patient_17.json diff --git a/tests/inputs/test__input__patient_18.json b/tests/raw/phenoage/test__raw__patient_18.json similarity index 100% rename from tests/inputs/test__input__patient_18.json rename to tests/raw/phenoage/test__raw__patient_18.json diff --git a/tests/inputs/test__input__patient_19.json b/tests/raw/phenoage/test__raw__patient_19.json similarity index 100% rename from tests/inputs/test__input__patient_19.json rename to tests/raw/phenoage/test__raw__patient_19.json diff --git a/tests/inputs/test__input__patient_20.json b/tests/raw/phenoage/test__raw__patient_20.json similarity index 100% rename from tests/inputs/test__input__patient_20.json rename to tests/raw/phenoage/test__raw__patient_20.json diff --git a/tests/inputs/test__input__patient_21.json b/tests/raw/phenoage/test__raw__patient_21.json similarity index 100% rename from tests/inputs/test__input__patient_21.json rename to tests/raw/phenoage/test__raw__patient_21.json diff --git a/tests/inputs/test__input__patient_22.json b/tests/raw/phenoage/test__raw__patient_22.json similarity index 100% rename from tests/inputs/test__input__patient_22.json rename to tests/raw/phenoage/test__raw__patient_22.json diff --git a/tests/inputs/test__input__patient_23.json b/tests/raw/phenoage/test__raw__patient_23.json similarity index 100% rename from tests/inputs/test__input__patient_23.json rename to tests/raw/phenoage/test__raw__patient_23.json diff --git a/tests/inputs/test__input__patient_24.json b/tests/raw/phenoage/test__raw__patient_24.json similarity index 100% rename from tests/inputs/test__input__patient_24.json rename to tests/raw/phenoage/test__raw__patient_24.json diff --git a/tests/inputs/test__input__patient_25.json b/tests/raw/score2/test__raw__patient_25.json similarity index 100% rename from tests/inputs/test__input__patient_25.json rename to tests/raw/score2/test__raw__patient_25.json diff --git a/tests/inputs/test__input__patient_26.json b/tests/raw/score2/test__raw__patient_26.json similarity index 100% rename from tests/inputs/test__input__patient_26.json rename to tests/raw/score2/test__raw__patient_26.json diff --git a/tests/raw/score2/test__raw__patient_27.json b/tests/raw/score2/test__raw__patient_27.json new file mode 100644 index 0000000..8c2f500 --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_28.json b/tests/raw/score2/test__raw__patient_28.json new file mode 100644 index 0000000..837f9c3 --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_29.json b/tests/raw/score2/test__raw__patient_29.json new file mode 100644 index 0000000..c9ded57 --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_30.json b/tests/raw/score2/test__raw__patient_30.json new file mode 100644 index 0000000..b43b9a0 --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_31.json b/tests/raw/score2/test__raw__patient_31.json new file mode 100644 index 0000000..0910c92 --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_32.json b/tests/raw/score2/test__raw__patient_32.json new file mode 100644 index 0000000..255d858 --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_33.json b/tests/raw/score2/test__raw__patient_33.json new file mode 100644 index 0000000..26cc61d --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_34.json b/tests/raw/score2/test__raw__patient_34.json new file mode 100644 index 0000000..f471469 --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_35.json b/tests/raw/score2/test__raw__patient_35.json new file mode 100644 index 0000000..3c06bf3 --- /dev/null +++ b/tests/raw/score2/test__raw__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/raw/score2/test__raw__patient_36.json b/tests/raw/score2/test__raw__patient_36.json new file mode 100644 index 0000000..d432a84 --- /dev/null +++ b/tests/raw/score2/test__raw__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/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/test_io.py b/tests/test_io.py index ba1b2ad..6f42c92 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" / "phenoage" +OUT_FILEPATH = Path(__file__).parent / "inputs" / "phenoage" @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..3da32da 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" / "phenoage" @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 0d19492..1f651c1 100644 --- a/tests/test_score2.py +++ b/tests/test_score2.py @@ -4,14 +4,24 @@ from vitals.score2 import compute -OUT_FILEPATH = Path(__file__).parent / "outputs" +OUT_FILEPATH = Path(__file__).parent / "inputs" / "score2" @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__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..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/inputs") - output_dir = Path("tests/outputs") +# 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("input", "output") +# 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) 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)