VerifyMode implements ResponseMode { protected boolean compareId(List<PRPAMT201306UV02LivingSubjectId> localIds, List<PRPAMT201306UV02LivingSubjectId> remoteIds) { boolean result = false; try { for (PRPAMT201306UV02LivingSubjectId localId : localIds) { for (PRPAMT201306UV02LivingSubjectId remoteId : remoteIds) { if (compareId(localId, remoteId)) { result = true; break; } } } } catch (Exception ex) { LOG.error(ex.getMessage(), ex); } return result; } VerifyMode(); @Override PRPAIN201306UV02 processResponse(ResponseParams params); @Override PRPAIN201306UV02 processResponse(PRPAIN201306UV02 response, AssertionType assertion, II localPatientId); PRPAIN201306UV02 processResponse(PRPAIN201305UV02 requestMsg, PRPAIN201306UV02 response,
        AssertionType assertion, NhinTargetSystemType target);  }
@Test public void testCompareId() { PRPAMT201306UV02LivingSubjectId localSubjectId = new PRPAMT201306UV02LivingSubjectId(); II localId = new II(); localId.setExtension("extension"); localId.setRoot("root"); localSubjectId.getValue().add(localId); PRPAMT201306UV02LivingSubjectId remoteSubjectId = new PRPAMT201306UV02LivingSubjectId(); II remoteId = new II(); remoteId.setExtension("extension"); remoteId.setRoot("root"); remoteSubjectId.getValue().add(remoteId); VerifyMode verifyMode = new VerifyMode(); boolean result = verifyMode.compareId(localSubjectId, remoteSubjectId); assertTrue(result); }
@Test public void testCompareId_List() { List<PRPAMT201306UV02LivingSubjectId> localSubjectIds = new ArrayList<>(); PRPAMT201306UV02LivingSubjectId localSubjectId = new PRPAMT201306UV02LivingSubjectId(); II localId = new II(); localId.setExtension("extension"); localId.setRoot("root"); localSubjectId.getValue().add(localId); localSubjectIds.add(localSubjectId); List<PRPAMT201306UV02LivingSubjectId> remoteSubjectIds = new ArrayList<>(); PRPAMT201306UV02LivingSubjectId remoteSubjectId = new PRPAMT201306UV02LivingSubjectId(); II remoteId = new II(); remoteId.setExtension("extension"); remoteId.setRoot("root"); remoteSubjectId.getValue().add(remoteId); remoteSubjectIds.add(remoteSubjectId); VerifyMode verifyMode = new VerifyMode(); boolean result = verifyMode.compareId(localSubjectIds, remoteSubjectIds); assertTrue(result); }