-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #489 from udsm-dhis2-lab/develop
Develop
- Loading branch information
Showing
77 changed files
with
1,992 additions
and
1,106 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
330 changes: 165 additions & 165 deletions
330
omods/core/api/src/main/java/org/openmrs/module/icare/core/aop/VisitDiagnosisAdvisor.java
Large diffs are not rendered by default.
Oops, something went wrong.
296 changes: 171 additions & 125 deletions
296
omods/core/api/src/main/java/org/openmrs/module/icare/core/dao/ICareDao.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
53 changes: 53 additions & 0 deletions
53
...in/java/org/openmrs/module/icare/scheduler/tasks/AutoGenerateAndSendDataTemplateTask.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,53 @@ | ||
package org.openmrs.module.icare.scheduler.tasks; | ||
|
||
import org.openmrs.api.context.Context; | ||
import org.openmrs.module.icare.core.ICareService; | ||
import org.openmrs.scheduler.tasks.AbstractTask; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.Calendar; | ||
import java.util.Date; | ||
|
||
public class AutoGenerateAndSendDataTemplateTask extends AbstractTask { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(AutoGenerateAndSendDataTemplateTask.class); | ||
|
||
public AutoGenerateAndSendDataTemplateTask() { | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
|
||
if (!this.isExecuting) { | ||
if (log.isDebugEnabled()) { | ||
log.debug("Starting Auto Generate Data Template Task..."); | ||
} | ||
|
||
this.startExecuting(); | ||
|
||
try { | ||
Date endDate = new Date(); | ||
Calendar calendar = Calendar.getInstance(); | ||
calendar.setTime(endDate); | ||
calendar.add(Calendar.HOUR_OF_DAY, -24); | ||
Date startDate = calendar.getTime(); | ||
|
||
ICareService iCareService = Context.getService(ICareService.class); | ||
System.out.println(startDate); | ||
System.out.println(endDate); | ||
iCareService.generateVisitsData(startDate, endDate, true, null); | ||
} | ||
catch (Exception e) { | ||
e.printStackTrace(); | ||
log.error("Error while auto generating data template and sending to external mediator ", e); | ||
} | ||
finally { | ||
this.stopExecuting(); | ||
} | ||
} | ||
|
||
} | ||
} |
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
Oops, something went wrong.