Wiki source code of Cases
Last modified by Jip-jan Alunkel on March 27, 18:30
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{include reference="assets.pagemaker.macros"/}} | ||
2 | |||
3 | {{velocity}} | ||
4 | #set($discard = $services.localization.use('document', 'cases.Code.translations')) | ||
5 | #set($discard = $services.localization.use('document', 'assets.pagemaker.translations')) | ||
6 | #set($discard = $xwiki.ssx.use('assets.pagemaker.WebHome', {'minify': false})) | ||
7 | #set($discard = $xwiki.jsx.use('assets.pagemaker.WebHome', {'minify': false})) | ||
8 | |||
9 | {{html wiki="true" clean="false"}} | ||
10 | <div class="intro-text float-right col-xs-12 col-sm-4"> | ||
11 | <p class="intro-text"> | ||
12 | <span class="saying">The true healing art is in its nature a pure science of experience, and can and must rest on clear facts and on the sensible phenomena pertaining to their sphere of action, for all the subjects it has to deal with are clearly and satisfactorily cognizable by the senses through experience.</span> | ||
13 | <span class="sayee">Samuel Hahnemann</span> | ||
14 | </p> | ||
15 | </div> | ||
16 | <p> | ||
17 | Memorable cases are preserved in our memory as stories, helping us to become better in what we do. | ||
18 | The publication of these stories would obviously have tremendous potential to teach and inspire. | ||
19 | If you want to share your case(s) too, you can do this here. | ||
20 | </p> | ||
21 | #if ($xcontext.user == 'XWiki.XWikiGuest') | ||
22 | <p> | ||
23 | Please remember to <a data-toggle="modal" data-target="#displayLogin" href="#">log in</a> for this functionality. Not registered yet? You can register via the login screen. | ||
24 | </p> | ||
25 | #end | ||
26 | <p class="alert alert-success alert-float-left alert-button-float-right"> | ||
27 | <span class="alert-button pull-right"> | ||
28 | #if ($xcontext.user != 'XWiki.XWikiGuest') | ||
29 | <a href="#addCase" class="btn btn-success">Add case</a> | ||
30 | #else | ||
31 | <a data-toggle="modal" data-target="#displayLogin" href="#" class="btn btn-primary">$services.localization.render('login')</a> | ||
32 | #end | ||
33 | </span> | ||
34 | <span class="alert-text"> | ||
35 | Add a case to this wiki | ||
36 | </span> | ||
37 | </p> | ||
38 | <div class="clearfix"></div> | ||
39 | <h2 class="inline-data-summary">Overview of all cases</h2> | ||
40 | <div class="livetable inline-data-summary"> | ||
41 | |||
42 | #set ($columns = ["doc.title", "remedy", "doc.space"]) | ||
43 | #set ($columnsProperties = { | ||
44 | "doc.title": {"type": "text", "filterable" : true, "sortable": true, "link": "view"}, | ||
45 | "remedy" : {"type": "text", "filterable" : true, "sortable": true, "headerClass": "remedy"}, | ||
46 | "doc.space" : {"type": "text", "filterable" : true, "sortable": true, "headerClass": "locality", "link": "space"} | ||
47 | }) | ||
48 | #set ($options = { | ||
49 | "className" : "cases.Code.casesClass", | ||
50 | "translationPrefix" : "cases.livetable.", | ||
51 | "queryFilters" : "currentlanguage", | ||
52 | "rowCount": 10 | ||
53 | }) | ||
54 | #livetable("cases" $columns $columnsProperties $options) | ||
55 | |||
56 | </div> | ||
57 | <h3 id="addCase">Add a case to this wiki</h3> | ||
58 | <p> | ||
59 | To make sure your case is correctly filed in this wiki it is necessary that you answer a few simple questions about the case. | ||
60 | </p> | ||
61 | #set($form_start = { | ||
62 | "id": "homeoworld_form", | ||
63 | "product": "case", | ||
64 | "method": "post", | ||
65 | "url": "", | ||
66 | "use_captcha": "false" | ||
67 | }) | ||
68 | #createFormStart($form_start) | ||
69 | #set($locality = { | ||
70 | "id": "locality", | ||
71 | "type": "select", | ||
72 | "value" : "", | ||
73 | "required": "true", | ||
74 | "label": "Locality of the main complaint", | ||
75 | "aria-label": "Select the locality", | ||
76 | "placeholder": "$services.localization.render('cases.word.locality_select.placeholder')", | ||
77 | "data-set-space": "true", | ||
78 | "data-space-xobj-classname": "cases.Code.casesLocalityClass", | ||
79 | "data-parent-space": "cases", | ||
80 | "data-error-response-type": "use_label_definite_1", | ||
81 | "select-json": { | ||
82 | "back": "Back", | ||
83 | "abdomen": "Abdomen", | ||
84 | "external throat": "External throat", | ||
85 | "extremities": "Extremities", | ||
86 | "eye": "Eye", | ||
87 | "face": "Face", | ||
88 | "female genitalia": "Female genitalia", | ||
89 | "fever": "Fever", | ||
90 | "generals": "Generals", | ||
91 | "head": "Head", | ||
92 | "hearing": "Hearing", | ||
93 | "kidneys": "Kidneys", | ||
94 | "larynx": "Larynx", | ||
95 | "male genitalia": "Male genitalia", | ||
96 | "mind": "Mind", | ||
97 | "mouth": "Mouth", | ||
98 | "nose": "Nose", | ||
99 | "perspiration": "Perspiration", | ||
100 | "prostate": "Prostate", | ||
101 | "rectum": "Rectum", | ||
102 | "respiration": "Respiration", | ||
103 | "skin": "Skin", | ||
104 | "bladder": "Bladder", | ||
105 | "sleep": "Sleep", | ||
106 | "stomach": "Stomach", | ||
107 | "stool": "Stool", | ||
108 | "teeth": "Teeth", | ||
109 | "throat": "Throat", | ||
110 | "urethra": "Urethra", | ||
111 | "urine": "Urine", | ||
112 | "vertigo": "Vertigo", | ||
113 | "vision": "Vision", | ||
114 | "chest": "Chest", | ||
115 | "chill": "Chill", | ||
116 | "cough": "Cough", | ||
117 | "dreams": "Dreams", | ||
118 | "ear": "Ear", | ||
119 | "expectoration": "Expectoration" | ||
120 | }, | ||
121 | "help-block": "In what locality can the main complaint be placed? Select the best fitting option from this list." | ||
122 | }) | ||
123 | #createFormElement($locality) | ||
124 | #set($main_complaint = { | ||
125 | "id" : "main_complaint", | ||
126 | "type" : "text", | ||
127 | "required" : "true", | ||
128 | "label" : "Main complaint", | ||
129 | "aria-label" : "Enter the main complaint", | ||
130 | "placeholder" : "$services.localization.render('cases.wordgroup.main_complaint.placeholder')", | ||
131 | "data-pattern" : "^[a-zA-ZÀ-ÖÙ-öù-ÿĀ-žḀ-ỿ]+[a-zA-ZÀ-ÖÙ-öù-ÿĀ-žḀ-ỿ0-9- ]*$", | ||
132 | "data-error-response-type" : "use_label_definite_1", | ||
133 | "data-auto-first-capital" : "true", | ||
134 | "data-query-type" : "XWQL", | ||
135 | "data-query-reference" : "assets.pagemaker.XWQL.matchTitle", | ||
136 | "data-query-scope" : "cases", | ||
137 | "data-query-list-type" : "suggest-negate", | ||
138 | "data-query-list-header" : "$services.localization.render('pagemaker.line.suggest_negate_list')", | ||
139 | "data-query-list-contents" : "value", | ||
140 | "data-create-page" : "true", | ||
141 | "help-block" : 'This will be used as the title of your case. The first character must be a letter. For example:<br />- "Otitis Media in 13 year old boy" or<br />- "Cataract in 72 year old paraplegic woman"' | ||
142 | }) | ||
143 | ##Please be as concise as possible when you describe the main complaint. For example:<br />"chronic headache with bowel complaints,"<br />"intermittend fever" or<br />"diarrhea." | ||
144 | #createFormElement($main_complaint) | ||
145 | #set($remedy = { | ||
146 | "id" : "remedy", | ||
147 | "type" : "text", | ||
148 | "required" : "true", | ||
149 | "label" : "Central remedy in this case", | ||
150 | "aria-label" : "Choose the remedy", | ||
151 | "placeholder" : "$services.localization.render('cases.word.remedy.placeholder')", | ||
152 | "data-error-response-type" : "use_label_definite_1", | ||
153 | "data-auto-first-capital" : "true", | ||
154 | "data-query-type" : "JSON", | ||
155 | "data-query-reference" : "assets.pagemaker.JSON.remedies", | ||
156 | "data-query-list-type" : "suggest-select", | ||
157 | "data-query-list-header" : "$services.localization.render('pagemaker.line.suggest_select_list')", | ||
158 | "data-query-list-contents" : "value/key", | ||
159 | "data-query-list-editable" : "false", | ||
160 | "data-create-xobj" : "true", | ||
161 | "data-xobj-classname" : "cases.Code.casesClass", | ||
162 | "data-xobj-fieldname" : "remedy", | ||
163 | "help-block" : 'Select the remedy that is central in this case.' | ||
164 | }) | ||
165 | #createFormElement($remedy) | ||
166 | #set($extra_info = { | ||
167 | "id" : "extra_info", | ||
168 | "type" : "checkbox", | ||
169 | "required" : "false", | ||
170 | "label" : "Extra information (optional)", | ||
171 | "data-checked" : "0", | ||
172 | "data-opener" : "true" | ||
173 | }) | ||
174 | #createFormElement($extra_info) | ||
175 | #createExpandStart($extra_info "1") | ||
176 | #getUser() | ||
177 | #set($author = { | ||
178 | "id" : "author", | ||
179 | "type" : "text", | ||
180 | "required" : "false", | ||
181 | "label" : "Author", | ||
182 | "aria-label" : "Enter the author name", | ||
183 | "data-default-value": "$user", | ||
184 | "placeholder" : "$services.localization.render('cases.word.author.placeholder')", | ||
185 | "data-auto-first-capital" : "true", | ||
186 | "data-query-type" : "XWQL", | ||
187 | "data-query-reference" : "assets.pagemaker.XWQL.matchObject", | ||
188 | "data-query-scope" : "", | ||
189 | "data-query-list-type" : "suggest-select", | ||
190 | "data-query-list-header" : "$services.localization.render('pagemaker.line.suggest_select_list')", | ||
191 | "data-query-list-contents" : "value", | ||
192 | "data-query-list-editable" : "true", | ||
193 | "data-create-xobj" : "true", | ||
194 | "data-xobj-classname" : "assets.pagemaker.classes.persons", | ||
195 | "data-xobj-fieldname" : "name", | ||
196 | "data-modal-input" : ["$services.localization.render('global.word.lastname')", "$services.localization.render('global.word.firstname')"], | ||
197 | "data-modal-input-glue": ", ", | ||
198 | "help-block" : 'If this is not your own case, enter the last name of the author of this case. Choose the author from the list or create a new author.' | ||
199 | }) | ||
200 | #createFormElement($author) | ||
201 | #createExpandEnd() | ||
202 | #set($submit = { | ||
203 | "id" : "create_case", | ||
204 | "button-text" : "Create new case", | ||
205 | "help-block" : "Please remind yourself to always anonymize the case." | ||
206 | }) | ||
207 | #createSubmit($submit) | ||
208 | #set($form_end = { | ||
209 | "use_captcha": "false" | ||
210 | }) | ||
211 | #createFormEnd($form_end) | ||
212 | |||
213 | {{/html}} | ||
214 | {{/velocity}} |