Skip to content
New issue

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

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

Already on GitHub? # to your account

SESP-317:Update List for Follow-up of Patients with Unsuppressed VL #524

Merged
merged 8 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
package org.openmrs.module.eptsreports.reporting.library.datasets;

import org.openmrs.module.eptsreports.reporting.library.cohorts.HighViralLoadCohortQueries;
import org.openmrs.module.eptsreports.reporting.library.indicators.EptsGeneralIndicator;
import org.openmrs.module.eptsreports.reporting.utils.EptsReportUtils;
import org.openmrs.module.reporting.dataset.definition.CohortIndicatorDataSetDefinition;
import org.openmrs.module.reporting.dataset.definition.DataSetDefinition;
import org.openmrs.module.reporting.indicator.CohortIndicator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class PatientWithHighViralLoadDataSet extends BaseDataSet {

@Autowired private EptsGeneralIndicator eptsGeneralIndicator;
@Autowired private HighViralLoadCohortQueries highViralLoadCohortQueries;

@Autowired
public DataSetDefinition constructHighVlDataset() {

final CohortIndicatorDataSetDefinition dataSetDefinition =
new CohortIndicatorDataSetDefinition();

dataSetDefinition.setName("VL");
dataSetDefinition.addParameters(this.getParameters());

final String mappings = "startDate=${startDate},endDate=${endDate},location=${location}";

final CohortIndicator highVl =
this.eptsGeneralIndicator.getIndicator(
"FIRST_HIGH_VL",
EptsReportUtils.map(this.highViralLoadCohortQueries.getFirstHighVl(), mappings));

final CohortIndicator highVlFC =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(
this.highViralLoadCohortQueries.getFirstConsultationWithHighVlInformed(),
mappings));

final CohortIndicator apss0AfterhighVl =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getApss0AfterHighVl(), mappings));

final CohortIndicator apss1AfterhighVl =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getApss1AfterHighVl(), mappings));
final CohortIndicator apss2AfterhighVl =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getApss2AfterHighVl(), mappings));

final CohortIndicator apss3AfterhighVl =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getApss3AfterHighVl(), mappings));

final CohortIndicator secondFchighVl =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getFCWithSecondHighVl(), mappings));

final CohortIndicator secondVlRepeat =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getSecondRepeatVl(), mappings));

final CohortIndicator secondVlLabElab =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getSecondVlLabElab(), mappings));

final CohortIndicator secondVlResult =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getSecondVlResult(), mappings));

final CohortIndicator newTerapeuticLine =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getNewTerapeuticLine(), mappings));

final CohortIndicator terapeuticLine =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getTerapeuticLine(), mappings));

final CohortIndicator newApss0AfterCV2 =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getTApss0AfterCV2(), mappings));

final CohortIndicator newApss1AfterCV2 =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getTApss1AfterCV2(), mappings));

final CohortIndicator newApss2AfterCV2 =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getTApss2AfterCV2(), mappings));

final CohortIndicator newApss3AfterCV2 =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getTApss3AfterCV2(), mappings));

final CohortIndicator thirdVlRequest =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getThirdVlRequest(), mappings));

final CohortIndicator thirdVlRepeat =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getThirdVlRepeat(), mappings));

final CohortIndicator thirdVlLabElab =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getThirdVlLabElab(), mappings));

final CohortIndicator thirdHighVl =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(this.highViralLoadCohortQueries.getThirdHighVl(), mappings));

final CohortIndicator thirdVlNewTerapeuticLine =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(
this.highViralLoadCohortQueries.getThirdHighVlForNewTerapeuticLine(), mappings));

final CohortIndicator thirdVlTerapeuticLine =
this.eptsGeneralIndicator.getIndicator(
"highVlFC",
EptsReportUtils.map(
this.highViralLoadCohortQueries.getThirdHighVlForTerapeuticLine(), mappings));

dataSetDefinition.addColumn(
"FIRST_HIGH_VL", "1ª Carga Viral Alta ", EptsReportUtils.map(highVl, mappings), "");

dataSetDefinition.addColumn(
"FIRST_HIGH_VL_FC",
"Consulta Clínica com CV registada na Ficha Clínica e comunicada ao Paciente",
EptsReportUtils.map(highVlFC, mappings),
"");
dataSetDefinition.addColumn(
"APSS0_AFTER_HIGH_VL",
"Sessão 0 de APSS/PP após CV alta",
EptsReportUtils.map(apss0AfterhighVl, mappings),
"");

dataSetDefinition.addColumn(
"APSS1_AFTER_HIGH_VL",
"Sessão 1 de APSS/PP após CV alta",
EptsReportUtils.map(apss1AfterhighVl, mappings),
"");
dataSetDefinition.addColumn(
"APSS2_AFTER_HIGH_VL",
"Sessão 2 de APSS/PP após CV alta",
EptsReportUtils.map(apss2AfterhighVl, mappings),
"");

dataSetDefinition.addColumn(
"APSS3_AFTER_HIGH_VL",
"Sessão 3 de APSS/PP após CV alta",
EptsReportUtils.map(apss3AfterhighVl, mappings),
"");

dataSetDefinition.addColumn(
"FC_SECOND_HIGH_VL",
"Consulta Clínica para Repetição da 2ª CV (Pedido)",
EptsReportUtils.map(secondFchighVl, mappings),
"");

dataSetDefinition.addColumn(
"SECOND_VL_REPEAT",
"Colheita de Repetição da 2ª CV",
EptsReportUtils.map(secondVlRepeat, mappings),
"");

dataSetDefinition.addColumn(
"SECOND_VL_LAB_ELAB",
"Resultado da 2ª CV (Laboratório ou e-Lab)",
EptsReportUtils.map(secondVlLabElab, mappings),
"");

dataSetDefinition.addColumn(
"SECOND_VL_RESULT",
"2ª Carga Viral Alta",
EptsReportUtils.map(secondVlResult, mappings),
"");

dataSetDefinition.addColumn(
"NEW_TERAPEUTIC_LINE",
"Consulta Clínica para Mudança de Linha após 2ª CV alta",
EptsReportUtils.map(newTerapeuticLine, mappings),
"");

dataSetDefinition.addColumn(
"TERAPEUTIC_LINE",
"Nova LINHA Terapêutica",
EptsReportUtils.map(terapeuticLine, mappings),
"");

dataSetDefinition.addColumn(
"APSS0_AFTER_CV2",
"Sessão 0 da APSS/PP após segunda CV alta",
EptsReportUtils.map(newApss0AfterCV2, mappings),
"");

dataSetDefinition.addColumn(
"APSS1_AFTER_CV2",
"1ª Consulta de APSS após segunda CV alta (se aplicável)",
EptsReportUtils.map(newApss1AfterCV2, mappings),
"");
dataSetDefinition.addColumn(
"APSS2_AFTER_CV2",
"2ª Consulta de APSS após segunda CV alta (se aplicável)",
EptsReportUtils.map(newApss2AfterCV2, mappings),
"");

dataSetDefinition.addColumn(
"APSS3_AFTER_CV2",
"3ª Consulta de APSS após segunda CV alta (se aplicável)",
EptsReportUtils.map(newApss3AfterCV2, mappings),
"");
dataSetDefinition.addColumn(
"THIRD_VL_REQUEST",
"Consulta Clínica para Repetição da 3ª CV (Pedido)",
EptsReportUtils.map(thirdVlRequest, mappings),
"");

dataSetDefinition.addColumn(
"THIRD_VL_REPEAT",
"Colheita de Repetição da 3ª CV",
EptsReportUtils.map(thirdVlRepeat, mappings),
"");

dataSetDefinition.addColumn(
"THIRD_VL_RESULT_LAB_ELAB",
"Resultado da 3ª CV (laboratório ou e-Lab)",
EptsReportUtils.map(thirdVlLabElab, mappings),
"");

dataSetDefinition.addColumn(
"THIRD_HIGH_VL", "3ª Carga Viral Alta", EptsReportUtils.map(thirdHighVl, mappings), "");

dataSetDefinition.addColumn(
"THIRD_VL_NEW_TERAPEUTIC_LINE",
"Consulta Clínica para Mudança de Linha após 3ª CV alta",
EptsReportUtils.map(thirdVlNewTerapeuticLine, mappings),
"");

dataSetDefinition.addColumn(
"THIRD_VL_TERAPEUTIC_LINE",
"Nova LINHA Terapêutica",
EptsReportUtils.map(thirdVlTerapeuticLine, mappings),
"");

return dataSetDefinition;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.openmrs.module.eptsreports.reporting.library.cohorts.GenericCohortQueries;
import org.openmrs.module.eptsreports.reporting.library.datasets.DatimCodeDataSet;
import org.openmrs.module.eptsreports.reporting.library.datasets.ListPatientWithHighViralLoadDataSet;
import org.openmrs.module.eptsreports.reporting.library.datasets.PatientWithHighViralLoadDataSet;
import org.openmrs.module.eptsreports.reporting.library.datasets.SismaCodeDataSet;
import org.openmrs.module.eptsreports.reporting.library.queries.BaseQueries;
import org.openmrs.module.eptsreports.reporting.reports.manager.EptsDataExportManager;
Expand All @@ -27,6 +28,7 @@ public class SetupListPatientWithHighViralLoad extends EptsDataExportManager {
@Autowired private GenericCohortQueries genericCohortQueries;

@Autowired private ListPatientWithHighViralLoadDataSet listPatientWithHighViralLoadDataSet;
@Autowired private PatientWithHighViralLoadDataSet patientWithHighViralLoadDataSet;

@Autowired private DatimCodeDataSet datimCodeDataset;
@Autowired private SismaCodeDataSet sismaCodeDataset;
Expand Down Expand Up @@ -68,6 +70,10 @@ public ReportDefinition constructReportDefinition() {
Mapped.mapStraightThrough(
listPatientWithHighViralLoadDataSet.constructDataset(getParameters())));

rd.addDataSetDefinition(
"HVL",
Mapped.mapStraightThrough(this.patientWithHighViralLoadDataSet.constructHighVlDataset()));

rd.addDataSetDefinition(
"D",
Mapped.mapStraightThrough(this.datimCodeDataset.constructDataset(this.getParameters())));
Expand Down Expand Up @@ -109,7 +115,7 @@ public List<ReportDesign> constructReportDesigns(ReportDefinition reportDefiniti

Properties props = new Properties();
props.put(
"repeatingSections", "sheet:1,row:12,dataset:PHVL | sheet:2,row:10,dataset:PHVLCURRWEEK");
"repeatingSections", "sheet:1,row:13,dataset:PHVL | sheet:2,row:10,dataset:PHVLCURRWEEK");
props.put("sortWeight", "5000");
reportDesign.setProperties(props);
} catch (IOException e) {
Expand Down
Binary file modified api/src/main/resources/ListPatientWithHighViralLoad.xls
Binary file not shown.
Loading