Changeset 4897
- Timestamp:
- 07/10/08 13:50:09 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/branches/complex-obs/src/api/org/openmrs/api/impl/ObsServiceImpl.java
r4785 r4897 44 44 /** 45 45 * Default implementation of the Observation Service 46 * 46 * 47 47 * @see org.openmrs.api.ObsService 48 48 */ … … 56 56 /** 57 57 * Report handlers that have been registered. 58 * 58 * 59 59 * This is filled via {@link #setHandlers(Map)} and spring's 60 60 * applicationContext-service.xml object … … 80 80 public Obs saveObs(Obs obs, String changeMessage) throws APIException { 81 81 // save or update complex obs 82 if (obs. isComplex() && null != obs.getComplexData().getData()) {82 if (obs.getConcept().isComplex() && null != obs.getComplexData().getData()) { 83 83 ComplexObsHandler handler = getHandler(obs); 84 84 if (null != handler) { … … 163 163 /** 164 164 * Voids an Obs 165 * 165 * 166 166 * If the Obs argument is an obsGroup, all group members will be voided. 167 * 167 * 168 168 * @see org.openmrs.api.ObsService#voidObs(org.openmrs.Obs, 169 169 * java.lang.String) … … 208 208 * Convenience method that recursively finds all 209 209 * child/grandchild/greatgrandchild group members of the given parentObs 210 * 210 * 211 211 * @param parentObs 212 212 * @param childMembers … … 225 225 /** 226 226 * Unvoids an Obs 227 * 227 * 228 228 * If the Obs argument is an obsGroup, all group members with the same 229 229 * dateVoided will also be unvoided. 230 * 230 * 231 231 * @see org.openmrs.api.ObsService#unvoidObs(org.openmrs.Obs) 232 232 * @param Obs obs the Obs to unvoid … … 388 388 * <code>searchString</code> with the patient's identifier, encounterId, 389 389 * and obsId 390 * 390 * 391 391 * @see org.openmrs.api.ObsService#getObservations(java.lang.String) 392 392 */ … … 441 441 /** 442 442 * Correct use case: 443 * 443 * 444 444 * <pre> 445 445 * Obs parent = new Obs(); 446 446 * Obs child1 = new Obs(); 447 447 * Obs child2 = new Obs(); 448 * 448 * 449 449 * parent.addGroupMember(child1); 450 450 * parent.addGroupMember(child2); 451 451 * </pre> 452 * 452 * 453 453 * @deprecated This method should no longer need to be called on the api. 454 454 * This was meant as temporary until we created a true ObsGroup 455 455 * pojo. 456 * 456 * 457 457 * @see org.openmrs.api.ObsService#createObsGroup(org.openmrs.Obs[]) 458 458 */ … … 565 565 * Convenience method for turning a string like "location.locationId asc, 566 566 * obs.valueDatetime desc" into a list of strings to sort on 567 * 567 * 568 568 * @param sort string 569 569 * @return simple list of strings to sort on without asc/desc … … 592 592 * This method should be removed when all methods using an Integer 593 593 * personType are removed. 594 * 594 * 595 595 * This method does a bitwise compare on <code>personType</code> and 596 596 * returns a list of PERSON_TYPEs that are comparable 597 * 597 * 598 598 * @param personType Integer corresponding to {@link ObsService#PERSON}, 599 599 * {@link ObsService#USER}, or {@link ObsService#PATIENT}, … … 630 630 return obsSet; 631 631 } 632 632 633 633 public List<Obs> getObservationsByPersonAndConcept(Person who, Concept question) throws APIException { 634 634 List<Person> whom = new Vector<Person>(); … … 637 637 List<Concept> questions = new Vector<Concept>(); 638 638 questions.add(question); 639 639 640 640 return getObservations(whom, null, questions, null, null, null, null, null, null, null, null, false); 641 641 } … … 862 862 Date fromDate, Date toDate) { 863 863 List<Person> persons = new Vector<Person>(); 864 864 865 865 if (patients != null) 866 866 for (Integer memberId : patients.getMemberIds()) 867 867 persons.add(new Person(memberId)); 868 868 869 869 return getObservations(persons, null, concepts, null, null, null, null, null, null, fromDate, toDate, false); 870 870 } … … 881 881 return obs; 882 882 } 883 883 884 884 /** 885 885 * @see org.openmrs.api.ObsService#getAllComplexObs() … … 920 920 /** 921 921 * Voids an Obs 922 * 922 * 923 923 * If the Obs argument is an obsGroup, all group members will be voided. 924 * 924 * 925 925 * @see org.openmrs.api.ObsService#voidObs(org.openmrs.Obs, 926 926 * java.lang.String) … … 935 935 * Obs.isComplexObs() is false or there is an error instantiating the 936 936 * handler class. 937 * 937 * 938 938 * @param obs A complex Obs. 939 939 * @return ComplexObsHandler for the complex Obs. or null on error. … … 974 974 /** 975 975 * ADDs handlers...doesn't replace them. 976 * 976 * 977 977 * @see org.openmrs.api.ObsService#setHandlers(Map) 978 978 */