use of org.openmrs.module.emrapi.account.AccountDomainWrapper in project openmrs-module-mirebalais by PIH.
the class MirebalaisHospitalActivatorComponentTest method verifyMirebalaisProviderIdentifierGeneratorConfigured.
private void verifyMirebalaisProviderIdentifierGeneratorConfigured() {
Person person = Context.getPersonService().getPerson(2);
AccountDomainWrapper account = accountService.getAccountByPerson(person);
accountService.saveAccount(account);
assertEquals("MCEPM", account.getProvider().getIdentifier());
}
use of org.openmrs.module.emrapi.account.AccountDomainWrapper in project openmrs-module-coreapps by openmrs.
the class EditProviderPageController method getAccount.
public AccountDomainWrapper getAccount(@RequestParam(value = "personId", required = false) Person person, @RequestParam(value = "personUuid", required = false) String personUuid, @SpringBean("accountService") AccountService accountService) {
AccountDomainWrapper account;
Person newPerson = person;
if (newPerson == null) {
if (StringUtils.isNotBlank(personUuid)) {
newPerson = Context.getPersonService().getPersonByUuid(personUuid);
}
if (newPerson == null) {
newPerson = new Person();
}
}
account = accountService.getAccountByPerson(newPerson);
if (account == null)
throw new APIException("Failed to find user account matching person with id:" + person.getPersonId());
return account;
}
Aggregations