appointments query had an unfortunate space
new patient writing was broken!
fixes #166 fixes #167