Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 the original author or authors.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *     
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.openehealth.ipf.platform.camel.ihe.hl7v3;
 
 
 import static org.openehealth.ipf.commons.ihe.core.IpfInteractionId.*;
 import static org.openehealth.ipf.platform.camel.core.adapter.ValidatorAdapter.validationEnabled;

Validating processors for HL7v3-based IPF components.

Author(s):
Dmytro Rud
 
 abstract public class PixPdqV3CamelValidators {
     private static final CombinedXmlValidator VALIDATOR = new CombinedXmlValidator();
 
     private static final Processor ITI_44_REQUEST_VALIDATOR  = validatingProcessor(true);
     private static final Processor ITI_44_RESPONSE_VALIDATOR = validatingProcessor(false);
     private static final Processor ITI_45_REQUEST_VALIDATOR  = validatingProcessor(true);
     private static final Processor ITI_45_RESPONSE_VALIDATOR = validatingProcessor(false);
     private static final Processor ITI_46_REQUEST_VALIDATOR  = validatingProcessor(true);
     private static final Processor ITI_46_RESPONSE_VALIDATOR = validatingProcessor(false);
     private static final Processor ITI_47_REQUEST_VALIDATOR  = validatingProcessor(true);
     private static final Processor ITI_47_RESPONSE_VALIDATOR = validatingProcessor(false);
 
     private static final Processor ITI_55_REQUEST_VALIDATOR  = validatingProcessor(true);
     private static final Processor ITI_55_RESPONSE_VALIDATOR = validatingProcessor(false);
     private static final Processor ITI_56_REQUEST_VALIDATOR  = validatingProcessor(true);
     private static final Processor ITI_56_RESPONSE_VALIDATOR = validatingProcessor(false);
 
     private static final Processor PCC_1_REQUEST_VALIDATOR   = validatingProcessor(true);
     private static final Processor PCC_1_RESPONSE_VALIDATOR  = validatingProcessor(false);

    
    
Returns a validating processor for ITI-44 request messages (Patient Identity Feed v3).
 
     public static Processor iti44RequestValidator() {
         return ;
     }
    
    
Returns a validating processor for ITI-44 response messages (Patient Identity Feed v3).
 
     public static Processor iti44ResponseValidator() {
         return ;
     }

    
Returns a validating processor for ITI-45 request messages (Patient Identity Query v3).
 
     public static Processor iti45RequestValidator() {
         return ;
     }
    
    
Returns a validating processor for ITI-45 response messages (Patient Identity Query v3).
 
     public static Processor iti45ResponseValidator() {
         return ;
     }

    
Returns a validating processor for ITI-46 request messages (Patient Identity Update Notification v3).
 
     public static Processor iti46RequestValidator() {
         return ;
     }
    
    
Returns a validating processor for ITI-46 response messages (Patient Identity Update Notification v3).
 
     public static Processor iti46ResponseValidator() {
         return ;
     }

    
Returns a validating processor for ITI-47 request messages (Patient Demographics Query v3).
    public static Processor iti47RequestValidator() {
        return ;
    }
    
    
Returns a validating processor for ITI-47 response messages (Patient Demographics Query v3).
    public static Processor iti47ResponseValidator() {
        return ;
    }
    
    
Returns a validating processor for ITI-55 request messages (Cross-Gateway Patient Discovery).
    public static Processor iti55RequestValidator() {
        return ;
    }

    
Returns a validating processor for ITI-55 response messages (Cross-Gateway Patient Discovery).
    public static Processor iti55ResponseValidator() {
        return ;
    }

    
Returns a validating processor for ITI-56 request messages (Patient Location Query).
    public static Processor iti56RequestValidator() {
        return ;
    }

    
Returns a validating processor for ITI-56 response messages (Patient Location Query).
    public static Processor iti56ResponseValidator() {
        return ;
    }

    
Returns a validating processor for PCC-1 request messages (Query for Existing Data).
    public static Processor pcc1RequestValidator() {
        return ;
    }

    
Returns a validating processor for PCC-1 response messages (Query for Existing Data).
    public static Processor pcc1ResponseValidator() {
        return ;
    }
    private static Processor validatingProcessor(
            final InteractionId interactionId,
            final boolean request)
    {
        return new Processor() {
            @Override
            public void process(Exchange exchangethrows Exception {
                doValidation(exchangeinteractionIdrequest);
            }
        };
    }
    private static void doValidation(
            Exchange exchange,
            InteractionId interactionId,
            boolean request)
    {
        if (! validationEnabled(exchange)) {
            return;
        }
        String message = exchange.getIn().getBody(String.class);
        .validate(messagerequest
                ? Hl7v3ValidationProfiles.getRequestValidationProfile(interactionId)
                : Hl7v3ValidationProfiles.getResponseValidationProfile(interactionId));
    }
New to GrepCode? Check out our FAQ X