gICS_2.8.6
ConsentTemplateDTO.java
1 package org.emau.icmvc.ganimed.ttp.cm2.dto;
2 
3 /*
4  * ###license-information-start###
5  * gICS - a Generic Informed Consent Service
6  * __
7  * Copyright (C) 2014 - 2018 The MOSAIC Project - Institut fuer Community
8  * Medicine of the University Medicine Greifswald -
9  * mosaic-projekt@uni-greifswald.de
10  *
11  * concept and implementation
12  * l.geidel
13  * web client
14  * a.blumentritt, m.bialke
15  *
16  * Selected functionalities of gICS were developed as part of the MAGIC Project (funded by the DFG HO 1937/5-1).
17  *
18  * please cite our publications
19  * http://dx.doi.org/10.3414/ME14-01-0133
20  * http://dx.doi.org/10.1186/s12967-015-0545-6
21  * http://dx.doi.org/10.3205/17gmds146
22  * __
23  * This program is free software: you can redistribute it and/or modify
24  * it under the terms of the GNU Affero General Public License as published by
25  * the Free Software Foundation, either version 3 of the License, or
26  * (at your option) any later version.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU Affero General Public License
34  * along with this program. If not, see <http://www.gnu.org/licenses/>.
35  * ###license-information-end###
36  */
37 
38 import java.io.Serializable;
39 import java.util.ArrayList;
40 import java.util.List;
41 
43 
50 public class ConsentTemplateDTO implements Serializable {
51 
52  private static final long serialVersionUID = -875195702630175964L;
53  private ConsentTemplateKeyDTO key;
54  private String title;
55  private String propertiesString;
56  private String comment;
57  private String externProperties;
58  private ConsentTemplateType type;
59  private String header;
60  private String footer;
61  private String scanBase64;
62  private String scanFileType;
63  private List<AssignedModuleDTO> assignedModules = new ArrayList<AssignedModuleDTO>();
64  private List<FreeTextDefDTO> freeTextDefs = new ArrayList<FreeTextDefDTO>();
66 
67  public ConsentTemplateDTO() {
68  }
69 
71  super();
72  this.key = key;
73  }
74 
75  public ConsentTemplateDTO(ConsentTemplateKeyDTO key, String title, String propertiesString, String comment, String externProperties,
76  ConsentTemplateType type, String header, String footer, String scanBase64, String scanFileType, List<AssignedModuleDTO> assignedModules,
77  List<FreeTextDefDTO> freeTextDefs) {
78  super();
79  this.key = key;
80  this.title = title;
81  this.propertiesString = propertiesString;
82  this.comment = comment;
83  this.externProperties = externProperties;
84  this.type = type;
85  this.header = header;
86  this.footer = footer;
87  this.scanBase64 = scanBase64;
88  this.scanFileType = scanFileType;
89  this.assignedModules = assignedModules;
90  this.freeTextDefs = freeTextDefs;
91  }
92 
93  public ConsentTemplateKeyDTO getKey() {
94  return key;
95  }
96 
97  public void setKey(ConsentTemplateKeyDTO key) {
98  if (key != null) {
99  this.key = key;
100  }
101  }
102 
103  public String getTitle() {
104  return title;
105  }
106 
107  public void setTitle(String title) {
108  this.title = title;
109  }
110 
111  public String getPropertiesString() {
112  return propertiesString;
113  }
114 
115  public void setPropertiesString(String propertiesString) {
116  this.propertiesString = propertiesString;
117  }
118 
119  public String getComment() {
120  return comment;
121  }
122 
123  public void setComment(String comment) {
124  this.comment = comment;
125  }
126 
127  public String getExternProperties() {
128  return externProperties;
129  }
130 
131  public void setExternProperties(String externProperties) {
132  this.externProperties = externProperties;
133  }
134 
135  public ConsentTemplateType getType() {
136  return type;
137  }
138 
139  public void setType(ConsentTemplateType type) {
140  this.type = type;
141  }
142 
143  public String getHeader() {
144  return header;
145  }
146 
147  public void setHeader(String header) {
148  this.header = header;
149  }
150 
151  public String getFooter() {
152  return footer;
153  }
154 
155  public void setFooter(String footer) {
156  this.footer = footer;
157  }
158 
159  public String getScanBase64() {
160  return scanBase64;
161  }
162 
163  public void setScanBase64(String scanBase64) {
164  this.scanBase64 = scanBase64;
165  }
166 
167  public String getScanFileType() {
168  return scanFileType;
169  }
170 
171  public void setScanFileType(String scanFileType) {
172  this.scanFileType = scanFileType;
173  }
174 
175  public List<AssignedModuleDTO> getAssignedModules() {
176  return assignedModules;
177  }
178 
179  public void setAssignedModules(List<AssignedModuleDTO> assignedModules) {
180  if (assignedModules != null) {
181  this.assignedModules = assignedModules;
182  }
183  }
184 
185  public List<FreeTextDefDTO> getFreeTextDefs() {
186  return freeTextDefs;
187  }
188 
189  public void setFreeTextDefs(List<FreeTextDefDTO> freeTextDefs) {
190  if (freeTextDefs != null) {
191  this.freeTextDefs = freeTextDefs;
192  }
193  }
194 
195  public ConsentTemplateStructureDTO getStructure() {
196  return structure;
197  }
198 
199  public void setStructure(ConsentTemplateStructureDTO structure) {
200  if (structure != null) {
201  this.structure = structure;
202  }
203  }
204 
205  @Override
206  public int hashCode() {
207  final int prime = 31;
208  int result = 1;
209  result = prime * result + ((comment == null) ? 0 : comment.hashCode());
210  result = prime * result + ((externProperties == null) ? 0 : externProperties.hashCode());
211  result = prime * result + ((type == null) ? 0 : type.hashCode());
212  result = prime * result + ((footer == null) ? 0 : footer.hashCode());
213  result = prime * result + ((header == null) ? 0 : header.hashCode());
214  result = prime * result + ((key == null) ? 0 : key.hashCode());
215  result = prime * result + ((assignedModules == null) ? 0 : assignedModules.hashCode());
216  result = prime * result + ((propertiesString == null) ? 0 : propertiesString.hashCode());
217  result = prime * result + ((scanFileType == null) ? 0 : scanFileType.hashCode());
218  result = prime * result + ((scanBase64 == null) ? 0 : scanBase64.hashCode());
219  result = prime * result + ((freeTextDefs == null) ? 0 : freeTextDefs.hashCode());
220  result = prime * result + ((structure == null) ? 0 : structure.hashCode());
221  result = prime * result + ((title == null) ? 0 : title.hashCode());
222  return result;
223  }
224 
225  @Override
226  public boolean equals(Object obj) {
227  if (this == obj)
228  return true;
229  if (obj == null)
230  return false;
231  if (getClass() != obj.getClass())
232  return false;
234  if (key == null) {
235  if (other.key != null)
236  return false;
237  } else if (!key.equals(other.key))
238  return false;
239  if (comment == null) {
240  if (other.comment != null)
241  return false;
242  } else if (!comment.equals(other.comment))
243  return false;
244  if (externProperties == null) {
245  if (other.externProperties != null)
246  return false;
247  } else if (!externProperties.equals(other.externProperties))
248  return false;
249  if (type == null) {
250  if (other.type != null)
251  return false;
252  } else if (!type.equals(other.type))
253  return false;
254  if (footer == null) {
255  if (other.footer != null)
256  return false;
257  } else if (!footer.equals(other.footer))
258  return false;
259  if (header == null) {
260  if (other.header != null)
261  return false;
262  } else if (!header.equals(other.header))
263  return false;
264  if (assignedModules == null) {
265  if (other.assignedModules != null)
266  return false;
267  } else if (!assignedModules.equals(other.assignedModules))
268  return false;
269  if (propertiesString == null) {
270  if (other.propertiesString != null)
271  return false;
272  } else if (!propertiesString.equals(other.propertiesString))
273  return false;
274  if (scanFileType == null) {
275  if (other.scanFileType != null)
276  return false;
277  } else if (!scanFileType.equals(other.scanFileType))
278  return false;
279  if (scanBase64 == null) {
280  if (other.scanBase64 != null)
281  return false;
282  } else if (!scanBase64.equals(other.scanBase64))
283  return false;
284  if (freeTextDefs == null) {
285  if (other.freeTextDefs != null)
286  return false;
287  } else if (!freeTextDefs.equals(other.freeTextDefs))
288  return false;
289  if (structure == null) {
290  if (other.structure != null)
291  return false;
292  } else if (!structure.equals(other.structure))
293  return false;
294  if (title == null) {
295  if (other.title != null)
296  return false;
297  } else if (!title.equals(other.title))
298  return false;
299  return true;
300  }
301 
302  @Override
303  public String toString() {
304  final StringBuilder sb = new StringBuilder();
305  sb.append(key);
306  sb.append(" with title '");
307  sb.append(title);
308  sb.append(", comment '");
309  sb.append(comment);
310  sb.append("', extern properties '");
311  sb.append(externProperties);
312  sb.append("', type '");
313  sb.append(type);
314  sb.append("', properties '");
315  sb.append(propertiesString);
316  sb.append("', ");
317  sb.append(assignedModules.size());
318  sb.append(" modules and ");
319  sb.append(freeTextDefs.size());
320  sb.append(" free text fields");
321  return sb.toString();
322  }
323 }
ein consent template kann mehrere module (mit jeweils mehreren policies) enthalten, es entspricht dem elektronischen aequivalent eines nicht ausgefuellten konsentdokumentes