Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/19/08 23:47:49 (6 months ago)
Author:
bmckown
Message:

complex_obs branch: Added ability to override handlers via Spring. Added methods to update and purge ComplexData from the file system. Added support for multiple mime types in ImageHandler based on file name. Added temporary files complexObsList.jsp and complexObsForm.jsp

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/branches/complex-obs/src/api/org/openmrs/api/ObsService.java

    r4239 r4265  
    1414package org.openmrs.api; 
    1515 
    16 import java.util.Collection; 
    1716import java.util.Date; 
    1817import java.util.List; 
     
    106105         * Obs with its ComplexData. Otherwise returns a simple Obs. 
    107106         *  
     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         *  
    108113         * @param obsId 
    109114         * @return Obs with a ComplexData 
     
    111116        @Transactional(readOnly = true) 
    112117        @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; 
    114132 
    115133        /** 
     
    122140        @Transactional(readOnly = true) 
    123141        @Authorized( { OpenmrsConstants.PRIV_VIEW_OBS }) 
    124         public ComplexData getComplexData(Integer obsId) throws APIException; 
     142        public ComplexData getComplexData(Integer obsId, String view) throws APIException; 
    125143 
    126144        /** 
     
    133151        @Transactional(readOnly = true) 
    134152        @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         
    137164        /** 
    138165         * Save changes to observation 
     
    383410                List<Concept> concepts, Date fromDate, Date toDate); 
    384411 
    385          
    386         /** 
    387          * @return All registered ComplexObsHandler  
    388          */ 
    389         @Transactional(readOnly=true) 
     412        /** 
     413         * @return All registered ComplexObsHandler 
     414         */ 
     415        @Transactional(readOnly = true) 
    390416        public List<ComplexObsHandler> getComplexObsHandlers(); 
    391417 
     
    396422         * @return 
    397423         */ 
    398         @Transactional(readOnly=true) 
     424        @Transactional(readOnly = true) 
    399425        public ComplexObsHandler getHandler(Class<? extends ComplexObsHandler> clazz); 
    400          
     426 
    401427        /** 
    402428         * Get the ComplexObsHandler 
     
    405431         * @return 
    406432         */ 
    407         @Transactional(readOnly=true) 
     433        @Transactional(readOnly = true) 
    408434        public ComplexObsHandler getHandler(String className); 
    409435 
     
    415441         * @param handlers Map of class to handler object 
    416442         */ 
    417         public void setHandlers(Map<String, ComplexObsHandler> handlers) throws APIException; 
    418          
     443        public void setHandlers(Map<String, ComplexObsHandler> handlers) 
     444                throws APIException; 
     445 
    419446        /** 
    420447         * Gets the handlers map registered to this report service 
     
    424451         */ 
    425452        public Map<String, ComplexObsHandler> getHandlers() throws APIException; 
    426          
     453 
    427454        /** 
    428455         * Registers the given handler with the service 
     
    432459         * @throws APIException 
    433460         */ 
    434         public void registerHandler(String key, ComplexObsHandler handler) throws APIException; 
    435          
     461        public void registerHandler(String key, ComplexObsHandler handler) 
     462                throws APIException; 
     463 
    436464        /** 
    437465         * Convenience method for {@link #registerHandler(Class, ComplexObsHandler)} 
     
    440468         * @throws APIException 
    441469         */ 
    442         public void registerHandler(String key, String handlerClass) throws APIException; 
    443          
     470        public void registerHandler(String key, String handlerClass) 
     471                throws APIException; 
     472 
    444473        /** 
    445474         * Remove the handler associated with <code>handlerClass</code> from the 
     
    449478         */ 
    450479        public void removeHandler(String handlerClass) throws APIException; 
    451          
    452          
     480 
    453481}