summaryrefslogtreecommitdiff
path: root/ksh-discharge.el
diff options
context:
space:
mode:
Diffstat (limited to 'ksh-discharge.el')
-rw-r--r--ksh-discharge.el63
1 files changed, 63 insertions, 0 deletions
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" . ""))))))