Search in sources :

Example 6 with VardpersonReferens

use of se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens in project webcert by sklintyg.

the class UtkastBootstrapBean method createUtkast.

private Utkast createUtkast(Utlatande json) throws JsonProcessingException {
    Utkast utkast = new Utkast();
    utkast.setEnhetsId(json.getGrundData().getSkapadAv().getVardenhet().getEnhetsid());
    utkast.setEnhetsNamn(json.getGrundData().getSkapadAv().getVardenhet().getEnhetsnamn());
    utkast.setIntygsId(json.getId());
    utkast.setIntygsTyp(json.getTyp());
    utkast.setModel(mapper.writeValueAsString(json));
    utkast.setPatientEfternamn(json.getGrundData().getPatient().getEfternamn());
    utkast.setPatientFornamn(json.getGrundData().getPatient().getFornamn());
    utkast.setPatientMellannamn(json.getGrundData().getPatient().getMellannamn());
    utkast.setPatientPersonnummer(json.getGrundData().getPatient().getPersonId());
    utkast.setRelationIntygsId(null);
    utkast.setRelationKod(null);
    // Used for both senastSparadAv and skapadAv
    VardpersonReferens vardRef = new VardpersonReferens();
    vardRef.setHsaId(json.getGrundData().getSkapadAv().getPersonId());
    vardRef.setNamn(json.getGrundData().getSkapadAv().getFullstandigtNamn());
    utkast.setSenastSparadAv(vardRef);
    utkast.setSkapadAv(vardRef);
    utkast.setSignatur(new Signatur(json.getGrundData().getSigneringsdatum(), json.getGrundData().getSkapadAv().getPersonId(), json.getId(), "intygData", "intygHash", "signatur"));
    utkast.setStatus(UtkastStatus.SIGNED);
    utkast.setSenastSparadDatum(json.getGrundData().getSigneringsdatum());
    utkast.setSkickadTillMottagare("FKASSA");
    utkast.setSkickadTillMottagareDatum(json.getGrundData().getSigneringsdatum().plusMinutes(2));
    utkast.setVardgivarId(json.getGrundData().getSkapadAv().getVardenhet().getVardgivare().getVardgivarid());
    utkast.setVardgivarNamn(json.getGrundData().getSkapadAv().getVardenhet().getVardgivare().getVardgivarnamn());
    utkast.setVersion(1);
    utkast.setVidarebefordrad(false);
    return utkast;
}
Also used : Signatur(se.inera.intyg.webcert.persistence.utkast.model.Signatur) Utkast(se.inera.intyg.webcert.persistence.utkast.model.Utkast) VardpersonReferens(se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens)

Example 7 with VardpersonReferens

use of se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens 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 8 with VardpersonReferens

use of se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens in project webcert by sklintyg.

the class IntygServiceRevokeTest method buildVardpersonReferens.

private VardpersonReferens buildVardpersonReferens(HoSPersonal person) {
    VardpersonReferens vardperson = new VardpersonReferens();
    vardperson.setHsaId(person.getPersonId());
    vardperson.setNamn(person.getFullstandigtNamn());
    return vardperson;
}
Also used : VardpersonReferens(se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens)

Example 9 with VardpersonReferens

use of se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens in project webcert by sklintyg.

the class CopyCompletionUtkastBuilderTest method createOriginalUtkast.

private Utkast createOriginalUtkast() {
    Utkast orgUtkast = new Utkast();
    orgUtkast.setIntygsId(INTYG_COPY_ID);
    orgUtkast.setIntygsTyp(INTYG_TYPE);
    orgUtkast.setPatientPersonnummer(PATIENT_SSN);
    orgUtkast.setPatientFornamn(PATIENT_FNAME);
    orgUtkast.setPatientMellannamn(PATIENT_MNAME);
    orgUtkast.setPatientEfternamn(PATIENT_LNAME);
    orgUtkast.setEnhetsId(VARDENHET_ID);
    orgUtkast.setEnhetsNamn(VARDENHET_NAME);
    orgUtkast.setVardgivarId(VARDGIVARE_ID);
    orgUtkast.setVardgivarNamn(VARDGIVARE_NAME);
    orgUtkast.setModel(INTYG_JSON);
    VardpersonReferens vpRef = new VardpersonReferens();
    vpRef.setHsaId(HOSPERSON_ID);
    vpRef.setNamn(HOSPERSON_NAME);
    orgUtkast.setSenastSparadAv(vpRef);
    orgUtkast.setSkapadAv(vpRef);
    return orgUtkast;
}
Also used : Utkast(se.inera.intyg.webcert.persistence.utkast.model.Utkast) VardpersonReferens(se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens)

Example 10 with VardpersonReferens

use of se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens in project webcert by sklintyg.

the class CreateRenewalCopyUtkastBuilderImplTest method createOriginalUtkast.

private Utkast createOriginalUtkast() {
    Utkast orgUtkast = new Utkast();
    orgUtkast.setIntygsId(INTYG_COPY_ID);
    orgUtkast.setIntygsTyp(INTYG_TYPE);
    orgUtkast.setPatientPersonnummer(PATIENT_SSN);
    orgUtkast.setPatientFornamn(PATIENT_FNAME);
    orgUtkast.setPatientMellannamn(PATIENT_MNAME);
    orgUtkast.setPatientEfternamn(PATIENT_LNAME);
    orgUtkast.setEnhetsId(VARDENHET_ID);
    orgUtkast.setEnhetsNamn(VARDENHET_NAME);
    orgUtkast.setVardgivarId(VARDGIVARE_ID);
    orgUtkast.setVardgivarNamn(VARDGIVARE_NAME);
    orgUtkast.setModel(INTYG_JSON);
    VardpersonReferens vpRef = new VardpersonReferens();
    vpRef.setHsaId(HOSPERSON_ID);
    vpRef.setNamn(HOSPERSON_NAME);
    orgUtkast.setSenastSparadAv(vpRef);
    orgUtkast.setSkapadAv(vpRef);
    return orgUtkast;
}
Also used : Utkast(se.inera.intyg.webcert.persistence.utkast.model.Utkast) VardpersonReferens(se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens)

Aggregations

VardpersonReferens (se.inera.intyg.webcert.persistence.utkast.model.VardpersonReferens)33 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)21 Before (org.junit.Before)5 Signatur (se.inera.intyg.webcert.persistence.utkast.model.Signatur)5 Test (org.junit.Test)4 HoSPersonal (se.inera.intyg.common.support.model.common.internal.HoSPersonal)4 Vardenhet (se.inera.intyg.common.support.model.common.internal.Vardenhet)4 SchemaVersion (se.inera.intyg.common.support.modules.support.api.notification.SchemaVersion)4 IntygUser (se.inera.intyg.infra.security.common.model.IntygUser)4 TakResult (se.inera.intyg.webcert.integration.tak.model.TakResult)4 BaseCreateDraftCertificateTest (se.inera.intyg.webcert.web.integration.interactions.createdraftcertificate.BaseCreateDraftCertificateTest)4 IntegreradEnhetEntry (se.inera.intyg.webcert.web.integration.registry.dto.IntegreradEnhetEntry)4 ResultValidator (se.inera.intyg.webcert.web.integration.validators.ResultValidator)4 CreateNewDraftRequest (se.inera.intyg.webcert.web.service.utkast.dto.CreateNewDraftRequest)4 Vardgivare (se.inera.intyg.common.support.model.common.internal.Vardgivare)3 PagaendeSignering (se.inera.intyg.webcert.persistence.utkast.model.PagaendeSignering)3 CreateDraftCertificateResponseType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.CreateDraftCertificateResponseType)3 CreateDraftCertificateType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.CreateDraftCertificateType)3 Intyg (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.Intyg)3 TypAvIntyg (se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg)3