| 39 | | * @param concept |
|---|
| 40 | | * to be created |
|---|
| 41 | | */ |
|---|
| 42 | | @Authorized({"Add Concepts"}) |
|---|
| 43 | | public void createConcept(Concept concept); |
|---|
| 44 | | |
|---|
| 45 | | /** |
|---|
| 46 | | * @param numeric |
|---|
| 47 | | * concept to be created |
|---|
| 48 | | */ |
|---|
| 49 | | @Authorized({"Add Concepts"}) |
|---|
| 50 | | public void createConcept(ConceptNumeric concept); |
|---|
| 51 | | |
|---|
| 52 | | /** |
|---|
| 53 | | * Save a ComplexConcept that is new or has been edited. |
|---|
| 54 | | * TODO: Annotation tags. |
|---|
| 55 | | * |
|---|
| 56 | | * @param concept |
|---|
| 57 | | */ |
|---|
| 58 | | public void saveConcept(ConceptComplex concept); |
|---|
| 59 | | |
|---|
| 60 | | /** |
|---|
| 61 | | * Get a ComplexConcept for the conceptId |
|---|
| 62 | | * |
|---|
| 63 | | * @param conceptId of the ComplexConcept |
|---|
| | 57 | * @deprecated use #saveConcept(Concept) |
|---|
| | 58 | */ |
|---|
| | 59 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 60 | public void createConcept(Concept concept) throws APIException; |
|---|
| | 61 | |
|---|
| | 62 | /** |
|---|
| | 63 | * @deprecated use #saveConcept(Concept) |
|---|
| | 64 | */ |
|---|
| | 65 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 66 | public void createConcept(ConceptNumeric concept) throws APIException; |
|---|
| | 67 | |
|---|
| | 68 | /** |
|---|
| | 69 | * @deprecated use #saveConcept(Concept) |
|---|
| | 70 | */ |
|---|
| | 71 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 72 | public void updateConcept(Concept concept) throws APIException; |
|---|
| | 73 | |
|---|
| | 74 | /** |
|---|
| | 75 | * @deprecated use #saveConcept(Concept) |
|---|
| | 76 | */ |
|---|
| | 77 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 78 | public void updateConcept(ConceptNumeric concept) throws APIException; |
|---|
| | 79 | |
|---|
| | 80 | /** |
|---|
| | 81 | * @deprecated use #saveDrug(Drug) |
|---|
| | 82 | */ |
|---|
| | 83 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 84 | public void createDrug(Drug drug) throws APIException; |
|---|
| | 85 | |
|---|
| | 86 | /** |
|---|
| | 87 | * @deprecated use #saveDrug(Drug) |
|---|
| | 88 | */ |
|---|
| | 89 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 90 | public void updateDrug(Drug drug) throws APIException; |
|---|
| | 91 | |
|---|
| | 92 | /** |
|---|
| | 93 | * @deprecated use #purgeConcept(Concept concept) |
|---|
| | 94 | */ |
|---|
| | 95 | @Authorized({OpenmrsConstants.PRIV_PURGE_CONCEPTS}) |
|---|
| | 96 | public void deleteConcept(Concept concept) throws APIException; |
|---|
| | 97 | |
|---|
| | 98 | /** |
|---|
| | 99 | * @deprecated use {@link #retireConcept(Concept, String)} |
|---|
| | 100 | */ |
|---|
| | 101 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 102 | public void voidConcept(Concept concept, String reason) throws APIException; |
|---|
| | 103 | |
|---|
| | 104 | /** |
|---|
| | 105 | * Save or update the given <code>Concept</code> or <code>ConceptNumeric</code> in the database |
|---|
| | 106 | * |
|---|
| | 107 | * @param Concept concept The <code>Concept</code> or <code>ConceptNumeric</code> to save or update |
|---|
| | 108 | * @return the <code>Concept</code> or <code>ConceptNumeric</code> that was saved or updated |
|---|
| | 109 | * @throws APIException |
|---|
| | 110 | */ |
|---|
| | 111 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 112 | public Concept saveConcept(Concept concept) throws APIException; |
|---|
| | 113 | |
|---|
| | 114 | /** |
|---|
| | 115 | * Save or update the given <code>Drug</code> in the database |
|---|
| | 116 | * |
|---|
| | 117 | * @param Drug drug The Drug to save or update |
|---|
| | 118 | * @return the Drug that was saved or updated |
|---|
| | 119 | * @throws APIException |
|---|
| | 120 | */ |
|---|
| | 121 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) |
|---|
| | 122 | public Drug saveDrug(Drug drug) throws APIException; |
|---|
| | 123 | |
|---|
| | 124 | /** |
|---|
| | 125 | * Completely purge a <code>Concept</code> or <code>ConceptNumeric</code> from the database. |
|---|
| | 126 | * This should not typically be used unless desperately needed. Most should just be retired. |
|---|
| | 127 | * See {@link #retireConcept(Concept, String)} |
|---|
| | 128 | * |
|---|
| | 129 | * @param Object conceptOrConceptNumeric The <code>Concept</code> or <code>ConceptNumeric</code> to remove from the system |
|---|
| | 130 | * @throws APIException |
|---|
| | 131 | */ |
|---|
| | 132 | @Authorized(OpenmrsConstants.PRIV_PURGE_CONCEPTS) |
|---|
| | 133 | public void purgeConcept(Concept conceptOrConceptNumeric) throws APIException; |
|---|
| | 134 | |
|---|
| | 135 | /** |
|---|
| | 136 | * Retiring a concept essentially removes it from circulation |
|---|
| | 137 | * |
|---|
| | 138 | * @param Concept conceptOrConceptNumeric The <code>Concept</code> or <code>ConceptNumeric</code> to retire |
|---|
| | 139 | * @param String reason The retire reason |
|---|
| | 140 | * @return the retired <code>Concept</code> or <code>ConceptNumeric</code> |
|---|
| | 141 | * @throws APIException |
|---|
| | 142 | */ |
|---|
| | 143 | @Authorized(OpenmrsConstants.PRIV_MANAGE_CONCEPTS) |
|---|
| | 144 | public Concept retireConcept(Concept conceptOrConceptNumeric, String reason) throws APIException; |
|---|
| | 145 | |
|---|
| | 146 | /** |
|---|
| | 147 | * Retiring a Drug essentially removes it from circulation |
|---|
| | 148 | * |
|---|
| | 149 | * @param Drug drug The Drug to retire |
|---|
| | 150 | * @param String reason The retire reason |
|---|
| | 151 | * @throws APIException |
|---|
| | 152 | * @return the retired Drug |
|---|
| | 153 | */ |
|---|
| | 154 | @Authorized(OpenmrsConstants.PRIV_MANAGE_CONCEPTS) |
|---|
| | 155 | public Drug retireDrug(Drug drug, String reason) throws APIException; |
|---|
| | 156 | |
|---|
| | 157 | /** |
|---|
| | 158 | * Completely purge a Drug from the database. This should not typically |
|---|
| | 159 | * be used unless desperately needed. Most Drugs should just be retired. |
|---|
| | 160 | * |
|---|
| | 161 | * @param Drug drug The Drug to remove from the system |
|---|
| | 162 | * @throws APIException |
|---|
| | 163 | */ |
|---|
| | 164 | @Authorized(OpenmrsConstants.PRIV_PURGE_CONCEPTS) |
|---|
| | 165 | public void purgeDrug(Drug drug) throws APIException; |
|---|
| | 166 | |
|---|
| | 167 | /** |
|---|
| | 168 | * Gets the concept with the given id |
|---|
| | 169 | * |
|---|
| | 170 | * @param Integer conceptId |
|---|
| | 171 | * @return the matching Concept object |
|---|
| | 172 | * @throws APIException |
|---|
| | 173 | */ |
|---|
| | 174 | @Transactional(readOnly=true) |
|---|
| | 175 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 176 | public Concept getConcept(Integer conceptId) throws APIException; |
|---|
| | 177 | |
|---|
| | 178 | /** |
|---|
| | 179 | * Gets the ConceptAnswer with the given id |
|---|
| | 180 | * |
|---|
| | 181 | * @param Integer conceptAnswerId |
|---|
| | 182 | * @return the matching ConceptAnswer object |
|---|
| | 183 | * @throws APIException |
|---|
| | 184 | */ |
|---|
| | 185 | @Transactional(readOnly=true) |
|---|
| | 186 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 187 | public ConceptAnswer getConceptAnswer(Integer conceptAnswerId) throws APIException; |
|---|
| | 188 | |
|---|
| | 189 | /** |
|---|
| | 190 | * Get the Drug with the given id |
|---|
| | 191 | * |
|---|
| | 192 | * @param Integer drugId |
|---|
| | 193 | * @return the matching Drug object |
|---|
| | 194 | * @throws APIException |
|---|
| | 195 | */ |
|---|
| | 196 | @Transactional(readOnly=true) |
|---|
| | 197 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 198 | public Drug getDrug(Integer drugId) throws APIException; |
|---|
| | 199 | |
|---|
| | 200 | /** |
|---|
| | 201 | * Get the ConceptNumeric with the given id |
|---|
| | 202 | * |
|---|
| | 203 | * @param Integer conceptId The ConceptNumeric id |
|---|
| | 204 | * @return the matching ConceptNumeric object |
|---|
| | 205 | * @throws APIException |
|---|
| | 206 | */ |
|---|
| | 207 | @Transactional(readOnly=true) |
|---|
| | 208 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 209 | public ConceptNumeric getConceptNumeric(Integer conceptId) throws APIException; |
|---|
| | 210 | |
|---|
| | 211 | /** |
|---|
| | 212 | * Return a Concept class matching the given identifier |
|---|
| | 213 | * @throws APIException |
|---|
| | 214 | * @param i the concept class identifier |
|---|
| | 215 | * @return the matching ConceptClass |
|---|
| | 216 | */ |
|---|
| | 217 | @Transactional(readOnly=true) |
|---|
| | 218 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 219 | public ConceptClass getConceptClass(Integer conceptClassId) throws APIException; |
|---|
| | 220 | |
|---|
| | 221 | /** |
|---|
| | 222 | * Return a list of unretired concepts sorted by concept id ascending and |
|---|
| | 223 | * |
|---|
| | 224 | * @return a List<Concept> object containing all of the sorted concepts |
|---|
| | 225 | * @throws APIException |
|---|
| | 226 | */ |
|---|
| | 227 | @Transactional(readOnly=true) |
|---|
| | 228 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 229 | public List<Concept> getAllConcepts() throws APIException; |
|---|
| | 230 | |
|---|
| | 231 | /** |
|---|
| | 232 | * Return a list of concepts sorted on sortBy in dir direction (asc/desc) |
|---|
| | 233 | * |
|---|
| | 234 | * @param sortBy The property name to sort by; if null or invalid, concept_id is used. |
|---|
| | 235 | * @param boolean asc true = sort ascending; false = sort descending |
|---|
| | 236 | * @param boolean includeRetired If <code>true</code>, retired concepts will also be returned |
|---|
| | 237 | * @return a List<Concept> object containing all of the sorted concepts |
|---|
| | 238 | * @throws APIException |
|---|
| | 239 | */ |
|---|
| | 240 | @Transactional(readOnly=true) |
|---|
| | 241 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 242 | public List<Concept> getAllConcepts(String sortBy, boolean asc, boolean includeRetired) throws APIException; |
|---|
| | 243 | |
|---|
| | 244 | /** |
|---|
| | 245 | * @deprecated use {@link #getAllConcepts(String, boolean, boolean)} |
|---|
| | 246 | */ |
|---|
| | 247 | @Transactional(readOnly=true) |
|---|
| | 248 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 249 | public List<Concept> getConcepts(String sortBy, String dir) throws APIException; |
|---|
| | 250 | |
|---|
| | 251 | /** |
|---|
| | 252 | * Returns a list of concepts matching any part of a concept name |
|---|
| | 253 | * @param String name The search string |
|---|
| | 254 | * @throws APIException |
|---|
| | 255 | * @return a List<Concept> object containing all of the matching concepts |
|---|
| | 256 | */ |
|---|
| | 257 | @Transactional(readOnly=true) |
|---|
| | 258 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 259 | public List<Concept> getConceptsByName(String name) throws APIException; |
|---|
| | 260 | |
|---|
| | 261 | /** |
|---|
| | 262 | * Return a Concept that matches the name exactly |
|---|
| | 263 | * @param String name The search string |
|---|
| | 264 | * @throws APIException |
|---|
| | 265 | * @return the found Concept |
|---|
| | 266 | */ |
|---|
| | 267 | @Transactional(readOnly=true) |
|---|
| | 268 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 269 | public Concept getConceptByName(String name) throws APIException; |
|---|
| | 270 | |
|---|
| | 271 | /** |
|---|
| | 272 | * Get Concepts by id or name |
|---|
| | 273 | * Note: this just calls other impl methods; no DAO of its own |
|---|
| | 274 | * |
|---|
| | 275 | * @param String idOrName |
|---|
| | 276 | * @return the found Concept |
|---|
| | 277 | * @deprecated use {@link #getConceptByName(String)} |
|---|
| | 278 | * @throws APIException |
|---|
| | 279 | */ |
|---|
| | 280 | @Transactional(readOnly=true) |
|---|
| | 281 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 282 | public Concept getConceptByIdOrName(String idOrName) throws APIException; |
|---|
| | 283 | |
|---|
| | 284 | /** |
|---|
| | 285 | * Get Concept by id or name convenience method |
|---|
| | 286 | * |
|---|
| | 287 | * @param String conceptIdOrName |
|---|
| | 288 | * @return the found Concept |
|---|
| | 289 | * @throws APIException |
|---|
| | 290 | */ |
|---|
| | 291 | @Transactional(readOnly=true) |
|---|
| | 292 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 293 | public Concept getConcept(String conceptIdOrName) throws APIException; |
|---|
| | 294 | |
|---|
| | 295 | /** |
|---|
| | 296 | * Searches for concepts by the given parameters via the ConceptWord table |
|---|
| | 297 | * |
|---|
| | 298 | * @param String phrase |
|---|
| | 299 | * @param List<Locale> locales |
|---|
| | 300 | * @param boolean includeRetired |
|---|
| | 301 | * @param List<ConceptClass> requireClasses |
|---|
| | 302 | * @param List<ConceptClass> excludeClasses |
|---|
| | 303 | * @param List<ConceptDatatype> requireDatatypes |
|---|
| | 304 | * @param List<ConceptDatatype> excludeDatatypes |
|---|
| | 305 | * @param answersToConcept all results will be a possible answer to this concept |
|---|
| | 306 | * @param int start |
|---|
| | 307 | * @param int size |
|---|
| | 308 | * @return A List<ConceptWord> object containing all matching ConceptWords |
|---|
| | 309 | * @throws APIException |
|---|
| | 310 | */ |
|---|
| | 311 | @Transactional(readOnly=true) |
|---|
| | 312 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 313 | public List<ConceptWord> getConceptWords(String phrase, List<Locale> locales, boolean includeRetired, |
|---|
| | 314 | List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, |
|---|
| | 315 | List<ConceptDatatype> requireDatatypes,List<ConceptDatatype> excludeDatatypes, |
|---|
| | 316 | Concept answersToConcept, Integer start, Integer size) throws APIException; |
|---|
| | 317 | |
|---|
| | 318 | /** |
|---|
| | 319 | * Convenience method for {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)} |
|---|
| | 320 | * |
|---|
| | 321 | * @param phrase search string |
|---|
| | 322 | * @param locale |
|---|
| 65 | | */ |
|---|
| 66 | | public ConceptComplex getConceptComplex(Integer conceptId); |
|---|
| 67 | | |
|---|
| 68 | | /** |
|---|
| 69 | | * Gets the concept with the given internal identifier |
|---|
| 70 | | * |
|---|
| 71 | | * @param conceptId |
|---|
| 72 | | * @return Concept |
|---|
| 73 | | */ |
|---|
| 74 | | @Transactional(readOnly=true) |
|---|
| 75 | | @Authorized({"View Concepts"}) |
|---|
| 76 | | public Concept getConcept(Integer conceptId); |
|---|
| 77 | | |
|---|
| 78 | | /** |
|---|
| 79 | | * Gets the conceptAnswer with the given internal identifier |
|---|
| 80 | | * |
|---|
| 81 | | * @param conceptAnswerId |
|---|
| 82 | | * @return ConceptAnswer |
|---|
| 83 | | */ |
|---|
| 84 | | @Transactional(readOnly=true) |
|---|
| 85 | | @Authorized({"View Concepts"}) |
|---|
| 86 | | public ConceptAnswer getConceptAnswer(Integer conceptAnswerId); |
|---|
| 87 | | |
|---|
| 88 | | /** |
|---|
| 89 | | * Return a list of concepts sorted on sortBy in dir direction (asc/desc) |
|---|
| 90 | | * |
|---|
| 91 | | * @param sortBy |
|---|
| 92 | | * @param dir |
|---|
| 93 | | * @return List of concepts |
|---|
| 94 | | */ |
|---|
| 95 | | @Transactional(readOnly=true) |
|---|
| 96 | | @Authorized({"View Concepts"}) |
|---|
| 97 | | public List<Concept> getConcepts(String sortBy, String dir); |
|---|
| 98 | | |
|---|
| 99 | | /** |
|---|
| 100 | | * Update the given concept |
|---|
| 101 | | * |
|---|
| 102 | | * @param concept |
|---|
| 103 | | * to be updated |
|---|
| 104 | | */ |
|---|
| 105 | | @Authorized({"Edit Concepts"}) |
|---|
| 106 | | public void updateConcept(Concept concept); |
|---|
| 107 | | |
|---|
| 108 | | /** |
|---|
| 109 | | * Update the given numeric concept |
|---|
| 110 | | * |
|---|
| 111 | | * @param numeric |
|---|
| 112 | | * concept to be updated |
|---|
| 113 | | */ |
|---|
| 114 | | @Authorized({"Edit Concepts"}) |
|---|
| 115 | | public void updateConcept(ConceptNumeric concept); |
|---|
| 116 | | |
|---|
| 117 | | /** |
|---|
| 118 | | * Delete the given concept |
|---|
| 119 | | * |
|---|
| 120 | | * For super users only. If dereferencing concepts, use |
|---|
| 121 | | * <code>voidConcept(org.openmrs.Concept)</code> |
|---|
| 122 | | * |
|---|
| 123 | | * @param Concept |
|---|
| 124 | | * to be deleted |
|---|
| 125 | | */ |
|---|
| 126 | | @Authorized({"Delete Concepts"}) |
|---|
| 127 | | public void deleteConcept(Concept concept); |
|---|
| 128 | | |
|---|
| 129 | | /** |
|---|
| 130 | | * Voiding a concept essentially removes it from circulation |
|---|
| 131 | | * |
|---|
| 132 | | * @param Concept |
|---|
| 133 | | * concept |
|---|
| 134 | | * @param String |
|---|
| 135 | | * reason |
|---|
| 136 | | */ |
|---|
| 137 | | @Authorized({"Edit Concepts"}) |
|---|
| 138 | | public void voidConcept(Concept concept, String reason); |
|---|
| 139 | | |
|---|
| 140 | | /** |
|---|
| 141 | | * @param drug |
|---|
| 142 | | * to be created |
|---|
| 143 | | */ |
|---|
| 144 | | @Authorized({"Add Concepts"}) |
|---|
| 145 | | public void createDrug(Drug drug); |
|---|
| 146 | | |
|---|
| 147 | | /** |
|---|
| 148 | | * Update the given drug |
|---|
| 149 | | * |
|---|
| 150 | | * @param drug |
|---|
| 151 | | * to be updated |
|---|
| 152 | | */ |
|---|
| 153 | | @Authorized({"Edit Concepts"}) |
|---|
| 154 | | public void updateDrug(Drug drug); |
|---|
| 155 | | |
|---|
| 156 | | /** |
|---|
| 157 | | * Return a list of concepts matching "name" anywhere in the name |
|---|
| 158 | | * |
|---|
| 159 | | * @param name |
|---|
| 160 | | * @return List of concepts |
|---|
| 161 | | */ |
|---|
| 162 | | @Transactional(readOnly=true) |
|---|
| 163 | | @Authorized({"View Concepts"}) |
|---|
| 164 | | public List<Concept> getConceptsByName(String name); |
|---|
| 165 | | |
|---|
| 166 | | /** |
|---|
| 167 | | * Return a Concept that matches the name exactly |
|---|
| 168 | | * |
|---|
| 169 | | * @param name |
|---|
| 170 | | * @return Concept with matching name |
|---|
| 171 | | */ |
|---|
| 172 | | @Transactional(readOnly=true) |
|---|
| 173 | | @Authorized({"View Concepts"}) |
|---|
| 174 | | public Concept getConceptByName(String name); |
|---|
| 175 | | |
|---|
| 176 | | /** |
|---|
| 177 | | * Return the drug object corresponding to the given id |
|---|
| 178 | | * |
|---|
| | 324 | * @throws APIException |
|---|
| | 325 | */ |
|---|
| | 326 | @Transactional(readOnly=true) |
|---|
| | 327 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 328 | public List<ConceptWord> getConceptWords(String phrase, Locale locale) throws APIException; |
|---|
| | 329 | |
|---|
| | 330 | /** |
|---|
| | 331 | * @deprecated Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer) |
|---|
| | 332 | */ |
|---|
| | 333 | @Transactional(readOnly=true) |
|---|
| | 334 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 335 | public List<ConceptWord> findConcepts(String phrase, Locale locale, |
|---|
| | 336 | boolean includeRetired) throws APIException; |
|---|
| | 337 | |
|---|
| | 338 | /** |
|---|
| | 339 | * @deprecated Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)} |
|---|
| | 340 | */ |
|---|
| | 341 | @Transactional(readOnly=true) |
|---|
| | 342 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 343 | public List<ConceptWord> findConcepts(String phrase, Locale locale, boolean includeRetired, |
|---|
| | 344 | List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, |
|---|
| | 345 | List<ConceptDatatype> requireDatatypes,List<ConceptDatatype> excludeDatatypes) throws APIException; |
|---|
| | 346 | |
|---|
| | 347 | /** |
|---|
| | 348 | * @deprecated Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer) |
|---|
| | 349 | */ |
|---|
| | 350 | @Transactional(readOnly=true) |
|---|
| | 351 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 352 | public List<ConceptWord> findConcepts(String phrase, Locale locale, |
|---|
| | 353 | boolean includeRetired, int start, int size) throws APIException; |
|---|
| | 354 | |
|---|
| | 355 | /** |
|---|
| | 356 | * Return the drug object corresponding to the given name or drugId |
|---|
| | 357 | * |
|---|
| | 358 | * @param drugNameOrId name or drugId to match exactly on |
|---|
| 191 | | @Authorized({"View Concepts"}) |
|---|
| 192 | | public Drug getDrug(String drugName); |
|---|
| 193 | | |
|---|
| 194 | | @Transactional(readOnly=true) |
|---|
| 195 | | @Authorized({"View Concepts"}) |
|---|
| 196 | | public Drug getDrugByNameOrId(String drugId); |
|---|
| 197 | | |
|---|
| 198 | | |
|---|
| 199 | | /** |
|---|
| 200 | | * Return a list of drugs currently in the database |
|---|
| 201 | | * |
|---|
| 202 | | * @return List of Drugs |
|---|
| 203 | | */ |
|---|
| 204 | | @Transactional(readOnly=true) |
|---|
| 205 | | @Authorized({"View Concepts"}) |
|---|
| 206 | | public List<Drug> getDrugs(); |
|---|
| 207 | | |
|---|
| | 373 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 374 | public Drug getDrugByNameOrId(String drugId) throws APIException; |
|---|
| | 375 | |
|---|
| | 376 | /** |
|---|
| | 377 | * @deprecated use {@link ConceptService#getAllDrugs()} |
|---|
| | 378 | */ |
|---|
| | 379 | @Transactional(readOnly=true) |
|---|
| | 380 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 381 | public List<Drug> getDrugs() throws APIException; |
|---|
| | 382 | |
|---|
| | 383 | /** |
|---|
| | 384 | * Return a list of drugs currently in the database that are |
|---|
| | 385 | * not retired |
|---|
| | 386 | * |
|---|
| | 387 | * @throws APIException |
|---|
| | 388 | * @return a List<Drug> object containing all drugs |
|---|
| | 389 | */ |
|---|
| | 390 | @Transactional(readOnly=true) |
|---|
| | 391 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 392 | public List<Drug> getAllDrugs() throws APIException; |
|---|
| | 393 | |
|---|
| | 394 | /** |
|---|
| | 395 | * @deprecated Use {@link #getDrugsByConcept(Concept)} |
|---|
| | 396 | */ |
|---|
| | 397 | @Transactional(readOnly=true) |
|---|
| | 398 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 399 | public List<Drug> getDrugs(Concept concept) throws APIException; |
|---|
| | 400 | |
|---|
| | 401 | /** |
|---|
| | 402 | * Return a list of drugs associated with the given concept |
|---|
| | 403 | * @throws APIException |
|---|
| | 404 | * @param Concept concept |
|---|
| | 405 | * @return a List<Drug> object containing all matching drugs |
|---|
| | 406 | */ |
|---|
| | 407 | @Transactional(readOnly=true) |
|---|
| | 408 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 409 | public List<Drug> getDrugsByConcept(Concept concept) throws APIException; |
|---|
| | 410 | |
|---|
| | 411 | /** |
|---|
| | 412 | * Get drugs by concept. |
|---|
| | 413 | * This method is the utility method that should be used to generically retrieve all Drugs in the system. |
|---|
| | 414 | * |
|---|
| | 415 | * @param includeRetired If <code>true</code> then the search will include voided Drugs |
|---|
| | 416 | * @return A List<Drug> object containing all matching Drugs |
|---|
| | 417 | */ |
|---|
| | 418 | @Transactional(readOnly=true) |
|---|
| | 419 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 420 | public List<Drug> getAllDrugs(boolean includeRetired); |
|---|
| | 421 | |
|---|
| | 422 | /** |
|---|
| | 423 | * @deprecated Use {@link #getDrugs(String)} |
|---|
| | 424 | */ |
|---|
| | 425 | @Transactional(readOnly=true) |
|---|
| | 426 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 427 | public List<Drug> findDrugs(String phrase, boolean includeVoided) throws APIException; |
|---|
| | 428 | |
|---|
| 244 | | */ |
|---|
| 245 | | @Transactional(readOnly=true) |
|---|
| 246 | | @Authorized({"View Concepts"}) |
|---|
| 247 | | public ConceptClass getConceptClass(Integer i); |
|---|
| 248 | | |
|---|
| 249 | | /** |
|---|
| 250 | | * Return a Concept class matching the given name |
|---|
| 251 | | * |
|---|
| 252 | | * @param name String |
|---|
| 253 | | * @return ConceptClass |
|---|
| 254 | | */ |
|---|
| 255 | | @Transactional(readOnly=true) |
|---|
| 256 | | @Authorized({"View Concepts"}) |
|---|
| 257 | | public ConceptClass getConceptClassByName(String name); |
|---|
| 258 | | |
|---|
| | 466 | * @throws APIException |
|---|
| | 467 | */ |
|---|
| | 468 | @Transactional(readOnly=true) |
|---|
| | 469 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_CLASSES) |
|---|
| | 470 | public ConceptClass getConceptClassByName(String name) throws APIException; |
|---|
| | 471 | |
|---|
| | 472 | /** |
|---|
| | 473 | * Return a list of concept classes currently in the database |
|---|
| | 474 | * |
|---|
| | 475 | * @throws APIException |
|---|
| | 476 | * @return List<ConceptClass> object with all ConceptClass objects |
|---|
| | 477 | */ |
|---|
| | 478 | @Transactional(readOnly=true) |
|---|
| | 479 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_CLASSES) |
|---|
| | 480 | public List<ConceptClass> getAllConceptClasses() throws APIException; |
|---|
| | 481 | |
|---|
| | 482 | /** |
|---|
| | 483 | * Return a list of concept classes currently in the database |
|---|
| | 484 | * |
|---|
| | 485 | * @param include retired concept classes in the search results |
|---|
| | 486 | * @throws APIException |
|---|
| | 487 | * @return List<ConceptClass> object with all ConceptClass objects |
|---|
| | 488 | */ |
|---|
| | 489 | @Transactional(readOnly=true) |
|---|
| | 490 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_CLASSES) |
|---|
| | 491 | public List<ConceptClass> getAllConceptClasses(boolean includeRetired) throws APIException; |
|---|
| | 492 | |
|---|
| | 493 | /** |
|---|
| | 494 | * Creates or updates a concept class |
|---|
| | 495 | * @param ConceptClass to create or update |
|---|
| | 496 | * @throws APIException |
|---|
| | 497 | */ |
|---|
| | 498 | @Authorized(OpenmrsConstants.PRIV_MANAGE_CONCEPT_CLASSES) |
|---|
| | 499 | public ConceptClass saveConceptClass(ConceptClass cc) throws APIException; |
|---|
| | 500 | |
|---|
| | 501 | /** |
|---|
| | 502 | * Purge a ConceptClass |
|---|
| | 503 | * @param ConceptClass to delete |
|---|
| | 504 | * @throws APIException |
|---|
| | 505 | */ |
|---|
| | 506 | @Authorized(OpenmrsConstants.PRIV_PURGE_CONCEPT_CLASSES) |
|---|
| | 507 | public void purgeConceptClass(ConceptClass cc) throws APIException; |
|---|
| | 508 | |
|---|
| | 509 | /** |
|---|
| | 510 | * Create or update a ConceptDatatype |
|---|
| | 511 | * @param ConceptDatatype to create or update |
|---|
| | 512 | * @throws APIException |
|---|
| | 513 | */ |
|---|
| | 514 | @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPT_DATATYPES}) |
|---|
| | 515 | public ConceptDatatype saveConceptDatatype(ConceptDatatype cd) throws APIException; |
|---|
| | 516 | |
|---|
| | 517 | /** |
|---|
| | 518 | * Purge a ConceptDatatype. This removes the concept datatype from the database completely. |
|---|
| | 519 | * @param ConceptDatatype to purge |
|---|
| | 520 | * @throws APIException |
|---|
| | 521 | */ |
|---|
| | 522 | @Authorized(OpenmrsConstants.PRIV_PURGE_CONCEPT_DATATYPES) |
|---|
| | 523 | public void purgeConceptDatatype(ConceptDatatype cd) throws APIException; |
|---|
| | 524 | |
|---|
| 305 | | * @param concept |
|---|
| 306 | | */ |
|---|
| 307 | | @Transactional(readOnly=true) |
|---|
| 308 | | @Authorized({"View Concepts"}) |
|---|
| 309 | | public List<ConceptSet> getSetsContainingConcept(Concept concept); |
|---|
| 310 | | |
|---|
| 311 | | /** |
|---|
| 312 | | * @return Returns all concepts in a given class |
|---|
| 313 | | */ |
|---|
| 314 | | @Transactional(readOnly=true) |
|---|
| 315 | | @Authorized({"View Concepts"}) |
|---|
| 316 | | public List<Concept> getConceptsByClass(ConceptClass cc); |
|---|
| 317 | | |
|---|
| 318 | | /** |
|---|
| 319 | | * Return a concept numeric object given the concept id |
|---|
| 320 | | * |
|---|
| 321 | | * @return ConceptNumeric |
|---|
| 322 | | */ |
|---|
| 323 | | @Transactional(readOnly=true) |
|---|
| 324 | | @Authorized({"View Concepts"}) |
|---|
| 325 | | public ConceptNumeric getConceptNumeric(Integer conceptId); |
|---|
| 326 | | |
|---|
| 327 | | /** |
|---|
| 328 | | * Searches on given phrase via the concept word table |
|---|
| | 633 | * @param Concept concept |
|---|
| | 634 | * @throws APIException |
|---|
| | 635 | * @return A List<ConceptSet> object with all parent concept sets |
|---|
| | 636 | */ |
|---|
| | 637 | @Transactional(readOnly=true) |
|---|
| | 638 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) |
|---|
| | 639 | public List<ConceptSet> getSetsContainingConcept(Concept concept) throws APIException; |
|---|
| | 640 | |
|---|
| | 641 | /** |
|---|
| | 642 | * @deprecated use {@link #getAllConceptProposals(boolean)} |
|---|
| | 643 | */ |
|---|
| | 644 | @Transactional(readOnly=true) |
|---|
| | 645 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) |
|---|
| | 646 | public List<ConceptProposal> getConceptProposals(boolean includeCompleted) throws APIException; |
|---|
| | 647 | |
|---|
| | 648 | /** |
|---|
| | 649 | * Get a List of all concept proposals |
|---|
| | 650 | * |
|---|
| | 651 | * @param boolean includeCompleted |
|---|
| | 652 | * @return a List<ConceptProposal> object of all found ConceptProposals |
|---|
| | 653 | * @throws APIException |
|---|
| | 654 | */ |
|---|
| | 655 | @Transactional(readOnly=true) |
|---|
| | 656 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) |
|---|
| | 657 | public List<ConceptProposal> getAllConceptProposals(boolean includeCompleted) throws APIException; |
|---|
| | 658 | |
|---|
| | 659 | /** |
|---|
| | 660 | * Get a ConceptProposal by conceptProposalId |
|---|
| | 661 | * |
|---|
| | 662 | * @param Integer conceptProposalId the concept proposal Id |
|---|
| | 663 | * @return the found ConceptProposal |
|---|
| | 664 | * @throws APIException |
|---|
| | 665 | */ |
|---|
| | 666 | @Transactional(readOnly=true) |
|---|
| | 667 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) |
|---|
| | 668 | public ConceptProposal getConceptProposal(Integer conceptProposalId) throws APIException; |
|---|
| | 669 | |
|---|
| | 670 | /** |
|---|
| | 671 | * find matching concept proposals |
|---|
| | 672 | * |
|---|
| | 673 | * @param String text |
|---|
| | 674 | * @return a List<ConceptProposal> object containing all concept proposals |
|---|
| | 675 | * @throws APIException |
|---|
| | 676 | */ |
|---|
| | 677 | @Transactional(readOnly=true) |
|---|
| | 678 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) |
|---|
| | 679 | public List<ConceptProposal> getConceptProposals(String text) throws APIException; |
|---|
| | 680 | |
|---|
| | 681 | /** |
|---|
| | 682 | * @deprecated Use #getConceptProposals(String) and then retrieve the Concepts out of the ConceptProposals... |
|---|
| | 683 | */ |
|---|
| | 684 | @Transactional(readOnly=true) |
|---|
| | 685 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) |
|---|
| | 686 | public List<Concept> findProposedConcepts(String text) throws APIException; |
|---|
| | 687 | |
|---|
| | 688 | /** |
|---|
| | 689 | * find matching concept proposals and return a list of the proposed concepts |
|---|
| | 690 | * |
|---|
| | 691 | * @param text |
|---|
| | 692 | * @return |
|---|
| | 693 | * @throws APIException |
|---|
| | 694 | */ |
|---|
| | 695 | @Transactional(readOnly=true) |
|---|
| | 696 | @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) |
|---|
| | 697 | public List<Concept> getProposedConcepts(String text) throws APIException; |
|---|
| | 698 | |
|---|
| | 699 | |
|---|
| | 700 | /** |
|---|
| | 701 | * Searches on given phrase via the concept word table within a sorted list of Locales |
|---|