You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While v5 visit_occurrence table supports both date and time of event, other occurrence tables and exposure tables such as drug, condition, and procedure support only the date level. It is desirable to have the option to include specific time data for such occurrences. Our goal is to allow temporal operations finer than day without disrupting OHDSI by requiring major recoding.
Here is the current use of date and time fields in CDM v5.01:
PERSON
year_of_birth as integer, required
month_of_birth as integer, not required
day_of_birth as integer, not required
time_of_birth as time, not required
SPECIMEN
specimen_date as date, required
specimen_time as time, not required
DEATH
death_date as date, required
VISIT_OCCURRENCE
visit_start_date as date, required
visit_start_time as time, not required
visit_end_date as date, required
visit_end_time as time, not required
PROCEDURE_OCCURRENCE
procedure_date as date, required
DRUG_EXPOSURE
drug_exposure_start_date as date, required
drug_exposure _end_date as date, not required
DEVICE_EXPOSURE
device_exposure_start_date as date, required
device _exposure _end_date as date, not required
CONDITION_OCCURRENCE
condition_start_date as date, required
condition _end_date as date, not required
MEASUREMENT
measurement_date as date, required
measurement _time as time, not required
NOTE
note_date as date, required
note_time as time, not required
OBSERVATION
observation_date as date, required
observation _time as time, not required
And the ERA tables, COHORT tables, and PAYER_PLAN_PERIOD table.
DECISION 1
We have a choice between adding fields of type time, which require significant processing to determine durations (join the date and time, and then operate on that) versus defining a datetime field as timestamp, which allows fast operations but produces redundancy.
[Suggest datetime = timestamp.]
DECISION 2
We propose adding a datetime field or fields to the following tables
Condition_Occurrence
Procedure_Occurrence
Drug_exposure
Device_exposure
Death
We propose replacing the current time fields with datetime fields in the following tables
Specimen
Visit_Occurrence
Measurement
Note
Observation
A datetime field (also known as timestamp field) would be added to each date field. Date fields would not be changed.
This would support handling data from ICU, Emergency Department, infusions, post-procedure care, etc. where multiple events occur on the same day and sequence matters. This granularity would also support the incorporation of data generated from tracking devices.
In addition, current *_TIME fields would be removed. At this point, all current software will continue working with the *_DATE fields, and over time we will develop extensions to the software to accommodate DATETIME in different database management systems.
[Suggest moving forward with fields called *_DATETIME, removing the *_TIME fields. The *_DATE fields will remain required.]
DECISION 3
Are the datetime fields required. Making them required allows developers to begin to use them with a potential migration from date+time or date+timestamp to timesteamp in the future, but it forces CDM builders to enter unknown times or timestamps. If required, the default time will be the first instant in the allowable period. E.g., 1990-12-01-00:00:00.000000 is the correct entry for December, 1990.
[Suggest optional for now.]
DECISION 4
Should a date time (timestamp) field be added to BIRTH (or alternatively should PERSON.time_of_birth be changed to timestamp). This will allow more rapid calculation of age but will be redundant with the current information.
Should we add a *_TIME_GRAN granularity field for each new timestamp field, which would indicate year, month, day, hour, minute, or second as the timestamp's granularity. When a timestamp is filled in, it should be set to the first valid time in that indicated interval.
[Suggest defer decision.]
The text was updated successfully, but these errors were encountered:
This issue is addressed in CDM v5.1.0 by adding the suggested fields according to decision 2. Further discussion is still going on regarding removing the date fields all together in favor of datetime fields. This would be an action for CDM v6.0.0 as it would affect all current queries written using previous versions.
While v5 visit_occurrence table supports both date and time of event, other occurrence tables and exposure tables such as drug, condition, and procedure support only the date level. It is desirable to have the option to include specific time data for such occurrences. Our goal is to allow temporal operations finer than day without disrupting OHDSI by requiring major recoding.
Here is the current use of date and time fields in CDM v5.01:
PERSON
SPECIMEN
DEATH
VISIT_OCCURRENCE
PROCEDURE_OCCURRENCE
DRUG_EXPOSURE
DEVICE_EXPOSURE
CONDITION_OCCURRENCE
MEASUREMENT
NOTE
OBSERVATION
And the ERA tables, COHORT tables, and PAYER_PLAN_PERIOD table.
DECISION 1
We have a choice between adding fields of type time, which require significant processing to determine durations (join the date and time, and then operate on that) versus defining a datetime field as timestamp, which allows fast operations but produces redundancy.
[Suggest datetime = timestamp.]
DECISION 2
We propose adding a datetime field or fields to the following tables
We propose replacing the current time fields with datetime fields in the following tables
A datetime field (also known as timestamp field) would be added to each date field. Date fields would not be changed.
This would support handling data from ICU, Emergency Department, infusions, post-procedure care, etc. where multiple events occur on the same day and sequence matters. This granularity would also support the incorporation of data generated from tracking devices.
In addition, current *_TIME fields would be removed. At this point, all current software will continue working with the *_DATE fields, and over time we will develop extensions to the software to accommodate DATETIME in different database management systems.
[Suggest moving forward with fields called *_DATETIME, removing the *_TIME fields. The *_DATE fields will remain required.]
DECISION 3
Are the datetime fields required. Making them required allows developers to begin to use them with a potential migration from date+time or date+timestamp to timesteamp in the future, but it forces CDM builders to enter unknown times or timestamps. If required, the default time will be the first instant in the allowable period. E.g., 1990-12-01-00:00:00.000000 is the correct entry for December, 1990.
[Suggest optional for now.]
DECISION 4
Should a date time (timestamp) field be added to BIRTH (or alternatively should PERSON.time_of_birth be changed to timestamp). This will allow more rapid calculation of age but will be redundant with the current information.
[Suggest add BIRTH_DATETIME. Remove TIME_OF_BIRTH.]
DECISION 5
Should we add a *_TIME_GRAN granularity field for each new timestamp field, which would indicate year, month, day, hour, minute, or second as the timestamp's granularity. When a timestamp is filled in, it should be set to the first valid time in that indicated interval.
[Suggest defer decision.]
The text was updated successfully, but these errors were encountered: