Twig template variables: Related records
The related record variables show data of a related record (for example, the breed of a patient or the payment terms of a client). Use these variables after a variable that shows a related record.
Variables that show a list
Some of these variables show a list. For example, consult.Vaccinations shows a list of the vaccinations of a clinical record.
To use a variable of this type:
- Put the variable in a Twig
forloop. - Between the
fortag and theendfortag, put the text to show for each item. - After
for, enter a name for each item in the list.
Note: Use the same name in the variables in the loop.
Example:
{% for vaccination in consult.Vaccinations %}
{{ vaccination.Description }}: invoice {{ vaccination.Invoice.Number }}
{% endfor %}In this example:
consult.Vaccinationsis the list of the vaccinations of a clinical record.vaccinationis the name for each item in the list.vaccination.Descriptionshows the description of each vaccination.vaccination.Invoice.Numbershows the number of the invoice of each vaccination.- The document shows the text between the tags one time for each item in the list.
Variables
| Name | Classic template system equivalent? | Function |
|---|---|---|
{{ animal.Breed.Name }} | No | Shows the name of the breed of the patient. Tip: To show the species record of the breed, enter {{ animal.Breed.Species }}. |
{{ animal.Species.Name }} | No | Shows the name of the species of the patient. |
{{ contact.PaymentTerms.Name }} | No | Shows the name of the payment terms of the client. |
{{ contact.PaymentTerms.Blurb }} | No | Shows the text of the payment terms of the client. |
{{ payment.PaymentMethod.Name }} | No | Shows the name of the payment method of the payment. |
{{ vaccination.Description }} | No | Shows the description of a vaccination of the clinical record. Note: Use this variable in a Twig for loop of {{ consult.Vaccinations }}. |
{{ medication.Prescription.Medications }} | No | Shows a list of all medications of the prescription. |
{{ problem.Specifics }} | No | Shows the content of the Specifics box of a master problem, therapeutic plan or diagnostic test request. Note: Use this variable in a Twig for loop of one of these variables:
|