Search in sources :

Example 1 with TypAvIntyg

use of se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg 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 2 with TypAvIntyg

use of se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg 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 3 with TypAvIntyg

use of se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg in project webcert by sklintyg.

the class NotificationPatientEnricherTest method buildIntyg.

private Intyg buildIntyg(String intygsTyp) {
    Intyg intyg = new Intyg();
    TypAvIntyg typAvIntyg = new TypAvIntyg();
    typAvIntyg.setCode(intygsTyp);
    intyg.setTyp(typAvIntyg);
    intyg.setPatient(NotificationTestHelper.buildPatient());
    return intyg;
}
Also used : TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg)

Example 4 with TypAvIntyg

use of se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg in project webcert by sklintyg.

the class NotificationTestHelper method createIntyg.

public static Intyg createIntyg(String intygsTyp) {
    Intyg intyg = new Intyg();
    IntygId intygId = new IntygId();
    intygId.setExtension("intyg123");
    intyg.setIntygsId(intygId);
    TypAvIntyg typAvIntyg = new TypAvIntyg();
    typAvIntyg.setCode(intygsTyp);
    intyg.setTyp(typAvIntyg);
    intyg.setPatient(buildPatient());
    HosPersonal hosPersonal = new HosPersonal();
    Enhet enhet = new Enhet();
    enhet.setVardgivare(new Vardgivare());
    enhet.setArbetsplatskod(new ArbetsplatsKod());
    hosPersonal.setEnhet(enhet);
    intyg.setSkapadAv(hosPersonal);
    // DatePeriodType and PartialDateType must be allowed
    intyg.getSvar().add(InternalConverterUtil.aSvar("").withDelsvar("", InternalConverterUtil.aDatePeriod(LocalDate.now(), LocalDate.now().plusDays(1))).withDelsvar("", InternalConverterUtil.aPartialDate(PartialDateTypeFormatEnum.YYYY, Year.of(1999))).build());
    return intyg;
}
Also used : HosPersonal(se.riv.clinicalprocess.healthcond.certificate.v3.HosPersonal) Enhet(se.riv.clinicalprocess.healthcond.certificate.v3.Enhet) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) ArbetsplatsKod(se.riv.clinicalprocess.healthcond.certificate.types.v3.ArbetsplatsKod) Intyg(se.riv.clinicalprocess.healthcond.certificate.v3.Intyg) TypAvIntyg(se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg) Vardgivare(se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare) IntygId(se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)

Example 5 with TypAvIntyg

use of se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg 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)

Aggregations

TypAvIntyg (se.riv.clinicalprocess.healthcond.certificate.types.v3.TypAvIntyg)5 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.v3.HsaId)3 PersonId (se.riv.clinicalprocess.healthcond.certificate.types.v3.PersonId)3 Patient (se.riv.clinicalprocess.healthcond.certificate.v3.Patient)3 Intyg (se.riv.clinicalprocess.healthcond.certificate.v3.Intyg)2 CreateDraftCertificateType (se.riv.clinicalprocess.healthcond.certificate.createdraftcertificateresponder.v3.CreateDraftCertificateType)1 ArbetsplatsKod (se.riv.clinicalprocess.healthcond.certificate.types.v3.ArbetsplatsKod)1 IntygId (se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)1 Enhet (se.riv.clinicalprocess.healthcond.certificate.v3.Enhet)1 HosPersonal (se.riv.clinicalprocess.healthcond.certificate.v3.HosPersonal)1 Vardgivare (se.riv.clinicalprocess.healthcond.certificate.v3.Vardgivare)1