Skip to content

Commit

Permalink
Add column immune_status to table subjects; resolve #20
Browse files Browse the repository at this point in the history
  • Loading branch information
philiptzou committed Feb 8, 2022
1 parent cbdade5 commit 5b97026
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drdb/commands/autofill_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']), {})
Expand All @@ -234,6 +239,7 @@ def autofill_subjects(tables_dir: Path) -> None:
'subject_name',
'subject_species',
'birth_year',
'immune_status',
'num_subjects'
],
BOM=True
Expand Down
8 changes: 8 additions & 0 deletions schema.dbml
Original file line number Diff line number Diff line change
Expand Up @@ -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)."
]
Expand Down

0 comments on commit 5b97026

Please sign in to comment.