Search in sources :

Example 11 with PersonId

use of se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId in project webcert by sklintyg.

the class CreateDraftCertificateResponderImplTest method createCertificateType.

private CreateDraftCertificateType createCertificateType() {
    // Type
    TypAvUtlatande utlTyp = new TypAvUtlatande();
    utlTyp.setCode("fk7263");
    // HoSPerson
    HsaId userHsaId = new HsaId();
    userHsaId.setExtension(USER_HSAID);
    userHsaId.setRoot("USERHSAID");
    HsaId unitHsaId = new HsaId();
    unitHsaId.setExtension(UNIT_HSAID);
    unitHsaId.setRoot("UNITHSAID");
    Enhet hosEnhet = new Enhet();
    hosEnhet.setEnhetsId(unitHsaId);
    HosPersonal hosPerson = new HosPersonal();
    hosPerson.setFullstandigtNamn("Abel Baker");
    hosPerson.setPersonalId(userHsaId);
    hosPerson.setEnhet(hosEnhet);
    // Patient
    PersonId personId = new PersonId();
    personId.setRoot("PERSNR");
    personId.setExtension("19121212-1212");
    Patient patType = new Patient();
    patType.setPersonId(personId);
    patType.getFornamn().add("Adam");
    patType.getFornamn().add("Bertil");
    patType.getMellannamn().add("Cesarsson");
    patType.getMellannamn().add("Davidsson");
    patType.setEfternamn("Eriksson");
    Utlatande utlatande = new Utlatande();
    utlatande.setTypAvUtlatande(utlTyp);
    utlatande.setSkapadAv(hosPerson);
    utlatande.setPatient(patType);
    CreateDraftCertificateType certificateType = new CreateDraftCertificateType();
    certificateType.setUtlatande(utlatande);
    return certificateType;
}
Also used : HosPersonal(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.HosPersonal) Enhet(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet) PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId) CreateDraftCertificateType(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.CreateDraftCertificateType) TypAvUtlatande(se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande) Utlatande(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Utlatande) Patient(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient) HsaId(se.riv.clinicalprocess.healthcond.certificate.types.v1.HsaId) TypAvUtlatande(se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande)

Example 12 with PersonId

use of se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId 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)

Example 13 with PersonId

use of se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId in project webcert by sklintyg.

the class ListCertificatesForCareWithQAResponderImplTest method testListCertificatesForCareWithQA.

@Test
public void testListCertificatesForCareWithQA() {
    final Personnummer personnummer = Personnummer.createPersonnummer("191212121212").get();
    final String enhet = "enhetHsaId";
    final LocalDate deadline = LocalDate.of(2017, 1, 1);
    final String reference = "ref";
    Handelse handelse = new Handelse();
    handelse.setCode(HandelsekodEnum.SKAPAT);
    handelse.setTimestamp(LocalDateTime.now());
    handelse.setAmne(ArendeAmne.AVSTMN);
    handelse.setSistaDatumForSvar(deadline);
    when(intygService.listCertificatesForCareWithQA(any(IntygWithNotificationsRequest.class))).thenReturn(Arrays.asList(new IntygWithNotificationsResponse(null, Arrays.asList(handelse), new ArendeCount(1, 1, 1, 1), new ArendeCount(2, 2, 2, 2), reference)));
    ListCertificatesForCareWithQAType request = new ListCertificatesForCareWithQAType();
    PersonId personId = new PersonId();
    personId.setExtension(personnummer.getPersonnummer());
    request.setPersonId(personId);
    HsaId hsaId = new HsaId();
    hsaId.setExtension(enhet);
    request.getEnhetsId().add(hsaId);
    ListCertificatesForCareWithQAResponseType response = responder.listCertificatesForCareWithQA("logicalAdress", request);
    assertNotNull(response);
    assertNotNull(response.getList());
    assertNotNull(response.getList().getItem());
    assertEquals(1, response.getList().getItem().size());
    assertEquals(1, response.getList().getItem().get(0).getHandelser().getHandelse().size());
    assertEquals(reference, response.getList().getItem().get(0).getRef());
    assertEquals(deadline, response.getList().getItem().get(0).getHandelser().getHandelse().get(0).getSistaDatumForSvar());
    assertEquals(HandelsekodEnum.SKAPAT.name(), response.getList().getItem().get(0).getHandelser().getHandelse().get(0).getHandelsekod().getCode());
    assertEquals(ArendeAmne.AVSTMN.name(), response.getList().getItem().get(0).getHandelser().getHandelse().get(0).getAmne().getCode());
}
Also used : Personnummer(se.inera.intyg.schemas.contract.Personnummer) ListCertificatesForCareWithQAResponseType(se.riv.clinicalprocess.healthcond.certificate.listCertificatesForCareWithQA.v3.ListCertificatesForCareWithQAResponseType) PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId) ArendeCount(se.inera.intyg.common.support.modules.support.api.notification.ArendeCount) IntygWithNotificationsResponse(se.inera.intyg.webcert.web.service.intyg.dto.IntygWithNotificationsResponse) IntygWithNotificationsRequest(se.inera.intyg.webcert.web.service.intyg.dto.IntygWithNotificationsRequest) ListCertificatesForCareWithQAType(se.riv.clinicalprocess.healthcond.certificate.listCertificatesForCareWithQA.v3.ListCertificatesForCareWithQAType) LocalDate(java.time.LocalDate) HsaId(se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId) Handelse(se.inera.intyg.webcert.persistence.handelse.model.Handelse) Test(org.junit.Test)

Example 14 with PersonId

use of se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId in project webcert by sklintyg.

the class ListCertificatesForCareWithQAResponderImplTest method missingBothEnhetAndVardgivareShouldNotThrow.

@Test
public void missingBothEnhetAndVardgivareShouldNotThrow() {
    ListCertificatesForCareWithQAType request = new ListCertificatesForCareWithQAType();
    PersonId personId = new PersonId();
    personId.setExtension("191212121212");
    request.setPersonId(personId);
    responder.listCertificatesForCareWithQA("logicalAdress", request);
}
Also used : PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId) ListCertificatesForCareWithQAType(se.riv.clinicalprocess.healthcond.certificate.listCertificatesForCareWithQA.v3.ListCertificatesForCareWithQAType) Test(org.junit.Test)

Example 15 with PersonId

use of se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId in project webcert by sklintyg.

the class ListCertificatesForCareWithQAResponderImplTest method bothEnhetAndVardgivareExistingShouldThrow.

@Test(expected = IllegalArgumentException.class)
public void bothEnhetAndVardgivareExistingShouldThrow() {
    ListCertificatesForCareWithQAType request = new ListCertificatesForCareWithQAType();
    PersonId personId = new PersonId();
    personId.setExtension("191212121212");
    request.setPersonId(personId);
    HsaId hsaId = new HsaId();
    hsaId.setExtension("enhetId");
    request.getEnhetsId().add(hsaId);
    HsaId vardgivarId = new HsaId();
    hsaId.setExtension("vardgivarId");
    request.setVardgivarId(vardgivarId);
    responder.listCertificatesForCareWithQA("logicalAdress", request);
}
Also used : PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId) ListCertificatesForCareWithQAType(se.riv.clinicalprocess.healthcond.certificate.listCertificatesForCareWithQA.v3.ListCertificatesForCareWithQAType) HsaId(se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId) Test(org.junit.Test)

Aggregations

PersonId (se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId)11 HsaId (se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId)6 Patient (se.riv.clinicalprocess.healthcond.certificate.v3.Patient)4 Test (org.junit.Test)3 Enhet (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet)3 HosPersonal (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.HosPersonal)3 Patient (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient)3 Utlatande (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Utlatande)3 Enhet (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.Enhet)3 HosPersonal (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.HosPersonal)3 Intyg (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.Intyg)3 ListCertificatesForCareWithQAType (se.riv.clinicalprocess.healthcond.certificate.listCertificatesForCareWithQA.v3.ListCertificatesForCareWithQAType)3 HsaId (se.riv.clinicalprocess.healthcond.certificate.types.v1.HsaId)3 PersonId (se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId)3 TypAvUtlatande (se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande)3 TypAvIntyg (se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg)3 Personnummer (se.inera.intyg.schemas.contract.Personnummer)2 Amneskod (se.riv.clinicalprocess.healthcond.certificate.types.v3.Amneskod)2 IntygId (se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)2 MeddelandeReferens (se.riv.clinicalprocess.healthcond.certificate.v3.MeddelandeReferens)2