Changeset 3446
- Timestamp:
- 02/21/08 17:46:14 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/dss/metadata/config.xml
r3397 r3446 7 7 <id>dss</id> 8 8 <name>Dss</name> 9 <version>2.0 5</version>9 <version>2.06</version> 10 10 <package>org.openmrs.module.@MODULE_ID@</package> 11 11 <author>Vibha Anand and Tammy Dugan</author> openmrs-modules/dss/src/org/openmrs/module/dss/DssManager.java
r3401 r3446 25 25 private HashMap<String,ArrayList<DssElement>> dssElementsByType = null; 26 26 private Patient patient = null; 27 private HashMap<String, Integer> maxDssElementsByType = null; 27 28 28 29 public DssManager(Patient patient) … … 31 32 } 32 33 33 public void populateDssElements( int numDssElements,String type, boolean override)34 public void populateDssElements(String type, boolean override) 34 35 { 35 36 if(this.dssElementsByType == null) … … 62 63 ArrayList<Rule> processedRules = null; 63 64 Result currResult = null; 64 int batchSize = numDssElements; 65 int maxDssElements = getMaxDssElementsByType(type); 66 int batchSize = maxDssElements; 65 67 AdministrationService adminService = Context.getAdministrationService(); 66 68 final int BATCH_SIZE = Integer.parseInt(adminService 67 69 .getGlobalProperty("dss.batchSizeRunRules")); 68 70 69 while (dssElements.size() < numDssElements && iter.hasNext())71 while (dssElements.size() < maxDssElements && iter.hasNext()) 70 72 { 71 73 ruleList = new ArrayList<Rule>(); … … 129 131 return this.dssElementsByType; 130 132 } 133 134 public void setMaxDssElementsByType(String type, int maxDssElements) 135 { 136 if(this.maxDssElementsByType == null) 137 { 138 this.maxDssElementsByType = new HashMap<String,Integer>(); 139 } 140 141 this.maxDssElementsByType.put(type, new Integer(maxDssElements)); 142 } 143 144 public int getMaxDssElementsByType(String type) 145 { 146 Integer lookup = null; 147 148 if (this.maxDssElementsByType != null) 149 { 150 lookup = this.maxDssElementsByType.get(type); 151 } 152 153 if(lookup != null) 154 { 155 return lookup.intValue(); 156 } 157 return 0; 158 } 131 159 } openmrs-modules/dss/src/org/openmrs/module/dss/util/Util.java
r3411 r3446 298 298 } 299 299 300 public static String processFileDirectory(String fileDirectory) 301 { 302 if(!(fileDirectory.endsWith("/")||fileDirectory.endsWith("\\"))) 303 { 304 fileDirectory+="/"; 305 } 306 return fileDirectory; 307 } 308 300 309 public static String processFileDirectoryGlobalProperty(String property) 301 310 { 302 311 AdministrationService adminService = Context.getAdministrationService(); 303 312 String fileDirectory = adminService.getGlobalProperty(property); 304 if(!(fileDirectory.endsWith("/")||fileDirectory.endsWith("\\"))) 305 { 306 fileDirectory+="/"; 307 } 308 return fileDirectory; 313 return processFileDirectory(fileDirectory); 309 314 } 310 315 }