Search in sources :

Example 6 with Enhet

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet in project webcert by sklintyg.

the class NotificationTypeConverterTest method buildIntyg.

private Intyg buildIntyg() {
    Enhet enhet = new Enhet();
    enhet.setArbetsplatskod(new ArbetsplatsKod());
    enhet.setVardgivare(new Vardgivare());
    // Not accepted value
    enhet.setEpost("");
    HosPersonal skapadAv = new HosPersonal();
    skapadAv.setEnhet(enhet);
    Intyg intyg = new Intyg();
    intyg.setSkapadAv(skapadAv);
    return intyg;
}
Also used : HosPersonal(se.riv.clinicalprocess.healthcond.certificate.v3.HosPersonal) Enhet(se.riv.clinicalprocess.healthcond.certificate.v3.Enhet) ArbetsplatsKod(se.riv.clinicalprocess.healthcond.certificate.types.v3.ArbetsplatsKod) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg) Vardgivare(se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare)

Example 7 with Enhet

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet in project webcert by sklintyg.

the class NotificationTypeConverterTest method testNotUpdatingExistingValues.

@Test
public void testNotUpdatingExistingValues() {
    final String intygsId = "intygsid";
    final String arbetsplatskod = "ARBETSPLATSKOD";
    final String epost = "EPOST";
    final LocalDateTime handelsetid = LocalDateTime.now().minusDays(1);
    final HandelsekodEnum handelsetyp = HandelsekodEnum.ANDRAT;
    Intyg intyg = buildIntyg();
    Enhet enhet = intyg.getSkapadAv().getEnhet();
    enhet.getArbetsplatskod().setExtension(arbetsplatskod);
    enhet.setEpost(epost);
    NotificationMessage msg = new NotificationMessage(intygsId, "luse", handelsetid, handelsetyp, "address", "", null, new ArendeCount(4, 3, 2, 1), new ArendeCount(4, 3, 2, 1), SchemaVersion.VERSION_3, "ref");
    CertificateStatusUpdateForCareType res = NotificationTypeConverter.convert(msg, intyg);
    assertEquals(arbetsplatskod, res.getIntyg().getSkapadAv().getEnhet().getArbetsplatskod().getExtension());
    assertEquals(epost, res.getIntyg().getSkapadAv().getEnhet().getEpost());
}
Also used : LocalDateTime(java.time.LocalDateTime) Enhet(se.riv.clinicalprocess.healthcond.certificate.v3.Enhet) NotificationMessage(se.inera.intyg.common.support.modules.support.api.notification.NotificationMessage) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg) ArendeCount(se.inera.intyg.common.support.modules.support.api.notification.ArendeCount) CertificateStatusUpdateForCareType(se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v3.CertificateStatusUpdateForCareType) HandelsekodEnum(se.inera.intyg.common.support.common.enumerations.HandelsekodEnum) Test(org.junit.Test)

Example 8 with Enhet

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet in project webcert by sklintyg.

the class SendMessageToRecipientTypeBuilder method buildEnhet.

private static Enhet buildEnhet(WebCertUser user) {
    Enhet enhet = new Enhet();
    SelectableVardenhet sourceVardenhet = user.getValdVardenhet();
    if (sourceVardenhet != null && sourceVardenhet instanceof AbstractVardenhet) {
        AbstractVardenhet valdVardenhet = (AbstractVardenhet) sourceVardenhet;
        enhet.setArbetsplatskod(InternalConverterUtil.getArbetsplatsKod(valdVardenhet.getArbetsplatskod()));
        enhet.setEnhetsId(InternalConverterUtil.getHsaId(valdVardenhet.getId()));
        enhet.setEnhetsnamn(StringUtils.defaultString(valdVardenhet.getNamn()));
        enhet.setEpost(StringUtils.trimToNull(valdVardenhet.getEpost()));
        enhet.setPostadress(StringUtils.defaultString(valdVardenhet.getPostadress()));
        enhet.setPostnummer(StringUtils.defaultString(valdVardenhet.getPostnummer()));
        enhet.setPostort(StringUtils.defaultString(valdVardenhet.getPostort()));
        enhet.setTelefonnummer(StringUtils.defaultString(valdVardenhet.getTelefonnummer()));
    }
    enhet.setVardgivare(buildVardgivare(user.getValdVardgivare()));
    return enhet;
}
Also used : Enhet(se.riv.clinicalprocess.healthcond.certificate.v3.Enhet) AbstractVardenhet(se.inera.intyg.infra.integration.hsa.model.AbstractVardenhet) SelectableVardenhet(se.inera.intyg.infra.integration.hsa.model.SelectableVardenhet)

Example 9 with Enhet

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet in project webcert by sklintyg.

the class NotificationTestHelper method createIntyg.

public static Intyg createIntyg(String intygsTyp) {
    Intyg intyg = new Intyg();
    IntygId intygId = new IntygId();
    intygId.setExtension("intyg123");
    intyg.setIntygsId(intygId);
    TypAvIntyg typAvIntyg = new TypAvIntyg();
    typAvIntyg.setCode(intygsTyp);
    intyg.setTyp(typAvIntyg);
    intyg.setPatient(buildPatient());
    HosPersonal hosPersonal = new HosPersonal();
    Enhet enhet = new Enhet();
    enhet.setVardgivare(new Vardgivare());
    enhet.setArbetsplatskod(new ArbetsplatsKod());
    hosPersonal.setEnhet(enhet);
    intyg.setSkapadAv(hosPersonal);
    // DatePeriodType and PartialDateType must be allowed
    intyg.getSvar().add(InternalConverterUtil.aSvar("").withDelsvar("", InternalConverterUtil.aDatePeriod(LocalDate.now(), LocalDate.now().plusDays(1))).withDelsvar("", InternalConverterUtil.aPartialDate(PartialDateTypeFormatEnum.YYYY, Year.of(1999))).build());
    return intyg;
}
Also used : HosPersonal(se.riv.clinicalprocess.healthcond.certificate.v3.HosPersonal) Enhet(se.riv.clinicalprocess.healthcond.certificate.v3.Enhet) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) ArbetsplatsKod(se.riv.clinicalprocess.healthcond.certificate.types.v3.ArbetsplatsKod) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) Vardgivare(se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare) IntygId(se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)

Example 10 with Enhet

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet in project webcert by sklintyg.

the class CreateNewDraftRequestBuilderTest method createUtlatande.

private Utlatande createUtlatande() {
    Utlatande utlatande = new Utlatande();
    // Type
    TypAvUtlatande utlTyp = new TypAvUtlatande();
    utlTyp.setCode(CERT_TYPE);
    utlatande.setTypAvUtlatande(utlTyp);
    // HoSPerson
    HsaId userHsaId = new HsaId();
    userHsaId.setExtension(USER_HSAID);
    userHsaId.setRoot("USERHSAID");
    HosPersonal hosPerson = new HosPersonal();
    hosPerson.setPersonalId(userHsaId);
    hosPerson.setFullstandigtNamn(FULLSTANDIGT_NAMN);
    HsaId unitHsaId = new HsaId();
    unitHsaId.setExtension(UNIT_HSAID);
    unitHsaId.setRoot("UNITHSAID");
    Enhet hosEnhet = new Enhet();
    hosEnhet.setEnhetsId(unitHsaId);
    hosPerson.setEnhet(hosEnhet);
    utlatande.setSkapadAv(hosPerson);
    // Patient
    PersonId personId = new PersonId();
    personId.setRoot("PERSNR");
    personId.setExtension(PERSNR);
    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.setPatient(patType);
    return utlatande;
}
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) Utlatande(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Utlatande) TypAvUtlatande(se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande) 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)

Aggregations

Enhet (se.riv.clinicalprocess.healthcond.certificate.v3.Enhet)6 ArbetsplatsKod (se.riv.clinicalprocess.healthcond.certificate.types.v3.ArbetsplatsKod)4 HsaId (se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId)4 PersonId (se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId)4 TypAvIntyg (se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg)4 HosPersonal (se.riv.clinicalprocess.healthcond.certificate.v3.HosPersonal)4 Intyg (se.riv.clinicalprocess.healthcond.certificate.v3.Intyg)4 Vardgivare (se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare)4 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 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 IntygId (se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)3 Patient (se.riv.clinicalprocess.healthcond.certificate.v3.Patient)3