Changeset 6152
- Timestamp:
- 12/01/08 19:47:23 (less than one hour ago)
- Files:
-
- openmrs-modules/piht1000patientdataexport/src/org/openmrs/module/thousandpatientdata/calculators/LastARVRegimenCalculator.java (modified) (4 diffs)
- openmrs-modules/piht1000patientdataexport/src/org/openmrs/module/thousandpatientdata/calculators/StartingARVRegimenCalculator.java (modified) (4 diffs)
- openmrs-modules/piht1000patientdataexport/src/org/openmrs/module/thousandpatientdata/impl/ThousandPatientDataExport.java (modified) (1 diff)
- openmrs-modules/piht1000patientdataexport/web/module/thousandPatientDataExportForm.jsp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/piht1000patientdataexport/src/org/openmrs/module/thousandpatientdata/calculators/LastARVRegimenCalculator.java
r6144 r6152 3 3 import java.util.ArrayList; 4 4 import java.util.Collection; 5 import java.util.Date; 5 6 import java.util.HashSet; 6 7 import java.util.List; … … 94 95 for(DrugOrder order : drugOrders){ 95 96 if(arvDrugs.contains(order.getDrug().getConcept())){ 96 long timeAfterARVStart = order.getStartDate().getTime() - arvStartDate.getTime(); 97 Date orderStartDate = order.getStartDate(); 98 if(orderStartDate == null){ 99 warnings.add("One of the orders for this patient has a null start date."); 100 continue; 101 } 102 long timeAfterARVStart = orderStartDate.getTime() - arvStartDate.getTime(); 97 103 if(timeAfterARVStart > longestTimeAfterARVStart){ 98 104 longestTimeAfterARVStart = timeAfterARVStart; … … 114 120 emrRegimenAsString += regimenItem.getName().getName() + " "; 115 121 } 116 if( !emrRegimenAsString.isEmpty())122 if(emrRegimenAsString.length()!=0) 117 123 emrRegimenAsString = emrRegimenAsString.substring(0,emrRegimenAsString.length()-2); 118 124 … … 123 129 } 124 130 } 125 if( !abstractionRegimenAsString.isEmpty())131 if(abstractionRegimenAsString.length()!=0) 126 132 abstractionRegimenAsString = abstractionRegimenAsString.substring(0,abstractionRegimenAsString.length()-2); 127 133 128 134 if(!abstractionRegimenAsString.equals(emrRegimenAsString)){ 129 warnings.add(" Starting EMR regimen (" + emrRegimenAsString + ") does not match startingabstraction regimen (" + abstractionRegimenAsString + ").");135 warnings.add("Final EMR regimen (" + emrRegimenAsString + ") does not match final abstraction regimen (" + abstractionRegimenAsString + ")."); 130 136 } 131 137 132 if(abstractionRegimen !=null && !abstractionRegimen.isEmpty())133 value = abstractionRegimenAsString;138 if(abstractionRegimen==null || abstractionRegimen.isEmpty() || emrRegimenAsString.length()!=0) 139 value = emrRegimenAsString; 134 140 else 135 value = emrRegimenAsString;141 value = abstractionRegimenAsString; 136 142 137 143 value = value.replaceFirst(" AND ", " "); openmrs-modules/piht1000patientdataexport/src/org/openmrs/module/thousandpatientdata/calculators/StartingARVRegimenCalculator.java
r6144 r6152 9 9 10 10 import org.openmrs.Concept; 11 import org.openmrs.Drug; 11 12 import org.openmrs.DrugOrder; 12 13 import org.openmrs.Encounter; … … 94 95 Set<Concept> earliestRegimen = new HashSet<Concept>(); 95 96 for(DrugOrder order : drugOrders){ 96 if(arvDrugs.contains(order.getDrug().getConcept())){ 97 Drug orderedDrug = order.getDrug(); 98 Concept drugConcept = orderedDrug.getConcept(); 99 if(arvDrugs.contains(drugConcept)){ 97 100 Date orderStartDate = order.getStartDate(); 101 if(orderStartDate == null){ 102 warnings.add("One of the orders for this patient has a null start date."); 103 continue; 104 } 98 105 long orderTime = orderStartDate.getTime(); 99 106 long arvStartDateTime = arvStartDate.getTime(); … … 118 125 emrRegimenAsString += regimenItem.getName().getName() + " "; 119 126 } 120 if( !emrRegimenAsString.isEmpty())127 if(emrRegimenAsString.length() != 0) 121 128 emrRegimenAsString = emrRegimenAsString.substring(0,emrRegimenAsString.length()-2); 122 129 … … 128 135 } 129 136 130 if( !abstractionRegimenAsString.isEmpty())137 if(abstractionRegimenAsString.length()!=0) 131 138 abstractionRegimenAsString = abstractionRegimenAsString.substring(0,abstractionRegimenAsString.length()-2); 132 139 openmrs-modules/piht1000patientdataexport/src/org/openmrs/module/thousandpatientdata/impl/ThousandPatientDataExport.java
r5579 r6152 31 31 for(VariableToOutput variable : variables){ 32 32 if(variable.getShouldOutput()){ 33 System.out.println(variable.getName()); 33 34 VariableView variableView = patient.getVariable(variable.getName()); 34 35 String date = variableView.getDate(); openmrs-modules/piht1000patientdataexport/web/module/thousandPatientDataExportForm.jsp
r5601 r6152 58 58 </ul> 59 59 60 <h4>Death</h4> 61 <ul> 62 <li> If the patient is marked as deceased, either in the EMR or a chart abstraction form, then the patient is considered deceased. 63 <li> If the death date in the EMR and abstraction forms are different, the date from the abstraction forms is taken. 64 </ul> 65 66 <h4>Starting Regimen</h4> 67 <ul> 68 <li> The regimen closest to the ARV start date is taken. 69 <li> If multiple drugs have the same start date, they are all outputted. 70 <li> If the EMR and abstraction are discrepent, the abstraction regimen is used. 71 </ul> 72 73 <h4>Last Regimen</h4> 74 <ul> 75 <li> The regimen furthest from the ARV start date is taken. 76 <li> If multiple drugs ahve the same start date, they are all outputted. 77 <li> If the EMR and abstraction are discrepent, the EMR regimen is used. 78 </ul> 79 60 80 <h4>Number of Visits Around an Anniversary</h4> 61 81 <ul>