Skip to content

Central line/arterial line durations have overlapping rows #371

Description

@alistairewj

Recently added some preliminary queries to get presence of central line (ref #312) / arterial line.

Ideally each row would contain the start time and end time of a line, and rows would not overlap. At the moment however, the rows are overlapping.

select
  cl1.*
from arterial_line_durations cl1
where icustay_id in
(
  select
  cl1.icustay_id
  -- , cl1.starttime, cl1.endtime
  -- , cl2.starttime as starttime2, cl2.endtime as endtime2
from arterial_line_durations cl1
left join arterial_line_durations cl2
  on cl1.icustay_id = cl2.icustay_id
  and cl1.starttime > cl2.starttime
  and cl1.endtime < cl2.endtime
where cl2.icustay_id is not null
)
order by cl1.icustay_id, cl1.starttime;
icustay_id starttime endtime duration_hours
200063 2141-03-12 16:30:00 2141-03-17 14:45:00 118.25
200063 2141-03-12 16:32:00 2141-03-13 20:00:00 27.4666666666667
200063 2141-03-17 12:30:00 2141-03-21 22:27:00 105.95

Similar query for a-lines.

select
  cl1.*
from central_line_durations cl1
where icustay_id in
(
  select
  cl1.icustay_id
  -- , cl1.starttime, cl1.endtime
  -- , cl2.starttime as starttime2, cl2.endtime as endtime2
from central_line_durations cl1
left join central_line_durations cl2
  on cl1.icustay_id = cl2.icustay_id
  and cl1.starttime > cl2.starttime
  and cl1.endtime < cl2.endtime
where cl2.icustay_id is not null
)
order by cl1.icustay_id, cl1.starttime;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions