From f116c573560cd43575fe26aec0f37bd93c6fdb2f Mon Sep 17 00:00:00 2001 From: Ethan Steinberg Date: Tue, 30 Apr 2024 20:28:16 -0700 Subject: [PATCH] Update schema.py --- src/meds/schema.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/meds/schema.py b/src/meds/schema.py index 03f978a..78a8cb2 100644 --- a/src/meds/schema.py +++ b/src/meds/schema.py @@ -21,14 +21,11 @@ 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 event = pa.struct( [ - pa.field("time", pa.timestamp("us"), nullable=False), + pa.field("time", pa.timestamp("us")), # Static events will have a null timestamp pa.field("code", pa.string(), nullable=False), pa.field("text_value", pa.string()), pa.field("numeric_value", pa.float32()), @@ -40,7 +37,7 @@ def patient_schema(per_event_properties_schema=pa.null()): patient = pa.schema( [ pa.field("patient_id", pa.int64(), nullable=False), - pa.field("events", pa.list_(event), nullable=False), # Require ordered by time + pa.field("events", pa.list_(event), nullable=False), # Require ordered by time, nulls must be first ] )