Search in sources :

Example 6 with EnhetType

use of se.riv.infrastructure.directory.privatepractitioner.v1.EnhetType in project webcert by sklintyg.

the class ConvertToFKTypes method toEnhetType.

public static EnhetType toEnhetType(Vardperson vp) {
    if (vp == null) {
        return null;
    }
    EnhetType et = new EnhetType();
    if (vp.getEnhetsId() != null) {
        et.setEnhetsId(toII(HSA_ID_OID, vp.getEnhetsId()));
    }
    et.setEnhetsnamn(vp.getEnhetsnamn());
    et.setEpost(vp.getEpost());
    et.setPostadress(vp.getPostadress());
    et.setPostnummer(vp.getPostnummer());
    et.setPostort(vp.getPostort());
    et.setTelefonnummer(vp.getTelefonnummer());
    if (vp.getArbetsplatsKod() != null) {
        et.setArbetsplatskod(toII(ARBETSPLATS_KOD_OID, vp.getArbetsplatsKod()));
    }
    VardgivareType vgt = new VardgivareType();
    vgt.setVardgivarnamn(vp.getVardgivarnamn());
    if (vp.getVardgivarId() != null) {
        vgt.setVardgivareId(toII(HSA_ID_OID, vp.getVardgivarId()));
    }
    et.setVardgivare(vgt);
    return et;
}
Also used : EnhetType(se.inera.ifv.insuranceprocess.healthreporting.v2.EnhetType) VardgivareType(se.inera.ifv.insuranceprocess.healthreporting.v2.VardgivareType)

Example 7 with EnhetType

use of se.riv.infrastructure.directory.privatepractitioner.v1.EnhetType in project webcert by sklintyg.

the class MailNotificationServiceImplTest method testSendMailForIncomingAnswerHsaIsNotCalledIfPrivatePractitioner.

@Test
public void testSendMailForIncomingAnswerHsaIsNotCalledIfPrivatePractitioner() throws Exception {
    // Given
    HoSPersonType hoSPersonType = new HoSPersonType();
    EnhetType enhet = new EnhetType();
    enhet.setEpost("test@test.se");
    enhet.setEnhetsnamn("TestEnhet");
    hoSPersonType.setEnhet(enhet);
    doReturn(hoSPersonType).when(ppService).getPrivatePractitioner(anyString(), isNull(), isNull());
    MailNotification mailNotification = mailNotification("intygsId", MailNotificationServiceImpl.PRIVATE_PRACTITIONER_HSAID_PREFIX + "1234");
    // When
    mailNotificationService.sendMailForIncomingAnswer(mailNotification);
    // Then
    verify(hsaOrganizationUnitService, times(0)).getVardenhet(anyString());
}
Also used : HoSPersonType(se.riv.infrastructure.directory.privatepractitioner.v1.HoSPersonType) EnhetType(se.riv.infrastructure.directory.privatepractitioner.v1.EnhetType) Test(org.junit.Test)

Example 8 with EnhetType

use of se.riv.infrastructure.directory.privatepractitioner.v1.EnhetType in project webcert by sklintyg.

the class ElegWebCertUserDetailsServiceTest method buildHosPerson.

private HoSPersonType buildHosPerson() {
    HoSPersonType hoSPersonType = new HoSPersonType();
    HsaId hsaId = new HsaId();
    hsaId.setExtension(HSA_ID);
    hoSPersonType.setHsaId(hsaId);
    PersonId personId = new PersonId();
    personId.setExtension(PERSON_ID);
    hoSPersonType.setPersonId(personId);
    EnhetType vardEnhet = new EnhetType();
    vardEnhet.setEnhetsnamn("enhetsNamn");
    HsaId enhetsId = new HsaId();
    enhetsId.setExtension("enhetsId");
    vardEnhet.setEnhetsId(enhetsId);
    VardgivareType vardgivare = new VardgivareType();
    HsaId vardgivareId = new HsaId();
    enhetsId.setExtension("vardgivareId");
    vardgivare.setVardgivareId(vardgivareId);
    vardgivare.setVardgivarenamn("vardgivareName");
    vardEnhet.setVardgivare(vardgivare);
    hoSPersonType.setEnhet(vardEnhet);
    return hoSPersonType;
}
Also used : PersonId(se.riv.infrastructure.directory.privatepractitioner.types.v1.PersonId) HoSPersonType(se.riv.infrastructure.directory.privatepractitioner.v1.HoSPersonType) EnhetType(se.riv.infrastructure.directory.privatepractitioner.v1.EnhetType) VardgivareType(se.riv.infrastructure.directory.privatepractitioner.v1.VardgivareType) HsaId(se.riv.infrastructure.directory.privatepractitioner.types.v1.HsaId)

Aggregations

EnhetType (se.riv.infrastructure.directory.privatepractitioner.v1.EnhetType)6 HoSPersonType (se.riv.infrastructure.directory.privatepractitioner.v1.HoSPersonType)6 Test (org.junit.Test)5 Address (javax.mail.Address)2 MimeMessage (javax.mail.internet.MimeMessage)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 EnhetType (se.inera.ifv.insuranceprocess.healthreporting.v2.EnhetType)2 MessagingException (javax.mail.MessagingException)1 WebServiceException (javax.xml.ws.WebServiceException)1 MailSendException (org.springframework.mail.MailSendException)1 VardgivareType (se.inera.ifv.insuranceprocess.healthreporting.v2.VardgivareType)1 HsaServiceCallException (se.inera.intyg.infra.integration.hsa.exception.HsaServiceCallException)1 HsaId (se.riv.infrastructure.directory.privatepractitioner.types.v1.HsaId)1 PersonId (se.riv.infrastructure.directory.privatepractitioner.types.v1.PersonId)1 VardgivareType (se.riv.infrastructure.directory.privatepractitioner.v1.VardgivareType)1