Search in sources :

Example 1 with PatientType

use of se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType in project webcert by sklintyg.

the class UtkastBootstrapBean method buildUtlatande.

// INTYG-4086: An incredibly ugly hack to mitigate the fact that we're populating test-data using the XML format
// and also directly to WC instead of storing in IT where these actually belong...
private Utlatande buildUtlatande(Resource resource, String moduleName) throws ModuleException, ModuleNotFoundException, IOException {
    String xml = Resources.toString(resource.getURL(), Charsets.UTF_8);
    Utlatande utlatande = registry.getModuleApi(moduleName).getUtlatandeFromXml(xml);
    switch(moduleName) {
        case "luse":
        case "luae_fs":
        case "luae_na":
        case "lisjp":
            RegisterCertificateType jaxbObject = JAXB.unmarshal(new StringReader(Resources.toString(resource.getURL(), Charsets.UTF_8)), RegisterCertificateType.class);
            Patient patient = jaxbObject.getIntyg().getPatient();
            utlatande.getGrundData().getPatient().setFornamn(patient.getFornamn());
            utlatande.getGrundData().getPatient().setMellannamn(patient.getMellannamn());
            utlatande.getGrundData().getPatient().setEfternamn(patient.getEfternamn());
            utlatande.getGrundData().getPatient().setFullstandigtNamn(IntygConverterUtil.concatPatientName(patient.getFornamn(), patient.getMellannamn(), patient.getEfternamn()));
            break;
        case "fk7263":
            RegisterMedicalCertificateType jaxbObject2 = JAXB.unmarshal(new StringReader(Resources.toString(resource.getURL(), Charsets.UTF_8)), RegisterMedicalCertificateType.class);
            PatientType patient2 = jaxbObject2.getLakarutlatande().getPatient();
            utlatande.getGrundData().getPatient().setEfternamn(patient2.getFullstandigtNamn());
            utlatande.getGrundData().getPatient().setFullstandigtNamn(patient2.getFullstandigtNamn());
            break;
        case "ts-bas":
        case "ts-diabetes":
            break;
    }
    return utlatande;
}
Also used : RegisterMedicalCertificateType(se.inera.ifv.insuranceprocess.healthreporting.registermedicalcertificateresponder.v3.RegisterMedicalCertificateType) PatientType(se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType) Utlatande(se.inera.intyg.common.support.model.common.internal.Utlatande) StringReader(java.io.StringReader) Patient(se.riv.clinicalprocess.healthcond.certificate.v3.Patient) RegisterCertificateType(se.riv.clinicalprocess.healthcond.certificate.registerCertificate.v3.RegisterCertificateType)

Example 2 with PatientType

use of se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType 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 3 with PatientType

use of se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType 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 4 with PatientType

use of se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType 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

PatientType (se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType)4 LakarutlatandeEnkelType (se.inera.ifv.insuranceprocess.healthreporting.medcertqa.v1.LakarutlatandeEnkelType)3 ArrayList (java.util.ArrayList)2 HosPersonalType (se.inera.ifv.insuranceprocess.healthreporting.v2.HosPersonalType)2 StringReader (java.io.StringReader)1 RegisterMedicalCertificateType (se.inera.ifv.insuranceprocess.healthreporting.registermedicalcertificateresponder.v3.RegisterMedicalCertificateType)1 Utlatande (se.inera.intyg.common.support.model.common.internal.Utlatande)1 RegisterCertificateType (se.riv.clinicalprocess.healthcond.certificate.registerCertificate.v3.RegisterCertificateType)1 Patient (se.riv.clinicalprocess.healthcond.certificate.v3.Patient)1