test_class.declarator: validator
test_class.modifier: private
test_class.original_string: private AdhocQueryRequestValidator validator;
test_class.type: AdhocQueryRequestValidator
test_class.var_name: validator
test_class.declarator: request
test_class.modifier: private
test_class.original_string: private QueryRegistry request, requestMpq, folderRequest, folderRequestMpq;
test_class.type: QueryRegistry
test_class.var_name: request
test_class.declarator: transformer
test_class.modifier: private
test_class.original_string: private QueryRegistryTransformer transformer;
test_class.type: QueryRegistryTransformer
test_class.var_name: transformer
test_class.declarator: iti16Profile
test_class.modifier: private
test_class.original_string: private ValidationProfile iti16Profile, iti18Profile, iti51Profile;
test_class.type: ValidationProfile
test_class.var_name: iti16Profile
test_class.file: commons/ihe/xds/src/test/java/org/openehealth/ipf/commons/ihe/xds/core/validate/requests/AdhocQueryRequestValidatorTest.java
test_class.identifier: AdhocQueryRequestValidatorTest
test_case.body: @Test
      public void testMissingPatientIdsMPQ() {
          ((FindDocumentsForMultiplePatientsQuery) requestMpq.getQuery()).setPatientIds(null);
          validator.validate(transformer.toEbXML(requestMpq), iti51Profile);
      }
test_case.class_method_signature: AdhocQueryRequestValidatorTest.testMissingPatientIdsMPQ()
test_case.full_signature: @Test public void testMissingPatientIdsMPQ()
test_case.identifier: testMissingPatientIdsMPQ
test_case.invocations: setPatientIds getQuery validate toEbXML
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMissingPatientIdsMPQ()
focal_class.declarator: cxValidator = new CXValidator()
focal_class.modifier: private static final
focal_class.original_string: private static final CXValidator cxValidator = new CXValidator();
focal_class.type: CXValidator
focal_class.var_name: cxValidator
focal_class.declarator: timeValidator = new TimeValidator()
focal_class.modifier: private static final
focal_class.original_string: private static final TimeValidator timeValidator = new TimeValidator();
focal_class.type: TimeValidator
focal_class.var_name: timeValidator
focal_class.declarator: nopValidator = new NopValidator()
focal_class.modifier: private static final
focal_class.original_string: private static final NopValidator nopValidator = new NopValidator();
focal_class.type: NopValidator
focal_class.var_name: nopValidator
focal_class.declarator: ALLOWED_MULTIPLE_SLOTS
focal_class.modifier: private static final
focal_class.original_string: private static final Map<QueryType, Set<String>> ALLOWED_MULTIPLE_SLOTS;
focal_class.type: Map<QueryType, Set<String>>
focal_class.var_name: ALLOWED_MULTIPLE_SLOTS
focal_class.declarator: ALLOWED_QUERY_TYPES
focal_class.modifier: private static final
focal_class.original_string: private static final Map<List<InteractionId>, List<QueryType>> ALLOWED_QUERY_TYPES;
focal_class.type: Map<List<InteractionId>, List<QueryType>>
focal_class.var_name: ALLOWED_QUERY_TYPES
focal_class.file: commons/ihe/xds/src/main/java/org/openehealth/ipf/commons/ihe/xds/core/validate/requests/AdhocQueryRequestValidator.java
focal_class.identifier: AdhocQueryRequestValidator
focal_class.interfaces: implements Validator<EbXMLAdhocQueryRequest, ValidationProfile>
focal_class.class_method_signature: AdhocQueryRequestValidator.addAllowedMultipleSlots(QueryType queryType, QueryParameter... parameters)
focal_class.full_signature: private static void addAllowedMultipleSlots(QueryType queryType, QueryParameter... parameters)
focal_class.identifier: addAllowedMultipleSlots
focal_class.modifiers: private static
focal_class.parameters: (QueryType queryType, QueryParameter... parameters)
focal_class.return: void
focal_class.signature: void addAllowedMultipleSlots(QueryType queryType, QueryParameter... parameters)
focal_class.class_method_signature: AdhocQueryRequestValidator.getValidators(QueryType queryType, ValidationProfile profile)
focal_class.full_signature: private QueryParameterValidation[] getValidators(QueryType queryType, ValidationProfile profile)
focal_class.identifier: getValidators
focal_class.modifiers: private
focal_class.parameters: (QueryType queryType, ValidationProfile profile)
focal_class.return: QueryParameterValidation[]
focal_class.signature: QueryParameterValidation[] getValidators(QueryType queryType, ValidationProfile profile)
focal_class.class_method_signature: AdhocQueryRequestValidator.validate(EbXMLAdhocQueryRequest request, ValidationProfile profile)
focal_class.full_signature: @Override public void validate(EbXMLAdhocQueryRequest request, ValidationProfile profile)
focal_class.identifier: validate
focal_class.modifiers: @Override public
focal_class.parameters: (EbXMLAdhocQueryRequest request, ValidationProfile profile)
focal_class.return: void
focal_class.signature: void validate(EbXMLAdhocQueryRequest request, ValidationProfile profile)
focal_method.body: @Override
      public void validate(EbXMLAdhocQueryRequest request, ValidationProfile profile) {
          notNull(request, "request cannot be null");
  
          if (profile.getInteractionId() == IpfInteractionId.ITI_63) {
              metaDataAssert(QueryReturnType.LEAF_CLASS_WITH_REPOSITORY_ITEM.getCode().equals(request.getReturnType()),
                      UNKNOWN_RETURN_TYPE, request.getReturnType());
          } else {
              metaDataAssert(QueryReturnType.LEAF_CLASS.getCode().equals(request.getReturnType())
                          || QueryReturnType.OBJECT_REF.getCode().equals(request.getReturnType()),
                  UNKNOWN_RETURN_TYPE, request.getReturnType());
          }
  
          QueryType queryType = QueryType.valueOfId(request.getId());
          metaDataAssert(queryType != null, UNKNOWN_QUERY_TYPE, request.getId());
  
          boolean found = false;
          for(Map.Entry<List<InteractionId>, List<QueryType>> entry : ALLOWED_QUERY_TYPES.entrySet()) {
              if (entry.getKey().contains(profile.getInteractionId())) {
                  metaDataAssert(entry.getValue().contains(queryType), UNSUPPORTED_QUERY_TYPE, queryType);
                  found = true;
                  break;
              }
          }
          metaDataAssert(found, UNKNOWN_QUERY_TYPE, queryType);
  
          if (queryType == QueryType.SQL) {
              metaDataAssert(request.getSql() != null, MISSING_SQL_QUERY_TEXT);
          } else {
              new SlotLengthAndNameUniquenessValidator().validateSlots(
                      request.getSlots(),
                      ALLOWED_MULTIPLE_SLOTS.get(queryType));
              for (QueryParameterValidation validation : getValidators(queryType, profile)) {
                  validation.validate(request);
              }
  
              if (queryType == FIND_DOCUMENTS_MPQ) {
                  metaDataAssert(
                          (! request.getSlotValues(DOC_ENTRY_CLASS_CODE.getSlotName()).isEmpty()) ||
                          (! request.getSlotValues(DOC_ENTRY_EVENT_CODE.getSlotName()).isEmpty()) ||
                          (! request.getSlotValues(DOC_ENTRY_HEALTHCARE_FACILITY_TYPE_CODE.getSlotName()).isEmpty()),
                          ValidationMessage.MISSING_REQUIRED_QUERY_PARAMETER,
                          "at least one of $XDSDocumentEntryClassCode, $XDSDocumentEntryEventCodeList, $XDSDocumentEntryHealthcareFacilityTypeCode");
              }
          }
      }
focal_method.class_method_signature: AdhocQueryRequestValidator.validate(EbXMLAdhocQueryRequest request, ValidationProfile profile)
focal_method.full_signature: @Override public void validate(EbXMLAdhocQueryRequest request, ValidationProfile profile)
focal_method.identifier: validate
focal_method.invocations: notNull getInteractionId metaDataAssert equals getCode getReturnType getReturnType metaDataAssert equals getCode getReturnType equals getCode getReturnType getReturnType valueOfId getId metaDataAssert getId entrySet contains getKey getInteractionId metaDataAssert contains getValue metaDataAssert metaDataAssert getSql validateSlots getSlots get getValidators validate metaDataAssert isEmpty getSlotValues getSlotName isEmpty getSlotValues getSlotName isEmpty getSlotValues getSlotName
focal_method.modifiers: @Override public
focal_method.parameters: (EbXMLAdhocQueryRequest request, ValidationProfile profile)
focal_method.return: void
focal_method.signature: void validate(EbXMLAdhocQueryRequest request, ValidationProfile profile)