generated from opensafely-core/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #663 from opensafely-core/evansd/schema-definitions
Add class-based schema definitions
- Loading branch information
Showing
8 changed files
with
333 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
import datetime | ||
|
||
from databuilder.query_language import build_patient_table | ||
from databuilder.query_language import PatientFrame, Series, construct | ||
|
||
from .contracts import universal | ||
|
||
patients = build_patient_table( | ||
"patients", | ||
{ | ||
"date_of_birth": datetime.date, | ||
"date_of_death": datetime.date, | ||
"sex": str, | ||
}, | ||
contract=universal.Patients, | ||
) | ||
@construct | ||
class patients(PatientFrame): | ||
date_of_birth = Series(datetime.date) | ||
date_of_death = Series(datetime.date) | ||
sex = Series(str) |
Oops, something went wrong.