forked from Raxa/raxacore
-
Notifications
You must be signed in to change notification settings - Fork 231
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
48bff2d
commit d0e8c7a
Showing
14 changed files
with
105 additions
and
201 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
38 changes: 19 additions & 19 deletions
38
bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/config/AsyncConfig.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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
package org.bahmni.module.bahmnicore.config; | ||
|
||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableAsync; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
||
import java.util.concurrent.Executor; | ||
@Configuration | ||
@EnableAsync | ||
public class AsyncConfig { | ||
|
||
@Bean(name = "bahmniCoreAsync") | ||
public Executor threadPoolTaskExecutor() { | ||
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); | ||
return threadPoolTaskExecutor; | ||
} | ||
} | ||
//package org.bahmni.module.bahmnicore.config; | ||
// | ||
// | ||
//import org.springframework.context.annotation.Bean; | ||
//import org.springframework.context.annotation.Configuration; | ||
//import org.springframework.scheduling.annotation.EnableAsync; | ||
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
// | ||
//import java.util.concurrent.Executor; | ||
//@Configuration | ||
//@EnableAsync | ||
//public class AsyncConfig { | ||
// | ||
// @Bean(name = "bahmniCoreAsync") | ||
// public Executor threadPoolTaskExecutor() { | ||
// ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); | ||
// return threadPoolTaskExecutor; | ||
// } | ||
//} |
50 changes: 50 additions & 0 deletions
50
.../src/main/java/org/bahmni/module/bahmnicore/eventListener/SMSEventListenerBahmniCore.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,50 @@ | ||
package org.bahmni.module.bahmnicore.eventListener; | ||
|
||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
import org.bahmni.module.events.api.model.BahmniEventType; | ||
import org.openmrs.Person; | ||
import org.openmrs.api.context.Context; | ||
import org.openmrs.api.context.UserContext; | ||
import org.openmrs.module.webservices.rest.SimpleObject; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.event.EventListener; | ||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.stereotype.Component; | ||
import org.bahmni.module.events.api.model.Event; | ||
|
||
import java.util.Locale; | ||
|
||
@Component | ||
public class SMSEventListenerBahmniCore { | ||
|
||
|
||
private final Log log = LogFactory.getLog(this.getClass()); | ||
|
||
|
||
@EventListener | ||
public void onApplicationEvent(Event event) { | ||
System.out.println("inside event listner bahmni core"); | ||
if (event.eventType == BahmniEventType.BAHMNI_PATIENT_CREATED) { | ||
Boolean isregistrationSmsEnabled = Boolean.valueOf(Context.getAdministrationService().getGlobalProperty("sms.enableRegistrationSMSAlert")); | ||
if (isregistrationSmsEnabled) { | ||
System.out.println("hi"); | ||
Object person = ((SimpleObject) event.payload).get("person"); | ||
// String phoneNumber = person.get("phoneNumebr"); | ||
// if (null == phoneNumber) { | ||
// log.info("Since no mobile number found for the patient. SMS not sent."); | ||
// return; | ||
// } | ||
// if (savePatientEvent.isRegistrationSmsEnabled()) { | ||
// UserContext userContext = savePatientEvent.getUserContext(); | ||
// Context.openSession(); | ||
// Context.setUserContext(userContext); | ||
|
||
// Location location = Context.getLocationService().getLocationByUuid(locationUuid); | ||
// String message = smsService.getRegistrationMessage(new Locale("en"), person, location); | ||
// smsService.sendSMS(phoneNumber, message); | ||
// } | ||
} | ||
} | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/OpenmrsLogin.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...nicore-api/src/main/java/org/bahmni/module/bahmnicore/service/RegistrationSmsService.java
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
...nicore-api/src/main/java/org/bahmni/module/bahmnicore/service/impl/ConnectionDetails.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/impl/OpenmrsLoginImpl.java
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
...i/src/main/java/org/bahmni/module/bahmnicore/service/impl/RegistrationSmsServiceImpl.java
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
bahmnicore-api/src/main/java/org/bahmni/module/bahmnicore/service/impl/WebClientFactory.java
This file was deleted.
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
Oops, something went wrong.