1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.ihe.hl7v2;
17
18 import ca.uhn.hl7v2.ErrorCode;
19 import ca.uhn.hl7v2.Version;
20 import lombok.AllArgsConstructor;
21 import lombok.Getter;
22 import org.openehealth.ipf.commons.ihe.core.IntegrationProfile;
23 import org.openehealth.ipf.commons.ihe.core.InteractionId;
24 import org.openehealth.ipf.commons.ihe.hl7v2.audit.iti64.Iti64AuditDataset;
25 import org.openehealth.ipf.commons.ihe.hl7v2.audit.iti64.Iti64AuditStrategy;
26 import org.openehealth.ipf.commons.ihe.hl7v2.definitions.CustomModelClassUtils;
27 import org.openehealth.ipf.commons.ihe.hl7v2.definitions.HapiContextFactory;
28 import org.openehealth.ipf.gazelle.validation.profile.pixpdq.PixPdqTransactions;
29
30 import java.util.Arrays;
31 import java.util.List;
32
33
34
35
36
37 public class XPID implements IntegrationProfile {
38
39 @AllArgsConstructor
40 public enum Interactions implements Hl7v2InteractionId<Iti64AuditDataset> {
41 ITI_64(ITI_64_CONFIGURATION, ITI_64_NAK_FACTORY);
42
43 @Getter private Hl7v2TransactionConfiguration<Iti64AuditDataset> hl7v2TransactionConfiguration;
44 @Getter private NakFactory<Iti64AuditDataset> nakFactory;
45 }
46
47 @Override
48 public List<InteractionId> getInteractionIds() {
49 return Arrays.asList(Interactions.values());
50 }
51
52 private static final Hl7v2TransactionConfiguration<Iti64AuditDataset> ITI_64_CONFIGURATION =
53 new Hl7v2TransactionConfiguration<>(
54 "xpid-iti64",
55 "XAD-PID Change Management",
56 false,
57 new Iti64AuditStrategy(false),
58 new Iti64AuditStrategy(true),
59 new Version[] {Version.V25},
60 "XPID adapter",
61 "IPF",
62 ErrorCode.APPLICATION_INTERNAL_ERROR,
63 ErrorCode.APPLICATION_INTERNAL_ERROR,
64 new String[] {"ADT"},
65 new String[] {"A43"},
66 new String[] {"ACK"},
67 new String[] {"*"},
68 new boolean[] {true},
69 new boolean[] {false},
70 HapiContextFactory.createHapiContext(
71 CustomModelClassUtils.createFactory("xpid", "2.5"),
72 PixPdqTransactions.ITI64));
73
74 private static final NakFactory ITI_64_NAK_FACTORY = new NakFactory(ITI_64_CONFIGURATION);
75 }