Changeset 3482
- Timestamp:
- 09/08/10 11:46:57 (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molgenis_projects/molgenis4phenotype/handwritten/java/plugin/yearlyreportplugin/VWAReport4.java
r3374 r3482 26 26 List<String> speciesList = new ArrayList<String>(); 27 27 private int year; 28 private String type; 28 29 29 30 public VWAReport4(Database db) { … … 37 38 try { 38 39 this.year = year; 40 this.type = type; 39 41 40 42 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.US); … … 62 64 if (valueList.size() > 0) { 63 65 String animalType = valueList.get(0).getValue(); 64 // Remove animals that are not of the correct type66 // Ignore animals that are not of the correct type for this report 65 67 if ((animalType.equals("A. Gewoon dier") && !type.equals("A")) || 66 68 (animalType.equals("B. Transgeen dier") && !type.equals("B")) || … … 70 72 skipAnimal = true; 71 73 } 74 } else { 75 skipAnimal = true; // Ignore animals that have no type 72 76 } 73 77 if (skipAnimal) continue; 74 78 75 // Get status 79 // Get status Alive 76 80 boolean aliveEndOfPrevYear = false; 77 81 boolean aliveEndOfThisYear = false; … … 94 98 } 95 99 } 96 } 100 } else { 101 // Don't consider animals that have (had) no 'Alive' status 102 skipAnimal = true; 103 } 104 if (skipAnimal) continue; 105 106 // Get status Dead (if any) 97 107 q = db.query(ObservedValue.class); 98 108 q.addRules(new QueryRule("observationTarget", Operator.EQUALS, targetid)); 99 109 q.addRules(new QueryRule("observableFeature", Operator.EQUALS, featid)); 100 q.addRules(new QueryRule("value", Operator.EQUALS, "D ied"));110 q.addRules(new QueryRule("value", Operator.EQUALS, "Dead")); 101 111 valueList = q.find(); 102 112 if (valueList.size() > 0) { … … 114 124 } 115 125 } else { 126 // Born before or in the year of interest and not dead yet 116 127 aliveEndOfThisYear = true; 117 128 } … … 151 162 } 152 163 } 153 } 164 } // end of loop through all animals 154 165 animalList.removeAll(removeList); 155 166 // Maybe do extra stuff with this list of relevant animals? … … 189 200 @Override 190 201 public String toString() { 191 String output = "<br /><p><strong>Report for the year " + year + "</strong></p>";202 String output = "<br /><p><strong>Report 4" + type + " for the year " + year + "</strong></p>"; 192 203 output += "<br /><table border='1' cellpadding='5' cellspacing='5'>"; 193 204 output += "<tr>";
Note: See TracChangeset
for help on using the changeset viewer.