Nightingale document template data
What a document template receives as data, per document kind.
In a template
Before compiling, the worker prepends #let data = json.decode("…"), so a template reads data.patient.full_name, data.visit.status.label and so on.
Fields
Every declared field is always present; a field with no value is none.
Sections
Some fields are sections, gated by a permission of the person asking for the document (and, for what is reached through a visit, access to its location). A section they may not see is none; a section with nothing recorded is an empty list. Leave a none section out entirely: printing it as empty would tell the reader that nothing is recorded when the requester simply cannot see it. Every section says so in its description.
Values
Coded values carry a stable code to compare against and a label in the template's locale. Dates and times carry an iso value and a display string already formatted for the template's locale, in the issuing location's time zone. Nothing describes the request: there is no requester and no generation time. The data holds only what the person who asked for the file may see.
Versioning
data.document.data_version is the version. Fields and enum values may be added within a version; removing or renaming a field, or changing its type, is a new version.