You can add medication that you only taken as needed, and not on a regular schedule, to your Health Plan.
Adding As Needed medication to your Health plan
Go to add a medication to your health plan as you usually would, and choose the frequency as 'As Needed'. This will then let you log it as taken, only when you need it.
How do I then log taking my 'as needed' medication?
Once set up, you will see this as a task just above to your Daily Bonus. Tap it to report a dose whenever you need to, but you do not need to do anything if you do not take that medication. This will not affect your ability to complete the Daily Bonus and earn your daily Heart.