summaryrefslogtreecommitdiff
path: root/ksh-discharge.el
blob: 9bd0e6de655764a7fb58287fb6444640ffbe1dfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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" . ""))))))