View Javadoc
1   /*
2    * Copyright 2018 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.fhir.mhd;
17  
18  import lombok.AllArgsConstructor;
19  import lombok.Getter;
20  import org.openehealth.ipf.commons.ihe.core.IntegrationProfile;
21  import org.openehealth.ipf.commons.ihe.core.InteractionId;
22  import org.openehealth.ipf.commons.ihe.core.TransactionConfiguration;
23  import org.openehealth.ipf.commons.ihe.fhir.FhirInteractionId;
24  import org.openehealth.ipf.commons.ihe.fhir.FhirTransactionConfiguration;
25  import org.openehealth.ipf.commons.ihe.fhir.audit.FhirQueryAuditDataset;
26  import org.openehealth.ipf.commons.ihe.fhir.iti65.Iti65AuditDataset;
27  import org.openehealth.ipf.commons.ihe.fhir.iti65.Iti65TransactionConfiguration;
28  import org.openehealth.ipf.commons.ihe.fhir.iti66.Iti66TransactionConfiguration;
29  import org.openehealth.ipf.commons.ihe.fhir.iti67.Iti67TransactionConfiguration;
30  import org.openehealth.ipf.commons.ihe.fhir.iti68.Iti68AuditDataset;
31  import org.openehealth.ipf.commons.ihe.fhir.iti68.Iti68TransactionConfiguration;
32  
33  import java.util.ArrayList;
34  import java.util.Arrays;
35  import java.util.Collections;
36  import java.util.List;
37  
38  /**
39   * @author Christian Ohr
40   * @since 3.2
41   */
42  public class MHD implements IntegrationProfile {
43  
44      @AllArgsConstructor
45      public enum SubmitInteractions implements FhirInteractionId<Iti65AuditDataset> {
46          ITI_65(ITI_65_CONFIG);
47  
48          @Getter
49          FhirTransactionConfiguration<Iti65AuditDataset> fhirTransactionConfiguration;
50      }
51  
52      @AllArgsConstructor
53      public enum QueryInteractions implements FhirInteractionId<FhirQueryAuditDataset> {
54          ITI_66(ITI_66_CONFIG),
55          ITI_67(ITI_67_CONFIG);
56  
57          @Getter FhirTransactionConfiguration<FhirQueryAuditDataset> fhirTransactionConfiguration;
58      }
59  
60      @AllArgsConstructor
61      public enum RetrieveInteractions implements InteractionId {
62          ITI_68(ITI_68_CONFIG);
63  
64          @Getter
65          TransactionConfiguration<Iti68AuditDataset> transactionConfiguration;
66      }
67  
68      @Override
69      public List<InteractionId> getInteractionIds() {
70          List<InteractionId> interactions = new ArrayList<>();
71          interactions.addAll(Arrays.asList(SubmitInteractions.values()));
72          interactions.addAll(Arrays.asList(QueryInteractions.values()));
73          return Collections.unmodifiableList(interactions);
74      }
75  
76  
77      private static final Iti65TransactionConfiguration ITI_65_CONFIG = new Iti65TransactionConfiguration();
78      private static final Iti66TransactionConfiguration ITI_66_CONFIG = new Iti66TransactionConfiguration();
79      private static final Iti67TransactionConfiguration ITI_67_CONFIG = new Iti67TransactionConfiguration();
80      private static final Iti68TransactionConfiguration ITI_68_CONFIG = new Iti68TransactionConfiguration();
81  }