\\documentclass{a4form}
\\usepackage{multicol}
% this is a template of a *community* PBS script form
% (hospital scripts are completely different and must be handwritten [sob])

\\begin{document}
\\begin{page}
\\text{25}{25}{80}{@user['ext_ids']["Prescriber No."]@}
\\text{130}{25}{80}{@user['ext_ids']["Prescriber No."]@}

\\text{35}{33}{80}{@(patient['ext_ids'].has_key ("Repat No.") and patient['ext_ids']['Repat No.']) or patient['ext_ids']["Medicare No."]@}
\\text{140}{33}{80}{@(patient.[['ext_ids'].has_key ('Repat No.'] and patient['ext_ids']["Repat No."]) or patient['ext_ids']["Medicare No."]@}
% use the Department of Veteran's affairs number if available: these patients get extra benefits

\\text{24}{57}{80}{@"%(first)s %(last)s" % patient.get_names ()@}
\\text{129}{57}{80}{@"(first)s %(last)s" % patient.get_names ()@}

\\text{15}{60}{80}{@"%(number)s %(street)s, %(city)s %(postcode)s" % patient['addresses']['home']@}
\\text{120}{60}{80}{@"%(number)s %(street)s, %(city)s %(postcode)s" % patient['addresses']['home']@}

\\text{9}{72}{50}{\\today}
\\text{114}{72}{50}{\\today}

\\ifnum@patient['ext_id's].has_key ("Repat No.")@>0
\\text{27}{77}{10}{X} % mark as RPBS script
\\text{132}{77}{10}{X}
\\else
\\text{7}{77}{10}{X} % ordinary PBS
\\text{112}{77}{10}{X}
\\fi

\\ifnum@brand@>0
\\text{43}{74.5}{7}{X}
\\text{148}{74.5}{7}{X}
\\fi

\\text{22.5}{84}{82.5}{
% TODO: drugs business objects yet to be written
\\vspace{1cm}
\\hspace{1cm} @"%(name)s %(form)s %(direction)s " % drug_list@
}

\\text{127.5}{84}{82.5}{
% TODO: drugs business objects yet to be written
\\vspace{1cm}
\\hspace{1cm} @"%(name)s %(form)s %(direction)s" % drug_list@
}
\\end{page}
\\end{document}