Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/28/08 05:16:52 (8 months ago)
Author:
bmckown
Message:

complex_obs branch: Merging trunk to complex-obs [3891] [4378] TODO: sqldiff.

Files:

Legend:

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

    • Property svn:eol-style set to CRLF
    r4239 r4417  
    2727import org.openmrs.ConceptWord; 
    2828import org.openmrs.Drug; 
    29 import org.openmrs.api.APIException
     29import org.openmrs.api.ConceptService
    3030 
    3131/** 
    3232 * Concept-related database functions 
    33  * @version 1.0 
     33 *  
     34 * @see ConceptService 
    3435 */ 
    3536public interface ConceptDAO { 
    3637 
    3738        /** 
    38          * @param Concept to be created 
    39          */ 
    40        public void createConcept(Concept concept)
    41          
    42         /** 
    43          * @param Numeric concept to be created 
    44          */ 
    45        public void createConcept(ConceptNumeric concept)
    46          
    47         public void saveConcept(ConceptComplex concept); 
     39         * @see org.openmrs.api.ConceptService#saveConcept(org.openmrs.Concept) 
     40         */ 
     41    public Concept saveConcept(Concept concept) throws DAOException
     42         
     43        /** 
     44         * @see org.openmrs.api.ConceptService#purgeConcept(org.openmrs.Concept) 
     45         */ 
     46    public void purgeConcept(Concept concept)throws DAOException
     47         
     48        public ConceptComplex saveConcept(ConceptComplex concept); 
    4849         
    4950        public ConceptComplex getConceptComplex(Integer conceptId); 
    5051         
    5152        /** 
    52          * Gets the concept with the given internal identifier 
    53          * @param conceptId 
    54          * @return Concept 
    55          */ 
    56         public Concept getConcept(Integer conceptId); 
    57          
    58         /** 
    59          * Gets the conceptAnswer with the given internal identifier 
    60          * @param conceptAnswerId 
    61          * @return ConceptAnswer 
    62          */ 
    63         public ConceptAnswer getConceptAnswer(Integer conceptAnswerId); 
    64  
    65         /** 
    66          * Return a list of concepts sorted on sortBy in direction 
    67          * @param sortBy 
    68          * @param direction 
    69          * @return List of concepts 
    70          */ 
    71         public List<Concept> getConcepts(String sortBy, String direction); 
    72          
    73         /** 
    74          * Update the given concept 
    75          * @param concept to be updated 
    76          */ 
    77         public void updateConcept(Concept concept); 
    78          
    79         /** 
    80          * Update the given numeric concept 
    81          * @param numeric concept to be updated 
    82          */ 
    83         public void updateConcept(ConceptNumeric concept); 
    84          
    85         /** 
    86          * Delete the given concept 
    87          *  
    88          * For super users only.  If dereferencing concepts, use <code>voidConcept(org.openmrs.Concept)</code> 
    89          *  
    90          * @param Concept to be deleted 
    91          */ 
    92         public void deleteConcept(Concept concept); 
    93          
    94         /** 
    95          * Voiding a concept essentially removes it from circulation 
    96          * @param Concept concept 
    97          * @param String reason 
    98          */ 
    99         public void voidConcept(Concept concept, String reason); 
    100          
    101         /** 
    102          * @param Drug to be created 
    103          */ 
    104         public void createDrug(Drug drug); 
    105          
    106         /** 
    107          * Update the given drug 
    108          * @param drug to be updated 
    109          */ 
    110         public void updateDrug(Drug drug); 
    111          
    112         /** 
    113          * Return a list of concepts matching "name" anywhere in the name 
    114          * @param name 
    115          * @return List of concepts 
    116          */ 
    117         public List<Concept> getConceptsByName(String name); 
    118          
    119         /** 
    120          * Return a Concept that matches the name exactly 
     53         * @see org.openmrs.api.ConceptService#purgeDrug(org.openmrs.Drug) 
     54         */ 
     55    public void purgeDrug(Drug drug) throws DAOException; 
     56         
     57        /** 
     58         * @see org.openmrs.api.ConceptService#saveDrug(org.openmrs.Drug) 
     59         */ 
     60    public Drug saveDrug(Drug drug) throws DAOException; 
     61 
     62        /** 
     63         * @see org.openmrs.api.ConceptService#getConcept(java.lang.Integer) 
     64         */ 
     65        public Concept getConcept(Integer conceptId) throws DAOException; 
     66         
     67        /** 
     68     * @see org.openmrs.api.ConceptService#getAllConcepts(java.lang.String, boolean, boolean) 
     69         */ 
     70    public List<Concept> getAllConcepts(String sortBy, boolean asc, boolean includeRetired) throws DAOException; 
     71         
     72        /** 
     73         * Returns a list of concepts based on the search criteria 
    12174         *  
    12275         * @param name 
    123          * @return Concept with matching name 
    124          */ 
    125         public Concept getConceptByName(String name); 
    126          
    127         /** 
    128          * Return drug object corresponding to the given id 
    129          * @return Drug 
    130          */ 
    131         public Drug getDrug(Integer drugId); 
    132          
    133         /** 
    134          * Return drug object corresponding to the given name 
    135          * @return Drug 
    136          */ 
    137         public Drug getDrug(String drugName); 
    138          
    139         /** 
    140          * Return a list of drugs currently in the database 
    141          * @return List of Drugs 
    142          */ 
    143         public List<Drug> getDrugs(); 
    144          
    145         /** 
    146          * Find drugs in the system. 
    147          * The string search can match either drug.name or drug.concept.name 
    148          * @param phrase 
     76         * @param loc 
     77         * @param searchOnPhrase  This puts wildcard characters around the concept name search criteria 
     78         * @return List<Concept> 
     79         * @throws DAOException 
     80         */ 
     81        public List<Concept> getConcepts(String name, Locale loc, boolean searchOnPhrase, List<ConceptClass> classes, List<ConceptDatatype> datatypes) throws DAOException; 
     82         
     83        /** 
     84         * @see org.openmrs.api.ConceptService#getConceptWords(java.lang.String, java.util.Locale, boolean, java.util.List, java.util.List, java.util.List, java.util.List, Concept, int, int) 
     85         */ 
     86        public List<ConceptWord> getConceptWords(String phrase, List<Locale> locales, boolean includeRetired,  
     87                                                        List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, 
     88                                                        List<ConceptDatatype> requireDatatypes,List<ConceptDatatype> excludeDatatypes, 
     89                                                        Concept answersToConcept, Integer start, Integer size) throws DAOException; 
     90         
     91        /** 
     92         * @see org.openmrs.api.ConceptService#getConceptAnswer(java.lang.Integer) 
     93         */ 
     94        public ConceptAnswer getConceptAnswer(Integer conceptAnswerId) throws DAOException; 
     95         
     96        /** 
     97         * @see org.openmrs.api.ConceptService#getDrug(java.lang.Integer) 
     98         */ 
     99        public Drug getDrug(Integer drugId) throws DAOException; 
     100         
     101        /** 
     102         * DAO for retrieving a list of drugs based on the following criteria 
     103         *  
     104         * @param drugName 
     105         * @param concept 
    149106         * @param includeRetired 
    150          * @return List of Drugs 
    151          */ 
    152         public List<Drug> findDrugs(String phrase, boolean includeRetired); 
    153          
    154         /** 
    155          * Return a list of drugs associated with this concept 
    156          * @param Concept 
    157          * @return List of Drugs 
    158          */ 
    159         public List<Drug> getDrugs(Concept c); 
    160          
    161         /** 
    162          * Return a list of concept classes currently in the database 
    163          * @return List of Concept class objects 
    164          */ 
    165         public List<ConceptClass> getConceptClasses(); 
    166          
    167         /** 
    168          * Return a Concept class matching the given identifier 
    169          * @param i Integer 
    170          * @return ConceptClass 
    171          */ 
    172         public ConceptClass getConceptClass(Integer i); 
    173          
    174         /** 
    175          * Return a Concept class matching the given identifier 
    176          * @param name String 
    177          * @return ConceptClass 
    178          */ 
    179         public ConceptClass getConceptClassByName(String name); 
    180          
    181         /** 
    182          * Return a list of concept datatypes currently in the database 
    183          * @return List of ConceptDatatypes 
    184          */ 
    185         public List<ConceptDatatype> getConceptDatatypes(); 
    186          
    187         /** 
    188          * Return concept datatype with given name 
    189          * @param name 
    190          * @return 
    191          */ 
    192         public ConceptDatatype getConceptDatatypeByName(String name); 
    193          
    194         /** 
    195          * Return a ConceptDatatype matching the given identifier 
    196          * @return ConceptDatatype 
    197          */ 
    198         public ConceptDatatype getConceptDatatype(Integer i); 
    199          
    200         /** 
    201          * Return a list of the concept sets with concept_set matching concept  
    202          * @return List 
    203          */ 
    204         public List<ConceptSet> getConceptSets(Concept c); 
     107         * @return List<Drug> 
     108         * @throws DAOException 
     109         */ 
     110        public List<Drug> getDrugs(String drugName, Concept concept, boolean includeRetired) throws DAOException; 
     111         
     112        /** 
     113         * @see org.openmrs.api.ConceptService#getDrugs(java.lang.String) 
     114         */ 
     115        public List<Drug> getDrugs(String phrase) throws DAOException; 
     116         
     117        /** 
     118         * @see org.openmrs.api.ConceptService#getConceptClass(java.lang.Integer) 
     119         */ 
     120        public ConceptClass getConceptClass(Integer i) throws DAOException; 
     121         
     122        /** 
     123         * @see org.openmrs.api.ConceptService#getConceptClassByName(java.lang.String) 
     124         */ 
     125        public List<ConceptClass> getConceptClasses(String name) throws DAOException; 
     126         
     127        /** 
     128     * @see org.openmrs.api.ConceptService#getAllConceptClasses(boolean) 
     129         */ 
     130        public List<ConceptClass> getAllConceptClasses(boolean includeRetired) throws DAOException; 
     131         
     132        /** 
     133         * @see org.openmrs.api.ConceptService#saveConceptClass(org.openmrs.ConceptClass) 
     134         */ 
     135        public ConceptClass saveConceptClass(ConceptClass cc) throws DAOException; 
     136         
     137        /** 
     138         * @see org.openmrs.api.ConceptService#purgeConceptClass(org.openmrs.ConceptClass) 
     139         */ 
     140        public void purgeConceptClass(ConceptClass cc) throws DAOException; 
     141         
     142        /** 
     143         * @see org.openmrs.api.ConceptService#getAllConceptDatatypes(boolean) 
     144         */ 
     145        public List<ConceptDatatype> getAllConceptDatatypes(boolean includeRetired) throws DAOException; 
     146         
     147        /** 
     148         * @see org.openmrs.api.ConceptService#getConceptDatatypes(java.lang.String) 
     149         */ 
     150        public List<ConceptDatatype> getConceptDatatypes(String name) throws DAOException; 
     151         
     152        /** 
     153         * @see org.openmrs.api.ConceptService#getConceptDatatype(java.lang.Integer) 
     154         */ 
     155        public ConceptDatatype getConceptDatatype(Integer i) throws DAOException; 
     156         
     157        /** 
     158         * @see org.openmrs.api.ConceptService#saveConceptDatatype(org.openmrs.ConceptDatatype) 
     159         */ 
     160        public ConceptDatatype saveConceptDatatype(ConceptDatatype cd) throws DAOException; 
     161         
     162        /** 
     163         * @see org.openmrs.api.ConceptService#purgeConceptDatatype(org.openmrs.ConceptDatatype) 
     164         */ 
     165        public void purgeConceptDatatype(ConceptDatatype cd) throws DAOException; 
     166         
     167        /** 
     168         * @see org.openmrs.api.ConceptService#updateConceptSetDerived(org.openmrs.Concept) 
     169         */ 
     170        public void updateConceptSetDerived(Concept concept) throws DAOException; 
     171         
     172        /** 
     173         * @see org.openmrs.api.ConceptService#updateConceptSetDerived() 
     174         */ 
     175        public void updateConceptSetDerived() throws DAOException; 
     176         
     177        /** 
     178     * @see org.openmrs.api.ConceptService#getConceptSetsByConcept(org.openmrs.Concept) 
     179         */ 
     180    public List<ConceptSet> getConceptSetsByConcept(Concept c) throws DAOException; 
    205181         
    206182        /** 
    207183         * @see org.openmrs.api.ConceptService#getSetsContainingConcept(org.openmrs.Concept) 
    208184         */ 
    209         public List<ConceptSet> getSetsContainingConcept(Concept concept); 
    210          
    211         /** 
    212          * Return a concept numeric object given the concept id 
    213          * @return ConceptNumeric 
    214          */ 
    215         public ConceptNumeric getConceptNumeric(Integer conceptId); 
    216  
    217         /** 
    218          * Searches on given phrase via the concept word table 
    219          * @param phrase/search/words String 
    220          * @param locale Locale 
    221          * @param includeRetired boolean 
    222          * @param requireClasses List<ConceptClass> 
    223          * @param excludeClasses List<ConceptClass> 
    224          * @param requireDatatypes List<ConceptDatatype> 
    225          * @param excludeDatatypes List<ConceptDatatype> 
    226          * @return 
    227          */ 
    228         public List<ConceptWord> findConcepts(String phrase, Locale locale, boolean includeRetired,  
    229                         List<ConceptClass> requireClasses, List<ConceptClass> excludeClasses, 
    230                         List<ConceptDatatype> requireDatatypes, List<ConceptDatatype> excludeDatatypes); 
    231          
    232         /** 
    233          * Searches on given phrase via the concept word table 
    234          * Restricts on answers to the given concept 
    235          *  
    236          * @param phrase/search/words String 
    237          * @param locale Locale 
    238          * @param Concept 
    239          * @param includeRetired boolean 
    240          * @return list of concept words 
    241          */ 
    242         public List<ConceptWord> findConceptAnswers(String phrase, Locale locale, Concept concept, boolean includeRetired); 
    243          
    244         /** 
    245          * Get the questions that have this concept as a possible answer 
    246          *  
    247          * @param concept Concept to get  
    248          * @return list of concepts 
    249          */ 
    250         public List<Concept> getQuestionsForAnswer(Concept concept); 
    251          
    252         /** 
    253          * Finds the previous available concept via concept id   
    254          * @param c 
    255          * @param offset 
    256          * @return 
    257          */ 
    258         public Concept getPrevConcept(Concept c);  
    259  
    260         /** 
    261          * Finds the next available concept via concept id   
    262          * @param c 
    263          * @param offset 
    264          * @return 
    265          */ 
    266         public Concept getNextConcept(Concept c);  
    267  
    268         /** 
    269          * Returns a list of ConceptProposals currently in the database 
    270          * @param includeComplete 
    271          * @return 
    272          */ 
    273         public List<ConceptProposal> getConceptProposals(boolean includeComplete); 
    274          
    275         public ConceptProposal getConceptProposal(Integer i); 
    276          
    277         public List<ConceptProposal> findMatchingConceptProposals(String text) throws APIException; 
    278          
    279         /** 
    280          * Looks in the proposed concepts table for a completed proposed concept that  
    281          * has the same text  
    282          * @param text 
    283          * @return 
    284          */ 
    285         public List<Concept> findProposedConcepts(String text); 
    286          
    287         public void proposeConcept(ConceptProposal cp); 
    288          
    289         public Integer getNextAvailableId(); 
    290  
    291         public List<Concept> getConceptsByClass(ConceptClass cc); 
    292          
    293         public List<Concept> getConceptsWithDrugsInFormulary(); 
     185        public List<ConceptSet> getSetsContainingConcept(Concept concept) throws DAOException; 
     186         
     187        /** 
     188         * @see org.openmrs.api.ConceptService#getConceptNumeric(java.lang.Integer) 
     189         */ 
     190        public ConceptNumeric getConceptNumeric(Integer conceptId) throws DAOException; 
     191 
     192        /** 
     193         * @see org.openmrs.api.ConceptService#getConceptsByAnswer(org.openmrs.Concept) 
     194         */ 
     195        public List<Concept> getConceptsByAnswer(Concept concept)throws DAOException; 
     196         
     197        /** 
     198         * @see org.openmrs.api.ConceptService#getPrevConcept(org.openmrs.Concept) 
     199         */ 
     200        public Concept getPrevConcept(Concept c) throws DAOException;  
     201         
     202        /** 
     203         * @see org.openmrs.api.ConceptService#getNextConcept(org.openmrs.Concept) 
     204         */ 
     205        public Concept getNextConcept(Concept c) throws DAOException;  
     206         
     207        /** 
     208         * @see org.openmrs.api.ConceptService#getAllConceptProposals(boolean) 
     209         */ 
     210        public List<ConceptProposal> getAllConceptProposals(boolean includeComplete) throws DAOException ; 
     211 
     212        /** 
     213         * @see org.openmrs.api.ConceptService#getConceptProposal(java.lang.Integer) 
     214         */ 
     215        public ConceptProposal getConceptProposal(Integer i) throws DAOException; 
     216 
     217        /** 
     218         * @see org.openmrs.api.ConceptService#getConceptProposals(java.lang.String) 
     219         */ 
     220        public List<ConceptProposal> getConceptProposals(String text) throws DAOException; 
     221         
     222        /** 
     223         * @see org.openmrs.api.ConceptService#getProposedConcepts(java.lang.String) 
     224         */ 
     225        public List<Concept> getProposedConcepts(String text) throws DAOException;  
     226         
     227        /** 
     228     * @see org.openmrs.api.ConceptService#saveConceptProposal(org.openmrs.ConceptProposal) 
     229     */ 
     230    public ConceptProposal saveConceptProposal(ConceptProposal cp) throws DAOException; 
     231         
     232        /** 
     233     * @see org.openmrs.api.ConceptService#purgeConceptProposal(org.openmrs.ConceptProposal) 
     234         */ 
     235    public void purgeConceptProposal(ConceptProposal cp) throws DAOException; 
     236         
     237    /** 
     238         * @see org.openmrs.api.ConceptService#getNextAvailableId() 
     239         */ 
     240        public Integer getNextAvailableId() throws DAOException; 
     241         
     242        /** 
     243         * @see org.openmrs.api.ConceptService#getConceptsWithDrugsInFormulary() 
     244         */ 
     245        public List<Concept> getConceptsWithDrugsInFormulary() throws DAOException; 
     246 
     247        /** 
     248         * @see org.openmrs.api.ConceptService#updateConceptWord(org.openmrs.Concept) 
     249         */ 
     250        public void updateConceptWord(Concept concept) throws DAOException; 
    294251         
    295252}