View Javadoc
1   /*
2    * Copyright 2010 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.pixpdq.ItiPixPdqProfile;
20  import org.openehealth.ipf.gazelle.validation.profile.pixpdq.PixPdqTransactions;
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 Dmytro Rud
28   */
29  abstract public class PixPdqCamelValidators {
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-8 request messages
46       * (Patient Identity Feed).
47       */
48      public static Processor iti8RequestValidator() {
49          return ConformanceProfileValidators.validatingProcessor(PixPdqTransactions.ITI8);
50      }
51  
52      /**
53       * Returns a validating processor for ITI-8 response messages
54       * (Patient Identity Feed).
55       */
56      public static Processor iti8ResponseValidator() {
57          return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_8_ACK);
58      }
59  
60      /**
61       * Returns a validating processor for ITI-9 request messages.
62       * (Patient Identity Query).
63       */
64      public static Processor iti9RequestValidator() {
65          return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_9_QBP_Q23);
66      }
67  
68      /**
69       * Returns a validating processor for ITI-9 response messages
70       * (Patient Identity Query).
71       */
72      public static Processor iti9ResponseValidator() {
73          return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_9_RSP_K23);
74      }
75  
76      /**
77       * Returns a validating processor for ITI-10 request messages
78       * (PIX Update Notification).
79       */
80      public static Processor iti10RequestValidator() {
81          return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_10_ADT_A31);
82      }
83  
84      /**
85       * Returns a validating processor for ITI-10 response messages
86       * (PIX Update Notification).
87       * FIXME I think this is the wrong profile
88       */
89      public static Processor iti10ResponseValidator() {
90          return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_10_ACK);
91      }
92  
93      /**
94       * Returns a validating processor for ITI-21 request messages
95       * (Patient Demographics Query).
96       */
97      public static Processor iti21RequestValidator() {
98          return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_21_QBP_Q22);
99      }
100 
101     /**
102      * Returns a validating processor for ITI-21 response messages
103      * (Patient Demographics Query).
104      */
105     public static Processor iti21ResponseValidator() {
106         return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_21_RSP_K22);
107     }
108 
109     /**
110      * Returns a validating processor for ITI-22 request messages
111      * (Patient Demographics and Visit Query).
112      */
113     public static Processor iti22RequestValidator() {
114         return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_22_QBP_ZV1);
115     }
116 
117     /**
118      * Returns a validating processor for ITI-22 response messages
119      * (Patient Demographics and Visit Query).
120      */
121     public static Processor iti22ResponseValidator() {
122         return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_22_RSP_ZV2);
123     }
124 
125     /**
126      * Returns a validating processor for ITI-64 request messages
127      * (XAD-PID Change Management).
128      */
129     public static Processor iti64RequestValidator() {
130         return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_64_ADT_A43);
131     }
132 
133     /**
134      * Returns a validating processor for ITI-64 response messages
135      * (XAD-PID Change Management).
136      */
137     public static Processor iti64ResponseValidator() {
138         return ConformanceProfileValidators.validatingProcessor(ItiPixPdqProfile.ITI_64_ACK_A43);
139     }
140 
141 }