Skip to content

Commit

Permalink
Make checkbox fields explicit (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
pipliggins committed Nov 20, 2023
1 parent 7c7296d commit 0d4768b
Show file tree
Hide file tree
Showing 11 changed files with 263 additions and 257 deletions.
17 changes: 9 additions & 8 deletions isaric/parsers/ccp-ghana.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
common = { visit_id = { field = "record_id", sensitive = true } }

[adtl.defs]
checkbox = { values = { 1 = true } }
"Y/N/NK" = { values = { 0 = false, 1 = true } }
uid = { field = "record_id", sensitive = true }

Expand Down Expand Up @@ -620,8 +621,8 @@
excludeWhen = "none"
fields = [
{ field = "daily_antimal_cmyn", description = "Antimalarial agent?", ref = "Y/N/NK" },
{ field = "daily_exper_cmtype___1", values = { 1 = true } },
{ field = "daily_exper_cmtype___2", values = { 1 = true } },
{ field = "daily_exper_cmtype___1", ref = "checkbox" },
{ field = "daily_exper_cmtype___2", ref = "checkbox" },
]

[visit.treatment_antimalarial_type]
Expand Down Expand Up @@ -715,7 +716,7 @@
excludeWhen = "none"
fields = [
{ field = "can_oxy_ther", description = "High-flow nasal canula oxygen therapy", ref = "Y/N/NK" },
{ field = "overall_oxygen_cmtype___2", description = "Oxygen therapy interface: HF nasal cannula", ref = "Y/N/NK" },
{ field = "overall_oxygen_cmtype___2", description = "Oxygen therapy interface: HF nasal cannula", ref = "checkbox" },
{ field = "daily_oxygen_cmtype_1", description = "Oxygen therapy interface: HF nasal cannula", ref = "Y/N/NK" },
]

Expand Down Expand Up @@ -799,27 +800,27 @@
[[visit.treatment_oxygen_therapy.fields]]
field = "overall_oxygen_cmtype___1"
description = "Oxygen therapy?"
values = { 1 = true }
ref = "checkbox"

[[visit.treatment_oxygen_therapy.fields]]
field = "overall_oxygen_cmtype___2"
description = "Oxygen therapy?"
values = { 1 = true }
ref = "checkbox"

[[visit.treatment_oxygen_therapy.fields]]
field = "overall_oxygen_cmtype___3"
description = "Oxygen therapy?"
values = { 1 = true }
ref = "checkbox"

[[visit.treatment_oxygen_therapy.fields]]
field = "overall_oxygen_cmtype___4"
description = "Oxygen therapy?"
values = { 1 = true }
ref = "checkbox"

[[visit.treatment_oxygen_therapy.fields]]
field = "overall_oxygen_cmtype___5"
description = "Oxygen therapy?"
values = { 1 = true }
ref = "checkbox"

[[visit.treatment_oxygen_therapy.fields]]
field = "daily_oxygen_cmtype_1"
Expand Down
5 changes: 3 additions & 2 deletions isaric/parsers/ccp-guinea.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

[adtl.defs]
"Y/N" = { values = { 1 = true, 2 = false } }
checkbox = { values = { 1 = true } }

[adtl.defs.admissionDateHierarchy]
combinedType = "firstNonNull"
Expand Down Expand Up @@ -552,8 +553,8 @@
excludeWhen = "none"
fields = [
{ field = "daily_antimal_cmyn", description = "Antimalarials?", values = { 1 = true, 0 = false } },
{ field = "daily_exper_cmtype___1", values = { 1 = true } },
{ field = "daily_exper_cmtype___2", values = { 1 = true } },
{ field = "daily_exper_cmtype___1", ref = "checkbox" },
{ field = "daily_exper_cmtype___2", ref = "checkbox" },
]

[visit.treatment_antimalarial_type]
Expand Down
9 changes: 6 additions & 3 deletions isaric/parsers/ccp-uganda-v2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
1 = true
0 = false

[adtl.defs.checkbox.values]
1 = true

[adtl.defs.admissionDateHierarchy]
combinedType = "firstNonNull"
fields = [
Expand Down Expand Up @@ -598,7 +601,7 @@
combinedType = "any"
fields = [
{ field = "cof", ref = "Y/N" },
{ field = "sick_symp___2", values = { 1 = true, 0 = false } },
{ field = "sick_symp___2", ref = "checkbox" },
]

[[observation]]
Expand Down Expand Up @@ -640,7 +643,7 @@
] } }
duration_type = "event"
phase = "admission"
is_present = { field = "sick_symp___3", values = { 1 = true, 0 = false } }
is_present = { field = "sick_symp___3", ref = "checkbox" }

[[observation]]
name = "diarrhoea"
Expand Down Expand Up @@ -674,7 +677,7 @@
date = { field = "onset_date" }
duration_type = "event"
phase = "admission"
is_present = { field = "sick_symp___1", values = { 1 = true } }
is_present = { field = "sick_symp___1", ref = "checkbox" }

[[observation]]
name = "history_of_fever"
Expand Down
21 changes: 11 additions & 10 deletions isaric/parsers/cocoa_pediatrics.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

[adtl.defs]
"Y/N/NK" = { values = { 0 = false, 1 = true } }
checkbox = { values = { 1 = true } }

[adtl.defs.admissionDateHierarchy]
combinedType = "firstNonNull"
Expand Down Expand Up @@ -376,7 +377,7 @@
name = "cough"
phase = "followup"
date = { field = "date" }
is_present = { field = "ongoing_symptoms___2", values = { 1 = true } }
is_present = { field = "ongoing_symptoms___2", ref = "checkbox" }

[[observation]]
name = "cough_dry"
Expand Down Expand Up @@ -414,7 +415,7 @@
name = "diarrhoea"
phase = "followup"
date = { field = "date" }
is_present = { field = "ongoing_symptoms___10", values = { 1 = true } }
is_present = { field = "ongoing_symptoms___10", ref = "checkbox" }

[[observation]]
name = "diastolic_blood_pressure_mmHg"
Expand All @@ -440,7 +441,7 @@
name = "hepatomegaly"
phase = "admission"
date = { field = "hostdat" }
is_present = { field = "cardiac_failure___4", values = { 1 = true } }
is_present = { field = "cardiac_failure___4", ref = "checkbox" }

[[observation]]
name = "history_of_fever"
Expand All @@ -454,7 +455,7 @@
name = "history_of_fever"
phase = "followup"
date = { field = "date" }
is_present = { field = "ongoing_symptoms___1", values = { 1 = true } }
is_present = { field = "ongoing_symptoms___1", ref = "checkbox" }

[[observation]]
name = "fatigue_malaise"
Expand All @@ -480,7 +481,7 @@
name = "feeding_intolerance_pediatrics"
phase = "followup"
date = { field = "date" }
is_present = { field = "ongoing_symptoms___11", values = { 1 = true } }
is_present = { field = "ongoing_symptoms___11", ref = "checkbox" }

[[observation]]
name = "inability_to_walk"
Expand Down Expand Up @@ -556,8 +557,8 @@
combinedType = "any"
excludeWhen = "none"
fields = [
{ field = "myalgia_ceoccur_v2", values = { 1 = true } },
{ field = "jointpain_ceoccur_v2", values = { 1 = true } },
{ field = "myalgia_ceoccur_v2", ref = "checkbox" },
{ field = "jointpain_ceoccur_v2", ref = "checkbox" },
]

[[observation]]
Expand Down Expand Up @@ -660,7 +661,7 @@
name = "shortness_of_breath"
phase = "followup"
date = { field = "date" }
is_present = { field = "ongoing_symptoms___3", values = { 1 = true } }
is_present = { field = "ongoing_symptoms___3", ref = "checkbox" }

[[observation]]
name = "skin_rash"
Expand All @@ -674,7 +675,7 @@
name = "skin_rash"
phase = "followup"
date = { field = "date" }
is_present = { field = "ongoing_symptoms___5", values = { 1 = true } }
is_present = { field = "ongoing_symptoms___5", ref = "checkbox" }

[[observation]]
name = "skin_ulcers"
Expand Down Expand Up @@ -740,7 +741,7 @@
name = "vomiting_nausea"
phase = "followup"
date = { field = "date" }
is_present = { field = "ongoing_symptoms___9", values = { 1 = true } }
is_present = { field = "ongoing_symptoms___9", ref = "checkbox" }

[[observation]]
name = "blantyre_coma_score"
Expand Down
40 changes: 19 additions & 21 deletions isaric/parsers/datcov-southafrica.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
1 = true
0 = false

[adtl.defs.checkbox.values]
1 = true

[adtl.defs.subjectId]
combinedType = "firstNonNull"
fields = [{ field = "PatientId" }, { field = "NICDCaseID" }]
Expand Down Expand Up @@ -135,35 +138,35 @@
[subject.has_chronic_hematologic_disease]
field = "flw_ongoing_chronic_list___12"
description = "Diagnosed, ongoing condition before COVID-19 diagnosis: Blood disorder"
ref = "Y/N/NK"
ref = "checkbox"

[subject.has_asplenia]
field = "flw_ongoing_chronic_list___10"
ref = "Y/N/NK"
ref = "checkbox"
description = "Asplenia"

[subject.has_tuberculosis]
combinedType = "any"
fields = [
{ field = "Tuberculosis Active", values = { 'Yes' = true, 'No' = false } }, # values = ['No', 'Unknown', 'Yes', 'UNKNOWN', nan]
{ field = "flw_ongoing_chronic_list___20", ref = "Y/N/NK" },
{ field = "flw_ongoing_chronic_list___20", ref = "checkbox" },
]

[subject.has_dementia]
field = "flw_ongoing_chronic_list___15"
ref = "Y/N/NK"
ref = "checkbox"
description = "Dementia"

[subject.has_rheumatologic_disorder]
field = "flw_ongoing_chronic_list___13"
ref = "Y/N/NK"
ref = "checkbox"
description = "Rhemumatologic disorder"

[subject.has_hiv]
combinedType = "any"
fields = [
{ field = "HIV Positive", values = { 'Yes' = true, 'No' = false } }, # values = ['No', 'Unknown', 'Yes', nan]}
{ field = "flw_ongoing_chronic_list___16", ref = "Y/N/NK" },
{ field = "flw_ongoing_chronic_list___16", ref = "checkbox" },
]

[subject.has_obesity]
Expand All @@ -175,14 +178,14 @@
combinedType = "any"
fields = [
{ field = "Hypertension", values = { 'Yes' = true, 'No' = false } },
{ field = "flw_ongoing_chronic_list___2", ref = "Y/N/NK" },
{ field = "flw_ongoing_chronic_list___2", ref = "checkbox" },
]

[subject.has_malignant_neoplasm]
combinedType = "any"
fields = [
{ field = "Malignancy", values = { 'Yes' = true, 'No' = false } }, # values = ['No', 'Unknown', 'UNKNOWN', 'Yes', nan]
{ field = "flw_ongoing_chronic_list___11", ref = "Y/N/NK" },
{ field = "flw_ongoing_chronic_list___11", ref = "checkbox" },
]

[subject.has_smoking]
Expand All @@ -196,30 +199,30 @@
combinedType = "any"
fields = [
{ field = "Asthma", values = { 'Yes' = true, 'No' = false } }, # values = ['No', 'Unknown', 'Yes', 'UNKNOWN', nan]
{ field = "flw_ongoing_chronic_list___3", ref = "Y/N/NK" },
{ field = "flw_ongoing_chronic_list___3", ref = "checkbox" },
]

[subject.has_chronic_cardiac_disease]
combinedType = "any"
fields = [
{ field = "Cardiac Disease", values = { 'Yes' = true, 'No' = false } }, # values = ['No', 'Unknown', 'UNKNOWN', 'Yes', nan]
{ field = "flw_ongoing_chronic_list___1", ref = "Y/N/NK" },
{ field = "flw_ongoing_chronic_list___1", ref = "checkbox" },
]

[subject.has_chronic_kidney_disease]
combinedType = "any"
fields = [
{ field = "Chronic Renal Failure", values = { 'Yes' = true, 'No' = false } }, # values = ['No', 'Unknown', 'UNKNOWN', 'Yes', nan] }
{ field = "flw_ongoing_chronic_list___8", ref = "Y/N/NK" },
{ field = "flw_ongoing_chronic_list___8", ref = "checkbox" },
]

[subject.has_diabetes]
combinedType = "any"
fields = [
{ field = "Diabetes", values = { 'Yes' = true, 'No' = false } }, # values = ['No', 'Unknown', 'Yes', 'UNKNOWN', nan]
{ field = "flw_ongoing_chronic_list___5", ref = "Y/N/NK", description = "Diabetes Type 1" },
{ field = "flw_ongoing_chronic_list___6", ref = "Y/N/NK", description = "Diabetes Type 2" },
{ field = "flw_ongoing_chronic_list___7", ref = "Y/N/NK", description = "Diabetes Gestational" },
{ field = "Diabetes", values = { 'Yes' = true, 'No' = false } }, # values = ['No', 'Unknown', 'Yes', 'UNKNOWN', nan]
{ field = "flw_ongoing_chronic_list___5", ref = "checkbox", description = "Diabetes Type 1" },
{ field = "flw_ongoing_chronic_list___6", ref = "checkbox", description = "Diabetes Type 2" },
{ field = "flw_ongoing_chronic_list___7", ref = "checkbox", description = "Diabetes Gestational" },
]
# can we assume diabetes as a disease was there before COVID? and so the followup data applies here?

Expand All @@ -233,14 +236,9 @@

[subject.has_liver_disease]
field = "flw_ongoing_chronic_list___9"
ref = "Y/N/NK"
ref = "checkbox"
description = "Liver disease"

# [subject.has_hiv_viral_suppression]
# field = "HIV Viral Suppression"
# values = { 'Yes' = true, 'No' = false }
# # values = [nan, 'No', 'Unknown', 'Yes']

[subject.has_tuberculosis_past]
field = "Tuberculosis Past"
values = { 'Yes' = true, 'No' = false }
Expand Down
5 changes: 4 additions & 1 deletion isaric/parsers/isaric-ccpuk.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
1 = true
2 = false

[adtl.defs.checkbox.values]
1 = true

[adtl.defs.admissionDateHierarchy]
combinedType = "firstNonNull"
fields = [
Expand Down Expand Up @@ -445,7 +448,7 @@

[visit.treatment_antimalarial]
field = "antiviral_cmtrt___7"
values = { 1 = true }
ref = "checkbox"

[visit.treatment_antimalarial_type]
combinedType = "set"
Expand Down
Loading

0 comments on commit 0d4768b

Please sign in to comment.