gICS_2.8.6
ConsentDTO.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 
49 public class ConsentDTO extends ConsentLightDTO implements Serializable {
50 
51  private static final long serialVersionUID = -4094005853140726190L;
52  private String patientSignatureBase64;
53  private String physicanSignatureBase64;
54  private String scanBase64;
55  private Map<String, String> freeTextVals = new HashMap<String, String>();
56 
57  public ConsentDTO() {
58  super();
59  }
60 
61  public ConsentDTO(ConsentKeyDTO key) {
62  super(key);
63  }
64 
65  public ConsentDTO(ConsentLightDTO lightDTO) {
66  super(lightDTO);
67  }
68 
69  public ConsentDTO(ConsentDTO dto, Date date) {
70  super(new ConsentKeyDTO(dto.getKey().getConsentTemplateKey(), dto.getKey().getSignerIds(), date));
71  super.setComment(dto.getComment());
72  super.setExternProperties(dto.getExternProperties());
73  Map<ModuleKeyDTO, ModuleStateDTO> moduleStates = new HashMap<ModuleKeyDTO, ModuleStateDTO>(dto.getModuleStates());
74  super.setModuleStates(moduleStates);
75  super.setPatientSignatureIsFromGuardian(dto.getPatientSignatureIsFromGuardian());
76  super.setPatientSigningDate(dto.getPatientSigningDate());
77  super.setPhysicanId(dto.getPhysicanId());
78  super.setPhysicanSigningDate(dto.getPhysicanSigningDate());
79  super.setScanFileType(dto.getScanFileType());
80  setPatientSignatureBase64(dto.getPatientSignatureBase64());
81  setPhysicanSignatureBase64(dto.getPhysicanSignatureBase64());
82  setScanBase64(dto.getScanBase64());
83  Map<String, String> freeTextVals = new HashMap<String, String>(dto.getFreeTextVals());
84  setFreeTextVals(freeTextVals);
85  }
86 
87  public String getPatientSignatureBase64() {
88  return patientSignatureBase64;
89  }
90 
91  public void setPatientSignatureBase64(String patientSignatureBase64) {
92  this.patientSignatureBase64 = patientSignatureBase64;
93  }
94 
95  public String getPhysicanSignatureBase64() {
96  return physicanSignatureBase64;
97  }
98 
99  public void setPhysicanSignatureBase64(String physicanSignatureBase64) {
100  this.physicanSignatureBase64 = physicanSignatureBase64;
101  }
102 
103  public String getScanBase64() {
104  return scanBase64;
105  }
106 
107  public void setScanBase64(String scanBase64) {
108  this.scanBase64 = scanBase64;
109  }
110 
111  public Map<String, String> getFreeTextVals() {
112  return freeTextVals;
113  }
114 
115  public void setFreeTextVals(Map<String, String> freeTextVals) {
116  if (freeTextVals != null) {
117  this.freeTextVals = freeTextVals;
118  }
119  }
120 
121  @Override
122  public int hashCode() {
123  final int prime = 31;
124  int result = super.hashCode();
125  result = prime * result + ((freeTextVals == null) ? 0 : freeTextVals.hashCode());
126  result = prime * result + ((patientSignatureBase64 == null) ? 0 : patientSignatureBase64.hashCode());
127  result = prime * result + ((physicanSignatureBase64 == null) ? 0 : physicanSignatureBase64.hashCode());
128  result = prime * result + ((scanBase64 == null) ? 0 : scanBase64.hashCode());
129  return result;
130  }
131 
132  @Override
133  public boolean equals(Object obj) {
134  if (this == obj)
135  return true;
136  if (!super.equals(obj))
137  return false;
138  if (getClass() != obj.getClass())
139  return false;
140  ConsentDTO other = (ConsentDTO) obj;
141  if (freeTextVals == null) {
142  if (other.freeTextVals != null)
143  return false;
144  } else if (!freeTextVals.equals(other.freeTextVals))
145  return false;
146  if (patientSignatureBase64 == null) {
147  if (other.patientSignatureBase64 != null)
148  return false;
149  } else if (!patientSignatureBase64.equals(other.patientSignatureBase64))
150  return false;
151  if (physicanSignatureBase64 == null) {
152  if (other.physicanSignatureBase64 != null)
153  return false;
154  } else if (!physicanSignatureBase64.equals(other.physicanSignatureBase64))
155  return false;
156  if (scanBase64 == null) {
157  if (other.scanBase64 != null)
158  return false;
159  } else if (!scanBase64.equals(other.scanBase64))
160  return false;
161  return true;
162  }
163 
164  @Override
165  public String toString() {
166  final StringBuilder sb = new StringBuilder(super.toString());
167  sb.append(" and ");
168  sb.append(freeTextVals.size());
169  sb.append(" free text values");
170  return sb.toString();
171  }
172 }
ein consent ist ein ausgefuelltes und unterschriebenes konsentdokument (consent template) ...
Definition: ConsentDTO.java:49
ein consent ist ein ausgefuelltes und unterschriebenes konsentdokument (consent template) das light ...