Search in sources :

Example 1 with Patient

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

the class CreateDraftCertificateValidatorImplTest method buildIntyg.

private Utlatande buildIntyg(String intygsKod, String patientEfternamn, String patientFornamn, String patientPersonId, String hosPersonalFullstandigtNamn, String hosPersonalHsaId, String enhetsnamn, String enhetHsaId, boolean createUnit) {
    Utlatande intyg = new Utlatande();
    TypAvUtlatande typAvIntyg = new TypAvUtlatande();
    typAvIntyg.setCode(intygsKod);
    intyg.setTypAvUtlatande(typAvIntyg);
    Patient patient = new Patient();
    patient.setEfternamn(patientEfternamn);
    if (patientFornamn != null) {
        patient.getFornamn().add(patientFornamn);
    }
    if (patientPersonId != null) {
        patient.setPersonId(new PersonId());
        patient.getPersonId().setExtension(patientPersonId);
    }
    intyg.setPatient(patient);
    HosPersonal hosPersonal = new HosPersonal();
    hosPersonal.setFullstandigtNamn(hosPersonalFullstandigtNamn);
    if (hosPersonalHsaId != null) {
        hosPersonal.setPersonalId(new HsaId());
        hosPersonal.getPersonalId().setExtension(hosPersonalHsaId);
    }
    if (createUnit) {
        Enhet enhet = new Enhet();
        enhet.setEnhetsnamn(enhetsnamn);
        if (enhetHsaId != null) {
            enhet.setEnhetsId(new HsaId());
            enhet.getEnhetsId().setExtension(enhetHsaId);
        }
        hosPersonal.setEnhet(enhet);
    }
    intyg.setSkapadAv(hosPersonal);
    return intyg;
}
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) 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)

Example 2 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
    TypAvIntyg utlTyp = new TypAvIntyg();
    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.setFornamn("Adam");
    patType.setMellannamn("Cesarsson");
    patType.setEfternamn("Eriksson");
    Intyg utlatande = new Intyg();
    utlatande.setTypAvIntyg(utlTyp);
    utlatande.setSkapadAv(hosPerson);
    utlatande.setPatient(patType);
    utlatande.setRef("Test-ref");
    CreateDraftCertificateType certificateType = new CreateDraftCertificateType();
    certificateType.setIntyg(utlatande);
    return certificateType;
}
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) CreateDraftCertificateType(se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.CreateDraftCertificateType) 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 3 with Patient

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

the class CreateDraftCertificateValidatorImplTest method buildIntyg.

private Intyg buildIntyg(String intygsKod, String patientEfternamn, String patientFornamn, String hosPersonalFullstandigtNamn, String enhetsId, String enhetsnamn, boolean createUnit, String personId) {
    Intyg intyg = new Intyg();
    TypAvIntyg typAvIntyg = new TypAvIntyg();
    typAvIntyg.setCode(intygsKod);
    intyg.setTypAvIntyg(typAvIntyg);
    Patient patient = new Patient();
    patient.setEfternamn(patientEfternamn);
    patient.setFornamn(patientFornamn);
    if (personId != null) {
        patient.setPersonId(new PersonId());
        patient.getPersonId().setExtension(personId);
    }
    intyg.setPatient(patient);
    HosPersonal hosPersonal = new HosPersonal();
    hosPersonal.setFullstandigtNamn(hosPersonalFullstandigtNamn);
    HsaId personalHsaId = new HsaId();
    personalHsaId.setExtension("personal-1");
    hosPersonal.setPersonalId(personalHsaId);
    if (createUnit) {
        Enhet enhet = new Enhet();
        enhet.setEnhetsId(new HsaId());
        enhet.getEnhetsId().setExtension(enhetsId);
        enhet.setEnhetsnamn(enhetsnamn);
        hosPersonal.setEnhet(enhet);
    }
    intyg.setSkapadAv(hosPersonal);
    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 4 with Patient

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

the class NotificationPatientEnricherTest method testSekretessmarkeradPatientIsNotUpdated.

@Test
public void testSekretessmarkeradPatientIsNotUpdated() throws TemporaryException {
    when(puService.getPerson(any(Personnummer.class))).thenReturn(buildPersonSvar(true));
    Intyg intyg = buildIntyg("luae_fs");
    testee.enrichWithPatient(intyg);
    verify(puService, times(1)).getPerson(any(Personnummer.class));
    Patient p = intyg.getPatient();
    assertEquals("191212121212", p.getPersonId().getExtension());
    assertEquals("", p.getFornamn());
    assertEquals("", p.getMellannamn());
    assertEquals("Sekretessmarkering", p.getEfternamn());
    assertEquals("", p.getPostadress());
    assertEquals("", p.getPostnummer());
    assertEquals("", p.getPostort());
}
Also used : Personnummer(se.inera.intyg.schemas.contract.Personnummer) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) Patient(se.riv.clinicalprocess.healthcond.certificate.v3.Patient) Test(org.junit.Test)

Example 5 with Patient

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

the class NotificationPatientEnricherTest method testLuaeFsIsEnriched.

@Test
public void testLuaeFsIsEnriched() throws TemporaryException {
    when(puService.getPerson(any(Personnummer.class))).thenReturn(buildPersonSvar(false));
    Intyg intyg = buildIntyg("luae_fs");
    testee.enrichWithPatient(intyg);
    verify(puService, times(1)).getPerson(any(Personnummer.class));
    Patient p = intyg.getPatient();
    assertEquals("Tolvan", p.getFornamn());
    assertEquals("Mellis", p.getMellannamn());
    assertEquals("Tolvansson", p.getEfternamn());
    assertEquals("Tolvgatan 12", p.getPostadress());
    assertEquals("12121", p.getPostnummer());
    assertEquals("Tolvhult", p.getPostort());
}
Also used : Personnummer(se.inera.intyg.schemas.contract.Personnummer) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) Patient(se.riv.clinicalprocess.healthcond.certificate.v3.Patient) Test(org.junit.Test)

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