Skip to content

Commit

Permalink
Update schema.py
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanSteinberg authored Apr 30, 2024
1 parent ae31fde commit 53d4526
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/meds/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
birth_code = "SNOMED/184099003"
death_code = "SNOMED/419620001"

# We define static events as always occurring on January 1st, 1 AD
static_event_time = datetime.datetime(1, 1, 1)

def patient_schema(per_event_properties_schema=pa.null()):
# Return a patient schema with a particular per event metadata subschema
def patient_schema(per_event_properties_schema=pa.null(), per_patient_properties_schema=pa.null()):
# Return a patient schema with a particular per event and per patient properties shcemas

event = pa.struct(
[
pa.field("time", pa.timestamp("us"), nullable=False),
Expand All @@ -41,6 +39,7 @@ def patient_schema(per_event_properties_schema=pa.null()):
[
pa.field("patient_id", pa.int64(), nullable=False),
pa.field("events", pa.list_(event), nullable=False), # Require ordered by time
pa.field("properties", per_patient_properties_schema),
]
)

Expand Down

0 comments on commit 53d4526

Please sign in to comment.