Search in sources :

Example 1 with SendType

use of se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateresponder.v1.SendType in project webcert by sklintyg.

the class IntygConverterUtil method buildSendTypeFromUtlatande.

public static SendType buildSendTypeFromUtlatande(Utlatande utlatande) {
    LakarutlatandeEnkelType utlatandeType = ModelConverter.toLakarutlatandeEnkelType(utlatande);
    VardAdresseringsType vardAdressType = ModelConverter.toVardAdresseringsType(utlatande.getGrundData());
    SendType sendType = new SendType();
    sendType.setLakarutlatande(utlatandeType);
    sendType.setAdressVard(vardAdressType);
    sendType.setVardReferensId(buildVardReferensId(utlatande.getId()));
    sendType.setAvsantTidpunkt(LocalDateTime.now());
    return sendType;
}
Also used : SendType(se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateresponder.v1.SendType) VardAdresseringsType(se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.VardAdresseringsType) LakarutlatandeEnkelType(se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType)

Example 2 with SendType

use of se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateresponder.v1.SendType in project webcert by sklintyg.

the class IntygConverterUtilTest method testBuildSendTypeFromUtlatande.

@Test
public void testBuildSendTypeFromUtlatande() throws Exception {
    Fk7263Utlatande utlatande = createUtlatandeFromJson();
    SendType res = IntygConverterUtil.buildSendTypeFromUtlatande(utlatande);
    assertNotNull(res);
    assertNotNull(res.getAvsantTidpunkt());
    assertTrue(res.getVardReferensId().contains("SEND-123-"));
    assertEquals("123", res.getLakarutlatande().getLakarutlatandeId());
    assertNull(res.getLakarutlatande().getPatient().getFullstandigtNamn());
    assertEquals("19121212-1212", res.getLakarutlatande().getPatient().getPersonId().getExtension());
    assertNotNull(res.getLakarutlatande().getSigneringsTidpunkt());
    assertNull(res.getAdressVard().getHosPersonal().getForskrivarkod());
    assertEquals("En Läkare", res.getAdressVard().getHosPersonal().getFullstandigtNamn());
    assertEquals("Personal HSA-ID", res.getAdressVard().getHosPersonal().getPersonalId().getExtension());
    assertEquals("Kir mott", res.getAdressVard().getHosPersonal().getEnhet().getEnhetsnamn());
    assertEquals("VardenhetY", res.getAdressVard().getHosPersonal().getEnhet().getEnhetsId().getExtension());
    assertEquals("123456789011", res.getAdressVard().getHosPersonal().getEnhet().getArbetsplatskod().getExtension());
    assertEquals("Landstinget Norrland", res.getAdressVard().getHosPersonal().getEnhet().getVardgivare().getVardgivarnamn());
    assertEquals("VardgivarId", res.getAdressVard().getHosPersonal().getEnhet().getVardgivare().getVardgivareId().getExtension());
}
Also used : Fk7263Utlatande(se.inera.intyg.common.fk7263.model.internal.Fk7263Utlatande) SendType(se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateresponder.v1.SendType) Test(org.junit.Test)

Aggregations

SendType (se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateresponder.v1.SendType)2 Test (org.junit.Test)1 LakarutlatandeEnkelType (se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType)1 VardAdresseringsType (se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.VardAdresseringsType)1 Fk7263Utlatande (se.inera.intyg.common.fk7263.model.internal.Fk7263Utlatande)1