Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPORTS-166: Reviewed reason for eligibility for ART #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public Boolean consume(Obs o) {
}

/**
* @see PatientSnapshot#consume(java.util.Map)
*/
*/
@Override
public Boolean consume(ObsRepresentation o) {
Integer q = o.getConceptId();
Expand Down Expand Up @@ -126,7 +125,8 @@ public boolean eligible() {
this.set("extras", Collections.singletonList("WHO Stage 4"));
return true;

} else if (this.get("pedsWHOStage").equals(3)
}
else if (this.get("pedsWHOStage").equals(3)
&& (Double) this.get("cd4ByFacs") < 500d
&& (Double) this.get("cd4PercentByFacs") < 25d) {
this.set("reason", REASON_CLINICAL_CD4);
Expand All @@ -141,45 +141,77 @@ public boolean eligible() {

// otherwise, check by age group
if (ageGroup.equals(MohEvaluableNameConstants.AgeGroup.UNDER_EIGHTEEN_MONTHS)) {
if (this.get("pedsWHOStage").equals(2)
&& (Double) this.get("cd4ByFacs") < 500d
&& (Boolean) this.get("HIVDNAPCRPositive")) {
if ((Boolean) this.get("HIVDNAPCRPositive")) {
this.set("reason", REASON_CLINICAL_CD4_HIV_DNA_PCR);
this.set("extras", Arrays.asList(
"WHO Stage 2",
String.format("CD4 Count: %.0f", this.get("cd4ByFacs")),
this.get("pedsWHOStage"),
String.format("CD4 %%: %.0f", this.get("cd4PercentByFacs")),
"HIV DNA PCR: Positive"
));
return true;

} else if (this.get("pedsWHOStage").equals(1) && (Boolean) this.get("HIVDNAPCRPositive")) {
this.set("reason", REASON_CLINICAL_HIV_DNA_PCR);
this.set("extras", Arrays.asList(
"WHO Stage 1",
"HIV DNA PCR: Positive"
));
return true;
}

} else if (ageGroup.equals(MohEvaluableNameConstants.AgeGroup.EIGHTEEN_MONTHS_TO_FIVE_YEARS)
&& (this.get("pedsWHOStage").equals(1) || this.get("pedsWHOStage").equals(2))
&& (Double) this.get("cd4PercentByFacs") < 20d) {
this.set("reason", REASON_CLINICAL_CD4);
this.set("extras", Arrays.asList(
String.format("WHO Stage %d", this.get("pedsWHOStage")),
String.format("CD4 %%: %.0f", this.get("cd4PercentByFacs"))
));
return true;

} else if (ageGroup.equals(MohEvaluableNameConstants.AgeGroup.FIVE_YEARS_TO_TWELVE_YEARS)
&& (this.get("pedsWHOStage").equals(1) || this.get("pedsWHOStage").equals(2))
&& (Double) this.get("cd4PercentByFacs") < 25d) {
this.set("reason", REASON_CLINICAL_CD4);
this.set("extras", Arrays.asList(
String.format("WHO Stage %d", this.get("pedsWHOStage")),
String.format("CD4 %%: %.0f", this.get("cd4PercentByFacs"))
));
return true;
} else if (ageGroup.equals(MohEvaluableNameConstants.AgeGroup.EIGHTEEN_MONTHS_TO_FIVE_YEARS)){

if (this.get("pedsWHOStage").equals(3) || this.get("pedsWHOStage").equals(4)) {
this.set("reason", REASON_CLINICAL);
this.set("extras", Collections.singletonList(
String.format("WHO Stage %d", this.get("pedsWHOStage"))));
return true;
}
else if((this.get("pedsWHOStage").equals(3) || this.get("pedsWHOStage").equals(4)) && (Double) this.get("cd4PercentByFacs") < 25d) {
this.set("reason", REASON_CLINICAL_CD4);
this.set("extras", Arrays.asList(
String.format("WHO Stage %d", this.get("pedsWHOStage")),
String.format("CD4 %%: %.0f", this.get("cd4PercentByFacs"))
));
return true;
}
else if((Double) this.get("cd4PercentByFacs") < 25d){
this.set("reason", "CD4");
this.set("extras", Collections.singletonList(
String.format("CD4 %%: %.0f", this.get("cd4PercentByFacs"))));
return true;
}


} else if (ageGroup.equals(MohEvaluableNameConstants.AgeGroup.FIVE_YEARS_TO_TWELVE_YEARS)){

if (this.get("pedsWHOStage").equals(3) || this.get("pedsWHOStage").equals(4)) {
this.set("reason", REASON_CLINICAL);
this.set("extras", Collections.singletonList(
String.format("WHO Stage %d", this.get("pedsWHOStage"))));
return true;

} else if((this.get("pedsWHOStage").equals(3) || this.get("pedsWHOStage").equals(4)) && (Double) this.get("cd4PercentByFacs") < 20d) {
this.set("reason", REASON_CLINICAL_CD4);
this.set("extras", Arrays.asList(
String.format("WHO Stage %d", this.get("pedsWHOStage")),
String.format("CD4 %%: %.0f", this.get("cd4PercentByFacs"))
));
return true;
}
else if((this.get("pedsWHOStage").equals(3) || this.get("pedsWHOStage").equals(4)) && (Double) this.get("cd4ByFacs") < 500d) {
this.set("reason", REASON_CLINICAL_CD4);
this.set("extras", Arrays.asList(
String.format("WHO Stage %d", this.get("pedsWHOStage")),
String.format("CD4 Count: %.0f", this.get("cd4ByFacs"))
));
return true;
}
else if((Double) this.get("cd4PercentByFacs") < 20d){
this.set("reason", "CD4");
this.set("extras", Collections.singletonList(
String.format("CD4 %%: %.0f", this.get("cd4PercentByFacs"))));
return true;
}
else if((Double) this.get("cd4ByFacs") < 500d){
this.set("reason", "CD4");
this.set("extras", Collections.singletonList(
String.format("CD4 Count: %.0f", this.get("cd4ByFacs"))));
return true;
}

} else if (ageGroup.equals(MohEvaluableNameConstants.AgeGroup.ABOVE_TWELVE_YEARS)) {
if ((this.get("pedsWHOStage").equals(1) || this.get("pedsWHOStage").equals(2))
Expand Down