Change how you store treatment attached to an appointment
Currently ( 8.0.7 ) in the database, treatment is stored as an encoded string in the appointment record. This prevents easy retrieval of procedures that have not been scheduled.
It would be far more useful if there were a separate table which linked procedures with appointments. Not only would this allow easier retrieval of procedures that still need attention, but it would also give greater flexibility in tracking past procedures that have been done ( you could follow the appointment history to completion from the procedure itself instead of having to scan the ledger for tx ).