Skip to content

Commit af4463d

Browse files
ssmusokeslubwama
authored andcommitted
EMTCT Module Integration forms (#326)
* Added follow--up encounter type * Updated modules to match Reference Application 2.7 release * Added custom concepts for EMTCT module * First draft of the follow-up form * Updated concept IDs to start from 165100 * Merge branch 'master' of https://github.com/METS-Programme/openmrs-module-aijar into emtct_module # Conflicts: # api/src/main/resources/metadata/Concepts_ART-1.xml * Concept name definitions * Updated ordering of concept to match the existing style * Added validations for the data capture form * Updated pom.xml for html form entry update to 3.6.0 which fixes a javascript issue
1 parent 402288d commit af4463d

File tree

7 files changed

+369
-15
lines changed

7 files changed

+369
-15
lines changed

api/src/main/java/org/openmrs/module/aijar/api/deploy/bundle/CommonMetadataBundle.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public void install() throws Exception {
5555
install(EncounterTypes.OPD_ENCOUNTER);
5656
install(EncounterTypes.TB_SUMMARY_ENCOUNTER);
5757
install(EncounterTypes.VIRAL_LOAD_NON_SUPPRESSED);
58+
install(EncounterTypes.APPOINTMENT_FOLLOW_UP);
5859

5960
//installing programs metadata
6061
log.info("Installing Programs");

api/src/main/java/org/openmrs/module/aijar/metadata/core/EncounterTypes.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,20 @@ public String uuid() {
8686
return "38cb2232-30fc-4b1f-8df1-47c795771ee9";
8787
}
8888
};
89+
90+
public static EncounterTypeDescriptor APPOINTMENT_FOLLOW_UP = new EncounterTypeDescriptor() {
91+
@Override
92+
public String name() {
93+
return "Appointment Follow-up ";
94+
}
95+
96+
@Override
97+
public String description() {
98+
return "Followup actions for patients especially after missing a facility visit";
99+
}
100+
101+
public String uuid() {
102+
return "dc551efc-024d-4c40-aeb8-2147c4033778";
103+
}
104+
};
89105
}

api/src/main/resources/metadata/Custom_Concepts.xml

Lines changed: 104 additions & 0 deletions
Large diffs are not rendered by default.

omod/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@
120120
<artifactId>htmlformentry-api-1.10</artifactId>
121121
</dependency>
122122

123+
<dependency>
124+
<groupId>org.openmrs.module</groupId>
125+
<artifactId>htmlformentry-api-2.0</artifactId>
126+
</dependency>
127+
123128
<dependency>
124129
<groupId>org.openmrs.module</groupId>
125130
<artifactId>htmlformentry-api-2.0</artifactId>
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
<htmlform formName="HMIS 053 Appointment Followup"
2+
formDescription="Followup for the appoinment"
3+
formEncounterType="dc551efc-024d-4c40-aeb8-2147c4033778"
4+
formUuid="2641baf2-fcc7-4aeb-ad3c-51a02ec7e556"
5+
formVersion="1.0"
6+
formAddMetadata="yes"
7+
formUILocation="patientDashboard.visitActions"
8+
formOrder="10"
9+
formIcon="icon-user"
10+
formShowIf="(visit.active || !visit.active) &amp;&amp; patient.person.dead==false"
11+
formDisplayStyle="Standard"
12+
formLabel="Appointment Followup">
13+
<style type="text/css">
14+
form#htmlform div.ai-page-frame table>tbody tr:nth-child(odd) td {
15+
background: #eeeeee;
16+
}
17+
18+
form#htmlform div.ai-page-frame table>tbody tr:nth-child(even) td {
19+
background: #f9f9f9;
20+
}
21+
22+
form#htmlform div.ai-page-frame fieldset#baby-information table {
23+
margin: 0 0 5px 0;
24+
}
25+
</style>
26+
27+
<script>
28+
jq(document).ready(function() {
29+
<ifMode mode="ENTER">
30+
disableContainer('#outcomeContainer');
31+
<!-- disableContainer('#nextstepsContainer'); -->
32+
</ifMode>
33+
<!-- enable SMS Message outcomes -->
34+
jq('#sms-message').click(function(){
35+
if (getValue('sms-message.value')) {
36+
fieldHelper.enable(getField('sms-not-delivered.value'));
37+
fieldHelper.enable(getField('sms-received.value'));
38+
fieldHelper.enable(getField('client-visit-rescheduled.value'));
39+
fieldHelper.enable(getField('new-visit-date.value'));
40+
fieldHelper.enable(getField('outcome-other.value'));
41+
enableContainer('#nextstepsContainer');
42+
} else {
43+
fieldHelper.disable(getField('sms-not-delivered.value'));
44+
fieldHelper.disable(getField('sms-received.value'));
45+
}
46+
});
47+
48+
<!-- enable Phone call outcomes -->
49+
jq('#phone-call').click(function(){
50+
if (getValue('phone-call.value')) {
51+
fieldHelper.enable(getField('phone-off.value'));
52+
fieldHelper.enable(getField('phone-not-answered.value'));
53+
fieldHelper.enable(getField('spoke-with-patient.value'));
54+
fieldHelper.enable(getField('spoke-with-someone-else.value'));
55+
fieldHelper.enable(getField('client-visit-rescheduled.value'));
56+
fieldHelper.enable(getField('new-visit-date.value'));
57+
fieldHelper.enable(getField('outcome-other.value'));
58+
enableContainer('#nextstepsContainer');
59+
} else {
60+
fieldHelper.disable(getField('phone-off.value'));
61+
fieldHelper.disable(getField('phone-not-answered.value'));
62+
fieldHelper.disable(getField('spoke-with-patient.value'));
63+
fieldHelper.disable(getField('spoke-with-someone-else.value'));
64+
}
65+
});
66+
67+
<!-- enable home visit outcomes -->
68+
jq('#home-visit').click(function(){
69+
if (getValue('home-visit.value')) {
70+
fieldHelper.enable(getField('spoke-with-patient.value'));
71+
fieldHelper.enable(getField('spoke-with-someone-else.value'));
72+
fieldHelper.enable(getField('client-visit-rescheduled.value'));
73+
fieldHelper.enable(getField('new-visit-date.value'));
74+
fieldHelper.enable(getField('outcome-other.value'));
75+
enableContainer('#nextstepsContainer');
76+
} else {
77+
fieldHelper.disable(getField('phone-off.value'));
78+
fieldHelper.disable(getField('phone-not-answered.value'));
79+
fieldHelper.disable(getField('spoke-with-patient.value'));
80+
fieldHelper.disable(getField('spoke-with-someone-else.value'));
81+
}
82+
});
83+
84+
<!-- additional validations -->
85+
beforeSubmit.push(function() {
86+
<!-- clear the error fields -->
87+
setValue('new-visit-date.error', '');
88+
setValue('new-followup-date.error', '');
89+
setValue('home-visit-date.error', '');
90+
<!-- New visit date must be after today -->
91+
var new_visit_date = new Date(changeFieldDateToJavascriptDate(getValue('new-visit-date.value')));
92+
var new_followup_date = new Date(changeFieldDateToJavascriptDate(getValue('new-followup-date.value')));
93+
var home_visit_date = new Date(changeFieldDateToJavascriptDate(getValue('home-visit-date.value')));
94+
var encounterDate = new Date(changeFieldDateToJavascriptDate(getValue('encounterDate.value')));
95+
96+
<!-- if the visit was rescheduled then the new visit date has to be provided -->
97+
if (getValue('client-visit-rescheduled.value')) {
98+
if (getValue('new-visit-date.value') == '') {
99+
getField('new-visit-date.error').html('The date when the client visit has been rescheduled to has to be provided').show();
100+
return false;
101+
} else {
102+
if (new_visit_date &lt;= encounterDate) {
103+
getField('new-visit-date.error').html('The date when the client visit has been rescheduled has to be after ' + changeFieldDateToJavascriptDate(getValue('encounterDate.value'))).show();
104+
return false;
105+
}
106+
}
107+
}
108+
<!-- if the next step is to a follow up again then a new followup date has to be provided -->
109+
if (getValue('try-followup-again.value')) {
110+
if (getValue('new-followup-date.value') == '') {
111+
getField('new-followup-date.error').html('The date of the next follow up has to be provided').show();
112+
return false;
113+
} else {
114+
if (new_followup_date &lt;= encounterDate) {
115+
getField('new-followup-date.error').html('The date of the next follow up has to be after ' + changeFieldDateToJavascriptDate(getValue('encounterDate.value'))).show();
116+
return false;
117+
}
118+
}
119+
}
120+
<!-- if the visit was rescheduled then the new visit date has to be provided -->
121+
if (getValue('home-visit-on.value')) {
122+
if (getValue('home-visit-date.value') == '') {
123+
getField('home-visit-date.error').html('The date of the home visit has to be provided ').show();
124+
return false;
125+
} else {
126+
if (home_visit_date &lt;= encounterDate) {
127+
getField('home-visit-date.error').html('The date of the home visit has to be after ' + changeFieldDateToJavascriptDate(getValue('encounterDate.value'))).show();
128+
return false;
129+
}
130+
}
131+
}
132+
});
133+
});
134+
</script>
135+
136+
<div class="ai-page-frame">
137+
<div class="headers" style="text-align: center;">
138+
<h3 style="background: #000000; padding: 10px;color:#07c1ae">HMIS 053 Appointment Book - Followup</h3>
139+
</div>
140+
<table width="100%" border="0" cellspacing="0" cellpadding="0">
141+
<tr>
142+
<td>
143+
<p>
144+
<label>Followup Date</label>
145+
</p>
146+
</td>
147+
<td>
148+
<encounterDate default="today" disallowMultipleEncountersOnDate="block"/>
149+
<span style="display: none;">
150+
<encounterLocation default="629d78e9-93e5-43b0-ad8a-48313fd99117"
151+
order="629d78e9-93e5-43b0-ad8a-48313fd99117"/>
152+
</span>
153+
</td>
154+
</tr>
155+
<tr>
156+
<td>
157+
<p>
158+
<label>Type of Care</label>
159+
</p>
160+
</td>
161+
<td>
162+
<!-- TODO: Add a validation to ensure that a user does not click Pre-ART and ART at the same time -->
163+
<obs id="pre-art" conceptId="160530" answerConceptId="160525" answerLabel="Pre ART" class="horizontal-layout-options"/><br/>
164+
<obs id="art" conceptId="160530" answerConceptId="160524" answerLabel="ART" class="horizontal-layout-options"/><br/>
165+
<includeIf velocityTest="$patient.age &gt; 5">
166+
<obs id="exposed-infant" conceptId="160530" answerConceptId="160526" answerLabel="HIV Exposed Infant" class="horizontal-layout-options"/><br/>
167+
</includeIf>
168+
<includeIf velocityTest="$patient.gender == 'F'">
169+
<obs id="anc" conceptId="160530" answerConceptId="160446" answerLabel="Antenatal Clinic (ANC)" class="horizontal-layout-options"/><br/>
170+
</includeIf>
171+
<obs id="tb" conceptId="160530" answerConceptId="160529" answerLabel="Tuberculosis (TB)" class="horizontal-layout-options"/>
172+
</td>
173+
</tr>
174+
<tr>
175+
<td>
176+
<p>
177+
<label>Followup Type</label>
178+
179+
</p>
180+
</td>
181+
<td>
182+
<p id="followupTypeContainer">
183+
<obs id="sms-message" conceptId="165100" answerConceptId="165101" answerLabel="SMS Message" class="horizontal-layout-options"/><br/>
184+
<obs id="phone-call" conceptId="165100" answerConceptId="165102" answerLabel="Phone Call" class="horizontal-layout-options"/><br/>
185+
<obs id="home-visit" conceptId="165100" answerConceptId="165103" answerLabel="Home Visit" class="horizontal-layout-options"/><br/><br/>
186+
<obs id="followup-type-other" conceptId="165100" answerConceptId="5622" answerLabel="Other Specify:" commentFieldLabel="" class="horizontal-layout-options"/>
187+
</p>
188+
</td>
189+
</tr>
190+
<tr>
191+
<td>
192+
<p>
193+
<label>Outcome</label>
194+
195+
196+
</p>
197+
</td>
198+
<td>
199+
<p id="outcomeContainer">
200+
<obs id="sms-not-delivered" conceptId="165104" answerConceptId="165105" answerLabel="SMS Message Not Delivered" class="horizontal-layout-options"/><br/>
201+
<obs id="sms-received" conceptId="165104" answerConceptId="165106" answerLabel="SMS Message Received" class="horizontal-layout-options"/><br/>
202+
<obs id="client-visit-rescheduled" conceptId="165104" answerConceptId="165107" answerLabel="Client Visit Rescheduled to " class="horizontal-layout-options"/><obs id="new-visit-date" conceptId="165108" allowFutureDates="true"/>
203+
<obs id="phone-off" conceptId="165104" answerConceptId="165109" answerLabel="Telephone off" class="horizontal-layout-options"/><br/>
204+
<obs id="phone-not-answered" conceptId="165104" answerConceptId="165110" answerLabel="Telephone not answered" class="horizontal-layout-options"/><br/>
205+
<obs id="spoke-with-patient" conceptId="165104" answerConceptId="165111" answerLabel="Spoke with patient" class="horizontal-layout-options"/><br/>
206+
<obs id="spoke-with-someone-else" conceptId="165104" answerConceptId="165112" answerLabel="Spoke with someone else" class="horizontal-layout-options"/><br/><br/>
207+
<obs id="outcome-other" conceptId="165100" answerConceptId="5622" answerLabel="Other Specify:" commentFieldLabel="" class="horizontal-layout-options"/>
208+
</p>
209+
</td>
210+
</tr>
211+
<tr>
212+
<td>
213+
<p>
214+
<label>Next Step</label>
215+
216+
</p>
217+
</td>
218+
<td>
219+
<p id="nextstepsContainer">
220+
<obs id="call-treatmentsupporter" conceptId="165113" answerConceptId="165114" answerLabel="Call Treatment Supporter" class="horizontal-layout-options"/><br/>
221+
<obs id="try-followup-again" conceptId="165113" answerConceptId="165115" answerLabel="Try to followup patient again on " class="horizontal-layout-options"/><obs id="new-followup-date" conceptId="165116" allowFutureDates="true"/>
222+
<obs id="home-visit-on" conceptId="165113" answerConceptId="165103" answerLabel="Home visit on" class="horizontal-layout-options" toggle="{id: 'new-followup-date', style: 'dim'}"/><obs id="home-visit-date" conceptId="165117" allowFutureDates="true"/>
223+
</p>
224+
</td>
225+
</tr>
226+
</table>
227+
<section>
228+
<submit/>
229+
</section>
230+
</div>
231+
</htmlform>

omod/src/main/webapp/resources/js/aijar.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ jq(document).ready(function () {
3737
});
3838

3939
/**
40-
* Changes a field date in the format yy-mm-dd to dd/mm/yy which eas
40+
* Changes a field date in the format yy-mm-dd to dd/mm/yy which is easier to read
4141
* @param dateValue
4242
*/
4343
function changeFieldDateToJavascriptDate(dateValue) {
44-
new Date();
45-
return new Date(dateValue);
44+
return jq.datepicker.formatDate('dd/mm/yy', jq.datepicker.parseDate('yy-mm-dd', dateValue));
4645
}
4746

4847

@@ -222,7 +221,7 @@ var fieldHelper = {
222221
this.$jqObj = jq(args);
223222
}
224223

225-
this.$jqObj.attr('disabled', true);
224+
this.$jqObj.attr('disabled', true).fadeTo(250, 0.25);
226225

227226
},
228227
enable: function (args) {
@@ -232,7 +231,7 @@ var fieldHelper = {
232231
this.$jqObj = jq(args);
233232
}
234233

235-
this.$jqObj.removeAttr('disabled');
234+
this.$jqObj.removeAttr('disabled').fadeTo(250, 1);
236235
},
237236
makeReadonly: function (args) {
238237
if (args instanceof jQuery) {

pom.xml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@
7676
<formentryappVersion>1.4.2</formentryappVersion>
7777
<formfilterVersion>1.0.0</formfilterVersion>
7878
<htmlformentryuiVersion>1.6.4</htmlformentryuiVersion>
79-
<htmlformentryVersion>3.3.2</htmlformentryVersion>
80-
<htmlformentryuiVersion>1.6.3</htmlformentryuiVersion>
8179
<htmlformentryVersion>3.6.0</htmlformentryVersion>
8280
<htmlwidgetsVersion>1.9.0</htmlwidgetsVersion>
8381
<idgenVersion>4.4.0</idgenVersion>
@@ -124,7 +122,7 @@
124122
<scope>compile</scope>
125123
</dependency>
126124
-->
127-
125+
128126
<dependency>
129127
<groupId>javax.servlet</groupId>
130128
<artifactId>javax.servlet-api</artifactId>
@@ -221,7 +219,7 @@
221219
<version>${dataexchangeVersion}</version>
222220
<scope>provided</scope>
223221
</dependency>
224-
222+
225223
<dependency>
226224
<groupId>org.openmrs.module</groupId>
227225
<artifactId>dataintegrity-api</artifactId>
@@ -265,7 +263,7 @@
265263
<version>${htmlformentryVersion}</version>
266264
<scope>provided</scope>
267265
</dependency>
268-
266+
269267
<dependency>
270268
<groupId>org.openmrs.module</groupId>
271269
<artifactId>htmlformentry-api-1.10</artifactId>
@@ -286,7 +284,7 @@
286284
<version>${idgenVersion}</version>
287285
<scope>provided</scope>
288286
</dependency>
289-
287+
290288
<dependency>
291289
<groupId>org.openmrs.module</groupId>
292290
<artifactId>legacyui-omod</artifactId>
@@ -342,7 +340,7 @@
342340
<version>${registrationcoreVersion}</version>
343341
<scope>provided</scope>
344342
</dependency>
345-
343+
346344
<dependency>
347345
<groupId>org.openmrs.module</groupId>
348346
<artifactId>registrationapp-api</artifactId>
@@ -363,7 +361,7 @@
363361
<version>${reportingVersion}</version>
364362
<scope>test</scope>
365363
</dependency>
366-
364+
367365
<dependency>
368366
<groupId>org.openmrs.module</groupId>
369367
<artifactId>reportingcompatibility-api</artifactId>
@@ -377,7 +375,7 @@
377375
<version>${serializationxstreamVersion}</version>
378376
<scope>provided</scope>
379377
</dependency>
380-
378+
381379
<dependency>
382380
<groupId>org.openmrs.module</groupId>
383381
<artifactId>serialization.xstream-api-2.0</artifactId>
@@ -565,4 +563,4 @@
565563
</pluginRepository>
566564
</pluginRepositories>
567565

568-
</project>
566+
</project>

0 commit comments

Comments
 (0)