1 /*=============================================================================
2 
3   Library: CTK
4 
5   Copyright (c) German Cancer Research Center,
6     Division of Medical and Biological Informatics
7 
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11 
12     http://www.apache.org/licenses/LICENSE-2.0
13 
14   Unless required by applicable law or agreed to in writing, software
15   distributed under the License is distributed on an "AS IS" BASIS,
16   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   See the License for the specific language governing permissions and
18   limitations under the License.
19 
20 =============================================================================*/
21 
22 // CTK includes
23 #include "ctkDicomAppHostingTypes.h"
24 
25 namespace ctkDicomAppHosting {
26 
27 //----------------------------------------------------------------------------
operator ==(const ctkDicomAppHosting::Status & left,const ctkDicomAppHosting::Status & right)28 bool operator ==(const ctkDicomAppHosting::Status& left,
29                  const ctkDicomAppHosting::Status& right)
30 {
31   return (left.statusType == right.statusType &&
32           left.codingSchemeDesignator == right.codingSchemeDesignator &&
33           left.codeValue == right.codeValue &&
34           left.codeMeaning == right.codeMeaning);
35 }
36 
37 //----------------------------------------------------------------------------
operator !=(const ctkDicomAppHosting::Status & left,const ctkDicomAppHosting::Status & right)38 bool operator !=(const ctkDicomAppHosting::Status& left,
39                  const ctkDicomAppHosting::Status& right)
40 {
41   return !(left == right);
42 }
43 
44 //----------------------------------------------------------------------------
operator ==(const ctkDicomAppHosting::ObjectLocator & left,const ctkDicomAppHosting::ObjectLocator & right)45 bool operator ==(const ctkDicomAppHosting::ObjectLocator& left,
46                  const ctkDicomAppHosting::ObjectLocator& right)
47 {
48   return (left.locator == right.locator &&
49           left.source == right.source &&
50           left.transferSyntax == right.transferSyntax &&
51           left.length == right.length &&
52           left.offset == right.offset &&
53           left.URI == right.URI);
54 }
55 
56 //----------------------------------------------------------------------------
operator !=(const ctkDicomAppHosting::ObjectLocator & left,const ctkDicomAppHosting::ObjectLocator & right)57 bool operator !=(const ctkDicomAppHosting::ObjectLocator& left,
58                  const ctkDicomAppHosting::ObjectLocator& right)
59 {
60   return !(left == right);
61 }
62 
63 //----------------------------------------------------------------------------
operator ==(const ctkDicomAppHosting::ObjectDescriptor & left,const ctkDicomAppHosting::ObjectDescriptor & right)64 bool operator ==(const ctkDicomAppHosting::ObjectDescriptor& left,
65                  const ctkDicomAppHosting::ObjectDescriptor& right)
66 {
67   return (left.descriptorUUID == right.descriptorUUID &&
68           left.mimeType == right.mimeType &&
69           left.classUID == right.classUID &&
70           left.transferSyntaxUID == right.transferSyntaxUID &&
71           left.modality == right.modality);
72 }
73 
74 //----------------------------------------------------------------------------
operator !=(const ctkDicomAppHosting::ObjectDescriptor & left,const ctkDicomAppHosting::ObjectDescriptor & right)75 bool operator !=(const ctkDicomAppHosting::ObjectDescriptor& left,
76                  const ctkDicomAppHosting::ObjectDescriptor& right)
77 {
78   return !(left == right);
79 }
80 
81 //----------------------------------------------------------------------------
operator ==(const ctkDicomAppHosting::Series & left,const ctkDicomAppHosting::Series & right)82 bool operator ==(const ctkDicomAppHosting::Series& left,
83                  const ctkDicomAppHosting::Series& right)
84 {
85   return (left.seriesUID == right.seriesUID &&
86           left.objectDescriptors == right.objectDescriptors);
87 }
88 
89 //----------------------------------------------------------------------------
operator !=(const ctkDicomAppHosting::Series & left,const ctkDicomAppHosting::Series & right)90 bool operator !=(const ctkDicomAppHosting::Series& left,
91                  const ctkDicomAppHosting::Series& right)
92 {
93   return !(left == right);
94 }
95 
96 //----------------------------------------------------------------------------
operator ==(const ctkDicomAppHosting::Study & left,const ctkDicomAppHosting::Study & right)97 bool operator ==(const ctkDicomAppHosting::Study& left,
98                  const ctkDicomAppHosting::Study& right)
99 {
100   return (left.studyUID == right.studyUID &&
101           left.series == right.series &&
102           left.objectDescriptors == right.objectDescriptors);
103 }
104 
105 //----------------------------------------------------------------------------
operator !=(const ctkDicomAppHosting::Study & left,const ctkDicomAppHosting::Study & right)106 bool operator !=(const ctkDicomAppHosting::Study& left,
107                  const ctkDicomAppHosting::Study& right)
108 {
109   return !(left == right);
110 }
111 
112 //----------------------------------------------------------------------------
operator ==(const ctkDicomAppHosting::Patient & left,const ctkDicomAppHosting::Patient & right)113 bool operator ==(const ctkDicomAppHosting::Patient& left,
114                  const ctkDicomAppHosting::Patient& right)
115 {
116   return (left.assigningAuthority == right.assigningAuthority &&
117           left.birthDate == right.birthDate &&
118           left.id == right.id &&
119           left.name == right.name &&
120           left.objectDescriptors == right.objectDescriptors &&
121           left.sex == right.sex &&
122           left.studies == right.studies);
123 }
124 
125 //----------------------------------------------------------------------------
operator !=(const ctkDicomAppHosting::Patient & left,const ctkDicomAppHosting::Patient & right)126 bool operator !=(const ctkDicomAppHosting::Patient& left,
127                  const ctkDicomAppHosting::Patient& right)
128 {
129   return !(left == right);
130 }
131 
132 //----------------------------------------------------------------------------
operator ==(const ctkDicomAppHosting::AvailableData & left,const ctkDicomAppHosting::AvailableData & right)133 bool operator ==(const ctkDicomAppHosting::AvailableData& left,
134                  const ctkDicomAppHosting::AvailableData& right)
135 {
136   return (left.patients == right.patients &&
137           left.objectDescriptors == right.objectDescriptors);
138 }
139 
140 //----------------------------------------------------------------------------
operator !=(const ctkDicomAppHosting::AvailableData & left,const ctkDicomAppHosting::AvailableData & right)141 bool operator !=(const ctkDicomAppHosting::AvailableData& left,
142                  const ctkDicomAppHosting::AvailableData& right)
143 {
144   return !(left == right);
145 }
146 
147 }
148 
149