Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 5272

Show
Ignore:
Timestamp:
08/13/08 14:46:29 (5 months ago)
Author:
tmdugan
Message:

-- atd

* refactored processFiles method

Files:

Legend:

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

    r5202 r5272  
    261261                 
    262262                String filename = ""; 
    263                 boolean processed = false; 
    264263                 
    265264                Iterator <FormInstance> iterator = pendingProcessing.keySet().iterator(); 
    266265                while (iterator.hasNext()) 
    267266                { 
    268                          
    269267                        FormInstance instance = iterator.next(); 
    270268                        TeleformFileState tfState = pendingProcessing.get(instance); 
    271269                        if(tfState.getCriteria() == "EXISTS") 
    272270                        { 
    273                                  
    274271                                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();           
    282273                        } 
    283274                        else if(tfState.getCriteria() == "GT_SENTINEL_TIME") 
    284275                        { 
    285276                                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 
    295283                                iterator.remove(); 
    296284                                tfState.setFilename(filename); 
     
    298286                                tfState.setFormInstanceId(instance.getFormInstanceId()); 
    299287                                fileProcessed(tfState); 
    300                         } 
    301                          
    302                 } 
    303          
    304         } 
    305          
     288                        }        
     289                } 
     290         
     291        } 
    306292         
    307293        public static void processTifFiles() throws APIException, Exception