The most likely reason for this is because the clinical note containing the template is not linked to either a referral or an appointment. Linking the note to a referral or appointment will tell Halaxy which appointment or referral should be used for the dynamic term.
To link a clinical note to an appointment or the referral:
Navigate to the clinical note.
Click the Edit (pencil) icon towards the top of the page (next to the name of the template).
The Edit Clinical Note pop-up appears. From the relevant drop-down menu, select the Referral or Appointment the note is to be linked to.
RESULT: The dynamic terms should now display after you preview or publish the note. In addition, you will see the clinical note become a "child" of either the referral or the appointment you linked it to in the left-hand column (the note will be indented underneath the "parent" referral or appointment).
To link a clinical note to both a referral AND an appointment, you must use the clinical note that is created automatically when you make an appointment in the calendar (the one named "Appointment" by default). You can rename it if you wish.