View Javadoc
1   /*
2    * Copyright 2017 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.XdsSubmitAuditDataset;
24  import org.openehealth.ipf.commons.ihe.xds.iti80.Iti80ClientAuditStrategy;
25  import org.openehealth.ipf.commons.ihe.xds.iti80.Iti80PortType;
26  import org.openehealth.ipf.commons.ihe.xds.iti80.Iti80ServerAuditStrategy;
27  
28  import javax.xml.namespace.QName;
29  
30  import java.util.Arrays;
31  import java.util.List;
32  
33  /**
34   * @author Remco Overdevest
35   * @since 3.3
36   */
37  public class XCDR implements XdsIntegrationProfile {
38  
39  	private static final XCDR Instance = new XCDR();
40  
41  	@AllArgsConstructor
42  	public enum Interactions implements XdsInteractionId {
43  		ITI_80(ITI_80_WS_CONFIG);
44  
45  		@Getter
46  		private WsTransactionConfiguration<? extends XdsAuditDataset> wsTransactionConfiguration;
47  
48  		@Override
49  		public XdsIntegrationProfile getInteractionProfile() {
50  			return Instance;
51  		}
52  	}
53  
54  	@Override
55  	public boolean isEbXml30Based() {
56  		return true;
57  	}
58  
59  	@Override
60  	public boolean requiresHomeCommunityId() {
61  		return true;
62  	}
63  
64  	@Override
65  	public List<InteractionId> getInteractionIds() {
66  		return Arrays.asList(Interactions.values());
67  	}
68  
69  	private final static WsTransactionConfiguration<XdsSubmitAuditDataset> ITI_80_WS_CONFIG = new WsTransactionConfiguration<>(
70  		"xcdr-iti80",
71  		"Cross Gateway Provide Document",
72  		false,
73  		new Iti80ClientAuditStrategy(),
74  		new Iti80ServerAuditStrategy(),
75  		new QName("urn:ihe:iti:xds-b:2007", "RespondingGateway_Service", "ihe"),
76  		Iti80PortType.class,
77  		new QName("urn:ihe:iti:xds-b:2007", "RespondingGateway_Binding_Soap12", "ihe"),
78  		true,
79  		"wsdl/iti80.wsdl",
80  		true,
81  		false,
82  		false,
83  		true);
84  }