|
| 1 | +/** |
| 2 | + * The contents of this file are subject to the OpenMRS Public License |
| 3 | + * Version 1.0 (the "License"); you may not use this file except in |
| 4 | + * compliance with the License. You may obtain a copy of the License at |
| 5 | + * http://license.openmrs.org |
| 6 | + * |
| 7 | + * Software distributed under the License is distributed on an "AS IS" |
| 8 | + * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
| 9 | + * License for the specific language governing rights and limitations |
| 10 | + * under the License. |
| 11 | + * |
| 12 | + * Copyright (C) OpenMRS, LLC. All Rights Reserved. |
| 13 | + */ |
| 14 | +package org.openmrs; |
| 15 | + |
| 16 | +import org.simpleframework.xml.Attribute; |
| 17 | + |
| 18 | +import java.io.Serializable; |
| 19 | +import java.util.Date; |
| 20 | + |
| 21 | +/** |
| 22 | + * The DrugReferenceMap map object represents a mapping between a drug and alternative drug terminologies. |
| 23 | + * |
| 24 | + * @since 1.10 |
| 25 | + */ |
| 26 | +public class DrugReferenceMap extends BaseOpenmrsObject implements Auditable, Retireable, Serializable { |
| 27 | + |
| 28 | + public static final long serialVersionUID = 1L; |
| 29 | + |
| 30 | + private Integer drugReferenceMapId; |
| 31 | + |
| 32 | + private Drug drug; |
| 33 | + |
| 34 | + private ConceptReferenceTerm conceptReferenceTerm; |
| 35 | + |
| 36 | + private ConceptMapType conceptMapType; |
| 37 | + |
| 38 | + private User creator; |
| 39 | + |
| 40 | + private Date dateCreated; |
| 41 | + |
| 42 | + private Boolean retired = false; |
| 43 | + |
| 44 | + private User retiredBy; |
| 45 | + |
| 46 | + private Date dateRetired; |
| 47 | + |
| 48 | + private User changedBy; |
| 49 | + |
| 50 | + private Date dateChanged; |
| 51 | + |
| 52 | + private String retireReason; |
| 53 | + |
| 54 | + /** |
| 55 | + * @return Returns the drugReferenceMapId. |
| 56 | + */ |
| 57 | + public Integer getDrugReferenceMapId() { |
| 58 | + return drugReferenceMapId; |
| 59 | + } |
| 60 | + |
| 61 | + /** |
| 62 | + * @param drugReferenceMapId The drugReferenceMapId to set. |
| 63 | + */ |
| 64 | + public void setDrugReferenceMapId(Integer drugReferenceMapId) { |
| 65 | + this.drugReferenceMapId = drugReferenceMapId; |
| 66 | + } |
| 67 | + |
| 68 | + /** |
| 69 | + * @return Returns the drug. |
| 70 | + */ |
| 71 | + public Drug getDrug() { |
| 72 | + return drug; |
| 73 | + } |
| 74 | + |
| 75 | + /** |
| 76 | + * @param drug The drug to set. |
| 77 | + */ |
| 78 | + public void setDrug(Drug drug) { |
| 79 | + this.drug = drug; |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * @return Returns the conceptReferenceTerm. |
| 84 | + */ |
| 85 | + public ConceptReferenceTerm getConceptReferenceTerm() { |
| 86 | + return conceptReferenceTerm; |
| 87 | + } |
| 88 | + |
| 89 | + /** |
| 90 | + * @param conceptReferenceTerm The conceptReferenceTerm to set. |
| 91 | + */ |
| 92 | + public void setConceptReferenceTerm(ConceptReferenceTerm conceptReferenceTerm) { |
| 93 | + this.conceptReferenceTerm = conceptReferenceTerm; |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * @return Returns the conceptMapType. |
| 98 | + */ |
| 99 | + public ConceptMapType getConceptMapType() { |
| 100 | + return conceptMapType; |
| 101 | + } |
| 102 | + |
| 103 | + /** |
| 104 | + * @param conceptMapType The conceptMapType to set. |
| 105 | + */ |
| 106 | + public void setConceptMapType(ConceptMapType conceptMapType) { |
| 107 | + this.conceptMapType = conceptMapType; |
| 108 | + } |
| 109 | + |
| 110 | + /** |
| 111 | + * @return id - The unique Identifier for the object |
| 112 | + */ |
| 113 | + @Override |
| 114 | + public Integer getId() { |
| 115 | + return getDrugReferenceMapId(); |
| 116 | + } |
| 117 | + |
| 118 | + /** |
| 119 | + * @param id - The unique Identifier for the object |
| 120 | + */ |
| 121 | + @Override |
| 122 | + public void setId(Integer id) { |
| 123 | + setDrugReferenceMapId(id); |
| 124 | + } |
| 125 | + |
| 126 | + /** |
| 127 | + * @return User - the user who created the object |
| 128 | + */ |
| 129 | + @Override |
| 130 | + public User getCreator() { |
| 131 | + return this.creator; |
| 132 | + } |
| 133 | + |
| 134 | + /** |
| 135 | + * @param creator - the user who created the object |
| 136 | + */ |
| 137 | + @Override |
| 138 | + public void setCreator(User creator) { |
| 139 | + this.creator = creator; |
| 140 | + } |
| 141 | + |
| 142 | + /** |
| 143 | + * @return Date - the date the object was created |
| 144 | + */ |
| 145 | + @Override |
| 146 | + public Date getDateCreated() { |
| 147 | + return dateCreated; |
| 148 | + } |
| 149 | + |
| 150 | + /** |
| 151 | + * @param dateCreated - the date the object was created |
| 152 | + */ |
| 153 | + @Override |
| 154 | + public void setDateCreated(Date dateCreated) { |
| 155 | + this.dateCreated = dateCreated; |
| 156 | + } |
| 157 | + |
| 158 | + /** |
| 159 | + * @return User - the user who last changed the object |
| 160 | + */ |
| 161 | + @Override |
| 162 | + public User getChangedBy() { |
| 163 | + return this.changedBy; |
| 164 | + } |
| 165 | + |
| 166 | + /** |
| 167 | + * @param changedBy - the user who last changed the object |
| 168 | + */ |
| 169 | + @Override |
| 170 | + public void setChangedBy(User changedBy) { |
| 171 | + this.changedBy = changedBy; |
| 172 | + } |
| 173 | + |
| 174 | + /** |
| 175 | + * @return Date - the date the object was last changed |
| 176 | + */ |
| 177 | + @Override |
| 178 | + public Date getDateChanged() { |
| 179 | + return this.dateChanged; |
| 180 | + } |
| 181 | + |
| 182 | + /** |
| 183 | + * @param dateChanged - the date the object was last changed |
| 184 | + */ |
| 185 | + @Override |
| 186 | + public void setDateChanged(Date dateChanged) { |
| 187 | + this.dateChanged = dateChanged; |
| 188 | + } |
| 189 | + |
| 190 | + /** |
| 191 | + * @return Boolean - whether of not this object is retired |
| 192 | + */ |
| 193 | + @Override |
| 194 | + public Boolean isRetired() { |
| 195 | + return this.retired; |
| 196 | + } |
| 197 | + |
| 198 | + /** |
| 199 | + * This method exists to satisfy spring and hibernates slightly bung use of Boolean object |
| 200 | + * getters and setters. |
| 201 | + * |
| 202 | + * @see org.openmrs.Concept#isRetired() |
| 203 | + * @deprecated Use the "proper" isRetired method. |
| 204 | + */ |
| 205 | + @Deprecated |
| 206 | + @Attribute |
| 207 | + public Boolean getRetired() { |
| 208 | + return isRetired(); |
| 209 | + } |
| 210 | + |
| 211 | + /** |
| 212 | + * @param retired - whether of not this object is retired |
| 213 | + */ |
| 214 | + @Override |
| 215 | + public void setRetired(Boolean retired) { |
| 216 | + this.retired = retired; |
| 217 | + } |
| 218 | + |
| 219 | + /** |
| 220 | + * @return User - the user who retired the object |
| 221 | + */ |
| 222 | + @Override |
| 223 | + public User getRetiredBy() { |
| 224 | + return this.retiredBy; |
| 225 | + } |
| 226 | + |
| 227 | + /** |
| 228 | + * @param retiredBy - the user who retired the object |
| 229 | + */ |
| 230 | + @Override |
| 231 | + public void setRetiredBy(User retiredBy) { |
| 232 | + this.retiredBy = retiredBy; |
| 233 | + } |
| 234 | + |
| 235 | + /** |
| 236 | + * @return Date - the date the object was retired |
| 237 | + */ |
| 238 | + @Override |
| 239 | + public Date getDateRetired() { |
| 240 | + return dateRetired; |
| 241 | + } |
| 242 | + |
| 243 | + /** |
| 244 | + * @param dateRetired - the date the object was retired |
| 245 | + */ |
| 246 | + @Override |
| 247 | + public void setDateRetired(Date dateRetired) { |
| 248 | + this.dateRetired = dateRetired; |
| 249 | + } |
| 250 | + |
| 251 | + /** |
| 252 | + * @return String - the reason the object was retired |
| 253 | + */ |
| 254 | + @Override |
| 255 | + public String getRetireReason() { |
| 256 | + return this.retireReason; |
| 257 | + } |
| 258 | + |
| 259 | + /** |
| 260 | + * @param retireReason - the reason the object was retired |
| 261 | + */ |
| 262 | + @Override |
| 263 | + public void setRetireReason(String retireReason) { |
| 264 | + this.retireReason = retireReason; |
| 265 | + } |
| 266 | +} |
0 commit comments