View Javadoc
1   /*
2    * Copyright 2016 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.commons.ihe.xds;
17  
18  import lombok.AllArgsConstructor;
19  import lombok.Getter;
20  import org.openehealth.ipf.commons.ihe.core.InteractionId;
21  import org.openehealth.ipf.commons.ihe.ws.WsTransactionConfiguration;
22  import org.openehealth.ipf.commons.ihe.xds.core.audit.XdsAuditDataset;
23  import org.openehealth.ipf.commons.ihe.xds.core.audit.XdsNonconstructiveDocumentSetRequestAuditDataset;
24  import org.openehealth.ipf.commons.ihe.xds.rad69.Rad69ClientAuditStrategy;
25  import org.openehealth.ipf.commons.ihe.xds.rad69.Rad69PortType;
26  import org.openehealth.ipf.commons.ihe.xds.rad69.Rad69ServerAuditStrategy;
27  import org.openehealth.ipf.commons.ihe.xds.rad75.Rad75ClientAuditStrategy;
28  import org.openehealth.ipf.commons.ihe.xds.rad75.Rad75PortType;
29  import org.openehealth.ipf.commons.ihe.xds.rad75.Rad75ServerAuditStrategy;
30  import org.openehealth.ipf.commons.ihe.xds.rad75.asyncresponse.Rad75AsyncResponsePortType;
31  
32  import javax.xml.namespace.QName;
33  import java.util.Arrays;
34  import java.util.List;
35  
36  /**
37   * @author Christian Ohr
38   * @since 3.2
39   */
40  public class RAD implements XdsIntegrationProfile {
41  
42      private static final RAD Instance = new RAD();
43  
44      @AllArgsConstructor
45      public enum Interactions implements XdsInteractionId {
46          RAD_69(RAD_69_WS_CONFIG),
47          RAD_75(RAD_75_WS_CONFIG),
48          RAD_75_ASYNC_RESPONSE(RAD_75_ASYNC_RESPONSE_WS_CONFIG);
49  
50          @Getter private WsTransactionConfiguration<? extends XdsAuditDataset> wsTransactionConfiguration;
51  
52          @Override
53          public XdsIntegrationProfile getInteractionProfile() {
54              return Instance;
55          }
56      }
57  
58      @Override
59      public boolean isEbXml30Based() {
60          return true;
61      }
62  
63      @Override
64      public boolean requiresHomeCommunityId() {
65          return false;
66      }
67  
68      @Override
69      public List<InteractionId> getInteractionIds() {
70          return Arrays.asList(Interactions.values());
71      }
72  
73      private final static WsTransactionConfiguration<XdsNonconstructiveDocumentSetRequestAuditDataset> RAD_69_WS_CONFIG = new WsTransactionConfiguration<>(
74              "xdsi-rad69",
75              "Retrieve Imaging Document Set",
76              false,
77              new Rad69ClientAuditStrategy(),
78              new Rad69ServerAuditStrategy(),
79              new QName("urn:ihe:rad:xdsi-b:2009", "DocumentRepository_Service", "iherad"),
80              Rad69PortType.class,
81              new QName("urn:ihe:rad:xdsi-b:2009", "DocumentRepository_Binding_Soap12", "iherad"),
82              true,
83              "wsdl/rad69.wsdl",
84              true,
85              false,
86              false,
87              false);
88  
89      private final static WsTransactionConfiguration<XdsNonconstructiveDocumentSetRequestAuditDataset> RAD_75_WS_CONFIG = new WsTransactionConfiguration<>(
90              "xcai-rad75",
91              "Cross Gateway Retrieve Imaging Document Set",
92              false,
93              new Rad75ClientAuditStrategy(),
94              new Rad75ServerAuditStrategy(),
95              new QName("urn:ihe:rad:xdsi-b:2009", "RespondingGateway_Service", "iherad"),
96              Rad75PortType.class,
97              new QName("urn:ihe:rad:xdsi-b:2009", "RespondingGateway_Binding_Soap12", "iherad"),
98              true,
99              "wsdl/rad75.wsdl",
100             true,
101             false,
102             false,
103             true);
104 
105     private final static WsTransactionConfiguration<XdsNonconstructiveDocumentSetRequestAuditDataset> RAD_75_ASYNC_RESPONSE_WS_CONFIG = new WsTransactionConfiguration<>(
106             "xcai-rad75-async-response",
107             "Cross Gateway Retrieve Imaging Document Set",
108             false,
109             null,
110             new Rad75ClientAuditStrategy(),      // really!
111             new QName("urn:ihe:rad:xdsi-b:2009", "InitiatingGateway_Service", "iherad"),
112             Rad75AsyncResponsePortType.class,
113             new QName("urn:ihe:rad:xdsi-b:2009", "InitiatingGateway_Binding", "iherad"),
114             false,
115             "wsdl/rad75-asyncresponse.wsdl",
116             true,
117             false,
118             false,
119             false);
120 }