I want to flag the below criteria.
A given day involved a diagnosis or an imaging procedure, and look for up to 10 days after the given day and search for the same body-site or type of injury. If so, we will connect the days of the two sets of records. Using the latter-day as the reference, and we will repeat the procedure until we no longer observed a subsequent day with relevant diagnosis code within a 10-day window.
Thank you for the help!