Currently writing a clinical report in Cerner's CCL (derived from SQL). The start of a patient's central line insertion is posted on 1 form, and the end on another form. Patients may end up having more than 1 start time documented on the same encounter (separate insertion forms). I am trying to line up a patients start and end times in order.
Example, this patient has 4 start times with end times that fall between 2 of the start times; a total of 8 documents. It is not a good workflow but it is what I am stuck with.
If I try:
join ce4
where ce4.parent_event_id = ce3.event_id
and ce4.event_cd = 703852.00 ;Central IV Activity Type
and ce4.result_val in ("Discontinue", "Deaccessed Port")
and ce4.performed_dt_tm > cnvtdatetime(data->centr[d.seq].dev_start)
It will only show the last time on the return for all 4 start times. My question is how do I get them to return in order between start times.