Changeset 3882
- Timestamp:
- 04/09/08 13:19:42 (9 months ago)
- Files:
-
- openmrs-modules/patientmatching/.classpath (modified) (1 diff)
- openmrs-modules/patientmatching/lib-common/log4j-1.2.13.jar (added)
- openmrs-modules/patientmatching/lib-common/mysql-connector-java-3.1.10-bin.jar (added)
- openmrs-modules/patientmatching/lib-common/openmrs-api-1.1.0.1810.jar (deleted)
- openmrs-modules/patientmatching/lib-common/openmrs-api-1.2.12.3789.jar (added)
- openmrs-modules/patientmatching/lib-common/spring-2.0.jar (deleted)
- openmrs-modules/patientmatching/lib-common/spring-2.5.1.jar (added)
- openmrs-modules/patientmatching/lib-common/web-openmrs-api-1.0.54.1540.jar (deleted)
- openmrs-modules/patientmatching/lib-common/web-openmrs-api-1.2.12.3789.jar (added)
- openmrs-modules/patientmatching/lib/log4j-1.2.15.jar (deleted)
- openmrs-modules/patientmatching/lib/mysql-connector-java-5.0.6-bin.jar (deleted)
- openmrs-modules/patientmatching/metadata/log4j.xml (added)
- openmrs-modules/patientmatching/src/org/openmrs/module/patientmatching/PatientMatchingActivator.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/patientmatching/.classpath
r3423 r3882 3 3 <classpathentry kind="src" path="src"/> 4 4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 5 <classpathentry kind="lib" path="commons-logging-1.0.4.jar"/>6 <classpathentry kind="lib" path="web-openmrs-api-1.0.54.1540.jar"/>7 <classpathentry kind="lib" path="lib-common/spring-2.0.jar"/>8 <classpathentry kind="lib" path="lib-common/openmrs-api-1.1.0.1810.jar"/>9 5 <classpathentry kind="lib" path="lib/postgresql-8.1-406.jdbc3.jar"/> 10 <classpathentry kind="lib" path="lib/mysql-connector-java-5.0.6-bin.jar"/> 11 <classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/> 6 <classpathentry kind="lib" path="lib/j2ee.jar"/> 7 <classpathentry kind="lib" path="lib/simmetrics_jar_v1_6_2_d07_02_07.jar"/> 8 <classpathentry kind="lib" path="lib-common/commons-logging-1.0.4.jar"/> 9 <classpathentry kind="lib" path="lib/simmetrics_jar_v1_4_d03_03_06.jar"/> 10 <classpathentry kind="lib" path="lib-common/log4j-1.2.13.jar"/> 11 <classpathentry kind="lib" path="lib-common/mysql-connector-java-3.1.10-bin.jar"/> 12 <classpathentry kind="lib" path="lib-common/spring-2.5.1.jar"/> 13 <classpathentry kind="lib" path="lib-common/openmrs-api-1.2.12.3789.jar"/> 14 <classpathentry kind="lib" path="lib-common/web-openmrs-api-1.2.12.3789.jar"/> 12 15 <classpathentry kind="lib" path="lib/commons-dbcp-1.2.2.jar"/> 13 16 <classpathentry kind="lib" path="lib/commons-pool-1.3.jar"/> 14 <classpathentry kind="lib" path="lib/j2ee.jar"/> 15 <classpathentry kind="lib" path="lib/simmetrics_jar_v1_6_2_d07_02_07.jar"/> 16 <classpathentry kind="output" path="bin"/> 17 <classpathentry kind="output" path="build"/> 17 18 </classpath> openmrs-modules/patientmatching/src/org/openmrs/module/patientmatching/PatientMatchingActivator.java
r2802 r3882 8 8 import java.util.Iterator; 9 9 import java.util.List; 10 import java.util.Set; 10 11 11 12 import org.aopalliance.aop.Advice; 12 13 import org.apache.commons.logging.Log; 13 14 import org.apache.commons.logging.LogFactory; 14 import org.apache.log4j.ConsoleAppender;15 import org.apache.log4j.FileAppender;16 import org.apache.log4j.Level;17 15 import org.apache.log4j.Logger; 18 import org.apache.log4j.PatternLayout;19 16 import org.openmrs.Patient; 20 17 import org.openmrs.PatientIdentifier; 21 18 import org.openmrs.PersonAttribute; 22 19 import org.openmrs.PersonAttributeType; 20 import org.openmrs.api.PatientService; 23 21 import org.openmrs.api.PatientSetService; 24 22 import org.openmrs.api.context.Context; … … 81 79 private Log log = LogFactory.getLog(this.getClass()); 82 80 public static String FILE_LOG = "patient_matching_file_log"; 83 public static String LOG_FILE_NAME = "log/link_module.log";84 81 private Logger file_log = Logger.getLogger(FILE_LOG); 85 82 … … 108 105 Context.addProxyPrivilege(PRIVILEGE2); 109 106 110 // configure file logging111 file_log.setAdditivity(false);112 file_log.setLevel((Level)Level.INFO);113 try{114 file_log.addAppender(new FileAppender(new PatternLayout("[%d{yyyy-MM-dd HH:mm:ss}]%m%n"), LOG_FILE_NAME));115 116 }117 catch(IOException ioe){118 file_log.addAppender(new ConsoleAppender());119 }120 121 107 log.info("Starting to populate matching table"); 122 108 if(LinkDBConnections.getInstance().getRecDBManager() != null){ … … 149 135 // a record with openmrs_id equal to patient.getID, then add 150 136 PatientSetService pss = Context.getPatientSetService(); 151 List<Patient> patient_list = pss.getAllPatients().getPatients(); 152 Iterator<Patient> it = patient_list.iterator(); 137 PatientService patientService = Context.getPatientService(); 138 Set<Integer> patient_list = pss.getAllPatients().getPersonIds(null); 139 Iterator<Integer> it = patient_list.iterator(); 153 140 while(it.hasNext()){ 154 Patient p = it.next();141 Patient p = patientService.getPatient(it.next()); 155 142 Integer id = p.getPatientId(); 156 143 int existing_patients = link_db.getRecordCountFromDB(LINK_TABLE_KEY_DEMOGRAPHIC, id.toString());