@Test public void testSetRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor_PartialSuccess() throws SAXException, IOException, Throwable { String expectedResponse = fileReader .readFile("errorSetRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor_PartialSuccess.xml"); RetrieveDocumentSetResponse response = new RetrieveDocumentSetResponse(); response.getDocumentResponse().add(new DocumentResponse()); response.getDocumentResponse().add(new DocumentResponse()); int numRemoved = 2; String patientIdMock = "patientIdMock"; String authorNPIMock = "authorNPIMock"; RetrieveDocumentSetResponse actualResponse = sut .setRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor( response, numRemoved, patientIdMock, authorNPIMock); assertResponse(expectedResponse, actualResponse); }
public RetrieveDocumentSetResponse setRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor( RetrieveDocumentSetResponse response, int numRemoved, String patientId, String authorNPI) { StringBuilder builder = new StringBuilder(); builder.append(numRemoved); builder.append(" document(s) is/are not authored by "); builder.append(authorNPI); builder.append(" or does/do not belong to the patient "); builder.append(patientId); builder.append(" and removed from the response."); String codeContext = builder.toString(); String errorCode = "XDSRepositoryError"; boolean isPartial = response.getDocumentResponse().size() > 0; setErrorRegistryResponse(codeContext, errorCode, isPartial, response); return response; }
XdsbErrorFactory { public RetrieveDocumentSetResponse setRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor( RetrieveDocumentSetResponse response, int numRemoved, String patientId, String authorNPI) { StringBuilder builder = new StringBuilder(); builder.append(numRemoved); builder.append(" document(s) is/are not authored by "); builder.append(authorNPI); builder.append(" or does/do not belong to the patient "); builder.append(patientId); builder.append(" and removed from the response."); String codeContext = builder.toString(); String errorCode = "XDSRepositoryError"; boolean isPartial = response.getDocumentResponse().size() > 0; setErrorRegistryResponse(codeContext, errorCode, isPartial, response); return response; } }
XdsbErrorFactory { public RetrieveDocumentSetResponse setRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor( RetrieveDocumentSetResponse response, int numRemoved, String patientId, String authorNPI) { StringBuilder builder = new StringBuilder(); builder.append(numRemoved); builder.append(" document(s) is/are not authored by "); builder.append(authorNPI); builder.append(" or does/do not belong to the patient "); builder.append(patientId); builder.append(" and removed from the response."); String codeContext = builder.toString(); String errorCode = "XDSRepositoryError"; boolean isPartial = response.getDocumentResponse().size() > 0; setErrorRegistryResponse(codeContext, errorCode, isPartial, response); return response; } XdsbErrorFactory();  XdsbErrorFactory(RegistryErrorListSetter registryErrorListSetter); }
XdsbErrorFactory { public RetrieveDocumentSetResponse setRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor( RetrieveDocumentSetResponse response, int numRemoved, String patientId, String authorNPI) { StringBuilder builder = new StringBuilder(); builder.append(numRemoved); builder.append(" document(s) is/are not authored by "); builder.append(authorNPI); builder.append(" or does/do not belong to the patient "); builder.append(patientId); builder.append(" and removed from the response."); String codeContext = builder.toString(); String errorCode = "XDSRepositoryError"; boolean isPartial = response.getDocumentResponse().size() > 0; setErrorRegistryResponse(codeContext, errorCode, isPartial, response); return response; } XdsbErrorFactory();  XdsbErrorFactory(RegistryErrorListSetter registryErrorListSetter); RetrieveDocumentSetResponse setRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor(
			RetrieveDocumentSetResponse response, int numRemoved,
			String patientId, String authorNPI); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseMultipleRepositoryId(); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseConstructByErrorMessage(
			String errorMessage); RetrieveDocumentSetResponse errorRetrieveDocumentSetInternalServerError(); RetrieveDocumentSetResponse noClinicalDocumentFound(
			String patientId, String authorNPI); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseSchemaValidation(
			RetrieveDocumentSetResponse response, Map<String, String> errorMap); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseNotExistsOrAccessible(
			RetrieveDocumentSetRequest input); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseRepositoryNotAvailable(); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseInternalPEPError(); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseAccessDeniedByPDP(); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseNoConsentsFound(
			String patientUniqueId); AdhocQueryResponse errorAdhocQueryResponseConstructByErrorMessage(
			String errorMessage); AdhocQueryResponse errorAdhocQueryResponseRegistryNotAvailable(); AdhocQueryResponse errorAdhocQueryResponseAccessDeniedByPDP(); AdhocQueryResponse errorAdhocQueryResponseInternalServerError(); AdhocQueryResponse errorAdhocQueryResponseNoDocumentsFound(
			String patientUniqueId, String intermediarySubjectNPI); AdhocQueryResponse errorAdhocQueryResponseMissingParameters(); }
XdsbErrorFactory { public RetrieveDocumentSetResponse setRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor( RetrieveDocumentSetResponse response, int numRemoved, String patientId, String authorNPI) { StringBuilder builder = new StringBuilder(); builder.append(numRemoved); builder.append(" document(s) is/are not authored by "); builder.append(authorNPI); builder.append(" or does/do not belong to the patient "); builder.append(patientId); builder.append(" and removed from the response."); String codeContext = builder.toString(); String errorCode = "XDSRepositoryError"; boolean isPartial = response.getDocumentResponse().size() > 0; setErrorRegistryResponse(codeContext, errorCode, isPartial, response); return response; } XdsbErrorFactory();  XdsbErrorFactory(RegistryErrorListSetter registryErrorListSetter); RetrieveDocumentSetResponse setRetrieveDocumentSetResponseRegistryErrorListFilteredByPatientAndAuthor(
			RetrieveDocumentSetResponse response, int numRemoved,
			String patientId, String authorNPI); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseMultipleRepositoryId(); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseConstructByErrorMessage(
			String errorMessage); RetrieveDocumentSetResponse errorRetrieveDocumentSetInternalServerError(); RetrieveDocumentSetResponse noClinicalDocumentFound(
			String patientId, String authorNPI); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseSchemaValidation(
			RetrieveDocumentSetResponse response, Map<String, String> errorMap); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseNotExistsOrAccessible(
			RetrieveDocumentSetRequest input); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseRepositoryNotAvailable(); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseInternalPEPError(); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseAccessDeniedByPDP(); RetrieveDocumentSetResponse errorRetrieveDocumentSetResponseNoConsentsFound(
			String patientUniqueId); AdhocQueryResponse errorAdhocQueryResponseConstructByErrorMessage(
			String errorMessage); AdhocQueryResponse errorAdhocQueryResponseRegistryNotAvailable(); AdhocQueryResponse errorAdhocQueryResponseAccessDeniedByPDP(); AdhocQueryResponse errorAdhocQueryResponseInternalServerError(); AdhocQueryResponse errorAdhocQueryResponseNoDocumentsFound(
			String patientUniqueId, String intermediarySubjectNPI); AdhocQueryResponse errorAdhocQueryResponseMissingParameters();  }