use of se.inera.intyg.infra.integration.hsa.model.Vardenhet in project webcert by sklintyg.
the class ElegWebCertUserDetailsService method decorateWebCertUserWithVardgivare.
private void decorateWebCertUserWithVardgivare(HoSPersonType hosPerson, WebCertUser webCertUser) {
String id = hosPerson.getEnhet().getVardgivare().getVardgivareId().getExtension();
String namn = hosPerson.getEnhet().getVardgivare().getVardgivarenamn();
Vardgivare vardgivare = new Vardgivare(id, namn);
Vardenhet vardenhet = new Vardenhet(hosPerson.getEnhet().getEnhetsId().getExtension(), hosPerson.getEnhet().getEnhetsnamn());
resolveArbetsplatsKod(hosPerson, vardenhet);
vardenhet.setPostadress(hosPerson.getEnhet().getPostadress());
vardenhet.setPostnummer(hosPerson.getEnhet().getPostnummer());
vardenhet.setPostort(hosPerson.getEnhet().getPostort());
vardenhet.setTelefonnummer(hosPerson.getEnhet().getTelefonnummer());
vardenhet.setEpost(hosPerson.getEnhet().getEpost());
List<Vardenhet> vardenhetList = new ArrayList<>();
vardenhetList.add(vardenhet);
vardgivare.setVardenheter(vardenhetList);
List<Vardgivare> vardgivareList = new ArrayList<>();
vardgivareList.add(vardgivare);
webCertUser.setVardgivare(vardgivareList);
webCertUser.setValdVardenhet(vardenhet);
webCertUser.setValdVardgivare(vardgivare);
// Since privatläkare doesn't have "Medarbetaruppdrag" we cannot reliably populate "miuNamnPerVardenhetsId".
// Populate with an empty map.
webCertUser.setMiuNamnPerEnhetsId(new HashMap<>());
}
use of se.inera.intyg.infra.integration.hsa.model.Vardenhet in project webcert by sklintyg.
the class ElegWebCertUserDetailsService method setFirstVardenhetOnFirstVardgivareAsDefault.
private boolean setFirstVardenhetOnFirstVardgivareAsDefault(WebCertUser user) {
Vardgivare firstVardgivare = user.getVardgivare().get(0);
user.setValdVardgivare(firstVardgivare);
Vardenhet firstVardenhet = firstVardgivare.getVardenheter().get(0);
user.setValdVardenhet(firstVardenhet);
return true;
}
use of se.inera.intyg.infra.integration.hsa.model.Vardenhet in project webcert by sklintyg.
the class LogServiceImplTest method createUser.
private WebCertUser createUser() {
Role role = AUTHORITIES_RESOLVER.getRole(AuthoritiesConstants.ROLE_LAKARE);
Vardenhet ve = new Vardenhet("VARDENHET_ID", "Vårdenheten");
Vardgivare vg = new Vardgivare("VARDGIVARE_ID", "Vårdgivaren");
vg.setVardenheter(Collections.singletonList(ve));
WebCertUser user = new WebCertUser();
user.setRoles(AuthoritiesResolverUtil.toMap(role));
user.setAuthorities(AuthoritiesResolverUtil.toMap(role.getPrivileges(), Privilege::getName));
user.setHsaId("HSAID");
user.setNamn("Markus Gran");
user.setVardgivare(Collections.singletonList(vg));
user.changeValdVardenhet("VARDENHET_ID");
user.setTitel("Överläkare");
user.setMiuNamnPerEnhetsId(buildMiUMap());
return user;
}
use of se.inera.intyg.infra.integration.hsa.model.Vardenhet in project webcert by sklintyg.
the class MailNotificationServiceImplTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
ReflectionTestUtils.setField(mailNotificationService, "adminMailAddress", "AdminMail");
ReflectionTestUtils.setField(mailNotificationService, "fromAddress", "FromAddress");
ReflectionTestUtils.setField(mailNotificationService, "webCertHostUrl", "WebCertHostUrl");
ReflectionTestUtils.setField(mailNotificationService, "ppLogicalAddress", "PpLogicalAddress");
MimeMessage mimeMessage = new MimeMessage(mock(MimeMessage.class));
doReturn(mimeMessage).when(mailSender).createMimeMessage();
Vardenhet vardenhet = new Vardenhet("aflkjdsalkjjlk", "dsaflkj", null, null, "adsflkjasdflkjadfsjlk");
vardenhet.setEpost("epost@mockadress.net");
doReturn(vardenhet).when(hsaOrganizationUnitService).getVardenhet(anyString());
}
use of se.inera.intyg.infra.integration.hsa.model.Vardenhet in project webcert by sklintyg.
the class PageControllerTest method createMockVardgivare.
private Vardgivare createMockVardgivare() {
Vardgivare vg = new Vardgivare("vg-1", "Vårdgivare 1");
Vardenhet ve = new Vardenhet("ve-1", "Vårdenhet 1");
vg.setVardenheter(Collections.singletonList(ve));
return vg;
}
Aggregations