Verily’s clinical research workflows need to identify periods when a patient had no recorded treatment activity. Given a patient event log, write a PostgreSQL query that finds consecutive treatment events separated by more than 90 days.
event_type = 'treatment' and event_date is not NULL.| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique clinical event identifier |
| patient_id | INT | Identifier of the patient associated with the event |
| event_type | VARCHAR(30) | Clinical event classification, such as treatment, visit, or lab |
| event_date | DATE | Date on which the clinical event occurred |