From your description, it is not clear whether your layout is properly normalized. (Not saying it isn't, but we can't tell from what you've posted.) Normalization would help organize your data.
Be warned that to do what you want isn't possible unless your design takes into account that you need to count visits in a certain way. This is because in the raw table, there IS no 13th or 19th visit unless you have a compound primary key based on patient ID and date. In the absence of proper ordering information, tables have no order.
Therefore, your design must allow for this by including a way to order the tables and then assign an ordinal position to the records. Once you do that, you can determine the 13th and 19th records. You need dates to provide order and patient IDs to segregate the records into patient-specific subsets.
If you want to know which record is the 13th, you need to do something like this in more or less this order...
1. Include a yes/no field in the detail records.
2. Before you start, set all such fields to NO (an UPDATE query can do this pretty fast)
3. Use an update query to set the field to YES for each case where the count of records with earlier dates = 12.
4. Now select all marked records.
5. When done, repeat the process for count of earlier dates = 18.
Poke around in the forum search to see about assigning ordinal numbers to records. I've seen that topic a few times.