Search in sources :

Example 1 with Vardgivare

use of se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare in project webcert by sklintyg.

the class SendMessageToRecipientTypeConverterTest method buildSendMessageToRecipientType.

private SendMessageToRecipientType buildSendMessageToRecipientType() {
    SendMessageToRecipientType res = new SendMessageToRecipientType();
    res.setAmne(new Amneskod());
    res.getAmne().setCode("OVRIGT");
    res.getAmne().setCodeSystem("ffa59d8f-8d7e-46ae-ac9e-31804e8e8499");
    res.getAmne().setDisplayName("Övrigt");
    res.setIntygsId(new IntygId());
    res.getIntygsId().setRoot("TSTNMT2321000156-1039");
    res.getIntygsId().setExtension("79d77cad-0c19-4278-8212-b23c82a7e33c");
    res.setLogiskAdressMottagare("SendMessageStub");
    res.setMeddelande("svarstext meddelande");
    res.setMeddelandeId("b7360a70-80a3-4d24-b10e-621c3c0c826a");
    res.setPatientPersonId(new PersonId());
    res.getPatientPersonId().setRoot("1.2.752.129.2.1.3.1");
    res.getPatientPersonId().setExtension("19121212-1212");
    res.setReferensId("referensId");
    res.setRubrik("en fråga");
    res.setSkickatAv(new HosPersonal());
    res.getSkickatAv().setEnhet(new Enhet());
    res.getSkickatAv().getEnhet().setArbetsplatskod(new ArbetsplatsKod());
    res.getSkickatAv().getEnhet().getArbetsplatskod().setRoot("1.2.752.29.4.71");
    res.getSkickatAv().getEnhet().getArbetsplatskod().setExtension("1234567890");
    res.getSkickatAv().getEnhet().setEnhetsId(new HsaId());
    res.getSkickatAv().getEnhet().getEnhetsId().setRoot("1.2.752.129.2.1.4.1");
    res.getSkickatAv().getEnhet().getEnhetsId().setExtension("TSTNMT2321000156-1039");
    res.getSkickatAv().getEnhet().setEnhetsnamn("NMT vg1 ve2");
    res.getSkickatAv().getEnhet().setVardgivare(new Vardgivare());
    res.getSkickatAv().getEnhet().getVardgivare().setVardgivareId(new HsaId());
    res.getSkickatAv().getEnhet().getVardgivare().getVardgivareId().setRoot("1.2.752.129.2.1.4.1");
    res.getSkickatAv().getEnhet().getVardgivare().getVardgivareId().setExtension("TSTNMT2321000156-1002");
    res.getSkickatAv().getEnhet().getVardgivare().setVardgivarnamn("NMT vg1");
    res.getSkickatAv().setForskrivarkod("0000000");
    res.getSkickatAv().setFullstandigtNamn("Leonie Koehl");
    res.getSkickatAv().setPersonalId(new HsaId());
    res.getSkickatAv().getPersonalId().setRoot("1.2.752.129.2.1.4.1");
    res.getSkickatAv().getPersonalId().setExtension("TSTNMT2321000156-103F");
    res.setSkickatTidpunkt(LocalDateTime.now());
    res.setSvarPa(new MeddelandeReferens());
    res.getSvarPa().setMeddelandeId("5d665d73-7029-4619-9a91-3225a90d81c8");
    res.getSvarPa().setReferensId("referensid2");
    return res;
}
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) PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId) SendMessageToRecipientType(se.riv.clinicalprocess.healthcond.certificate.sendMessageToRecipient.v2.SendMessageToRecipientType) Vardgivare(se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare) Amneskod(se.riv.clinicalprocess.healthcond.certificate.types.v3.Amneskod) HsaId(se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId) MeddelandeReferens(se.riv.clinicalprocess.healthcond.certificate.v3.MeddelandeReferens) IntygId(se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)

Example 2 with Vardgivare

use of se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare in project webcert by sklintyg.

the class NotificationTransformerTest method testSchemaVersion2Transformation.

@Test
public void testSchemaVersion2Transformation() throws Exception {
    NotificationMessage notificationMessage = new NotificationMessage(INTYGS_ID, LUSE, LocalDateTime.now(), HandelsekodEnum.SKAPAT, LOGISK_ADRESS, "{ }", null, ArendeCount.getEmpty(), ArendeCount.getEmpty(), SchemaVersion.VERSION_3, "ref");
    Message message = spy(new DefaultMessage());
    message.setBody(notificationMessage);
    ModuleApi moduleApi = mock(ModuleApi.class);
    when(moduleRegistry.getModuleApi(eq(LUSE))).thenReturn(moduleApi);
    Intyg intyg = new Intyg();
    IntygId intygsId = new IntygId();
    intygsId.setExtension(INTYGS_ID);
    intyg.setIntygsId(intygsId);
    HosPersonal hosPersonal = new HosPersonal();
    Enhet enhet = new Enhet();
    enhet.setArbetsplatskod(new ArbetsplatsKod());
    enhet.setVardgivare(new Vardgivare());
    hosPersonal.setEnhet(enhet);
    intyg.setSkapadAv(hosPersonal);
    when(moduleApi.getIntygFromUtlatande(any())).thenReturn(intyg);
    transformer.process(message);
    assertEquals(INTYGS_ID, ((se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v3.CertificateStatusUpdateForCareType) message.getBody()).getIntyg().getIntygsId().getExtension());
    assertEquals(HandelsekodEnum.SKAPAT.value(), message.getHeader(NotificationRouteHeaders.HANDELSE));
    assertEquals(INTYGS_ID, message.getHeader(NotificationRouteHeaders.INTYGS_ID));
    assertEquals(LOGISK_ADRESS, message.getHeader(NotificationRouteHeaders.LOGISK_ADRESS));
    assertEquals(SchemaVersion.VERSION_3.name(), message.getHeader(NotificationRouteHeaders.VERSION));
    verify(message, times(1)).setHeader(eq(NotificationRouteHeaders.LOGISK_ADRESS), eq(LOGISK_ADRESS));
    verify(message, times(1)).setHeader(eq(NotificationRouteHeaders.INTYGS_ID), eq(INTYGS_ID));
    verify(message, times(1)).setHeader(eq(NotificationRouteHeaders.HANDELSE), eq(HandelsekodEnum.SKAPAT.value()));
    verify(message, times(1)).setHeader(eq(NotificationRouteHeaders.VERSION), eq(SchemaVersion.VERSION_3.name()));
    verify(moduleRegistry, times(1)).getModuleApi(eq(LUSE));
    verify(moduleApi, times(1)).getUtlatandeFromJson(any());
    verify(moduleApi, times(1)).getIntygFromUtlatande(any());
    verify(notificationPatientEnricher, times(1)).enrichWithPatient(any());
}
Also used : DefaultMessage(org.apache.camel.impl.DefaultMessage) ModuleApi(se.inera.intyg.common.support.modules.support.api.ModuleApi) HosPersonal(se.riv.clinicalprocess.healthcond.certificate.v3.HosPersonal) ArbetsplatsKod(se.riv.clinicalprocess.healthcond.certificate.types.v3.ArbetsplatsKod) Message(org.apache.camel.Message) NotificationMessage(se.inera.intyg.common.support.modules.support.api.notification.NotificationMessage) DefaultMessage(org.apache.camel.impl.DefaultMessage) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg) Vardgivare(se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare) IntygId(se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId) Enhet(se.riv.clinicalprocess.healthcond.certificate.v3.Enhet) NotificationMessage(se.inera.intyg.common.support.modules.support.api.notification.NotificationMessage) Test(org.junit.Test)

Example 3 with Vardgivare

use of se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare 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 4 with Vardgivare

use of se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare in project webcert by sklintyg.

the class SendMessageToRecipientTypeBuilder method buildVardgivare.

private static Vardgivare buildVardgivare(SelectableVardenhet valdVardgivare) {
    Vardgivare vardgivare = new Vardgivare();
    if (valdVardgivare != null) {
        vardgivare.setVardgivareId(InternalConverterUtil.getHsaId(valdVardgivare.getId()));
        vardgivare.setVardgivarnamn(StringUtils.defaultString(valdVardgivare.getNamn()));
    }
    return vardgivare;
}
Also used : Vardgivare(se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare)

Example 5 with Vardgivare

use of se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare 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)

Aggregations

Vardgivare (se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare)5 ArbetsplatsKod (se.riv.clinicalprocess.healthcond.certificate.types.v3.ArbetsplatsKod)4 Enhet (se.riv.clinicalprocess.healthcond.certificate.v3.Enhet)4 HosPersonal (se.riv.clinicalprocess.healthcond.certificate.v3.HosPersonal)4 IntygId (se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)3 Intyg (se.riv.clinicalprocess.healthcond.certificate.v3.Intyg)3 Message (org.apache.camel.Message)1 DefaultMessage (org.apache.camel.impl.DefaultMessage)1 Test (org.junit.Test)1 ModuleApi (se.inera.intyg.common.support.modules.support.api.ModuleApi)1 NotificationMessage (se.inera.intyg.common.support.modules.support.api.notification.NotificationMessage)1 SendMessageToRecipientType (se.riv.clinicalprocess.healthcond.certificate.sendMessageToRecipient.v2.SendMessageToRecipientType)1 Amneskod (se.riv.clinicalprocess.healthcond.certificate.types.v3.Amneskod)1 HsaId (se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId)1 PersonId (se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId)1 TypAvIntyg (se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg)1 MeddelandeReferens (se.riv.clinicalprocess.healthcond.certificate.v3.MeddelandeReferens)1