- Timestamp:
- 05/16/08 18:28:28 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/branches/api_refactoring/src/api/org/openmrs/api/ConceptService.java
r4231 r4240 34 34 * Contains methods pertaining to creating/updating/deleting/retiring 35 35 * Concepts, Drugs, Concept Proposals, and all other things 'Concept' 36 * 37 * Use: 38 * <code> 39 * List<Concept> concepts = Context.getConceptService().getAllConcepts(); 40 * </code> 41 * 42 * @see org.openmrs.api.context.Context 36 43 */ 37 44 @Transactional … … 47 54 48 55 /** 49 * Create a new Concept50 * @param Concept concept The concept to be created51 * @throws APIException52 56 * @deprecated use #saveConcept(Concept) 53 57 */ … … 56 60 57 61 /** 58 * Create a new Numeric Concept 59 * @param ConceptNumeric concept The numeric concept to be created 60 * @throws APIException 61 * @deprecated use #saveConceptNumeric(ConceptNumeric) 62 * @deprecated use #saveConcept(Concept) 62 63 */ 63 64 @Authorized({OpenmrsConstants.PRIV_ADD_CONCEPTS}) … … 65 66 66 67 /** 67 * Update the given concept68 * @param Concept concept The concept to be updated69 * @throws APIException70 68 * @deprecated use #saveConcept(Concept) 71 69 */ … … 74 72 75 73 /** 76 * Update the given numeric concept 77 * @param ConceptNumeric concept The numeric concept to be updated 78 * @throws APIException 79 * @deprecated use #saveConceptNumeric(ConceptNumeric) 74 * @deprecated use #saveConcept(Concept) 80 75 */ 81 76 @Authorized({OpenmrsConstants.PRIV_EDIT_CONCEPTS}) … … 83 78 84 79 /** 85 * Create the given drug86 * @param Drug drug The drug to be created87 * @throws APIException88 80 * @deprecated use #saveDrug(Drug) 89 81 */ … … 92 84 93 85 /** 94 * Update the given drug95 * @param Drug drug The drug to be updated96 * @throws APIException97 86 * @deprecated use #saveDrug(Drug) 98 87 */ … … 101 90 102 91 /** 103 * Delete the given concept104 *105 * For super users only. If dereferencing concepts, use106 * <code>retireConcept(Concept, String)</code>107 * @param Concept concept The concept to be deleted108 92 * @deprecated use #purgeConcept(Concept concept) 109 * @throws APIException110 93 */ 111 94 @Authorized({OpenmrsConstants.PRIV_DELETE_CONCEPTS}) … … 113 96 114 97 /** 115 * Voiding a concept essentially removes it from circulation 116 * 117 * @param Concept concept 118 * @param String reason 119 * @throws APIException 120 * @deprecated use #retireConcept 98 * @deprecated use {@link #retireConcept(Concept, String)} 121 99 */ 122 100 @Authorized({"Edit Concepts"}) … … 147 125 * This should not typically be used unless desperately needed. Most should just be retired. 148 126 * See {@link #retireConcept(Concept, String)} 149 * This should be used instead of deleteConcept(Concept)150 127 * 151 128 * @param Object conceptOrConceptNumeric The <code>Concept</code> or <code>ConceptNumeric</code> to remove from the system … … 155 132 public void purgeConcept(Concept conceptOrConceptNumeric) throws APIException; 156 133 157 158 134 /** 159 135 * Retiring a concept essentially removes it from circulation … … 167 143 public Concept retireConcept(Concept conceptOrConceptNumeric, String reason) throws APIException; 168 144 169 170 145 /** 171 146 * Retiring a Drug essentially removes it from circulation … … 177 152 */ 178 153 @Authorized(OpenmrsConstants.PRIV_MANAGE_CONCEPTS) 179 public Drug voidDrug(Drug drug, String reason) throws APIException;154 public Drug retireDrug(Drug drug, String reason) throws APIException; 180 155 181 156 /** … … 244 219 245 220 /** 221 * Return a list of unretired concepts sorted by concept id ascending and 222 * 223 * @return a List<Concept> object containing all of the sorted concepts 224 * @throws APIException 225 */ 226 @Transactional(readOnly=true) 227 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 228 public List<Concept> getAllConcepts() throws APIException; 229 230 /** 246 231 * Return a list of concepts sorted on sortBy in dir direction (asc/desc) 247 * This is the method that should be used to generically return all concepts248 232 * 249 233 * @param String sortBy The property name to sort by; if null or invalid, concept_id is used. … … 255 239 @Transactional(readOnly=true) 256 240 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 257 public List<Concept> getConcepts(String sortBy, boolean asc, boolean includeRetired) throws APIException; 258 259 260 /** 261 * 262 * Returns a list of concepts by concept class and retired or not retired. 263 * 264 * @param cc A concept class 265 * @param includeRetired 266 * @return a List object containing all of the matching concepts 267 * @throws APIException 268 */ 269 @Transactional(readOnly=true) 270 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 271 public List<Concept> getConcepts(ConceptClass cc, boolean includeRetired) throws APIException; 272 273 /** 274 * 275 * Gets a list of concepts with an optional search on phrase argument that allows for finding by phrase 276 * 277 * @param name 278 * @param loc 279 * @param includeRetired 280 * @param searchOnPhrase 281 * @return a List of Concepts matching the search criteria. 282 * @throws APIException 283 */ 284 public List<Concept> getConcepts(String name, Locale loc, boolean includeRetired, boolean searchOnPhrase) throws APIException; 285 286 /** 287 * Return a list of unvoided concepts sorted on sortBy in dir direction (asc/desc) 288 * 289 * @param String sortBy The concept property value to sort on 290 * @param String dir The sort direction (asc/desc) 291 * @return a List<Concept> object containing all of the sorted concepts 292 * @deprecated use getConcepts(String, boolean, boolean) 293 * @throws APIException 241 public List<Concept> getAllConcepts(String sortBy, boolean asc, boolean includeRetired) throws APIException; 242 243 /** 244 * @deprecated use {@link #getAllConcepts(String, boolean, boolean)} 294 245 */ 295 246 @Transactional(readOnly=true) 296 247 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 297 248 public List<Concept> getConcepts(String sortBy, String dir) throws APIException; 298 299 249 300 250 /** … … 302 252 * @param String name The search string 303 253 * @throws APIException 304 * @deprecated use getConcepts(String, Locale, boolean, boolean)305 254 * @return a List<Concept> object containing all of the matching concepts 306 255 */ … … 313 262 * @param String name The search string 314 263 * @throws APIException 315 * @deprecated Use getConcept(String, Locale, boolean).316 264 * @return the found Concept 317 265 */ … … 321 269 322 270 /** 323 *324 271 * Get Concepts by id or name 325 272 * Note: this just calls other impl methods; no DAO of its own … … 327 274 * @param String idOrName 328 275 * @return the found Concept 329 * @deprecated use getConcept(...)276 * @deprecated use {@link #getConceptByName(String)} 330 277 * @throws APIException 331 278 */ … … 335 282 336 283 /** 337 *338 284 * Get Concept by id or name convenience method 339 285 * … … 345 291 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 346 292 public Concept getConcept(String conceptIdOrName) throws APIException; 347 348 /**349 * Returns a concept by either name or id, locale, and retired status350 *351 * @param String idOrName352 * @param Locale locale353 * @param boolean includeRetired If <code>true</code> the search will include retired Concepts354 * @return the matching Concept355 * @throws APIException356 */357 @Transactional(readOnly=true)358 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS)359 public Concept getConcept(String name, Locale locale, boolean includeRetired) throws APIException;360 293 361 294 /** … … 369 302 * @param List<ConceptDatatype> requireDatatypes 370 303 * @param List<ConceptDatatype> excludeDatatypes 304 * @param answersToConcept all results will be a possible answer to this concept 371 305 * @param int start 372 306 * @param int size … … 376 310 @Transactional(readOnly=true) 377 311 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 378 public List<ConceptWord> getConcept s(String phrase, List<Locale> locales, boolean includeRetired,312 public List<ConceptWord> getConceptWords(String phrase, List<Locale> locales, boolean includeRetired, 379 313 List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, 380 314 List<ConceptDatatype> requireDatatypes,List<ConceptDatatype> excludeDatatypes, 381 Integer start, Integer size) throws APIException; 382 383 /** 384 * @deprecated Use {@link #getConcepts(String, List, boolean, List, List, List, List, Integer, Integer) 315 Concept answersToConcept, Integer start, Integer size) throws APIException; 316 317 /** 318 * Convenience method for {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)} 319 * 320 * @param phrase search string 321 * @param locale 322 * @return 323 * @throws APIException 324 */ 325 @Transactional(readOnly=true) 326 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 327 public List<ConceptWord> getConceptWords(String phrase, Locale locale) throws APIException; 328 329 /** 330 * @deprecated Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer) 385 331 */ 386 332 @Transactional(readOnly=true) … … 390 336 391 337 /** 392 * @deprecated Use {@link #getConcept s(String, List, boolean, List, List, List, List, Integer, Integer)}338 * @deprecated Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer)} 393 339 */ 394 340 @Transactional(readOnly=true) … … 399 345 400 346 /** 401 * 402 * Finds concepts but only returns the given range 403 * 404 * @param phrase 405 * @param locale 406 * @param includeRetired 407 * @param start 408 * @param size 409 * @return ConceptWord list 410 * @throws APIException 411 * @deprecated Use getConcepts(...) 347 * @deprecated Use {@link #getConceptWords(String, List, boolean, List, List, List, List, Integer, Integer) 412 348 */ 413 349 @Transactional(readOnly=true) … … 416 352 boolean includeRetired, int start, int size) throws APIException; 417 353 418 419 /** 420 * Return the drug object corresponding to the given name 421 * @param String drugName 422 * @throws APIException 423 * @deprecated use getDrug(String, Locale, boolean) 354 /** 355 * Return the drug object corresponding to the given name or drugId 356 * 357 * @param drugNameOrId name or drugId to match exactly on 424 358 * @return Drug 425 * /426 427 @Transactional(readOnly=true) 428 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 429 public Drug getDrug(String drugName ) throws APIException;359 * @throws APIException 360 */ 361 @Transactional(readOnly=true) 362 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 363 public Drug getDrug(String drugNameOrId) throws APIException; 430 364 431 365 /** … … 433 367 * @param String drugId 434 368 * @throws APIException 435 * @deprecated use #getDrug(...)436 369 * @return Drug 437 370 */ … … 439 372 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 440 373 public Drug getDrugByNameOrId(String drugId) throws APIException; 441 442 /** 443 * Find a drug by drugName or id 444 * 445 * @param drugNameOrId 446 * @param locale 447 * @param includeVoided If <code>true</code> then the search will include retired Drugs 448 * @return The matching Drug object 449 * @throws APIException 450 */ 451 @Transactional(readOnly=true) 452 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 453 public Drug getDrug(String drugNameOrId, boolean includeVoided) throws APIException; 454 455 /** 456 * Return a list of drugs currently in the database 374 375 /** 376 * @deprecated use {@link ConceptService#getAllDrugs()} 377 */ 378 @Transactional(readOnly=true) 379 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 380 public List<Drug> getDrugs() throws APIException; 381 382 /** 383 * Return a list of drugs currently in the database that are 384 * not retired 385 * 457 386 * @throws APIException 458 387 * @return a List<Drug> object containing all drugs 459 * @deprecated use getDrugs(boolean) 460 */ 461 @Transactional(readOnly=true) 462 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 463 public List<Drug> getDrugs() throws APIException; 388 */ 389 @Transactional(readOnly=true) 390 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 391 public List<Drug> getAllDrugs() throws APIException; 392 393 /** 394 * @deprecated Use {@link #getDrugsByConcept(Concept)} 395 */ 396 @Transactional(readOnly=true) 397 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 398 public List<Drug> getDrugs(Concept concept) throws APIException; 464 399 465 400 /** … … 468 403 * @param Concept concept 469 404 * @return a List<Drug> object containing all matching drugs 470 * @deprecated Use getDrugs(...) instead 471 */ 472 @Transactional(readOnly=true) 473 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 474 public List<Drug> getDrugs(Concept concept) throws APIException; 475 476 /** 477 * Get drugs by concept 478 * 479 * @param Concept concept 480 * @param includeRetired If <code>true</code> then the search will include retired Drugs 481 * @return A List<Drug> object containing all matching Drugs 482 * @throws APIException 483 */ 484 @Transactional(readOnly=true) 485 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 486 public List<Drug> getDrugs(Concept concept, boolean includeVoided); 405 */ 406 @Transactional(readOnly=true) 407 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 408 public List<Drug> getDrugsByConcept(Concept concept) throws APIException; 487 409 488 410 /** … … 490 412 * This method is the utility method that should be used to generically retrieve all Drugs in the system. 491 413 * 492 * @param include Voided If <code>true</code> then the search will include voided Drugs414 * @param includeRetired If <code>true</code> then the search will include voided Drugs 493 415 * @return A List<Drug> object containing all matching Drugs 494 416 */ 495 417 @Transactional(readOnly=true) 496 418 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 497 public List<Drug> getDrugs(boolean includeVoided); 419 public List<Drug> getAllDrugs(boolean includeRetired); 420 421 /** 422 * @deprecated Use {@link #getDrugs(String)} 423 */ 424 @Transactional(readOnly=true) 425 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 426 public List<Drug> findDrugs(String phrase, boolean includeVoided) throws APIException; 498 427 499 428 /** … … 502 431 * 503 432 * @param String phrase 504 * @param boolean includeRetired if <code>true</code> then retired drugs will be included in the search433 * @param Locale locale 505 434 * @throws APIException 506 435 * @return A List<Drug> object containing all Drug matches 507 * @deprecated Use findDrugs(String, Locale, boolean) 508 */ 509 @Transactional(readOnly=true) 510 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 511 public List<Drug> findDrugs(String phrase, boolean includeVoided) throws APIException; 512 513 /** 514 * Find drugs in the system. The string search can match either drug.name or 515 * drug.concept.name 516 * 517 * @param String phrase 518 * @param boolean includeVoided if <code>true</code> then voided drugs will be included in the search 519 * @param Locale locale 520 * @throws APIException 521 * @return A List<Drug> object containing all Drug matches 522 */ 523 @Transactional(readOnly=true) 524 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 525 public List<Drug> getDrugs(String phrase, boolean includeVoided) throws APIException; 436 */ 437 @Transactional(readOnly=true) 438 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 439 public List<Drug> getDrugs(String phrase) throws APIException; 526 440 527 441 /** … … 529 443 * @return Returns all concepts in a given class 530 444 * @throws APIException 531 * @deprecated use findConcepts(...)532 445 */ 533 446 @Transactional(readOnly=true) … … 539 452 * @throws APIException 540 453 * @return List<ConceptClass> object with all ConceptClass objects 541 * @deprecated use getAllConceptClasses(boolean)542 */ 543 @Transactional(readOnly=true) 544 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT S)454 * @deprecated use #getAllConceptClasses(boolean) 455 */ 456 @Transactional(readOnly=true) 457 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_CLASSES) 545 458 public List<ConceptClass> getConceptClasses() throws APIException; 546 459 … … 550 463 * @param String name 551 464 * @return ConceptClass 552 * @deprecated Use getConceptClass(String) 553 * @throws APIException 554 */ 555 @Transactional(readOnly=true) 556 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 465 * @throws APIException 466 */ 467 @Transactional(readOnly=true) 468 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_CLASSES) 557 469 public ConceptClass getConceptClassByName(String name) throws APIException; 558 470 559 471 /** 560 * Return a Concept class matching the given name561 *562 * @param String name563 * @return the matching ConceptClass564 * @throws APIException565 */566 @Transactional(readOnly=true)567 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS)568 public ConceptClass getConceptClass(String name) throws APIException;569 570 /**571 472 * Return a list of concept classes currently in the database 473 * 474 * @throws APIException 475 * @return List<ConceptClass> object with all ConceptClass objects 476 */ 477 @Transactional(readOnly=true) 478 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_CLASSES) 479 public List<ConceptClass> getAllConceptClasses() throws APIException; 480 481 /** 482 * Return a list of concept classes currently in the database 483 * 572 484 * @param include retired concept classes in the search results 573 485 * @throws APIException … … 575 487 */ 576 488 @Transactional(readOnly=true) 577 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT S)578 public List<ConceptClass> getAllConceptClasses( ) throws APIException;489 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_CLASSES) 490 public List<ConceptClass> getAllConceptClasses(boolean includeRetired) throws APIException; 579 491 580 492 /** … … 582 494 * @param ConceptClass to create or update 583 495 * @throws APIException 584 * 585 */ 586 @Authorized(OpenmrsConstants.PRIV_MANAGE_CONCEPTS) 496 */ 497 @Authorized(OpenmrsConstants.PRIV_MANAGE_CONCEPT_CLASSES) 587 498 public ConceptClass saveConceptClass(ConceptClass cc) throws APIException; 588 499 589 590 500 /** 591 501 * Purge a ConceptClass … … 593 503 * @throws APIException 594 504 */ 595 @Authorized(OpenmrsConstants.PRIV_PURGE_CONCEPT S)505 @Authorized(OpenmrsConstants.PRIV_PURGE_CONCEPT_CLASSES) 596 506 public void purgeConceptClass(ConceptClass cc) throws APIException; 597 598 507 599 508 /** … … 604 513 @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) 605 514 public ConceptDatatype saveConceptDatatype(ConceptDatatype cd) throws APIException; 606 607 515 608 516 /** … … 611 519 * @throws APIException 612 520 */ 613 @Authorized( {OpenmrsConstants.PRIV_PURGE_CONCEPTS})521 @Authorized(OpenmrsConstants.PRIV_PURGE_CONCEPT_DATATYPES) 614 522 public void purgeConceptDatatype(ConceptDatatype cd) throws APIException; 615 523 616 524 /** 617 525 * Return a list of concept datatypes currently in the database 526 * 618 527 * @throws APIException 619 528 * @return List of ConceptDatatypes 620 529 */ 621 530 @Transactional(readOnly=true) 622 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 623 public List<ConceptDatatype> getConceptDatatypes() throws APIException; 624 531 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_DATATYPES) 532 public List<ConceptDatatype> getAllConceptDatatypes() throws APIException; 533 534 /** 535 * Return a list of concept datatypes currently in the database 536 * 537 * @param includeRetired true/false whether to include the retired datatypes 538 * @throws APIException 539 * @return List of ConceptDatatypes 540 */ 541 @Transactional(readOnly=true) 542 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_DATATYPES) 543 public List<ConceptDatatype> getAllConceptDatatypes(boolean includeRetired) throws APIException; 544 545 /** 546 * Find concept datatypes that contain the given name string 547 * 548 * @param name 549 * @return 550 * @throws APIException 551 */ 552 @Transactional(readOnly=true) 553 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_DATATYPES) 554 public List<ConceptDatatype> getConceptDatatypes(String name) throws APIException; 555 625 556 /** 626 557 * Return a ConceptDatatype matching the given identifier … … 630 561 */ 631 562 @Transactional(readOnly=true) 632 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT S)563 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_DATATYPES) 633 564 public ConceptDatatype getConceptDatatype(Integer i) throws APIException; 634 565 … … 638 569 * @param String name 639 570 * @return ConceptDatatype 640 * @deprecated Use getConceptDataType(String) 641 * @throws APIException 642 */ 643 @Transactional(readOnly=true) 644 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 571 * @throws APIException 572 */ 573 @Transactional(readOnly=true) 574 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_DATATYPES) 645 575 public ConceptDatatype getConceptDatatypeByName(String name) throws APIException; 646 647 /**648 * Return a Concept datatype matching the given name649 *650 * @param String name651 * @return The matching ConceptDatatype object652 * @throws APIException653 */654 @Transactional(readOnly=true)655 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS)656 public ConceptDatatype getConceptDatatype(String name) throws APIException;657 658 576 659 577 /** … … 671 589 @Authorized({OpenmrsConstants.PRIV_MANAGE_CONCEPTS}) 672 590 public void updateConceptSetDerived() throws APIException; 591 592 /** 593 * @deprecated use {@link #getConceptSetsByConcept(Concept)} 594 */ 595 @Transactional(readOnly=true) 596 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 597 public List<ConceptSet> getConceptSets(Concept concept) throws APIException; 673 598 674 599 /** … … 677 602 * getConceptSets(getConcept("ANTIRETROVIRAL MEDICATIONS")) 678 603 * and then take the conceptIds from the resulting list. 604 * 679 605 * @param Concept concept The concept representing the concept set 680 606 * @return A List<ConceptSet> object containing all matching ConceptSets … … 683 609 @Transactional(readOnly=true) 684 610 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 685 public List<ConceptSet> getConceptSets(Concept concept) throws APIException; 611 public List<ConceptSet> getConceptSetsByConcept(Concept concept) throws APIException; 612 613 /** 614 * @deprecated use {@link #getConceptsByConceptSet(Concept)} 615 */ 616 @Transactional(readOnly=true) 617 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 618 public List<Concept> getConceptsInSet(Concept concept) throws APIException; 686 619 687 620 /** … … 691 624 * @throws APIException 692 625 */ 693 694 @Transactional(readOnly=true) 695 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 696 public List<Concept> getConceptsInSet(Concept concept) throws APIException; 626 @Transactional(readOnly=true) 627 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 628 public List<Concept> getConceptsByConceptSet(Concept concept) throws APIException; 697 629 698 630 /** … … 706 638 public List<ConceptSet> getSetsContainingConcept(Concept concept) throws APIException; 707 639 640 /** 641 * @deprecated use {@link #getAllConceptProposals(boolean)} 642 */ 643 @Transactional(readOnly=true) 644 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) 645 public List<ConceptProposal> getConceptProposals(boolean includeCompleted) throws APIException; 708 646 709 647 /** … … 715 653 */ 716 654 @Transactional(readOnly=true) 717 @Authorized(OpenmrsConstants.PRIV_ ADD_CONCEPT_PROPOSAL)718 public List<ConceptProposal> get ConceptProposals(boolean includeCompleted) throws APIException;719 655 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) 656 public List<ConceptProposal> getAllConceptProposals(boolean includeCompleted) throws APIException; 657 720 658 /** 721 659 * Get a ConceptProposal by conceptProposalId … … 726 664 */ 727 665 @Transactional(readOnly=true) 728 @Authorized(OpenmrsConstants.PRIV_ ADD_CONCEPT_PROPOSAL)666 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) 729 667 public ConceptProposal getConceptProposal(Integer conceptProposalId) throws APIException; 730 668 731 669 /** 732 *733 670 * find matching concept proposals 734 671 * … … 738 675 */ 739 676 @Transactional(readOnly=true) 740 @Authorized(OpenmrsConstants.PRIV_ ADD_CONCEPT_PROPOSAL)677 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) 741 678 public List<ConceptProposal> getConceptProposals(String text) throws APIException; 742 679 743 680 /** 744 * 745 * find matching concept proposals and return a list of the proposed concepts 746 * 747 * @param text 748 * @return a List<Concept> object containing all proposed concepts 749 * @throws APIException 750 * @deprecated Use getConceptProposals(String) and then retrieve the Concepts out of the ConceptProposals... 751 */ 752 @Transactional(readOnly=true) 753 @Authorized(OpenmrsConstants.PRIV_ADD_CONCEPT_PROPOSAL) 681 * @deprecated Use #getConceptProposals(String) and then retrieve the Concepts out of the ConceptProposals... 682 */ 683 @Transactional(readOnly=true) 684 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 754 685 public List<Concept> findProposedConcepts(String text) throws APIException; 755 686 756 757 758 /** 759 * 687 /** 760 688 * find matching concept proposals and return a list of the proposed concepts 761 689 * … … 765 693 */ 766 694 @Transactional(readOnly=true) 767 @Authorized(OpenmrsConstants.PRIV_ ADD_CONCEPT_PROPOSAL)695 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPT_PROPOSALS) 768 696 public List<Concept> getProposedConcepts(String text) throws APIException; 769 697 770 771 /** 772 * 773 * Convenience method for proposing a Concept 774 * 775 * @param ConceptProposal conceptProposal the proposed concept 776 * @throws APIException 777 * @deprecated 778 * 779 */ 780 @Authorized(OpenmrsConstants.PRIV_ADD_CONCEPT_PROPOSAL) 698 /** 699 * @deprecated use {@link #saveConceptProposal(ConceptProposal)} 700 */ 701 @Authorized(OpenmrsConstants.PRIV_ADD_CONCEPT_PROPOSALS) 781 702 public void proposeConcept(ConceptProposal conceptProposal) throws APIException; 782 703 … … 788 709 * @return the saved/update ConceptProposal object 789 710 */ 790 @Authorized( OpenmrsConstants.PRIV_ADD_CONCEPT_PROPOSAL)711 @Authorized({OpenmrsConstants.PRIV_ADD_CONCEPT_PROPOSALS, OpenmrsConstants.PRIV_EDIT_CONCEPT_PROPOSALS}) 791 712 public ConceptProposal saveConceptProposal(ConceptProposal conceptProposal) throws APIException; 792 713 793 714 /** 794 *795 715 * Removes a concept proposal from the database entirely. 796 716 * … … 798 718 * @throws APIException 799 719 */ 800 @Authorized(OpenmrsConstants.PRIV_ MANAGE_CONCEPT_PROPOSAL)720 @Authorized(OpenmrsConstants.PRIV_PURGE_CONCEPT_PROPOSALS) 801 721 public void purgeConceptProposal(ConceptProposal cp) throws APIException; 802 /**803 *722 723 /** 804 724 * Maps a concept proposal to a concept 805 725 * 806 726 * @param cp 807 727 * @param mappedConcept 808 * @throws APIException 809 */ 810 @Authorized(OpenmrsConstants.PRIV_ADD_CONCEPT_PROPOSAL) 811 public void mapConceptProposalToConcept(ConceptProposal cp, 728 * @return the mappedConcept 729 * @throws APIException 730 */ 731 @Authorized(OpenmrsConstants.PRIV_MANAGE_CONCEPTS) 732 public Concept mapConceptProposalToConcept(ConceptProposal cp, 812 733 Concept mappedConcept) throws APIException; 813 734 814 735 /** 815 * 816 * Rejects a concept proposal 817 * 818 * @param cp 819 * @throws APIException 820 */ 821 @Authorized(OpenmrsConstants.PRIV_MANAGE_CONCEPT_PROPOSAL) 736 * @deprecated use {@link ConceptProposal#rejectConceptProposal()} 737 */ 738 @Authorized(OpenmrsConstants.PRIV_EDIT_CONCEPT_PROPOSALS) 822 739 public void rejectConceptProposal(ConceptProposal cp) throws APIException; 823 740 824 741 825 742 /** 826 * 827 * Find concept proposals by original text 828 * 829 * @param text 830 * @return 831 * @deprecated use getConceptProposals(String) 832 */ 833 @Authorized(OpenmrsConstants.PRIV_ADD_CONCEPT_PROPOSAL) 743 * @deprecated use {@link ConceptService#getConceptProposals(String)} 744 */ 745 @Authorized(OpenmrsConstants.PRIV_ADD_CONCEPT_PROPOSALS) 834 746 public List<ConceptProposal> findMatchingConceptProposals(String text); 747 748 /** 749 * @deprecated use {@link #getConceptAnswers(String, Locale, Concept)} 750 */ 751 @Transactional(readOnly=true) 752 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 753 public List<ConceptWord> findConceptAnswers(String phrase, Locale locale, 754 Concept concept, boolean includeRetired) throws APIException; 835 755 836 756 /** … … 839 759 * @param String phrase 840 760 * @param Locale locale 841 * @param Concept concept 842 * @param boolean includeRetired 761 * @param Concept concept the answers to match on 843 762 * @return List<ConceptWord> object 844 763 * @throws APIException … … 846 765 @Transactional(readOnly=true) 847 766 @Authorized(OpenmrsConstants.PRIV_VIEW_CONCEPTS) 848 public List<ConceptWord> findConceptAnswers(String phrase, Locale locale, 849 Concept concept, boolean includeRetired) throws APIException; 850 851 /** 852 * Get the questions that have this concept as a possible answer 853 * 854 * @param concept concept 855 * @return List<Concept> object of all possible Concepts 856 * @throws APIException 857 * @deprecated use getConceptsByAnswer(Concepts) 767 public List<ConceptWord> getConceptAnswers(String phrase, Locale locale, 768 Concept concept) throws APIException; 769 770 /** 771 * @deprecated use #getConceptsByAnswer(Concept) 858 772 */ 859 773 @Transactional(readOnly=true) … … 874 788 875 789 /** 876 * Finds the previous concept 790 * Finds the previous concept in the dictionary that has the next 791 * lowest concept id 877 792 * 878 793 * @param Concept concept the offset Concept … … 885 800 886 801 /** 887 * Finds the next concept 802 * Finds the next concept in the dictionary that has the next 803 * largest concept id 804 * 888 805 * @param Concept concept the offset Concept 889 806 * @return the foundConcept … … 894 811 public Concept getNextConcept(Concept concept) throws APIException; 895 812 896 897 /** 898 * 899 * Get the next available conceptId