-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7671565
commit 503d52e
Showing
8 changed files
with
102 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
api/src/main/java/org/openmrs/module/aijar/tasks/StopActiveFacilityVisitTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.openmrs.module.aijar.tasks; | ||
|
||
import org.openmrs.Visit; | ||
import org.openmrs.api.VisitService; | ||
import org.openmrs.api.context.Context; | ||
import org.openmrs.scheduler.tasks.AbstractTask; | ||
import org.openmrs.util.OpenmrsUtil; | ||
|
||
import java.util.List; | ||
|
||
public class StopActiveFacilityVisitTask extends AbstractTask { | ||
@Override | ||
public void execute() { | ||
VisitService visitService = Context.getVisitService(); | ||
List<Visit> visitList = visitService.getAllVisits(); | ||
for (Visit visit : visitList) { | ||
if (visit.getStopDatetime() == null && visit.getVisitType()==visitService.getVisitTypeByUuid("7b0f5697-27e3-40c4-8bae-f4049abfb4ed")) { | ||
visitService.endVisit(visit, OpenmrsUtil.getLastMomentOfDay(visit.getStartDatetime())); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters