Skip to content

Commit 4f1d29c

Browse files
committed
GSoC 2019: Patient search criteria module
1 parent 7c48d7a commit 4f1d29c

File tree

4 files changed

+354
-23
lines changed

4 files changed

+354
-23
lines changed

Diff for: omod/pom.xml

+23
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
<gem.path>${basedir}/.rubygems</gem.path>
1919
</properties>
2020

21+
<!-- Repository for patient search criteria -->
22+
<repositories>
23+
<repository>
24+
<id>jitpack.io</id>
25+
<url>https://jitpack.io</url>
26+
</repository>
27+
</repositories>
28+
29+
2130
<dependencies>
2231

2332
<!--
@@ -255,6 +264,20 @@
255264
<scope>provided</scope>
256265
</dependency>
257266

267+
<!-- Patient search criteria module -->
268+
<dependency>
269+
<groupId>com.github.Reyano132.openmrs-module-patientsearchcriteria</groupId>
270+
<artifactId>patientsearch-api</artifactId>
271+
<version>v1.0.0</version>
272+
<scope>provided</scope>
273+
</dependency>
274+
<dependency>
275+
<groupId>com.github.Reyano132.openmrs-module-patientsearchcriteria</groupId>
276+
<artifactId>patientsearch-omod</artifactId>
277+
<version>v1.0.0</version>
278+
<scope>provided</scope>
279+
</dependency>
280+
258281
</dependencies>
259282

260283
<build>

Diff for: omod/src/main/webapp/fragments/patientsearch/patientSearchWidget.gsp

+54-19
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,61 @@
9090
patientSearchWidget = new PatientSearchWidget(widgetConfig);
9191
});
9292
</script>
93+
<div class="row">
94+
<div class="col-md-12 col-sm-12 col-xs-12">
95+
<form method="get" id="patient-search-form" onsubmit="return false">
96+
<input class="form-control input-sm input-lg" type="text" id="patient-search" placeholder="${ ui.message("coreapps.findPatient.search.placeholder") }" autocomplete="off" <% if (doInitialSearch) { %>value="${doInitialSearch}"<% } %>/><i id="patient-search-clear-button" class="small icon-remove-sign"></i>
97+
<select id="patient-gender-search">
98+
<option value="" selected>${ ui.message("coreapps.gender") }</option>
99+
<option value="M">${ ui.message("coreapps.gender.M") }</option>
100+
<option value="F">${ ui.message("coreapps.gender.F") }</option>
101+
</select>
102+
<input type="checkbox" id="getAgeAndBirthdateFilter" >Search with age or birthdate<br>
93103

94-
<form method="get" id="patient-search-form" onsubmit="return false">
95-
<input type="text" id="patient-search" placeholder="${ ui.message("coreapps.findPatient.search.placeholder") }" autocomplete="off" <% if (doInitialSearch) { %>value="${doInitialSearch}"<% } %>/><i id="patient-search-clear-button" class="small icon-remove-sign"></i>
96-
<% if(patientSearchExtensions){
104+
<div id="patient-search-age-birthdate" style="display:none">
105+
<input type="radio" name ="patient-age-birthdate" value="patient-age"> Search by range of age
106+
<br>
107+
<input type="radio" name ="patient-age-birthdate" value="patient-birthdate"> Search by birthdate
108+
109+
<p id="patient-age-range-search" style="display:none">
110+
<label>Range of Age</label>
111+
From:<input type="text" id="patient-age-range-from" placeholder="From" maxlength="2" style="min-width: 5px" onkeypress="return event.charCode >= 48 && event.charCode <= 57">
112+
To:<input type="text" id="patient-age-range-to" placeholder="To" maxlength="2"
113+
style="min-width: 5px" onkeypress="return event.charCode >= 48 && event.charCode <= 57">
114+
</p>
115+
116+
<p id="patient-birthdate-search" style="display:none">
117+
Birthdate:<input type="date" id="patient-birthdate" style="min-width: 5px"/>
118+
</p>
119+
</div>
97120

98-
patientSearchExtensions.each {
99-
// create a base map from the fragmentConfig if it exists, otherwise just create an empty map
100-
def configs = [:];
101-
if(it.extensionParams.fragmentConfig != null){
102-
configs = it.extensionParams.fragmentConfig;
103-
}
104-
%>
105-
${ ui.includeFragment(it.extensionParams.provider, it.extensionParams.fragment, configs) }
106-
<%}
107-
} %>
108-
</form>
121+
122+
<% if(patientSearchExtensions){
109123
110-
<div id="patient-search-results"></div>
111-
<% if (registrationAppLink ?: false) { %>
112-
<div id="register-patient-link">
113-
<label>${ ui.message("coreapps.findPatient.registerPatient.label") }&nbsp;&nbsp;</label><a id="patient-search-register-patient" class="button" href="/${contextPath}/${registrationAppLink}">${ui.message("registrationapp.registration.label")}</a>
124+
patientSearchExtensions.each {
125+
// create a base map from the fragmentConfig if it exists, otherwise just create an empty map
126+
def configs = [:];
127+
if(it.extensionParams.fragmentConfig != null){
128+
configs = it.extensionParams.fragmentConfig;
129+
}
130+
%>
131+
${ ui.includeFragment(it.extensionParams.provider, it.extensionParams.fragment, configs) }
132+
<%}
133+
} %>
134+
</form>
135+
</div>
136+
</div>
137+
<div class="row">
138+
<div class="col-md-12 col-sm-12 col-xs-12">
139+
<div id="patient-search-results"></div>
140+
</div>
114141
</div>
115-
<% } %>
142+
<div class="row">
143+
<div class="col-md-12 col-sm-12 col-xs-12">
144+
<% if (registrationAppLink ?: false) { %>
145+
<div id="register-patient-link">
146+
<label>${ ui.message("coreapps.findPatient.registerPatient.label") }&nbsp;&nbsp;</label><a id="patient-search-register-patient" class="button" href="/${contextPath}/${registrationAppLink}">${ui.message("registrationapp.registration.label")}</a>
147+
</div>
148+
<% } %>
149+
</div>
150+
</div>

0 commit comments

Comments
 (0)