1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.ihe.xds.core.metadata;
17
18 import ca.uhn.hl7v2.model.v25.datatype.HD;
19
20 import javax.xml.bind.annotation.XmlAccessType;
21 import javax.xml.bind.annotation.XmlAccessorType;
22 import javax.xml.bind.annotation.XmlAttribute;
23 import javax.xml.bind.annotation.XmlType;
24 import java.util.Objects;
25
26
27
28
29
30
31
32
33
34
35
36
37 @XmlAccessorType(XmlAccessType.PUBLIC_MEMBER)
38 @XmlType(name = "CXiAssigningAuthority", propOrder = {"namespaceId"})
39 public class CXiAssigningAuthority extends AssigningAuthority {
40
41 public CXiAssigningAuthority() {
42 super();
43 }
44
45 public CXiAssigningAuthority(Holder<HD> hdHolder) {
46 super(hdHolder);
47 }
48
49 public CXiAssigningAuthority(HD hd) {
50 super(hd);
51 }
52
53
54
55
56
57
58
59
60
61
62 public CXiAssigningAuthority(String namespaceId, String universalId, String universalIdType) {
63 super(universalId, universalIdType);
64 setNamespaceId(namespaceId);
65 }
66
67
68
69
70 @XmlAttribute
71 public String getNamespaceId() {
72 return getHapiObject().getInternal().getHd1_NamespaceID().getValue();
73 }
74
75
76
77
78
79 public void setNamespaceId(String namespaceId) {
80 setValue(getHapiObject().getInternal().getHd1_NamespaceID(), namespaceId);
81 }
82
83 @Override
84 public boolean equals(Object o) {
85 if (this == o) return true;
86 if (o == null || getClass() != o.getClass()) return false;
87 if (!super.equals(o)) return false;
88
89 CXiAssigningAuthority that = (CXiAssigningAuthority) o;
90
91 return Objects.equals(getNamespaceId(), that.getNamespaceId());
92 }
93
94 @Override
95 public int hashCode() {
96 return Objects.hash(super.hashCode(), getNamespaceId());
97 }
98
99 @Override
100 public String toString() {
101 return "CXiAssigningAuthority(" +
102 "super=" + super.toString() +
103 "namespaceId=" + getNamespaceId() +
104 ')';
105 }
106 }