Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 5378

Show
Ignore:
Timestamp:
08/28/08 00:49:18 (3 months ago)
Author:
nribeka
Message:

patient matching module: modified patientToRecord method and remove duplicate entry in the report file.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/patientmatching/src/org/openmrs/module/patientmatching/PatientMatchingActivator.java

    r5361 r5378  
    226226            List<String> listExcludedProperties = new ArrayList<String>(); 
    227227             
    228             Class[] classes = {Patient.class, PersonAddress.class, PersonName.class}; 
    229228            List<String> propertyList = new ArrayList<String>(); 
    230             for (Class clazz : classes) { 
    231                 propertyList.addAll(MatchingConfigUtilities.introspectBean(listExcludedProperties, clazz)); 
    232             } 
     229            propertyList.addAll(MatchingConfigUtilities.introspectBean(listExcludedProperties, Patient.class)); 
    233230             
    234231            for (String property : propertyList) { 
     
    243240                } 
    244241            } 
     242             
     243            propertyList = new ArrayList<String>(); 
     244            propertyList.addAll(MatchingConfigUtilities.introspectBean(listExcludedProperties, PersonName.class)); 
     245             
     246            PersonName personName = patient.getPersonName(); 
     247             
     248            for (String property : propertyList) { 
     249                String value = ""; 
     250                try { 
     251                    String classProperty = property.substring(property.lastIndexOf(".") + 1); 
     252                    value = BeanUtils.getProperty(personName, classProperty); 
     253                } catch (Exception e) { 
     254                    logger.debug("Error getting the value for property: " + property, e); 
     255                } finally { 
     256                    ret.addDemographic(property, value); 
     257                } 
     258            } 
     259             
     260            propertyList = new ArrayList<String>(); 
     261            propertyList.addAll(MatchingConfigUtilities.introspectBean(listExcludedProperties, PersonAddress.class)); 
     262 
     263            PersonAddress personAddress = patient.getPersonAddress(); 
     264             
     265            for (String property : propertyList) { 
     266                String value = ""; 
     267                try { 
     268                    String classProperty = property.substring(property.lastIndexOf(".") + 1); 
     269                    value = BeanUtils.getProperty(personAddress, classProperty); 
     270                } catch (Exception e) { 
     271                    logger.debug("Error getting the value for property: " + property, e); 
     272                } finally { 
     273                    ret.addDemographic(property, value); 
     274                } 
     275            } 
    245276 
    246277            PatientService patientService = Context.getPatientService(); 
  • openmrs-modules/patientmatching/web/src/org/openmrs/module/patientmatching/web/MatchingConfigUtilities.java

    r5361 r5378  
    1414import java.util.List; 
    1515import java.util.Map; 
     16import java.util.Set; 
    1617import java.util.TreeMap; 
     18import java.util.TreeSet; 
    1719 
    1820import org.apache.commons.beanutils.PropertyUtils; 
     
    368370        } 
    369371         
    370         List<String> globalIncludeColumns = new ArrayList<String>(); 
     372        Set<String> globalIncludeColumns = new TreeSet<String>(); 
    371373        DedupMatchResultList list = new DedupMatchResultList(); 
    372374        for (MatchingConfig matchingConfig : matchingConfigLists) { 
     
    406408 
    407409        List<Map<String, String>> buffer = new ArrayList<Map<String, String>>(); 
    408          
    409         Collections.sort(globalIncludeColumns); 
    410410 
    411411        for (List<Record> recordList: records) {