Changeset 3847 for openmrs/trunk/src/api/org/openmrs/api/ObsService.java
- Timestamp:
- 04/07/08 14:31:55 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/trunk/src/api/org/openmrs/api/ObsService.java
r3685 r3847 16 16 import java.util.Date; 17 17 import java.util.List; 18 import java.util.Map;19 18 import java.util.Set; 20 19 … … 30 29 import org.openmrs.logic.Constraint; 31 30 import org.openmrs.reporting.PatientSet; 31 import org.openmrs.util.OpenmrsConstants; 32 32 import org.springframework.transaction.annotation.Transactional; 33 33 34 /** 35 * The ObsService provides methods for acting on Obs, ObsGroup, and 36 * ComplexObs objects. 37 * 38 * Use: 39 * <code> 40 * Context.getObsService().getObs(123); 41 * </code> 42 * 43 * There are also a number of convenience methods for extracting obs 44 * pertaining to certain Concepts, people, or encounters 45 * 46 */ 34 47 @Transactional 35 48 public interface ObsService { … … 47 60 * @throws APIException 48 61 */ 62 @Authorized({OpenmrsConstants.PRIV_ADD_OBS}) 49 63 public void createObs(Obs obs) throws APIException; 50 64 51 65 /** 52 66 * Create a grouping of observations (observations linked by 53 * obs.obs_group_id) 54 * 55 * @param obs - 56 * array of observations to be grouped 57 * @throws APIException 58 */ 67 * {@link org.openmrs.Obs#getObsGroupId()} 68 * 69 * The proper use is: 70 * <pre> 71 * Obs obsGroup = new Obs(); 72 * for (Obs member : obs) { 73 * obsGroup.addGroupMember(obs); 74 * } 75 * pass obsGroup to {@link #createObs(Obs)} 76 * </pre> 77 * 78 * @param obs array of observations to be grouped 79 * @throws APIException 80 * @deprecated This method should no longer need to be called on the api. This 81 * was meant as temporary until we created a true ObsGroup pojo. 82 * Replaced by {@link #createObsGroup(Obs, List)} 83 * 84 * @see #createObsGroup(Obs, List) 85 */ 86 @Authorized({OpenmrsConstants.PRIV_ADD_OBS}) 59 87 public void createObsGroup(Obs[] obs) throws APIException; 60 88 … … 68 96 */ 69 97 @Transactional(readOnly = true) 98 @Authorized({OpenmrsConstants.PRIV_VIEW_OBS}) 70 99 public Obs getObs(Integer obsId) throws APIException; 71 100 … … 76 105 * @throws APIException 77 106 */ 107 @Authorized({OpenmrsConstants.PRIV_EDIT_OBS}) 78 108 public void updateObs(Obs obs) throws APIException; 79 109 … … 87 117 * @throws APIException 88 118 */ 119 @Authorized({OpenmrsConstants.PRIV_EDIT_OBS}) 89 120 public void voidObs(Obs obs, String reason) throws APIException; 90 121 … … 95 126 * @throws APIException 96 127 */ 128 @Authorized({OpenmrsConstants.PRIV_EDIT_OBS}) 97 129 public void unvoidObs(Obs obs) throws APIException; 98 130 … … 104 136 * @see voidObs(Obs) 105 137 */ 138 @Authorized({OpenmrsConstants.PRIV_DELETE_OBS}) 106 139 public void deleteObs(Obs obs) throws APIException; 107 140 108 141 /** 109 142 * Get all mime types