Search in sources :

Example 1 with LakarutlatandeEnkelType

use of se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType in project webcert by sklintyg.

the class ConvertToFKTypesTest method testToLakarUtlatandeIntygsReferensNull.

@Test
public void testToLakarUtlatandeIntygsReferensNull() {
    LakarutlatandeEnkelType res = ConvertToFKTypes.toLakarUtlatande(null);
    assertNull(res);
}
Also used : LakarutlatandeEnkelType(se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType) Test(org.junit.Test)

Example 2 with LakarutlatandeEnkelType

use of se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType 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 3 with LakarutlatandeEnkelType

use of se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType in project webcert by sklintyg.

the class QuestionAnswerValidator method validate.

public static List<String> validate(ReceiveMedicalCertificateQuestionType request) {
    List<String> messages = new ArrayList<>();
    if (request.getQuestion().getFraga() == null) {
        messages.add("Missing fraga element.");
    }
    validateAmne(messages, request.getQuestion().getAmne());
    LakarutlatandeEnkelType lakarutlatande = request.getQuestion().getLakarutlatande();
    validateLakarutlatande(messages, lakarutlatande);
    HosPersonalType hosPersonal = request.getQuestion().getAdressVard().getHosPersonal();
    validateHosPersonal(messages, hosPersonal);
    validateEnhet(messages, hosPersonal);
    validateVardgivare(messages, hosPersonal);
    PatientType patient = lakarutlatande.getPatient();
    validatePatient(messages, patient);
    return messages;
}
Also used : PatientType(se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType) ArrayList(java.util.ArrayList) HosPersonalType(se.inera.ifv.insuranceprocess.healthreporting.v2.HosPersonalType) LakarutlatandeEnkelType(se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType)

Example 4 with LakarutlatandeEnkelType

use of se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType in project webcert by sklintyg.

the class QuestionAnswerValidator method validate.

public static List<String> validate(ReceiveMedicalCertificateAnswerType request) {
    List<String> messages = new ArrayList<>();
    if (request.getAnswer().getSvar() == null) {
        messages.add("Missing svar element.");
    }
    validateAmne(messages, request.getAnswer().getAmne());
    LakarutlatandeEnkelType lakarutlatande = request.getAnswer().getLakarutlatande();
    validateLakarutlatande(messages, lakarutlatande);
    HosPersonalType hosPersonal = request.getAnswer().getAdressVard().getHosPersonal();
    validateHosPersonal(messages, hosPersonal);
    validateEnhet(messages, hosPersonal);
    validateVardgivare(messages, hosPersonal);
    PatientType patient = lakarutlatande.getPatient();
    validatePatient(messages, patient);
    return messages;
}
Also used : PatientType(se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType) ArrayList(java.util.ArrayList) HosPersonalType(se.inera.ifv.insuranceprocess.healthreporting.v2.HosPersonalType) LakarutlatandeEnkelType(se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType)

Example 5 with LakarutlatandeEnkelType

use of se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType in project webcert by sklintyg.

the class ConvertToFKTypes method toLakarUtlatande.

public static LakarutlatandeEnkelType toLakarUtlatande(IntygsReferens ir) {
    if (ir == null) {
        return null;
    }
    LakarutlatandeEnkelType lu = new LakarutlatandeEnkelType();
    lu.setLakarutlatandeId(ir.getIntygsId());
    PatientType pt = new PatientType();
    String root = PERSON_ID_OID;
    if (SamordningsnummerValidator.isSamordningsNummer(Optional.ofNullable(ir.getPatientId()))) {
        root = SAMORDNING_ID_OID;
    }
    pt.setPersonId(toII(root, ir.getPatientId().getPersonnummerWithDash()));
    lu.setPatient(pt);
    lu.setSigneringsTidpunkt(ir.getSigneringsDatum());
    return lu;
}
Also used : PatientType(se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType) LakarutlatandeEnkelType(se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType)

Aggregations

LakarutlatandeEnkelType (se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType)7 Test (org.junit.Test)3 PatientType (se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType)3 LocalDateTime (java.time.LocalDateTime)2 ArrayList (java.util.ArrayList)2 HosPersonalType (se.inera.ifv.insuranceprocess.healthreporting.v2.HosPersonalType)2 IntygsReferens (se.inera.intyg.webcert.persistence.fragasvar.model.IntygsReferens)2 VardAdresseringsType (se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.VardAdresseringsType)1 SendType (se.inera.ifv.insuranceprocess.healthreporting.sendmedicalcertificateresponder.v1.SendType)1