/ Current View source
Projects/ImmuKnow Studio/Typst Reference

Typst Reference

Examples for editing ImmuKnow letters. Keep the opening #import "settings.typ" as immuknow and #show: immuknow.letter lines and the @immuknow-settings comment in Template in place; they are essential setup. They provide the client information, dates and page settings used below. Settings connects the selected client once; the helpers already know whose information to display.

Write and format

*Important* and _emphasized_ words.

A blank line starts a new paragraph.
#text(size: 12pt, fill: immuknow.heading-color)[Please reply.]
#v(0.3cm)
#align(center)[Thank you.]

# starts code in ordinary text; […] contains text inside code. Inside a function's parentheses, another function needs no #. Use // for a comment, \@ for a literal at sign, and \# for a literal hash.

Client information

Record: #immuknow.notice.client_id
As of #immuknow.date_as_of

#if immuknow.to_student [
  Please update your record.
] else if immuknow.to_guardian [
  Please update your child's record.
] else [
  Please update the named client's record.
]

immuknow.to_student and immuknow.to_guardian are boolean flags supplied by Settings. An explicit CSV intended_reader choice takes priority over the age default. Only one flag can be true; both are false when the reader is unknown, so the final else uses neutral wording. The address block uses the same reader by default, including in suspension orders. Its addressee option overrides the label without changing the intended reader. Use the Example client arrows to try different readers, including Sarah Cook with an explicit guardian choice.

Records and notice eligibility

#if immuknow.no_records [Please send any available vaccination records.]
#if immuknow.up_to_date [No diseases are reported overdue.]
#immuknow.overdue-diseases(no-records: auto)
#immuknow.overdue-diseases(ispa-only: true)
#let ispa_up_to_date = immuknow.notice-flags(include-ispa: true).ispa_up_to_date

immuknow.no_records describes the original history before exclusions. immuknow.up_to_date reflects overdue diseases, independently of overdue immunizing agents. Wrap a whole section in #if not immuknow.no_records […] to omit it when records are absent. The affirmative starter errors when diseases are overdue. The suspension starter requires an overdue ISPA disease and lists only diseases covered for the client's birth cohort, including varicella for births from 2010. ISPA-only agent lists are unsupported. Keep upstream assessments and explicit notice assignments; these flags do not assess exemptions.

Client identifiers and history legends

#immuknow.client-block(show-client-id: false, show-oiid: true, missing-oiid: auto)
#immuknow.immunization-history(legend-labels: (invalid: "Does not count toward requirements"))

Client ID and OIID display are independent. The optional CSV oiid column preserves leading zeros. For a missing OIID, use none to omit the line, "" for a blank value, auto for “Not available” / “Non disponible”, or custom text. Enabling OIID display errors if the entire input cohort lacks OIIDs. Each downloaded example is a one-client cohort. Labels are customizable with id-label and oiid-label.

Validity display defaults to true. Fully unflagged histories use recorded-dose marks; partially flagged histories error unless validity display is explicitly disabled. Legends appear only when applicable and have English/Canadian French defaults. Customize valid, invalid or unspecified entries in legend-labels.

Pages and headings

#immuknow.notice-page("Immunization Record")[
  For your reference:
  #immuknow.immunization-history()
]

immuknow.notice-page starts a new page with a heading and warns if the content runs onto another page. Add allow-overflow: true when you want to allow extra pages. immuknow.immunization-history() places the history table using your Settings choices. To change just this table, pass an option such as #immuknow.immunization-history(show-age: true, font-size: 12pt). Page options work the same way, for example #immuknow.notice-page("Immunization Record", title-size: 18pt)[...]. These choices leave other calls unchanged.

Address, overdue list and QR code

#immuknow.client-block(window: immuknow.envelope-window)
#immuknow.overdue-diseases(columns: 1)
#immuknow.overdue-agents(ignore-agents: ("COVID-19 mRNA", "Inf (TIV)"))
#immuknow.qr-code(..immuknow.qr)

Use overdue-agents for the vaccine agent list. Its ignore-agents option excludes exact agent-name matches from that list only. Set the history table's ignore-agents separately; neither option changes the source facts. Overdue lists display repeated items once; disease entries with different doses stay distinct when include-dose is enabled. Duplicate source entries produce warnings in Findings and remain unchanged in the source facts. Bullet indentation defaults to 0.8cm; set indent: 1cm on the helper to change just that list. These functions display the client's information; their options control how it looks. Add font-size: 11pt or details: "below" to a client block when you want to change its defaults. Omit the QR call when the letter does not use a QR code. ..immuknow.qr uses the group of QR options defined in Settings. Review Findings for any warnings about the letter.

Signature image and printed name

#immuknow.signature-block(
  signature: image("assets/signature.png", width: 4.5cm),
  name: "Dr. Annie Body, MD",
  title: "Medical Officer of Health",
)

For a smaller signature, change width: 4.5cm to width: 3cm. Leave height out to preserve the image's aspect ratio. The filename, size and printed name are visible in the Template. Theme can change the image and printed name without changing its width. In a suspension order, order-signatory-name controls the name in the legal wording separately from credentials printed below the signature.

Links and reusable text

#let reply-line(deadline) = [
  Please reply by *#deadline*.
]
#reply-line("March 2")
#immuknow.link("https://example.org/immunization")[Update your record]

#let defines a value or a function you can use again. Use immuknow.link to include a link in ImmuKnow's checks. To put a client ID in a web address, use immuknow.query-url(base, (client: immuknow.notice.client_id)), where base is your website address. It handles special characters in the ID for you.

Editor shortcuts

Press Ctrl+Space for suggestions; use the arrow keys and Enter to choose one, or Escape to dismiss. Hover over a supported function for its options and an example.

Ctrl+/ comments selected lines; Ctrl+[ and Ctrl+] change indentation. On a Mac, use Command for these editing shortcuts; suggestions still use Ctrl+Space.

Try short and long examples, review every page and read Findings. Double-click preview text to locate its source when available.