From 5b9702638c24665c82a0ef003444aa4ba17030c1 Mon Sep 17 00:00:00 2001 From: Philip Tzou Date: Tue, 8 Feb 2022 12:07:59 -0800 Subject: [PATCH] Add column immune_status to table subjects; resolve #20 --- drdb/commands/autofill_payload.py | 6 ++++++ schema.dbml | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/drdb/commands/autofill_payload.py b/drdb/commands/autofill_payload.py index d7dc1fb..7e7c7e2 100644 --- a/drdb/commands/autofill_payload.py +++ b/drdb/commands/autofill_payload.py @@ -212,6 +212,11 @@ def autofill_subjects(tables_dir: Path) -> None: .get((rx['ref_name'], rx['subject_name']), {}) .get('birth_year') or 'NULL' ), + 'immune_status': ( + known_subjects + .get((rx['ref_name'], rx['subject_name']), {}) + .get('immune_status') or 'NULL' + ), 'num_subjects': ( known_subjects .get((rx['ref_name'], rx['subject_name']), {}) @@ -234,6 +239,7 @@ def autofill_subjects(tables_dir: Path) -> None: 'subject_name', 'subject_species', 'birth_year', + 'immune_status', 'num_subjects' ], BOM=True diff --git a/schema.dbml b/schema.dbml index 5b24c12..3419a7b 100644 --- a/schema.dbml +++ b/schema.dbml @@ -133,11 +133,19 @@ Enum subject_species_enum { "HyperIG" // Hyperimmune immunoglobulin TODO: this should be another type of Rx } +Enum immune_status_enum { + "HIV" + "Medical" // The subject received medical that could suppress their immuno system + "Unknown" // The immune status is not indicated by the study + "None" // the subject is not immunosuppressed +} + Table subjects as Pt { ref_name varchar [ref: > R.ref_name] subject_name varchar subject_species subject_species_enum birth_year numeric(4) + immune_status immune_status_enum num_subjects int [ note: "Indicates if this record is for an individual subject (=1) or a group of subjects (>1)." ]