# Document Templates A document template is the text the system fills in to produce a patient document: a prescription, a medical certificate, a referral letter, an inpatient diagnosis card and so on. Each template belongs to one user, so each doctor can have their own wording and layout. **Path:** EMR menu (stethoscope icon) → **Settings** → **Documents** tab → **Add new Document Template** or **List Document Templates** The **View Template Examples** button on the Document Templates screen opens this page. ## Template types | Type | Used for | |---|---| | **Prescription** | The prescription printed from an OPD or clinic visit | | **Medical Certificate** | Medical (sick-leave) certificates | | **Fitness Certificate** | Fitness certificates | | **Referral** | Referral letters to another doctor or institution | | **Inpatient Diagnosis Card** | The diagnosis card given at discharge. See [Generation of Inpatient Diagnosis Card](Generation-of-Inpatient-Diagnosis-Card). | | **Inpatient Letter** | Letters about an admission, for example to a credit company | | **Inpatient Email** | Emails about an admission. The template also has an **Email Subject**. | | **Covering Letter** | Covering letters sent with bills. See [Covering Letters for Multiple Admissions and Bills](Covering-Letters-for-Multiple-Admissions-and-Bills). | ## Create or edit a template 1. Enter the **Name** and choose the **Type**. 2. Choose the **User** the template belongs to. 3. Write the **Template Content**. Type placeholders such as `{patient_name}` where the patient's details should go. The **Available Placeholders** panel beside the editor lists every placeholder. 4. Set the options: - **Default Template**: use this template automatically. For example, a default **Prescription** template is created for every new visit. - **Auto Regenerate**: refill the document from the template whenever the visit changes, so it always shows the latest medicines and findings. Turn it off if doctors edit the generated text by hand. 5. Click **Save Template**. ## Placeholders The editor lists them all. The main groups are: | Group | Examples | |---|---| | Patient | `{patient_name}`, `{patient_age}`, `{sex}`, `{address}`, `{phone}`, `{patient_phn_number}`, `{patient_nic}` | | Visit | `{comments}`, `{height}`, `{weight}`, `{bmi}`, `{bp}`, `{pr}`, `{rr}`, `{pfr}`, `{sat}` | | Clinical | `{medicines}`, `{indoor}`, `{outdoor}`, `{ix}` (investigations), `{pa}` (plan of action), `{allergies}` | | Certificates and referrals | `{medical_start_date}`, `{medical_end_days}`, `{medical_certificate_duration}`, `{referral_institution}`, `{referral_doctor}` | | Inpatient diagnosis card | `{bht}`, `{doa}` (date of admission), `{dod}` (date of discharge), `{dx}` (diagnoses), `{rx}` (inpatient treatment), `{drx}` (discharge treatment), `{procedures}` | | Inpatient letter | `{credit_company}`, `{credit_company_address}` | ## Related - [EHR Settings](EHR-Settings) - [Electronic Health Record (EHR)](Electronic-Health-Record-(EHR))