Skip to content

Commit c834916

Browse files
authored
Merge pull request #214 from slubwama/U4X-1037
U4X-1037: Return changes for U4X-1031 that were overwitten by another commit.
2 parents 611ef31 + 713047b commit c834916

52 files changed

Lines changed: 88 additions & 4470 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,6 @@
9494
<artifactId>openmrs-web</artifactId>
9595
<scope>test</scope>
9696
</dependency>
97-
98-
<dependency>
99-
<groupId>org.openmrs.module</groupId>
100-
<artifactId>uiframework-api</artifactId>
101-
</dependency>
10297
<dependency>
10398
<groupId>org.openmrs.module</groupId>
10499
<artifactId>fhir2-api</artifactId>

api/src/main/java/org/openmrs/module/ugandaemrsync/tasks/CrossBorderIntegrationSyncTask.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.openmrs.module.ugandaemrsync.model.SyncFhirProfile;
1212
import org.openmrs.module.ugandaemrsync.server.SyncFHIRRecord;
1313
import org.openmrs.scheduler.tasks.AbstractTask;
14-
import org.openmrs.ui.framework.SimpleObject;
1514

1615

1716
import static org.openmrs.module.ugandaemrsync.UgandaEMRSyncConfig.PATIENT_ID_TYPE_CROSS_BORDER_UUID;
@@ -35,7 +34,7 @@ public void execute() {
3534

3635
}
3736

38-
public SimpleObject updatePatientWithCBI(String patientDataObject) throws Exception {
37+
public void updatePatientWithCBI(String patientDataObject) throws Exception {
3938
ObjectMapper objectMapper = new ObjectMapper();
4039
try {
4140
UgandaEMRSyncService ugandaEMRSyncService = Context.getService(UgandaEMRSyncService.class);
@@ -48,14 +47,11 @@ public SimpleObject updatePatientWithCBI(String patientDataObject) throws Except
4847
}
4948
if (patient != null) {
5049
log.info("Patient " + patient.getNames() + "Successfully Updated");
51-
return SimpleObject.create("status", objectMapper.writeValueAsString("Patient Successfully Updated "));
5250
}
5351
}
5452

5553
} catch (Exception e) {
56-
return SimpleObject.create("status",
57-
objectMapper.writeValueAsString("There was a problem updating in patient cross boarder ID"));
54+
log.error("There was a problem updating in patient cross boarder ID",e);
5855
}
59-
return null;
6056
}
6157
}

api/src/main/java/org/openmrs/module/ugandaemrsync/tasks/SendDHIS2DataToCentralServerTask.java

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import org.openmrs.module.ugandaemrsync.server.SyncGlobalProperties;
1111
import org.openmrs.module.ugandaemrsync.api.UgandaEMRHttpURLConnection;
1212
import org.openmrs.scheduler.tasks.AbstractTask;
13-
import org.openmrs.ui.framework.SimpleObject;
1413
import org.springframework.stereotype.Component;
1514
import java.io.IOException;
1615
import java.io.InputStream;
@@ -33,19 +32,14 @@ public class SendDHIS2DataToCentralServerTask extends AbstractTask {
3332
protected Log log = LogFactory.getLog(getClass());
3433
SyncGlobalProperties syncGlobalProperties = new SyncGlobalProperties();
3534
protected byte[] data ;
36-
SimpleObject serverResponseObject;
3735

38-
public SimpleObject getServerResponseObject(){
39-
return serverResponseObject;
40-
}
4136
UgandaEMRHttpURLConnection ugandaEMRHttpURLConnection = new UgandaEMRHttpURLConnection();
4237

4338

4439
public SendDHIS2DataToCentralServerTask() {}
4540

46-
public SendDHIS2DataToCentralServerTask(byte[] data, SimpleObject simpleObject) {
41+
public SendDHIS2DataToCentralServerTask(byte[] data) {
4742
this.data = data;
48-
this.serverResponseObject= simpleObject;
4943
}
5044

5145

@@ -56,14 +50,6 @@ public void execute() {
5650
String baseUrl = ugandaEMRHttpURLConnection.getBaseURL(syncGlobalProperties.getGlobalProperty(GP_DHIS2_SERVER_URL));
5751
if (isBlank(syncGlobalProperties.getGlobalProperty(GP_DHIS2_SERVER_URL))) {
5852
log.error("DHIS 2 server URL is not set");
59-
60-
try {
61-
map.put("responseCode", responseCode);
62-
map.put("responseMessage", "DHIS 2 server URL is not set");
63-
serverResponseObject = SimpleObject.create("message", objectMapper.writeValueAsString(map));
64-
} catch (IOException e) {
65-
log.error("error creating message to interface", e);
66-
}
6753
log.error("DHIS 2 server URL is not set");
6854
return;
6955
}
@@ -72,11 +58,7 @@ public void execute() {
7258
if (!ugandaEMRHttpURLConnection.isConnectionAvailable()) {
7359
map.put("responseCode", responseCode);
7460
map.put("responseMessage", "Failed to connect to the internet. Check connection");
75-
try {
76-
serverResponseObject = SimpleObject.create("message", objectMapper.writeValueAsString(map));
77-
} catch (IOException e) {
78-
e.printStackTrace();
79-
}
61+
8062
return;
8163
}
8264

@@ -85,11 +67,6 @@ public void execute() {
8567
map.put("responseCode", responseCode);
8668
map.put("responseMessage", "Server Not Available");
8769

88-
try {
89-
serverResponseObject = SimpleObject.create("message", objectMapper.writeValueAsString(map));
90-
} catch (IOException e) {
91-
e.printStackTrace();
92-
}
9370
return;
9471
}
9572

@@ -111,13 +88,6 @@ public void execute() {
11188
log.error(e);
11289
}
11390

114-
115-
try {
116-
serverResponseObject = SimpleObject.create("message", objectMapper.writeValueAsString(map));
117-
serverResponseObject.put("responseCode", responseCode);
118-
} catch (IOException e) {
119-
e.printStackTrace();
120-
}
12191
}
12292

12393
public Map getMapOfResults(InputStream inputStreamReader, int responseCode) throws IOException {

api/src/main/java/org/openmrs/module/ugandaemrsync/tasks/SendPatientsToFacilitySHRTask.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import org.openmrs.module.ugandaemrsync.model.SyncFhirProfile;
1111
import org.openmrs.module.ugandaemrsync.server.SyncFHIRRecord;
1212
import org.openmrs.scheduler.tasks.AbstractTask;
13-
import org.openmrs.ui.framework.SimpleObject;
1413

1514
public class SendPatientsToFacilitySHRTask extends AbstractTask {
1615
protected final Log log = LogFactory.getLog(SendPatientsToFacilitySHRTask.class);
@@ -31,7 +30,7 @@ public void execute() {
3130

3231
}
3332

34-
public SimpleObject transferIn(String patientDataObject) throws Exception {
33+
public void transferIn(String patientDataObject) throws Exception {
3534
ObjectMapper objectMapper = new ObjectMapper();
3635
try {
3736
UgandaEMRSyncService ugandaEMRSyncService = Context.getService(UgandaEMRSyncService.class);
@@ -45,14 +44,11 @@ public SimpleObject transferIn(String patientDataObject) throws Exception {
4544
}
4645
if (patient != null) {
4746
log.info("Patient " + patient.getNames() + "Successfully Created");
48-
return SimpleObject.create("status", objectMapper.writeValueAsString("Patient Successfully Created "));
4947
}
5048
}
5149

5250
} catch (Exception e) {
53-
return SimpleObject.create("status",
54-
objectMapper.writeValueAsString("There was a problem transferring in patient"));
51+
log.info(e);
5552
}
56-
return null;
5753
}
5854
}

api/src/main/java/org/openmrs/module/ugandaemrsync/tasks/SendReportsTask.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import org.openmrs.module.ugandaemrsync.model.SyncTaskType;
1010
import org.openmrs.module.ugandaemrsync.server.SyncGlobalProperties;
1111
import org.openmrs.scheduler.tasks.AbstractTask;
12-
import org.openmrs.ui.framework.SimpleObject;
1312
import org.springframework.stereotype.Component;
1413

1514
import static org.apache.commons.lang.StringUtils.isBlank;
@@ -30,8 +29,6 @@ public class SendReportsTask extends AbstractTask {
3029

3130
SyncTaskType syncTaskType;
3231

33-
SimpleObject response;
34-
3532
public SendReportsTask() {
3633
super();
3734
}

api/src/test/java/org/openmrs/module/ugandaemrsync/server/SyncFHIRRecordTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
import org.junit.Assert;
1111
import org.junit.Before;
1212
import org.junit.Test;
13-
import org.mockito.MockedStatic;
14-
import org.openmrs.Patient;
15-
import org.openmrs.api.PatientService;
1613
import org.openmrs.api.context.Context;
1714
import org.openmrs.module.ugandaemrsync.api.UgandaEMRSyncService;
1815
import org.openmrs.module.ugandaemrsync.model.SyncFhirProfile;
@@ -21,11 +18,8 @@
2118
import org.openmrs.test.BaseModuleContextSensitiveTest;
2219
import org.springframework.context.annotation.ComponentScan;
2320

24-
import java.text.SimpleDateFormat;
2521
import java.util.*;
2622

27-
import static org.mockito.Mockito.*;
28-
2923
@ComponentScan(basePackages = {"org.openmrs.module.fhir2"})
3024
public class SyncFHIRRecordTest extends BaseModuleContextSensitiveTest {
3125

omod/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,6 @@
5656
<artifactId>idgen-api</artifactId>
5757
</dependency>
5858

59-
<dependency>
60-
<groupId>org.openmrs.module</groupId>
61-
<artifactId>uiframework-omod</artifactId>
62-
<scope>provided</scope>
63-
</dependency>
64-
65-
<dependency>
66-
<groupId>org.openmrs.module</groupId>
67-
<artifactId>appui-omod</artifactId>
68-
<scope>provided</scope>
69-
</dependency>
70-
7159
<dependency>
7260
<groupId>org.openmrs.module</groupId>
7361
<artifactId>calculation-api</artifactId>

omod/src/main/java/org/openmrs/module/ugandaemrsync/fragment/controller/GenerateInitialDataFragmentController.java

Lines changed: 0 additions & 38 deletions
This file was deleted.

omod/src/main/java/org/openmrs/module/ugandaemrsync/fragment/controller/GenerateInitialFHIRDataFragmentController.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

omod/src/main/java/org/openmrs/module/ugandaemrsync/fragment/controller/GetFacilityIdFragmentController.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)