gICS_2.8.6
ConsentLightDTO.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.Date;
40 import java.util.HashMap;
41 import java.util.Map;
42 
44 
52 public class ConsentLightDTO implements Serializable {
53 
54  private static final long serialVersionUID = -4082209239245270664L;
55  private ConsentKeyDTO key;
56  private boolean patientSignatureIsFromGuardian;
57  private String physicanId;
58  private Date patientSigningDate;
59  private Date physicanSigningDate;
60  private String comment;
61  private String externProperties;
62  private String scanFileType;
63  private ConsentTemplateType templateType;
64  private Map<ModuleKeyDTO, ModuleStateDTO> moduleStates = new HashMap<ModuleKeyDTO, ModuleStateDTO>();
65 
66  public ConsentLightDTO() {
67  }
68 
69  public ConsentLightDTO(ConsentKeyDTO key) {
70  super();
71  this.key = key;
72  }
73 
74  public ConsentLightDTO(ConsentLightDTO lightDTO) {
75  this.key = lightDTO.getKey();
76  setComment(lightDTO.getComment());
77  setExternProperties(lightDTO.getExternProperties());
78  Map<ModuleKeyDTO, ModuleStateDTO> moduleStates = new HashMap<ModuleKeyDTO, ModuleStateDTO>(lightDTO.getModuleStates());
79  setModuleStates(moduleStates);
80  setPatientSignatureIsFromGuardian(lightDTO.getPatientSignatureIsFromGuardian());
81  setPatientSigningDate(lightDTO.getPatientSigningDate());
82  setPhysicanId(lightDTO.getPhysicanId());
83  setPhysicanSigningDate(lightDTO.getPhysicanSigningDate());
84  setScanFileType(lightDTO.getScanFileType());
85  }
86 
87  public ConsentKeyDTO getKey() {
88  return key;
89  }
90 
91  public void setKey(ConsentKeyDTO key) {
92  if (key != null) {
93  this.key = key;
94  }
95  }
96 
97  public boolean getPatientSignatureIsFromGuardian() {
98  return patientSignatureIsFromGuardian;
99  }
100 
101  public void setPatientSignatureIsFromGuardian(boolean patientSignatureIsFromGuardian) {
102  this.patientSignatureIsFromGuardian = patientSignatureIsFromGuardian;
103  }
104 
105  public String getPhysicanId() {
106  return physicanId;
107  }
108 
109  public void setPhysicanId(String physicanId) {
110  this.physicanId = physicanId;
111  }
112 
113  public Date getPatientSigningDate() {
114  return patientSigningDate;
115  }
116 
117  public void setPatientSigningDate(Date patientSigningDate) {
118  this.patientSigningDate = patientSigningDate;
119  }
120 
121  public Date getPhysicanSigningDate() {
122  return physicanSigningDate;
123  }
124 
125  public void setPhysicanSigningDate(Date physicanSigningDate) {
126  this.physicanSigningDate = physicanSigningDate;
127  }
128 
129  public String getComment() {
130  return comment;
131  }
132 
133  public void setComment(String comment) {
134  this.comment = comment;
135  }
136 
137  public String getExternProperties() {
138  return externProperties;
139  }
140 
141  public void setExternProperties(String externProperties) {
142  this.externProperties = externProperties;
143  }
144 
145  public String getScanFileType() {
146  return scanFileType;
147  }
148 
149  public void setScanFileType(String scanFileType) {
150  this.scanFileType = scanFileType;
151  }
152 
153  public ConsentTemplateType getTemplateType() {
154  return templateType;
155  }
156 
157  public void setTemplateType(ConsentTemplateType templateType) {
158  this.templateType = templateType;
159  }
160 
161  public Map<ModuleKeyDTO, ModuleStateDTO> getModuleStates() {
162  return moduleStates;
163  }
164 
165  public void setModuleStates(Map<ModuleKeyDTO, ModuleStateDTO> moduleStates) {
166  if (moduleStates != null) {
167  this.moduleStates = moduleStates;
168  }
169  }
170 
171  @Override
172  public int hashCode() {
173  final int prime = 31;
174  int result = 1;
175  result = prime * result + ((comment == null) ? 0 : comment.hashCode());
176  result = prime * result + ((externProperties == null) ? 0 : externProperties.hashCode());
177  result = prime * result + ((key == null) ? 0 : key.hashCode());
178  result = prime * result + ((patientSignatureIsFromGuardian) ? 1231 : 1237);
179  result = prime * result + ((patientSigningDate == null) ? 0 : patientSigningDate.hashCode());
180  result = prime * result + ((physicanId == null) ? 0 : physicanId.hashCode());
181  result = prime * result + ((physicanSigningDate == null) ? 0 : physicanSigningDate.hashCode());
182  result = prime * result + ((moduleStates == null) ? 0 : moduleStates.hashCode());
183  result = prime * result + ((scanFileType == null) ? 0 : scanFileType.hashCode());
184  return result;
185  }
186 
187  @Override
188  public boolean equals(Object obj) {
189  if (this == obj)
190  return true;
191  if (obj == null)
192  return false;
193  if (getClass() != obj.getClass())
194  return false;
195  ConsentLightDTO other = (ConsentLightDTO) obj;
196  if (key == null) {
197  if (other.key != null)
198  return false;
199  } else if (!key.equals(other.key))
200  return false;
201  if (comment == null) {
202  if (other.comment != null)
203  return false;
204  } else if (!comment.equals(other.comment))
205  return false;
206  if (externProperties == null) {
207  if (other.externProperties != null)
208  return false;
209  } else if (!externProperties.equals(other.externProperties))
210  return false;
211  if(patientSignatureIsFromGuardian != other.patientSignatureIsFromGuardian)
212  return false;
213  if (patientSigningDate == null) {
214  if (other.patientSigningDate != null)
215  return false;
216  } else if (!patientSigningDate.equals(other.patientSigningDate))
217  return false;
218  if (physicanId == null) {
219  if (other.physicanId != null)
220  return false;
221  } else if (!physicanId.equals(other.physicanId))
222  return false;
223  if (physicanSigningDate == null) {
224  if (other.physicanSigningDate != null)
225  return false;
226  } else if (!physicanSigningDate.equals(other.physicanSigningDate))
227  return false;
228  if (moduleStates == null) {
229  if (other.moduleStates != null)
230  return false;
231  } else if (!moduleStates.equals(other.moduleStates))
232  return false;
233  if (scanFileType == null) {
234  if (other.scanFileType != null)
235  return false;
236  } else if (!scanFileType.equals(other.scanFileType))
237  return false;
238  return true;
239  }
240 
241  @Override
242  public String toString() {
243  final StringBuilder sb = new StringBuilder();
244  sb.append(key);
245  sb.append(" with comment '");
246  sb.append(comment);
247  sb.append("', extern properties '");
248  sb.append(externProperties);
249  sb.append("', ");
250  sb.append(moduleStates.size());
251  sb.append(" module states");
252  return sb.toString();
253  }
254 }
ein consent ist ein ausgefuelltes und unterschriebenes konsentdokument (consent template) das light ...