summaryrefslogtreecommitdiff
path: root/ksh-scan3.el
diff options
context:
space:
mode:
authorArun Isaac2016-12-21 02:21:54 +0530
committerArun Isaac2016-12-21 02:21:54 +0530
commitb3484b533476aa6d6263775b7a79670bc9eec70e (patch)
treeb23b559f5aef54bcde689ee7307da762181dce9a /ksh-scan3.el
downloadksh-reports-b3484b533476aa6d6263775b7a79670bc9eec70e.tar.gz
ksh-reports-b3484b533476aa6d6263775b7a79670bc9eec70e.tar.lz
ksh-reports-b3484b533476aa6d6263775b7a79670bc9eec70e.zip
Initial commit
Diffstat (limited to 'ksh-scan3.el')
-rw-r--r--ksh-scan3.el130
1 files changed, 130 insertions, 0 deletions
diff --git a/ksh-scan3.el b/ksh-scan3.el
new file mode 100644
index 0000000..83018c5
--- /dev/null
+++ b/ksh-scan3.el
@@ -0,0 +1,130 @@
+;; -*- lexical-binding: t -*-
+
+(load "ksh-forms-improved.el")
+(load "ksh-report-header.el")
+(load "ksh-biometry.el")
+
+;; Datafile path and fields
+(setq forms-file (expand-file-name "scan3.dat" ksh-data-path))
+(setq forms-number-of-fields
+ (forms-enumerate
+ '(ip-op-no patient-name age sex visit-date lmp-date lmp-edd
+ scan
+ survey-presentation survey-placenta survey-liquor
+ survey-amniotic-fluid-index survey-umbilical-cord
+ survey-fetal-activity survey-cardiac-activity
+ survey-fetal-heart-rate
+ biometry-bpd biometry-bpd-age biometry-bpd-percentile
+ biometry-hc biometry-hc-age biometry-hc-percentile
+ biometry-ac biometry-ac-age biometry-ac-percentile
+ biometry-fl biometry-fl-age biometry-fl-percentile
+ biometry-fetal-weight
+ impression-gestational-age impression-menstrual-age
+ impression-corrected-edd impression-notes
+ sonologist)))
+
+;; Default values for fields
+(setq default-field-values
+ `((,sex . "F")
+ (,survey-presentation . "cephalic")
+ (,survey-placenta . "posterior")
+ (,survey-liquor . "normal")
+ (,survey-fetal-activity . "normal")
+ (,survey-cardiac-activity . "normal")
+ (,sonologist . "Dr. Bala Bharathy")))
+
+;; Format specification for form display
+(setq forms-format-list
+ (append
+ (list "Trimester 3 - Scan Report\n\n")
+ (form-entries
+ '(("IP/OP No" . ip-op-no)
+ ("Patient Name" . patient-name)
+ ("Age" . age)
+ ("Sex" . sex)
+ ("Visit Date" . visit-date)
+ ("LMP Date" . lmp-date)
+ ("LMP EDD" . lmp-edd)))
+ (list "Indications\n" "Growth Scan\n"
+ "Real time B-mode ultrasonography of gravid uterus done.\n"
+ "Route: Transabdominal\n" scan "\n\n")
+ (list "Fetal Survey\n")
+ (form-entries
+ '(("Presentation" . survey-presentation)
+ ("Placenta" . survey-placenta)
+ ("Liquor" . survey-liquor)
+ ("Amniotic fluid index" . survey-amniotic-fluid-index)
+ ("Umbilical cord" . survey-umbilical-cord)
+ ("Fetal activity" . survey-fetal-activity)
+ ("Cardiac activity" . survey-cardiac-activity)
+ ("Fetal heart rate" . survey-fetal-heart-rate)))
+ (list "Fetal Biometry\n")
+ (form-entries
+ '(("BPD" . biometry-bpd)
+ ("BPD-Age" . biometry-bpd-age)
+ ("BPD-Percentile" . biometry-bpd-percentile)
+ ("HC" . biometry-hc)
+ ("HC-Age" . biometry-hc-age)
+ ("HC-Percentile" . biometry-hc-percentile)
+ ("AC" . biometry-ac)
+ ("AC-Age" . biometry-ac-age)
+ ("AC-Percentile" . biometry-ac-percentile)
+ ("FL" . biometry-fl)
+ ("FL-Age" . biometry-fl-age)
+ ("FL-Percentile" . biometry-fl-percentile)
+ ("Estimated fetal weight according to BPD, HC, AC, FL" . biometry-fetal-weight)))
+ (list "Impression\n")
+ (form-entries
+ '(("Gestational age" . impression-gestational-age)
+ ("Menstrual age" . impression-menstrual-age)
+ ("Corrected EDD" . impression-corrected-edd)
+ ("Notes" . impression-notes)
+ ("Sonologist" . sonologist)))))
+
+(setq form-to-org
+ (lambda ()
+ (with-output-to-string
+ (make-report-header "OB - 3/3 TRIMESTER SCAN REPORT")
+ (single-line-org-entries
+ `(("IP/OP No" . ,ip-op-no)
+ ("Age" . ,age)
+ ("Sex" . ,sex)
+ ("Name of Patient" . ,patient-name)
+ ("Visit Date" . ,visit-date)
+ ("LMP Date" . ,lmp-date)
+ ("LMP EDD" . ,lmp-edd)))
+ (mapc 'princ `("* Indications\n" "** Growth Scan\n"
+ "Real time B-mode ultrasonography of gravid uterus done.\n\n"))
+ (single-line-org-entries
+ `(("Route" . "Transabdominal")))
+ (text-if-non-blank (get-field scan))
+ (princ "* Fetal Survey\n")
+ (single-line-org-entries
+ `(("Presentation" . ,survey-presentation)
+ ("Placenta" . ,survey-placenta)
+ ("Liquor" . ,survey-liquor)
+ ("Amniotic fluid index" . ,survey-amniotic-fluid-index)
+ ("Umbilical cord" . ,survey-umbilical-cord)
+ ("Fetal activity" . ,survey-fetal-activity)
+ ("Cardiac activity" . ,survey-cardiac-activity)
+ ("Fetal heart rate" . ,survey-fetal-heart-rate)))
+ (princ "* Fetal Biometry\n")
+ (insert-biometry
+ `(("BPD" ,biometry-bpd ,biometry-bpd-age ,biometry-bpd-percentile)
+ ("HC" ,biometry-hc ,biometry-hc-age ,biometry-hc-percentile)
+ ("AC" ,biometry-ac ,biometry-ac-age ,biometry-ac-percentile)
+ ("FL" ,biometry-fl ,biometry-fl-age ,biometry-fl-percentile)))
+ (princ "* Impression\n")
+ (princ (format "%s corresponding to a gestational age of %s\n\n"
+ (get-field scan) (get-field impression-gestational-age)))
+ (princ "Gestational age assigned as per biometry (CRL)\n\n")
+ (single-line-org-entries
+ `(("Menstrual age" . ,impression-menstrual-age)
+ ("Corrected EDD" . ,impression-corrected-edd)
+ ("Placenta" . ,survey-placenta)
+ ("Presentation" . ,survey-presentation)
+ ("Liquor" . ,survey-liquor)
+ ("Estimated fetal weight according to BPD, HC, AC, FL" . ,biometry-fetal-weight)))
+ (text-if-non-blank (get-field impression-notes))
+ (multi-line-org-entries
+ `(("Sonologist" . ,sonologist))))))