Changeset 5272
- Timestamp:
- 08/13/08 14:46:29 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/atd/src/org/openmrs/module/atd/TeleformFileMonitor.java
r5202 r5272 261 261 262 262 String filename = ""; 263 boolean processed = false;264 263 265 264 Iterator <FormInstance> iterator = pendingProcessing.keySet().iterator(); 266 265 while (iterator.hasNext()) 267 266 { 268 269 267 FormInstance instance = iterator.next(); 270 268 TeleformFileState tfState = pendingProcessing.get(instance); 271 269 if(tfState.getCriteria() == "EXISTS") 272 270 { 273 274 271 filename = tfState.getDirectoryName() + "\\" + 275 instance.getFormInstanceId() + tfState.getFileState(); 276 File processFile = new File(filename); 277 if(processFile.exists()) 278 { 279 // event file processed 280 processed = true; 281 } 272 instance.getFormInstanceId() + tfState.getFileState(); 282 273 } 283 274 else if(tfState.getCriteria() == "GT_SENTINEL_TIME") 284 275 { 285 276 filename = tfState.getDirectoryName() + "\\" + getLastModifiedFilename(tfState.getDirectoryName(), tfState.getFileState(), tfState.getSentinelDate(), tfState.getCriteria()); 286 File processFile = new File(filename); 287 if(processFile.exists()) 288 { 289 // event file processed 290 processed = true; 291 } 292 } 293 if(processed) 294 { 277 } 278 279 File processFile = new File(filename); 280 if(processFile.exists()) 281 { 282 // event file processed 295 283 iterator.remove(); 296 284 tfState.setFilename(filename); … … 298 286 tfState.setFormInstanceId(instance.getFormInstanceId()); 299 287 fileProcessed(tfState); 300 } 301 302 } 303 304 } 305 288 } 289 } 290 291 } 306 292 307 293 public static void processTifFiles() throws APIException, Exception