Skip to content

Commit

Permalink
fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzy11 committed Sep 12, 2024
1 parent 60bf365 commit 314198d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public void shutdown() {

private Boolean updateTasksInBundle(List<Bundle> taskBundles) {
Boolean tasksUpdated = false;
String commentText = "Update Order with remote fhir status :)";
String commentText = "Update Order with remote fhir status : ";
for (Bundle bundle : taskBundles) {
for (Iterator tasks = bundle.getEntry().iterator(); tasks.hasNext();) {
String openmrsTaskUuid = null;
Expand Down Expand Up @@ -228,20 +228,21 @@ private Boolean updateTasksInBundle(List<Bundle> taskBundles) {

if(openelisTask.getStatus().toString().equals(TaskStatus.REJECTED.toString()) ){
openmrsTask.setStatus(openelisTask.getStatus());
commentText = openelisTask.getStatusReason().getText().toString().isEmpty() ? commentText: openelisTask.getStatusReason().getText();
commentText = commentText + TaskStatus.REJECTED.toString();
setOrderStatus(openmrsTask.getBasedOn(), openelisTask.getStatus().toCode(), Order.FulfillerStatus.EXCEPTION, commentText);
tasksUpdated = true;
}

if(openelisTask.getStatus().toString().equals(TaskStatus.CANCELLED.toString()) ){
openmrsTask.setStatus(openelisTask.getStatus());
commentText = TaskStatus.CANCELLED.toString();
commentText = commentText + TaskStatus.CANCELLED.toString();
setOrderStatus(openmrsTask.getBasedOn(), openelisTask.getStatus().toCode(), Order.FulfillerStatus.EXCEPTION, commentText);
tasksUpdated = true;
}

if( openelisTask.getStatus().toString().equals(TaskStatus.ACCEPTED.toString()) ){
openmrsTask.setStatus(openelisTask.getStatus());
commentText = commentText + TaskStatus.ACCEPTED.toString();
setOrderStatus(openmrsTask.getBasedOn(), openelisTask.getStatus().toCode(), Order.FulfillerStatus.IN_PROGRESS, commentText);
tasksUpdated = true;
}
Expand Down

0 comments on commit 314198d

Please sign in to comment.