- Timestamp:
- 05/19/08 23:47:49 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/branches/complex-obs/src/api/org/openmrs/api/ObsService.java
r4239 r4265 14 14 package org.openmrs.api; 15 15 16 import java.util.Collection;17 16 import java.util.Date; 18 17 import java.util.List; … … 106 105 * Obs with its ComplexData. Otherwise returns a simple Obs. 107 106 * 107 * TODO: Possibly remove this method. It is confusing because you may have a 108 * complexObs, but not want the complexData attached at the time. 109 * Nevertheless, you may think that this method is necessary to use, when 110 * you could just call getObs(). This will attach the complexData onto the 111 * obs. 112 * 108 113 * @param obsId 109 114 * @return Obs with a ComplexData … … 111 116 @Transactional(readOnly = true) 112 117 @Authorized( { OpenmrsConstants.PRIV_VIEW_OBS }) 113 public Obs getComplexObs(Integer obsId) throws APIException; 118 public Obs getComplexObs(Integer obsId, String view) throws APIException; 119 120 /** 121 * This is meant to be a temporary method for development purposes in order 122 * to get a list of all ComplexObs. This does <bold>not</bold> attach a 123 * ComplexData object onto the ComplexObs. TODO: Probably should not have 124 * this method exist in production. 125 * 126 * @return 127 * @throws APIException 128 */ 129 @Transactional(readOnly = true) 130 @Authorized( { OpenmrsConstants.PRIV_VIEW_OBS }) 131 public List<Obs> getAllComplexObs() throws APIException; 114 132 115 133 /** … … 122 140 @Transactional(readOnly = true) 123 141 @Authorized( { OpenmrsConstants.PRIV_VIEW_OBS }) 124 public ComplexData getComplexData(Integer obsId ) throws APIException;142 public ComplexData getComplexData(Integer obsId, String view) throws APIException; 125 143 126 144 /** … … 133 151 @Transactional(readOnly = true) 134 152 @Authorized( { OpenmrsConstants.PRIV_VIEW_OBS }) 135 public ComplexData getComplexData(Obs obs) throws APIException; 136 153 public ComplexData getComplexData(Obs obs, String view) throws APIException; 154 155 /** 156 * Completely removes the ComplexData from its storage location. 157 * 158 * @param obs 159 * @return boolean true if successfully removed. 160 */ 161 @Authorized( {OpenmrsConstants.PRIV_DELETE_OBS}) 162 public boolean purgeComplexData(Obs obs) throws APIException; 163 137 164 /** 138 165 * Save changes to observation … … 383 410 List<Concept> concepts, Date fromDate, Date toDate); 384 411 385 386 /** 387 * @return All registered ComplexObsHandler 388 */ 389 @Transactional(readOnly=true) 412 /** 413 * @return All registered ComplexObsHandler 414 */ 415 @Transactional(readOnly = true) 390 416 public List<ComplexObsHandler> getComplexObsHandlers(); 391 417 … … 396 422 * @return 397 423 */ 398 @Transactional(readOnly =true)424 @Transactional(readOnly = true) 399 425 public ComplexObsHandler getHandler(Class<? extends ComplexObsHandler> clazz); 400 426 401 427 /** 402 428 * Get the ComplexObsHandler … … 405 431 * @return 406 432 */ 407 @Transactional(readOnly =true)433 @Transactional(readOnly = true) 408 434 public ComplexObsHandler getHandler(String className); 409 435 … … 415 441 * @param handlers Map of class to handler object 416 442 */ 417 public void setHandlers(Map<String, ComplexObsHandler> handlers) throws APIException; 418 443 public void setHandlers(Map<String, ComplexObsHandler> handlers) 444 throws APIException; 445 419 446 /** 420 447 * Gets the handlers map registered to this report service … … 424 451 */ 425 452 public Map<String, ComplexObsHandler> getHandlers() throws APIException; 426 453 427 454 /** 428 455 * Registers the given handler with the service … … 432 459 * @throws APIException 433 460 */ 434 public void registerHandler(String key, ComplexObsHandler handler) throws APIException; 435 461 public void registerHandler(String key, ComplexObsHandler handler) 462 throws APIException; 463 436 464 /** 437 465 * Convenience method for {@link #registerHandler(Class, ComplexObsHandler)} … … 440 468 * @throws APIException 441 469 */ 442 public void registerHandler(String key, String handlerClass) throws APIException; 443 470 public void registerHandler(String key, String handlerClass) 471 throws APIException; 472 444 473 /** 445 474 * Remove the handler associated with <code>handlerClass</code> from the … … 449 478 */ 450 479 public void removeHandler(String handlerClass) throws APIException; 451 452 480 453 481 }