From b3484b533476aa6d6263775b7a79670bc9eec70e Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 21 Dec 2016 02:21:54 +0530 Subject: Initial commit --- ksh-discharge.el | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 ksh-discharge.el (limited to 'ksh-discharge.el') diff --git a/ksh-discharge.el b/ksh-discharge.el new file mode 100644 index 0000000..9bd0e6d --- /dev/null +++ b/ksh-discharge.el @@ -0,0 +1,63 @@ +;; -*- lexical-binding: t -*- + +(load "ksh-forms-improved.el") + +;; Datafile path and fields +(setq forms-file (expand-file-name "discharge.dat" ksh-data-path)) +(setq forms-number-of-fields + (forms-enumerate + '(ip-op-no patient-name age sex address admission-date + discharge-date diagnosis surgical-procedure + history clinical-examination course-in-hospital + investigation treatment condition-on-discharge advice))) + +;; Default values for fields +(setq default-field-values + `((,sex . "F") + (,advice . "Triple A Cal Forte - 30 Cap"))) + +;; Format specification for form display +(setq forms-format-list + (append + (list "Discharge Summary\n\n") + (form-entries + '(("IP/OP No" . ip-op-no) + ("Age" . age) + ("Sex" . sex) + ("Name of Patient" . patient-name) + ("Address" . address) + ("Date of Admission" . admission-date) + ("Date of Discharge" . discharge-date) + ("Diagnosis" . diagnosis) + ("Surgical Procedure" . surgical-procedure) + ("History" . history) + ("Clinical Examination" . clinical-examination) + ("Course in Hospital" . course-in-hospital) + ("Investigation" . investigation) + ("Treatment" . treatment) + ("Condition on Discharge" . condition-on-discharge) + ("Advice" . advice))))) + +(setq form-to-org + (lambda () + (with-output-to-string + (make-report-header "DISCHARGE SUMMARY") + (single-line-org-entries + `(("IP/OP No" . ,ip-op-no) + ("Age" . ,age) + ("Sex" . ,sex) + ("Name of Patient" . ,patient-name) + ("Date of Admission" . ,admission-date) + ("Date of Discharge" . ,discharge-date))) + (multi-line-org-entries + `(("Address" . ,address) + ("Diagnosis" . ,diagnosis) + ("Surgical Procedure" . ,surgical-procedure) + ("History" . ,history) + ("Clinical Examination" . ,clinical-examination) + ("Course in Hospital" . ,course-in-hospital) + ("Investigation" . ,investigation) + ("Treatment" . ,treatment) + ("Condition on Discharge" . ,condition-on-discharge) + ("Advice" . ,advice) + ("Signature of the Medical Officer" . "")))))) -- cgit v1.2.3