Search in sources :

Example 6 with Patient

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient 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 7 with Patient

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient in project webcert by sklintyg.

the class NotificationTestHelper method buildPatient.

public static Patient buildPatient() {
    PersonId personId = new PersonId();
    personId.setExtension(PERSNR);
    Patient patient = new Patient();
    patient.setPersonId(personId);
    patient.setFornamn("");
    patient.setMellannamn("");
    patient.setEfternamn("");
    patient.setPostadress("");
    patient.setPostnummer("");
    patient.setPostort("");
    return patient;
}
Also used : PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId) Patient(se.riv.clinicalprocess.healthcond.certificate.v3.Patient)

Example 8 with Patient

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient in project webcert by sklintyg.

the class CreateNewDraftRequestBuilderTest method createUtlatande.

private Utlatande createUtlatande() {
    Utlatande utlatande = new Utlatande();
    // Type
    TypAvUtlatande utlTyp = new TypAvUtlatande();
    utlTyp.setCode(CERT_TYPE);
    utlatande.setTypAvUtlatande(utlTyp);
    // HoSPerson
    HsaId userHsaId = new HsaId();
    userHsaId.setExtension(USER_HSAID);
    userHsaId.setRoot("USERHSAID");
    HosPersonal hosPerson = new HosPersonal();
    hosPerson.setPersonalId(userHsaId);
    hosPerson.setFullstandigtNamn(FULLSTANDIGT_NAMN);
    HsaId unitHsaId = new HsaId();
    unitHsaId.setExtension(UNIT_HSAID);
    unitHsaId.setRoot("UNITHSAID");
    Enhet hosEnhet = new Enhet();
    hosEnhet.setEnhetsId(unitHsaId);
    hosPerson.setEnhet(hosEnhet);
    utlatande.setSkapadAv(hosPerson);
    // Patient
    PersonId personId = new PersonId();
    personId.setRoot("PERSNR");
    personId.setExtension(PERSNR);
    Patient patType = new Patient();
    patType.setPersonId(personId);
    patType.getFornamn().add("Adam");
    patType.getFornamn().add("Bertil");
    patType.getMellannamn().add("Cesarsson");
    patType.getMellannamn().add("Davidsson");
    patType.setEfternamn("Eriksson");
    utlatande.setPatient(patType);
    return utlatande;
}
Also used : HosPersonal(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.HosPersonal) Enhet(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet) PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId) Utlatande(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Utlatande) TypAvUtlatande(se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande) Patient(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient) HsaId(se.riv.clinicalprocess.healthcond.certificate.types.v1.HsaId) TypAvUtlatande(se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande)

Example 9 with Patient

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient in project webcert by sklintyg.

the class CreateNewDraftRequestBuilderTest method createIntyg.

private Intyg createIntyg() {
    Intyg intyg = new Intyg();
    TypAvIntyg intygTyp = new TypAvIntyg();
    intygTyp.setCode(CERT_TYPE);
    intyg.setTypAvIntyg(intygTyp);
    HosPersonal hosPerson = new HosPersonal();
    HsaId userHsaId = new HsaId();
    userHsaId.setExtension(USER_HSAID);
    userHsaId.setRoot("USERHSAID");
    hosPerson.setPersonalId(userHsaId);
    hosPerson.setFullstandigtNamn(FULLSTANDIGT_NAMN);
    Enhet hosEnhet = new Enhet();
    HsaId unitHsaId = new HsaId();
    unitHsaId.setExtension(UNIT_HSAID);
    unitHsaId.setRoot("UNITHSAID");
    hosEnhet.setEnhetsId(unitHsaId);
    hosPerson.setEnhet(hosEnhet);
    intyg.setSkapadAv(hosPerson);
    Patient patType = new Patient();
    PersonId personId = new PersonId();
    personId.setRoot("PERSNR");
    personId.setExtension(PERSONNUMMER);
    patType.setPersonId(personId);
    patType.setFornamn(FORNAMN);
    patType.setMellannamn(MELLANNAMN);
    patType.setEfternamn(EFTERNAMN);
    patType.setPostadress(PATIENT_POSTADRESS);
    patType.setPostnummer(PATIENT_POSTNUMMER);
    patType.setPostort(PATIENT_POSTORT);
    intyg.setPatient(patType);
    return intyg;
}
Also used : HosPersonal(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.HosPersonal) Enhet(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.Enhet) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) Intyg(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.Intyg) Patient(se.riv.clinicalprocess.healthcond.certificate.v3.Patient) HsaId(se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId)

Example 10 with Patient

use of se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient in project webcert by sklintyg.

the class CreateDraftCertificateResponderImplTest method createCertificateType.

private CreateDraftCertificateType createCertificateType() {
    // Type
    TypAvUtlatande utlTyp = new TypAvUtlatande();
    utlTyp.setCode("fk7263");
    // HoSPerson
    HsaId userHsaId = new HsaId();
    userHsaId.setExtension(USER_HSAID);
    userHsaId.setRoot("USERHSAID");
    HsaId unitHsaId = new HsaId();
    unitHsaId.setExtension(UNIT_HSAID);
    unitHsaId.setRoot("UNITHSAID");
    Enhet hosEnhet = new Enhet();
    hosEnhet.setEnhetsId(unitHsaId);
    HosPersonal hosPerson = new HosPersonal();
    hosPerson.setFullstandigtNamn("Abel Baker");
    hosPerson.setPersonalId(userHsaId);
    hosPerson.setEnhet(hosEnhet);
    // Patient
    PersonId personId = new PersonId();
    personId.setRoot("PERSNR");
    personId.setExtension("19121212-1212");
    Patient patType = new Patient();
    patType.setPersonId(personId);
    patType.getFornamn().add("Adam");
    patType.getFornamn().add("Bertil");
    patType.getMellannamn().add("Cesarsson");
    patType.getMellannamn().add("Davidsson");
    patType.setEfternamn("Eriksson");
    Utlatande utlatande = new Utlatande();
    utlatande.setTypAvUtlatande(utlTyp);
    utlatande.setSkapadAv(hosPerson);
    utlatande.setPatient(patType);
    CreateDraftCertificateType certificateType = new CreateDraftCertificateType();
    certificateType.setUtlatande(utlatande);
    return certificateType;
}
Also used : HosPersonal(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.HosPersonal) Enhet(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet) PersonId(se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId) CreateDraftCertificateType(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.CreateDraftCertificateType) TypAvUtlatande(se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande) Utlatande(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Utlatande) Patient(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient) HsaId(se.riv.clinicalprocess.healthcond.certificate.types.v1.HsaId) TypAvUtlatande(se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande)

Aggregations

Patient (se.riv.clinicalprocess.healthcond.certificate.v3.Patient)7 TypAvIntyg (se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg)5 PersonId (se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId)4 Enhet (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Enhet)3 HosPersonal (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.HosPersonal)3 Patient (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Patient)3 Utlatande (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v1.Utlatande)3 Enhet (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.Enhet)3 HosPersonal (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.HosPersonal)3 Intyg (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.Intyg)3 HsaId (se.riv.clinicalprocess.healthcond.certificate.types.v1.HsaId)3 PersonId (se.riv.clinicalprocess.healthcond.certificate.types.v1.PersonId)3 TypAvUtlatande (se.riv.clinicalprocess.healthcond.certificate.types.v1.TypAvUtlatande)3 HsaId (se.riv.clinicalprocess.healthcond.certificate.types.v3.HsaId)3 Test (org.junit.Test)2 Personnummer (se.inera.intyg.schemas.contract.Personnummer)2 Intyg (se.riv.clinicalprocess.healthcond.certificate.v3.Intyg)2 StringReader (java.io.StringReader)1 RegisterMedicalCertificateType (se.inera.ifv.insuranceprocess.healthreporting.registermedicalcertificateresponder.v3.RegisterMedicalCertificateType)1 PatientType (se.inera.ifv.insuranceprocess.healthreporting.v2.PatientType)1