Search in sources :

Example 1 with Amneskod

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

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

the class NotificationTypeConverterTest method testConvertWhenHandelsekodIsNYFRFM.

@Test
public void testConvertWhenHandelsekodIsNYFRFM() throws Exception {
    final String intygsId = "intygsid";
    final LocalDateTime handelsetid = LocalDateTime.now().minusDays(1);
    final LocalDate sistaSvarsDatum = LocalDate.now().plusWeeks(3);
    final HandelsekodEnum handelsetyp = HandelsekodEnum.NYFRFM;
    final Amneskod amneskod = AmneskodCreator.create("KOMPLT", "Komplettering");
    final int skickadeFragorTotalt = 8;
    final int skickadeFragorHanterade = 7;
    final int skickadeFragorBesvarade = 6;
    final int skickadeFragorEjBesvarade = 5;
    final int mottagnaFragorTotalt = 4;
    final int mottagnaFragorHanterade = 3;
    final int mottagnaFragorBesvarade = 2;
    final int mottagnaFragorEjBesvarade = 1;
    final Intyg intyg = buildIntyg();
    ArendeCount skickadeFragor = new ArendeCount(skickadeFragorTotalt, skickadeFragorEjBesvarade, skickadeFragorBesvarade, skickadeFragorHanterade);
    ArendeCount mottagnaFragor = new ArendeCount(mottagnaFragorTotalt, mottagnaFragorEjBesvarade, mottagnaFragorBesvarade, mottagnaFragorHanterade);
    NotificationMessage msg = new NotificationMessage(intygsId, "luse", handelsetid, handelsetyp, "address", "", null, skickadeFragor, mottagnaFragor, SchemaVersion.VERSION_3, "ref", amneskod, sistaSvarsDatum);
    CertificateStatusUpdateForCareType res = NotificationTypeConverter.convert(msg, intyg);
    assertEquals(intyg, res.getIntyg());
    assertEquals(HandelsekodEnum.NYFRFM.value(), res.getHandelse().getHandelsekod().getCode());
    assertEquals(HandelsekodEnum.NYFRFM.description(), res.getHandelse().getHandelsekod().getDisplayName());
    assertEquals(handelsetid, res.getHandelse().getTidpunkt());
    assertEquals(sistaSvarsDatum, res.getHandelse().getSistaDatumForSvar());
    assertEquals(amneskod.getCode(), res.getHandelse().getAmne().getCode());
    assertEquals(amneskod.getCodeSystem(), res.getHandelse().getAmne().getCodeSystem());
    assertEquals(amneskod.getDisplayName(), res.getHandelse().getAmne().getDisplayName());
    assertSkickadeFrågor(skickadeFragorTotalt, skickadeFragorHanterade, skickadeFragorBesvarade, skickadeFragorEjBesvarade, res);
    assertMottagnaFragor(mottagnaFragorTotalt, mottagnaFragorHanterade, mottagnaFragorBesvarade, mottagnaFragorEjBesvarade, res);
    // Make sure we have a valid Intyg according to service contract
    assertEquals(NotificationTypeConverter.TEMPORARY_ARBETSPLATSKOD, res.getIntyg().getSkapadAv().getEnhet().getArbetsplatskod().getExtension());
    assertNull(res.getIntyg().getSkapadAv().getEnhet().getEpost());
}
Also used : LocalDateTime(java.time.LocalDateTime) 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) LocalDate(java.time.LocalDate) Amneskod(se.riv.clinicalprocess.healthcond.certificate.types.v3.Amneskod) Test(org.junit.Test)

Example 3 with Amneskod

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

the class SendMessageToRecipientTypeBuilder method buildAmne.

private static Amneskod buildAmne(Arende arende) {
    Amneskod amneskod = new Amneskod();
    amneskod.setCode(arende.getAmne().name());
    amneskod.setCodeSystem(KV_AMNE_CODE_SYSTEM);
    amneskod.setDisplayName(arende.getAmne().getDescription());
    return amneskod;
}
Also used : Amneskod(se.riv.clinicalprocess.healthcond.certificate.types.v3.Amneskod)

Example 4 with Amneskod

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

the class ListCertificatesForCareWithQAResponderImpl method buildAmne.

private static Amneskod buildAmne(ArendeAmne arende) {
    Amneskod amneskod = new Amneskod();
    amneskod.setCode(arende.name());
    amneskod.setCodeSystem(KV_AMNE_CODE_SYSTEM);
    amneskod.setDisplayName(arende.getDescription());
    return amneskod;
}
Also used : Amneskod(se.riv.clinicalprocess.healthcond.certificate.types.v3.Amneskod)

Example 5 with Amneskod

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

the class AmneskodCreator method create.

public static Amneskod create(String code, String displayName) {
    Assert.notNull(code, "The code argument must not be null");
    Amneskod amne = new Amneskod();
    amne.setCode(code);
    amne.setCodeSystem(KV_AMNE_CODE_SYSTEM);
    amne.setDisplayName(displayName);
    return amne;
}
Also used : Amneskod(se.riv.clinicalprocess.healthcond.certificate.types.v3.Amneskod)

Aggregations

Amneskod (se.riv.clinicalprocess.healthcond.certificate.types.v3.Amneskod)8 NotificationMessage (se.inera.intyg.common.support.modules.support.api.notification.NotificationMessage)2 SendMessageToCareType (se.riv.clinicalprocess.healthcond.certificate.sendMessageToCare.v2.SendMessageToCareType)2 IntygId (se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)2 PersonId (se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId)2 MeddelandeReferens (se.riv.clinicalprocess.healthcond.certificate.v3.MeddelandeReferens)2 LocalDate (java.time.LocalDate)1 LocalDateTime (java.time.LocalDateTime)1 Test (org.junit.Test)1 HandelsekodEnum (se.inera.intyg.common.support.common.enumerations.HandelsekodEnum)1 ArendeCount (se.inera.intyg.common.support.modules.support.api.notification.ArendeCount)1 CertificateStatusUpdateForCareType (se.riv.clinicalprocess.healthcond.certificate.certificatestatusupdateforcareresponder.v3.CertificateStatusUpdateForCareType)1 Komplettering (se.riv.clinicalprocess.healthcond.certificate.sendMessageToCare.v2.SendMessageToCareType.Komplettering)1 SkickatAv (se.riv.clinicalprocess.healthcond.certificate.sendMessageToCare.v2.SendMessageToCareType.SkickatAv)1 SendMessageToRecipientType (se.riv.clinicalprocess.healthcond.certificate.sendMessageToRecipient.v2.SendMessageToRecipientType)1 ArbetsplatsKod (se.riv.clinicalprocess.healthcond.certificate.types.v3.ArbetsplatsKod)1 HsaId (se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId)1 Part (se.riv.clinicalprocess.healthcond.certificate.types.v3.Part)1 Enhet (se.riv.clinicalprocess.healthcond.certificate.v3.Enhet)1 HosPersonal (se.riv.clinicalprocess.healthcond.certificate.v3.HosPersonal)1