use of se.riv.infrastructure.directory.privatepractitioner.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;
}
use of se.riv.infrastructure.directory.privatepractitioner.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;
}
use of se.riv.infrastructure.directory.privatepractitioner.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());
}
use of se.riv.infrastructure.directory.privatepractitioner.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);
}
use of se.riv.infrastructure.directory.privatepractitioner.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);
}
Aggregations