Commit 3a5d5bca authored by Kamalavelan's avatar Kamalavelan 💬

Changed migrations, added questionnaire table

Created local copy of Bulma
Updated dependencies
Signed-off-by: Kamalavelan's avatarKamalavelan <sskamalavelan@gmail.com>
parent 024eb0a3
......@@ -12,19 +12,19 @@
;; [io.pedestal/pedestal.tomcat "0.5.5"]
[ch.qos.logback/logback-classic "1.2.3" :exclusions [org.slf4j/slf4j-api]]
[org.slf4j/jul-to-slf4j "1.7.26"]
[org.slf4j/jcl-over-slf4j "1.7.26"]
[org.slf4j/log4j-over-slf4j "1.7.26"]
[org.slf4j/jul-to-slf4j "1.7.28"]
[org.slf4j/jcl-over-slf4j "1.7.28"]
[org.slf4j/log4j-over-slf4j "1.7.28"]
[hiccup "2.0.0-alpha2"]
[org.clojure/clojurescript "1.10.520"]
[hikari-cp "2.8.0"]
[hikari-cp "2.9.0"]
[mount "0.1.16"]
[ragtime "0.8.0"]
[org.postgresql/postgresql "42.2.6"]
[com.layerware/hugsql "0.4.9"]
[org.postgresql/postgresql "42.2.8"]
[com.layerware/hugsql "0.5.1"]
[buddy/buddy-auth "2.2.0"]
[buddy/buddy-hashers "1.4.0"]
[cheshire "5.8.1"]]
[cheshire "5.9.0"]]
:min-lein-version "2.0.0"
:resource-paths ["config", "resources"]
......
{:visit [{:days [7, 14]
:baby_ask ["When passed urine & meconium?", "Difficulties in breastfeeding?", "Fever?", "Not suckling well?", "Any complaints?"]
:baby_examine ["Respiratory rate", "Baby's color - Pallor / Jaundice / Cynanosis", "Baby's body temperature"]
:baby_counsel ["Exclusive breastfeeding","Hygiene of the baby", "When & where to seek help in case of signs of illness", "Immunization"]
:mother_ask ["Any bleeding?", "Any vaginal discharge?", "Fever?", "Breast swelling?", "Pain during passing urine","Not feeling well?", "Unhappiness / Post-partum depression?"]
:mother_examine ["BP, Pulse, Temperature", "Abdominal and vulval examination", "Check breasts and nipples"]
:mother_counsel ["Diet", "Contraception"]}
,{:days [28]
:mother_ask ["Has vaginal bleeding stopped?", "Has menstrual cycle resumed?", "Any vaginal discharge?", "Pain during passing urine?", "Does not feel well?", "Any problems with breastfeeding?"]
:mother_examine ["BP", " Check Pallor", "Examine vulva & perinium", "Breast & Nipples"]
:mother_counsel ["Diet & Rest", "Nutrition", "Contraception"]
:baby_ask ["Received vaccines recommended so far","Does baby take breastfeeds well?", "Does baby have any problems?"]
:baby_examine ["Weight of the baby", "Check if baby is active or lethargic"]
:baby_counsel ["Importance of exclusive breastfeeding", "Immunization", "About emergency care unit if baby is having problems?"]}]}
;; Centers table
{:up ["CREATE TABLE questionnaire
(id SERIAL PRIMARY KEY,
days INT,
question VARCHAR(255),
subject VARCHAR(20),
task VARCHAR(30));"]
:down ["DROP TABLE questionnaire CASCADE;"]}
......@@ -4,5 +4,6 @@
mother INT references mothers(id),
worker VARCHAR(250) references users(email),
geolocation VARCHAR(100),
date TIMESTAMP);"]
sched_date DATE,
visited_date DATE);"]
:down ["DROP TABLE mothers CASCADE;"]}
......@@ -4,6 +4,6 @@
worker VARCHAR(255) REFERENCES users(email),
mother INT REFERENCES mothers(id),
visit INT REFERENCES visits(id),
question VARCHAR(255),
answer VARCHAR(255));"]
:down ["DROP TABLE centers CASCADE;"]}
question INT REFERENCES questionnaire(id),
answer BOOLEAN);"]
:down ["DROP TABLE questions CASCADE;"]}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -113,6 +113,8 @@
["/create/center" :post (conj common-interceptors `site.centers/create-center-post) :route-name :center-create-post]
["/create/user" :get (conj common-interceptors `site.users/create-user-page) :route-name :user-create-get]
["/create/user" :post (conj common-interceptors `site.users/create-user-post) :route-name :user-create-post]
["/create/visit" :get (conj common-interceptors `site.visits/visit-add-page) :route-name :visit-add-page]
["/create/visit" :post (conj common-interceptors `site.visits/visit-add-post) :route-name :visit-add-post]
["/users" :get (conj json-interceptors `site.users/user-all)]
["/users/login" :get (conj common-interceptors `site.auth/auth-page) :route-name :user-login-page]
......@@ -123,20 +125,15 @@
["/user/:user-id" :get (conj json-interceptors `site.users/user-record-page) :route-name :user-record-page]
["/user/:user-id/update" :post (conj json-interceptors `site.users/user-record-update) :route-name :user-record-update]
["/user/:user-id/edit" :get (conj common-interceptors `site.users/user-record-page) :route-name :user-record-edit]
["/user/:user-id/mothers/all" :get (conj json-interceptors `site.mothers/mothers-by-worker) :route-name :mothers-all-by-worker]
["/center/:center-id/mothers/create" :get (conj common-interceptors `site.mothers/create-mother-page) :route-name :mother-create-get]
["/center/:center-id/mothers/create" :post (conj common-interceptors `site.mothers/create-mother-post) :route-name :mother-create-post] ;; ["/centers" :get (conj json-interceptors `site.users/user-all)]
["/center/:center-id" :get (conj common-interceptors `site.centers/center-overview-page) :route-name :center-overview-page]
;;
["/center/:center-id/users" :get (conj common-interceptors `site.centers/users-all-page) :route-name :center-users-all-page]
["/center/:center-id/mothers" :get (conj common-interceptors `site.centers/mothers-all-page) :route-name :center-mothers-all-page]
;; ["/mothers" :get (conj json-interceptors `site.users/user-all)]
["/mother/:mother-id" :get (conj common-interceptors `site.mothers/mother-record-page) :route-name :mother-record-page]
["/mother/:mother-id/update" :post (conj common-interceptors `site.mothers/mother-record-update) :route-name :mother-record-update-post]
["/mother/:mother-id/edit" :get (conj common-interceptors `site.mothers/mother-record-page) :route-name :mother-record-edit]
......@@ -145,9 +142,6 @@
["/questions" :get (conj common-interceptors `site.questions/questions-list-page) :route-name :questions-list-page]
["/questions/add" :get (conj common-interceptors `site.questions/add-questions-page) :route-name :questions-list-add]
["/visits/add" :get (conj common-interceptors `site.visits/visit-add-page) :route-name :visit-add-page]
["/visits/add" :post (conj common-interceptors `site.visits/visit-add-post) :route-name :visit-add-post]
["/visits/:visit-id" :get (conj common-interceptors `site.visits/visit-page) :route-name :visit-page]
......
......@@ -103,7 +103,7 @@
[:div.column.is-one-third
[:h1.title.is-size-3 "Configure"]
[:a.button.is-primary {:href "/create/center"} "Add new center"] [:hr]
[:a.button.is-primary {:href "/visits/add"} "Add new visit"] [:hr]
[:a.button.is-primary {:href "/create/visit"} "Add new visit"] [:hr]
;;[:a.button.is-primary {:href "/create/user"} "Add new worker"] [:hr]
]
[:div.column
......
(ns pprg.site.questions
(:require [hiccup.core :as hiccup]
[ring.util.response :as ring-resp]
[pprg.site :as site]
[pprg.site.auth :as site.auth]
[buddy.auth :as buddy.auth]
[pprg.db :as db]
[pprg.db.centers :as db.centers]
[pprg.db.users :as db.users]
[pprg.db.mothers :as db.mothers]
[pprg.site.centers :as site.centers]
[pprg.site.users :as site.users]
[pprg.site.mothers :as site.mothers]))
(defn add-questions-page [request]
(ring-resp/response
(site/admin-template
"Add new question")))
(defn questions-list-page [request]
(ring-resp/response
(site/admin-template
"All questions")))
(defn populate-questions-db []
(let [a (slurp "/resources/data/visits-data.edn")]
;;
))
(ns pprg.site.visits
(:require [hiccup.core :as hiccup]
[ring.util.response :as ring-resp]
[pprg.site :as site]
[pprg.site.auth :as site.auth]
[buddy.auth :as buddy.auth]
[pprg.db :as db]
[pprg.db.centers :as db.centers]
[pprg.db.users :as db.users]
[pprg.db.mothers :as db.mothers]))
(defn visit-add-post [request])
(defn visit-add-page [request]
(ring-resp/response
(site/admin-template
"Add new visit"
[:h1.title "Add new visit"]
[:div.column.is-2
[:form {:method "POST" :action "/create/visit"}
(site/form-control "Days from childbirth" "name")
(site/form-control-checkbox "All mothers?" "all_mothers")
(site/form-control-button "Submit")]])))
(defn visit-page [request]
(ring-resp/response (:visit-id (:path-params request))))
(defn visits-list-table []
[:div.column
[:h1.title.is-size-3 "Visits"]])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment