diff --git a/api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/surveillance/EligibleForHaemorrhagicCalculation.java b/api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/surveillance/EligibleForHaemorrhagicCalculation.java index d06b57e6ec..947f37a2f0 100644 --- a/api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/surveillance/EligibleForHaemorrhagicCalculation.java +++ b/api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/surveillance/EligibleForHaemorrhagicCalculation.java @@ -47,7 +47,6 @@ * @should calculate Fever * @should calculate Onset at least 72hours. * @should calculate bleeding - * @should calculate Duration > 2 days */ public class EligibleForHaemorrhagicCalculation extends AbstractPatientCalculation implements PatientFlagCalculation { protected static final Log log = LogFactory.getLog(EligibleForHaemorrhagicCalculation.class); @@ -62,10 +61,8 @@ public class EligibleForHaemorrhagicCalculation extends AbstractPatientCalculati public String getFlagMessage() { return "Suspected Haemorrhagic Fever"; } - Integer FEVER = 140238; - Integer BLEEDING_TENDENCIES = 159339; - Integer DURATION = 159368; + Integer BLEEDING_TENDENCIES = 159339; Integer SCREENING_QUESTION = 5219; @Override @@ -79,8 +76,7 @@ public CalculationResultMap evaluate(Collection cohort, Map activeVisits = Context.getVisitService().getActiveVisitsByPatient(patientService.getPatient(ptId)); if (!activeVisits.isEmpty()) { - Date currentDate = new Date(); - Double duration = 0.0; + Date currentDate = new Date(); Date dateCreated = null; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); String todayDate = dateFormat.format(currentDate); @@ -103,16 +99,12 @@ public CalculationResultMap evaluate(Collection cohort, Map= 3) { + String createdDate = dateFormat.format(dateCreated); if (createdDate.equals(todayDate)) { eligible = true; - break; - } + break; } } } @@ -121,17 +113,12 @@ public CalculationResultMap evaluate(Collection cohort, Map= 3) { + String createdDate = dateFormat.format(dateCreated); if (createdDate.equals(todayDate)) { eligible = true; - break; - } + break; } } } diff --git a/api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/surveillance/EligibleForRiftValleyFeverCalculation.java b/api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/surveillance/EligibleForRiftValleyFeverCalculation.java index 31ae28d843..c7907db1f7 100644 --- a/api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/surveillance/EligibleForRiftValleyFeverCalculation.java +++ b/api/src/main/java/org/openmrs/module/kenyaemr/calculation/library/surveillance/EligibleForRiftValleyFeverCalculation.java @@ -49,7 +49,7 @@ * @should calculate Fever * @should calculate Temperature >37.5C * @should calculate Dizziness - * @should calculate Jaundice + * @should calculate Jaundice from general examinations finding * @should calculate General body malaise * @should calculate Duration > 2 */ @@ -73,7 +73,8 @@ public String getFlagMessage() { Integer TEMPERATURE = 5088; Integer FEVER = 140238; Integer DURATION = 159368; - Integer SCREENING_QUESTION = 5219; + Integer SCREENING_QUESTION_COMPLAINTS= 5219; + Integer SCREENING_QUESTION_EXAMINATION= 162737; @Override public CalculationResultMap evaluate(Collection cohort, Map parameterValues, PatientCalculationContext context) { @@ -103,18 +104,19 @@ public CalculationResultMap evaluate(Collection cohort, Map