View Javadoc
1   /*
2    * Copyright 2015 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.openehealth.ipf.platform.camel.ihe.mllp;
17  
18  import org.apache.camel.Processor;
19  import org.openehealth.ipf.gazelle.validation.profile.pam.ItiPamProfile;
20  import org.openehealth.ipf.gazelle.validation.profile.pam.PamTransactions;
21  import org.openehealth.ipf.platform.camel.hl7.HL7v2;
22  import org.openehealth.ipf.platform.camel.hl7.validation.ConformanceProfileValidators;
23  
24  /**
25   * Validating processors for MLLP-based IPF IHE components.
26   *
27   * @author Christian Ohr
28   */
29  abstract public class PamCamelValidators {
30  
31  
32      /**
33       * Returns a validating processor that obtains the validation rules from the currently
34       * used {@link ca.uhn.hl7v2.HapiContext HapiContext} and the type of the message contained
35       * in the exchange body. As such there is no real need to use the explicitly transaction-dependent
36       * validators.
37       *
38       * @return all-purpose validating processor
39       */
40      public static Processor itiValidator() {
41          return HL7v2.validatingProcessor();
42      }
43  
44      /**
45       * Returns a validating processor for ITI-30 request messages
46       * (Patient Identity Management).
47       */
48      public static Processor iti30RequestValidator() {
49          return ConformanceProfileValidators.validatingProcessor(PamTransactions.ITI30);
50      }
51  
52      /**
53       * Returns a validating processor for ITI-30 response messages
54       * (Patient Identity Management).
55       */
56      public static Processor iti30ResponseValidator() {
57          return ConformanceProfileValidators.validatingProcessor(ItiPamProfile.ITI_30_ACK);
58      }
59  
60      /**
61       * Returns a validating processor for ITI-31 request messages
62       * (Patient Encounter Management).
63       */
64      public static Processor iti31RequestValidator() {
65          return ConformanceProfileValidators.validatingProcessor(PamTransactions.ITI31);
66      }
67  
68      /**
69       * Returns a validating processor for ITI-31 response messages
70       * (Patient Encounter Management).
71       */
72      public static Processor iti31ResponseValidator() {
73          return ConformanceProfileValidators.validatingProcessor(ItiPamProfile.ITI_31_ACK);
74      }
75  
76  }