Search in sources :

Example 6 with HoSPersonal

use of se.inera.intyg.common.support.model.common.internal.HoSPersonal in project webcert by sklintyg.

the class CreateNewDraftRequestBuilderImpl method buildCreateNewDraftRequest.

@Override
public CreateNewDraftRequest buildCreateNewDraftRequest(Utlatande utlatande, IntygUser user) {
    HoSPersonal hosPerson = createHoSPerson(utlatande.getSkapadAv(), HoSPersonHelper.createVardenhetFromIntygUser(utlatande.getSkapadAv().getEnhet().getEnhetsId().getExtension(), user));
    HoSPersonHelper.enrichHoSPerson(hosPerson, user);
    return new CreateNewDraftRequest(null, utlatande.getTypAvUtlatande().getCode(), null, hosPerson, createPatient(utlatande.getPatient()));
}
Also used : HoSPersonal(se.inera.intyg.common.support.model.common.internal.HoSPersonal) CreateNewDraftRequest(se.inera.intyg.webcert.web.service.utkast.dto.CreateNewDraftRequest)

Example 7 with HoSPersonal

use of se.inera.intyg.common.support.model.common.internal.HoSPersonal in project webcert by sklintyg.

the class CreateNewDraftRequestBuilderImpl method createHoSPerson.

private HoSPersonal createHoSPerson(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.HosPersonal hoSPersonType, Vardenhet vardenhet) {
    HoSPersonal hoSPerson = new HoSPersonal();
    hoSPerson.setFullstandigtNamn(hoSPersonType.getFullstandigtNamn());
    hoSPerson.setPersonId(hoSPersonType.getPersonalId().getExtension());
    hoSPerson.setVardenhet(vardenhet);
    return hoSPerson;
}
Also used : HoSPersonal(se.inera.intyg.common.support.model.common.internal.HoSPersonal)

Example 8 with HoSPersonal

use of se.inera.intyg.common.support.model.common.internal.HoSPersonal in project webcert by sklintyg.

the class IntygServiceRevokeTest method setup.

@Before
public void setup() throws Exception {
    HoSPersonal person = buildHosPerson();
    VardpersonReferens vardperson = buildVardpersonReferens(person);
    WebCertUser user = buildWebCertUser(person);
    signedUtkast = buildUtkast(INTYG_ID, INTYG_TYPE, UtkastStatus.SIGNED, INTYG_JSON, vardperson);
    revokedUtkast = buildUtkast(INTYG_ID, INTYG_TYPE, UtkastStatus.SIGNED, json, vardperson);
    revokedUtkast.setAterkalladDatum(LocalDateTime.now());
    when(webCertUserService.getUser()).thenReturn(user);
}
Also used : HoSPersonal(se.inera.intyg.common.support.model.common.internal.HoSPersonal) VardpersonReferens(se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens) WebCertUser(se.inera.intyg.webcert.web.service.user.dto.WebCertUser) Before(org.junit.Before)

Example 9 with HoSPersonal

use of se.inera.intyg.common.support.model.common.internal.HoSPersonal in project webcert by sklintyg.

the class IntygServiceRevokeTest method buildHosPerson.

private HoSPersonal buildHosPerson() {
    HoSPersonal person = new HoSPersonal();
    person.setPersonId(HSA_ID);
    person.setFullstandigtNamn("Dr Dengroth");
    return person;
}
Also used : HoSPersonal(se.inera.intyg.common.support.model.common.internal.HoSPersonal)

Example 10 with HoSPersonal

use of se.inera.intyg.common.support.model.common.internal.HoSPersonal in project webcert by sklintyg.

the class CopyUtkastServiceImplTest method setup.

@Before
public void setup() {
    hoSPerson = new HoSPersonal();
    hoSPerson.setPersonId(HOSPERSON_ID);
    hoSPerson.setFullstandigtNamn(HOSPERSON_NAME);
    Vardgivare vardgivare = new Vardgivare();
    vardgivare.setVardgivarid(VARDGIVARE_ID);
    vardgivare.setVardgivarnamn(VARDGIVARE_NAME);
    Vardenhet vardenhet = new Vardenhet();
    vardenhet.setEnhetsid(VARDENHET_ID);
    vardenhet.setEnhetsnamn(VARDENHET_NAME);
    vardenhet.setVardgivare(vardgivare);
    hoSPerson.setVardenhet(vardenhet);
    patient = new Patient();
    patient.setPersonId(PATIENT_SSN);
}
Also used : HoSPersonal(se.inera.intyg.common.support.model.common.internal.HoSPersonal) Patient(se.inera.intyg.common.support.model.common.internal.Patient) Vardgivare(se.inera.intyg.common.support.model.common.internal.Vardgivare) Vardenhet(se.inera.intyg.common.support.model.common.internal.Vardenhet) Before(org.junit.Before)

Aggregations

HoSPersonal (se.inera.intyg.common.support.model.common.internal.HoSPersonal)38 WebCertUser (se.inera.intyg.webcert.web.service.user.dto.WebCertUser)15 Test (org.junit.Test)13 Patient (se.inera.intyg.common.support.model.common.internal.Patient)11 GrundData (se.inera.intyg.common.support.model.common.internal.GrundData)10 Utlatande (se.inera.intyg.common.support.model.common.internal.Utlatande)10 Before (org.junit.Before)8 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)7 Vardenhet (se.inera.intyg.common.support.model.common.internal.Vardenhet)5 Vardgivare (se.inera.intyg.common.support.model.common.internal.Vardgivare)5 ValidateDraftResponse (se.inera.intyg.common.support.modules.support.api.dto.ValidateDraftResponse)5 Vardenhet (se.inera.intyg.infra.integration.hsa.model.Vardenhet)5 Personnummer (se.inera.intyg.schemas.contract.Personnummer)5 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)4 Vardgivare (se.inera.intyg.infra.integration.hsa.model.Vardgivare)4 VardpersonReferens (se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens)4 CreateNewDraftRequest (se.inera.intyg.webcert.web.service.utkast.dto.CreateNewDraftRequest)4 UpdatePatientOnDraftRequest (se.inera.intyg.webcert.web.service.utkast.dto.UpdatePatientOnDraftRequest)4 AbstractVardenhet (se.inera.intyg.infra.integration.hsa.model.AbstractVardenhet)3 SaveDraftResponse (se.inera.intyg.webcert.web.service.utkast.dto.SaveDraftResponse)3