use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType 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;
}
use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType in project webcert by sklintyg.
the class IntygRelationHelperImplTest method testGetRelationsForIntygNothingInIT.
@Test
public void testGetRelationsForIntygNothingInIT() {
when(listRelationsForCertificateResponderInterface.listRelationsForCertificate(isNull(), any(ListRelationsForCertificateType.class))).thenReturn(new ListRelationsForCertificateResponseType());
Relations relationsForIntyg = testee.getRelationsForIntyg(INTYG_ID);
assertNotNull(relationsForIntyg);
}
use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType in project webcert by sklintyg.
the class IntygRelationHelperImplTest method testGetRelationsForIntygNothingInITWithMergeFromWebcert.
@Test
public void testGetRelationsForIntygNothingInITWithMergeFromWebcert() {
when(listRelationsForCertificateResponderInterface.listRelationsForCertificate(isNull(), any(ListRelationsForCertificateType.class))).thenReturn(new ListRelationsForCertificateResponseType());
Relations webcertRelations = new Relations();
Relations.FrontendRelations fr = webcertRelations.getLatestChildRelations();
fr.setReplacedByIntyg(new WebcertCertificateRelation(OTHER_INTYG_ID_2, RelationKod.ERSATT, LocalDateTime.now().minusDays(1), UtkastStatus.SIGNED));
fr.setReplacedByUtkast(new WebcertCertificateRelation(OTHER_INTYG_ID_2, RelationKod.ERSATT, LocalDateTime.now().minusDays(1), UtkastStatus.DRAFT_COMPLETE));
fr.setComplementedByIntyg(new WebcertCertificateRelation(OTHER_INTYG_ID_2, RelationKod.KOMPLT, LocalDateTime.now().minusDays(2), UtkastStatus.SIGNED));
fr.setComplementedByUtkast(new WebcertCertificateRelation(OTHER_INTYG_ID_2, RelationKod.KOMPLT, LocalDateTime.now().minusDays(2), UtkastStatus.DRAFT_INCOMPLETE));
webcertRelations.setParent(new WebcertCertificateRelation(PARENT_INTYG_1, RelationKod.KOMPLT, LocalDateTime.now().minusDays(3), UtkastStatus.SIGNED));
when(certificateRelationService.getRelations(INTYG_ID)).thenReturn(webcertRelations);
Relations relationsForIntyg = testee.getRelationsForIntyg(INTYG_ID);
assertNotNull(relationsForIntyg);
assertFrontendRelations(relationsForIntyg.getLatestChildRelations(), webcertRelations.getLatestChildRelations().getComplementedByIntyg(), webcertRelations.getLatestChildRelations().getComplementedByUtkast(), webcertRelations.getLatestChildRelations().getReplacedByIntyg(), webcertRelations.getLatestChildRelations().getReplacedByUtkast());
}
use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType 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;
}
use of se.inera.intyg.clinicalprocess.healthcond.certificate.listrelationsforcertificate.v1.ListRelationsForCertificateResponseType in project webcert by sklintyg.
the class IntygRelationHelperImpl method getRelationsFromIntygstjanst.
private ListRelationsForCertificateResponseType getRelationsFromIntygstjanst(List<String> intygIds) {
if (intygIds == null || intygIds.size() == 0) {
return new ListRelationsForCertificateResponseType();
}
ListRelationsForCertificateType request = new ListRelationsForCertificateType();
request.getIntygsId().addAll(intygIds);
return listRelationsForCertificateResponderInterface.listRelationsForCertificate(logicalAddress, request);
}
Aggregations