def appointment(journal, form=None): if journal: appt = model.get_appointment(journal.id) pt = model.get_pt(journal.patientid) txs = model.get_tx_for_appointment(appt.journalid) else: inp = web.input(pt=0) appt = None pt = model.get_pt(int(inp.pt)) txs = model.get_txplan(int(inp.pt)) if not form: form = forms.journal['appointment']() if journal: form['patientid'].set_value(str(pt.id)) form['journalid'].set_value(str(journal.id)) form['ts'].set_value(model.display_datetime(model.load_datetime(journal.ts))) form['summary'].set_value(journal.summary) form['status'].set_value(appt.status) form['notes'].set_value(appt.notes) form['kind'].set_value(appt.kind) form['duration'].set_value(appt.duration) return render.appointment(journal, appt, pt, form, txs)
def GET(self, id): pt = model.get_pt(id) newtx = forms.newtx() txplan = model.get_txplan(pt.id) return render.txplan(pt, newtx, txplan)