Search in sources :

Example 1 with IntygRelations

use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.IntygRelations in project webcert by sklintyg.

the class IntygRelationHelperImplTest method buildResponseWithParent.

private ListRelationsForCertificateResponseType buildResponseWithParent() {
    ListRelationsForCertificateResponseType resp = new ListRelationsForCertificateResponseType();
    IntygRelations intygRelations = new IntygRelations();
    intygRelations.getRelation().add(buildRelation(INTYG_ID, PARENT_INTYG_1));
    resp.getIntygRelation().add(intygRelations);
    return resp;
}
Also used : ListRelationsForCertificateResponseType(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType) IntygRelations(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.IntygRelations)

Example 2 with IntygRelations

use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.IntygRelations in project webcert by sklintyg.

the class IntygRelationHelperImplTest method buildResponse.

private ListRelationsForCertificateResponseType buildResponse() {
    ListRelationsForCertificateResponseType resp = new ListRelationsForCertificateResponseType();
    IntygRelations intygRelations = new IntygRelations();
    IntygId intygId = new IntygId();
    intygId.setExtension(INTYG_ID);
    intygRelations.setIntygsId(intygId);
    intygRelations.getRelation().add(buildRelation(OTHER_INTYG_ID, INTYG_ID));
    resp.getIntygRelation().add(intygRelations);
    return resp;
}
Also used : ListRelationsForCertificateResponseType(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType) IntygRelations(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.IntygRelations) IntygId(se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)

Example 3 with IntygRelations

use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.IntygRelations in project webcert by sklintyg.

the class IntygRelationHelperImpl method decorateIntygListWithRelations.

@Override
public void decorateIntygListWithRelations(List<ListIntygEntry> fullIntygItemList) {
    ListRelationsForCertificateResponseType response = getRelationsFromIntygstjanst(fullIntygItemList.stream().map(ListIntygEntry::getIntygId).collect(Collectors.toList()));
    if (response != null) {
        // Very ugly, iterate over both lists, find matches and create relation(s) on the ListIntygEntries.
        for (IntygRelations ir : response.getIntygRelation()) {
            for (ListIntygEntry lie : fullIntygItemList) {
                if (lie.getIntygId().equals(ir.getIntygsId().getExtension())) {
                    // Create a Relations instance to hold relations.
                    lie.setRelations(new Relations());
                    // Iterate over all relations for this particular intyg
                    for (Relation r : ir.getRelation()) {
                        applyRelation(lie.getIntygId(), lie.getRelations(), r);
                    }
                }
            }
        }
    }
    // account.
    for (ListIntygEntry lie : fullIntygItemList) {
        Relations relations = certificateRelationService.getRelations(lie.getIntygId());
        mergeRelations(lie.getRelations(), relations);
    }
}
Also used : ListRelationsForCertificateResponseType(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType) WebcertCertificateRelation(se.inera.intyg.webcert.common.model.WebcertCertificateRelation) Relation(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation) IntygRelations(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.IntygRelations) ListIntygEntry(se.inera.intyg.webcert.web.web.controller.api.dto.ListIntygEntry) Relations(se.inera.intyg.webcert.web.web.controller.api.dto.Relations) IntygRelations(se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.IntygRelations)

Aggregations

IntygRelations (se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.IntygRelations)3 ListRelationsForCertificateResponseType (se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType)3 Relation (se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.Relation)1 WebcertCertificateRelation (se.inera.intyg.webcert.common.model.WebcertCertificateRelation)1 ListIntygEntry (se.inera.intyg.webcert.web.web.controller.api.dto.ListIntygEntry)1 Relations (se.inera.intyg.webcert.web.web.controller.api.dto.Relations)1 IntygId (se.riv.clinicalprocess.healthcond.certificate.types.v3.IntygId)1