View Javadoc
1   /*
2    * Copyright 2011 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.core.mbean;
17  
18  import ca.uhn.hl7v2.DefaultHapiContext;
19  import ca.uhn.hl7v2.ErrorCode;
20  import ca.uhn.hl7v2.Version;
21  import org.openehealth.ipf.commons.ihe.hl7v2.Hl7v2TransactionConfiguration;
22  import org.openehealth.ipf.commons.ihe.hl7v2.NakFactory;
23  import org.openehealth.ipf.commons.ihe.hl7v2.audit.MllpAuditDataset;
24  import org.openehealth.ipf.platform.camel.ihe.mllp.core.MllpTransactionComponent;
25  
26  /**
27   * Test MLLP Component implementation
28   */
29  public class SomeMllpItiComponent extends MllpTransactionComponent<MllpAuditDataset> {
30      
31      private static final Hl7v2TransactionConfiguration<MllpAuditDataset> CONFIGURATION =
32          new Hl7v2TransactionConfiguration<>(
33                  "foo",
34                  "Some MLLP Component",
35                  false,
36                  null,
37                  null,
38                  new Version[] {Version.V25},
39                  "Some MLLP adapter",
40                  "IPF-Test",
41                  ErrorCode.APPLICATION_INTERNAL_ERROR,
42                  ErrorCode.APPLICATION_INTERNAL_ERROR,
43                  new String[] { "ADT" },
44                  new String[] { "A01 A04" },
45                  new String[] { "ACK" },
46                  new String[] { "*" },
47                  new boolean[] { true },
48                  new boolean[] { false },
49                  new DefaultHapiContext());
50  
51      public SomeMllpItiComponent() {
52          super(null);
53      }
54  
55      private static final NakFactory<MllpAuditDataset> NAK_FACTORY = new NakFactory<>(CONFIGURATION);
56  
57      @Override
58      public NakFactory<MllpAuditDataset> getNakFactory() {
59          return NAK_FACTORY;
60      }
61      
62      @Override
63      public Hl7v2TransactionConfiguration<MllpAuditDataset> getHl7v2TransactionConfiguration() {
64          return CONFIGURATION;
65      }
66      
67  }