Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@
<artifactId>openmrs-web</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>uiframework-api</artifactId>
</dependency>
<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>fhir2-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import org.openmrs.module.ugandaemrsync.model.SyncFhirProfile;
import org.openmrs.module.ugandaemrsync.server.SyncFHIRRecord;
import org.openmrs.scheduler.tasks.AbstractTask;
import org.openmrs.ui.framework.SimpleObject;


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

}

public SimpleObject updatePatientWithCBI(String patientDataObject) throws Exception {
public void updatePatientWithCBI(String patientDataObject) throws Exception {
ObjectMapper objectMapper = new ObjectMapper();
try {
UgandaEMRSyncService ugandaEMRSyncService = Context.getService(UgandaEMRSyncService.class);
Expand All @@ -48,14 +47,11 @@ public SimpleObject updatePatientWithCBI(String patientDataObject) throws Except
}
if (patient != null) {
log.info("Patient " + patient.getNames() + "Successfully Updated");
return SimpleObject.create("status", objectMapper.writeValueAsString("Patient Successfully Updated "));
}
}

} catch (Exception e) {
return SimpleObject.create("status",
objectMapper.writeValueAsString("There was a problem updating in patient cross boarder ID"));
log.error("There was a problem updating in patient cross boarder ID",e);
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.openmrs.module.ugandaemrsync.server.SyncGlobalProperties;
import org.openmrs.module.ugandaemrsync.api.UgandaEMRHttpURLConnection;
import org.openmrs.scheduler.tasks.AbstractTask;
import org.openmrs.ui.framework.SimpleObject;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -33,19 +32,14 @@ public class SendDHIS2DataToCentralServerTask extends AbstractTask {
protected Log log = LogFactory.getLog(getClass());
SyncGlobalProperties syncGlobalProperties = new SyncGlobalProperties();
protected byte[] data ;
SimpleObject serverResponseObject;

public SimpleObject getServerResponseObject(){
return serverResponseObject;
}
UgandaEMRHttpURLConnection ugandaEMRHttpURLConnection = new UgandaEMRHttpURLConnection();


public SendDHIS2DataToCentralServerTask() {}

public SendDHIS2DataToCentralServerTask(byte[] data, SimpleObject simpleObject) {
public SendDHIS2DataToCentralServerTask(byte[] data) {
this.data = data;
this.serverResponseObject= simpleObject;
}


Expand All @@ -56,14 +50,6 @@ public void execute() {
String baseUrl = ugandaEMRHttpURLConnection.getBaseURL(syncGlobalProperties.getGlobalProperty(GP_DHIS2_SERVER_URL));
if (isBlank(syncGlobalProperties.getGlobalProperty(GP_DHIS2_SERVER_URL))) {
log.error("DHIS 2 server URL is not set");

try {
map.put("responseCode", responseCode);
map.put("responseMessage", "DHIS 2 server URL is not set");
serverResponseObject = SimpleObject.create("message", objectMapper.writeValueAsString(map));
} catch (IOException e) {
log.error("error creating message to interface", e);
}
log.error("DHIS 2 server URL is not set");
return;
}
Expand All @@ -72,11 +58,7 @@ public void execute() {
if (!ugandaEMRHttpURLConnection.isConnectionAvailable()) {
map.put("responseCode", responseCode);
map.put("responseMessage", "Failed to connect to the internet. Check connection");
try {
serverResponseObject = SimpleObject.create("message", objectMapper.writeValueAsString(map));
} catch (IOException e) {
e.printStackTrace();
}

return;
}

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

try {
serverResponseObject = SimpleObject.create("message", objectMapper.writeValueAsString(map));
} catch (IOException e) {
e.printStackTrace();
}
return;
}

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


try {
serverResponseObject = SimpleObject.create("message", objectMapper.writeValueAsString(map));
serverResponseObject.put("responseCode", responseCode);
} catch (IOException e) {
e.printStackTrace();
}
}

public Map getMapOfResults(InputStream inputStreamReader, int responseCode) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.openmrs.module.ugandaemrsync.model.SyncFhirProfile;
import org.openmrs.module.ugandaemrsync.server.SyncFHIRRecord;
import org.openmrs.scheduler.tasks.AbstractTask;
import org.openmrs.ui.framework.SimpleObject;

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

}

public SimpleObject transferIn(String patientDataObject) throws Exception {
public void transferIn(String patientDataObject) throws Exception {
ObjectMapper objectMapper = new ObjectMapper();
try {
UgandaEMRSyncService ugandaEMRSyncService = Context.getService(UgandaEMRSyncService.class);
Expand All @@ -45,14 +44,11 @@ public SimpleObject transferIn(String patientDataObject) throws Exception {
}
if (patient != null) {
log.info("Patient " + patient.getNames() + "Successfully Created");
return SimpleObject.create("status", objectMapper.writeValueAsString("Patient Successfully Created "));
}
}

} catch (Exception e) {
return SimpleObject.create("status",
objectMapper.writeValueAsString("There was a problem transferring in patient"));
log.info(e);
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.openmrs.module.ugandaemrsync.model.SyncTaskType;
import org.openmrs.module.ugandaemrsync.server.SyncGlobalProperties;
import org.openmrs.scheduler.tasks.AbstractTask;
import org.openmrs.ui.framework.SimpleObject;
import org.springframework.stereotype.Component;

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

SyncTaskType syncTaskType;

SimpleObject response;

public SendReportsTask() {
super();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.MockedStatic;
import org.openmrs.Patient;
import org.openmrs.api.PatientService;
import org.openmrs.api.context.Context;
import org.openmrs.module.ugandaemrsync.api.UgandaEMRSyncService;
import org.openmrs.module.ugandaemrsync.model.SyncFhirProfile;
Expand All @@ -21,11 +18,8 @@
import org.openmrs.test.BaseModuleContextSensitiveTest;
import org.springframework.context.annotation.ComponentScan;

import java.text.SimpleDateFormat;
import java.util.*;

import static org.mockito.Mockito.*;

@ComponentScan(basePackages = {"org.openmrs.module.fhir2"})
public class SyncFHIRRecordTest extends BaseModuleContextSensitiveTest {

Expand Down
12 changes: 0 additions & 12 deletions omod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,6 @@
<artifactId>idgen-api</artifactId>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>uiframework-omod</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>appui-omod</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>calculation-api</artifactId>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading