Need help on calculation and configuring case list

Hi, everyone

Module I: I have a registration form where patients can be of any of the following types:

  1. Support visit
  2. Lost to follow up

Module II: For support visit case, we make two visits. The first visit is immediately after registration and the second visit is 37 days after the first visit as shown the app preview case detail. The case can change from support visit to lost to follow up.
I have Aida Maleco whose 2nd visit is within 37 days (proxima visita= next visit date). What I would like to happen is that when Aida changes, for example, to lost to follow up, the app does not show me 37 days in the case detail list, but this is what is happening now even if there has a case change.

Could you help me to implement this logic?