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

Openmrs 2.6.x upgrade #1682

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
743f196
Revise Regimen options in the HEI enrollment form for the mother
gabriel090 Jul 7, 2023
ff5d42b
When initial sputum (for Gene expert) collected the system still flag…
gabriel090 Jul 11, 2023
68ce1b9
Add RHZE as a regimen in the TB Regimen history for the children.
gabriel090 Aug 7, 2023
a21576c
In the MCH Antenatal Visit form, make Height and Weight in the vitals…
gabriel090 Aug 9, 2023
986a4f0
Add a column for 'Facility transferred to' on the clients transferred…
gabriel090 Aug 30, 2023
cdf7042
ART Readiness assessment form missing medical criteria.
gabriel090 Aug 30, 2023
37d3402
Applied changes on the file
gabriel090 Aug 31, 2023
d7fb0fc
Update Tx_PVLS query on DATIM report to accurately capture targeted V…
njorocs Aug 31, 2023
802773a
Disabled MoH257 form for the discontinued clients and dead clients
njorocs Aug 31, 2023
39f3544
Add more checks for appointment sync
Aug 31, 2023
3f72013
KHP3-4071 Improve care panel to include regimen initial and current
CynthiaKamau Aug 28, 2023
00a9e5f
Made pharmacy refill date mandatory
njorocs Sep 1, 2023
d66fc88
Merge pull request #1648 from CynthiaKamau/care-panel-regimen
makombe Sep 4, 2023
d934565
Merge pull request #1651 from makombe/appointment-checks
CynthiaKamau Sep 4, 2023
2211106
Merge pull request #1650 from njorocs/KHP3-3553
patryllus Sep 4, 2023
1fb7762
Merge pull request #1649 from njorocs/KHP3-3965
patryllus Sep 4, 2023
f6a7a8e
Merge pull request #1654 from njorocs/KHP3-3930
patryllus Sep 4, 2023
35a0183
Merge pull request #1646 from gabriel090/KHP3-3969
patryllus Sep 4, 2023
f94ee77
Add endpoint for regimen history
Sep 4, 2023
d98aa65
Merge pull request #1656 from makombe/regimen-end-point
CynthiaKamau Sep 5, 2023
0508801
Added calculation for determining whether VL as done within required …
njorocs Sep 5, 2023
fb82d3b
Merge pull request #1657 from njorocs/sims-revision
patryllus Sep 5, 2023
c4aa338
KHP3-3260 Added various facilities
PatrickWaweru Sep 5, 2023
6027090
Merge pull request #1605 from gabriel090/KHP3-2971
patryllus Sep 5, 2023
3878969
Merge pull request #1630 from gabriel090/KHP3-3882_1
patryllus Sep 5, 2023
a088202
Merge pull request #1647 from gabriel090/KHP3-3224
patryllus Sep 5, 2023
5b1b252
(feat) Add rest endpoint to return facility name given mfl code
CynthiaKamau Sep 7, 2023
c26be6d
format the code
gabriel090 Sep 8, 2023
6da3974
Merge branch 'master' into KHP3-3946
gabriel090 Sep 8, 2023
08a10b9
Merge branch 'master' into KHP3-2571
gabriel090 Sep 8, 2023
9ae34ff
Merge pull request #1603 from gabriel090/KHP3-2571
gabriel090 Sep 8, 2023
78e7e96
Merge pull request #1660 from CynthiaKamau/care-panel-regimen
makombe Sep 8, 2023
9482f44
Create custom API rest endpoint for ARV drugs for non standard regimen
Sep 11, 2023
407079a
Code review
Sep 12, 2023
2536b96
(enhancement) Removed completed forms from the returned results in ad…
donaldkibet Sep 12, 2023
8d4d5aa
Merge pull request #1664 from palladiumkenya/enhancement/formsEndpoint
ojwanganto Sep 12, 2023
8534638
Merge pull request #1635 from gabriel090/KHP3-3946
patryllus Sep 18, 2023
7af0e07
Merge pull request #1663 from makombe/arv-drugs
ojwanganto Sep 18, 2023
1ddef53
Create API endpoint for standard regimen
Sep 19, 2023
9c41645
Merge pull request #1668 from makombe/standard-regimen
ojwanganto Sep 19, 2023
3df0818
Add endpoint to retrieve child father, mother or guardian
CynthiaKamau Jul 13, 2023
27e8b4a
Merge pull request #1607 from CynthiaKamau/child-parents
makombe Sep 19, 2023
bf6c53b
Add API endpoint for regimen change/stop reasons
Sep 19, 2023
b847303
Fix Owners and Add one more Facility
PatrickWaweru Sep 20, 2023
a4a0a91
Merge pull request #1659 from PatrickWaweru/KHP3-3260-AddMoreFacilities
patryllus Sep 20, 2023
54dfbb0
KHP3-715:Renamed TX curr monthly and quarterly reports
njorocs Sep 20, 2023
3e089d5
Remove sd NVP+AZT+3TC
Sep 20, 2023
0eff68c
Merge pull request #1671 from gabriel090/KHP3-4094
patryllus Sep 21, 2023
2152e04
Merge pull request #1670 from njorocs/KHP3-715
patryllus Sep 21, 2023
43f86d4
KHP3-3041:Defaulter tracing register: Fixing Date client missed appoi…
njorocs Sep 21, 2023
f333cf8
RDQA REPORT_ Add columns for most recent WHO stage on the RDQA report.
Sep 21, 2023
505b4c5
Merge pull request #1674 from gabriel090/KHP3-740
patryllus Sep 21, 2023
ec1894b
Merge pull request #1673 from njorocs/KHP3-3041
patryllus Sep 21, 2023
87f68b2
API endpoint for last regimen encounter
Sep 22, 2023
50f6a1c
Merge pull request #1675 from makombe/last-regimen-encounter
CynthiaKamau Sep 25, 2023
d18187f
Added Medical cover and status at Current on ART linelist
patryllus Sep 25, 2023
8d18010
Merge pull request #1676 from patryllus/medical-insurance
njorocs Sep 25, 2023
1a226f9
Fix NEP on last regimen encounter url
Sep 27, 2023
92f76dd
Bump last regimen encounter with additional properties
Sep 27, 2023
76a80e9
Add ability to display TB regimens
Sep 27, 2023
c80bc30
Merge pull request #1678 from makombe/tb-lines
CynthiaKamau Sep 28, 2023
72088d6
Merge pull request #1669 from makombe/regimen-change-reason
CynthiaKamau Sep 28, 2023
bd5ed64
Merge pull request #1677 from makombe/last-regimen-fix
CynthiaKamau Oct 2, 2023
5e1e669
(fix) Add regimen dates in printable patient summary endpoint
CynthiaKamau Oct 2, 2023
8d17283
Merge pull request #1681 from CynthiaKamau/regimen-date-summary
makombe Oct 3, 2023
ff1c04d
Added a chore to migrate patient conditions
jecihjoy Jun 21, 2023
787cfbc
Added a chore to migrate patient allergies
jecihjoy Jun 21, 2023
1e0f21e
Post upgrade changes
jecihjoy Jul 4, 2023
5fddc8b
Update referredAndLinkedSinceThreeMonthsAgo clients query to support …
jecihjoy Aug 21, 2023
76c1fe8
Add support for platform 2.6.0
jecihjoy Jun 9, 2023
a1e4bdb
Upgrade to omrs 2.6.2 with encounter diagnosis support
Oct 3, 2023
47a7cc5
Merge branch 'openmrs-2.6.x-upgrade' into openmrs-2.6.x-upgrade
jecihjoy Oct 3, 2023
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 @@ -221,7 +221,6 @@ private void processEditHivFollowupEncounter(Encounter enc) throws Throwable {
appointmentServiceDefinition.setAppointmentServiceId(appointmentServiceDefinitionService.getAppointmentServiceByUuid(DRUG_REFILL_SERVICE).getId());

Appointment editedFollowUpAppointment = appointmentsService.getAppointmentByUuid(enc.getUuid());

Appointment refillAppointment = new Appointment();
Date refillStartDateTime = DateUtil.convertToDate(dateFormat.format(o.getValueDatetime()).concat("T07:00:00.0Z"), DateUtil.DateFormatType.UTC);
Date refillEndDateTime = DateUtil.convertToDate(dateFormat.format(o.getValueDatetime()).concat("T20:00:00.0Z"), DateUtil.DateFormatType.UTC);
Expand All @@ -234,10 +233,11 @@ private void processEditHivFollowupEncounter(Encounter enc) throws Throwable {
refillAppointment.setProvider(EmrUtils.getProvider(Context.getAuthenticatedUser()));
refillAppointment.setAppointmentKind(AppointmentKind.Scheduled);
Appointment app = appointmentsService.validateAndSave(refillAppointment);

editedFollowUpAppointment.setRelatedAppointment(app);
Appointment app2 = appointmentsService.validateAndSave(editedFollowUpAppointment);


if (editedFollowUpAppointment != null) {
editedFollowUpAppointment.setRelatedAppointment(app);
Appointment app2 = appointmentsService.validateAndSave(editedFollowUpAppointment);
}
}

}
Expand Down Expand Up @@ -277,7 +277,7 @@ private void processCreateHivFollowupEncounter(Encounter enc) throws Throwable {
refillApptDate = o.getValueDatetime();
}

if(appointmentReason != null && appointmentReason == 160523 || appointmentReason != null && appointmentReason == 160521 ) {
if((appointmentReason != null && appointmentReason == 160523) || (appointmentReason != null && appointmentReason == 160521) ) {
AppointmentServiceDefinition appointmentServiceDefinition = new AppointmentServiceDefinition();

// create HIV followup appointment
Expand Down Expand Up @@ -316,8 +316,10 @@ private void processCreateHivFollowupEncounter(Encounter enc) throws Throwable {
refillAppointment.setAppointmentKind(AppointmentKind.Scheduled);
Appointment app = appointmentsService.validateAndSave(refillAppointment);

currentFollowUpAppointment.setRelatedAppointment(app);
Appointment app2 = appointmentsService.validateAndSave(currentFollowUpAppointment);
if (currentFollowUpAppointment != null ) {
currentFollowUpAppointment.setRelatedAppointment(app);
Appointment app2 = appointmentsService.validateAndSave(currentFollowUpAppointment);
}
}

} else if ( appointmentReason != null && appointmentReason == 1283) {
Expand Down Expand Up @@ -369,7 +371,6 @@ private void processProgramEncounter(Encounter enc) throws Throwable {

if(editAppointment != null) {
//edit MCH or PREP or TB or KP appointment

Date nextApptStartDateTime = DateUtil.convertToDate(dateFormat.format(o.getValueDatetime()).concat("T07:00:00.0Z"), DateUtil.DateFormatType.UTC);
Date nextApptEndDateTime = DateUtil.convertToDate(dateFormat.format(o.getValueDatetime()).concat("T20:00:00.0Z"), DateUtil.DateFormatType.UTC);
editAppointment.setStartDateTime(nextApptStartDateTime);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import org.openmrs.Concept;
import org.openmrs.Obs;
import org.openmrs.Program;
import org.openmrs.api.ConceptService;
import org.openmrs.api.context.Context;
import org.openmrs.calculation.patient.PatientCalculationContext;
import org.openmrs.calculation.result.CalculationResultMap;
import org.openmrs.module.kenyacore.calculation.AbstractPatientCalculation;
Expand Down Expand Up @@ -60,13 +62,15 @@ public CalculationResultMap evaluate(Collection<Integer> cohort, Map<String, Obj
// Get all patients who are alive and in TB program
Set<Integer> alive = Filters.alive(cohort, context);
Set<Integer> inTbProgram = Filters.inProgram(tbProgram, alive, context);
ConceptService cs = Context.getConceptService();

// Get concepts
Concept tbsuspect = Dictionary.getConcept(Dictionary.DISEASE_SUSPECTED);
Concept pulmonaryTb = Dictionary.getConcept(Dictionary.PULMONARY_TB);
Concept smearPositive = Dictionary.getConcept(Dictionary.POSITIVE);
Concept NEGATIVE = Dictionary.getConcept(Dictionary.NEGATIVE);
Concept SPUTUM_FOR_ACID_FAST_BACILLI = Dictionary.getConcept(Dictionary.SPUTUM_FOR_ACID_FAST_BACILLI);
Concept geneXpertConcept = cs.getConcept(162202);

// check if there is any observation recorded per the tuberculosis disease status
CalculationResultMap lastObsTbDiseaseStatus = Calculations.lastObs(Dictionary.getConcept(Dictionary.TUBERCULOSIS_DISEASE_STATUS), cohort, context);
Expand All @@ -81,6 +85,7 @@ public CalculationResultMap evaluate(Collection<Integer> cohort, Map<String, Obj

// get the date when Tb treatment was started, the patient should be in tb program to have this date
CalculationResultMap tbStartTreatmentDate = Calculations.lastObs(Dictionary.getConcept(Dictionary.TUBERCULOSIS_DRUG_TREATMENT_START_DATE), cohort, context);
CalculationResultMap lastGeneXpertConcept = Calculations.lastObs(geneXpertConcept, alive, context);

CalculationResultMap ret = new CalculationResultMap();
for (Integer ptId : cohort) {
Expand All @@ -91,10 +96,11 @@ public CalculationResultMap evaluate(Collection<Integer> cohort, Map<String, Obj
Date treatmentStartDate = EmrCalculationUtils.datetimeObsResultForPatient(tbStartTreatmentDate, ptId);
Obs lastObsTbDiseaseResults = EmrCalculationUtils.obsResultForPatient(lastObsTbDiseaseStatus, ptId);
Obs lastSputumResultsObs = EmrCalculationUtils.obsResultForPatient(lastSputumResults, ptId);

Obs lastGeneXpertObs = EmrCalculationUtils.obsResultForPatient(lastGeneXpertConcept, ptId);
//
// check if a patient is alive
if (alive.contains(ptId)) {
if ((lastObsTbDiseaseResults != null) && (lastObsTbDiseaseResults.getValueCoded().equals(tbsuspect)) && lastSputumResultsObs == null && !(inTbProgram.contains(ptId))) {
if ((lastObsTbDiseaseResults != null) && (lastObsTbDiseaseResults.getValueCoded().equals(tbsuspect)) && lastSputumResultsObs == null && !(inTbProgram.contains(ptId)) && lastGeneXpertObs ==null) {
needsSputum = true;
}
else if(inTbProgram.contains(ptId) && diseaseClassification != null && tbResults != null && (diseaseClassification.getValueCoded().equals(pulmonaryTb)) && (tbResults.getValueCoded().equals(smearPositive)) && treatmentStartDate != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.ETLRefillDateDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.ETLStabilityDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.HeightAtArtDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.MedicalCoverDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.MedicalCoverStatusDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.NCDDateDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.NCDStatusDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.NCDsDataDefinition;
Expand Down Expand Up @@ -187,6 +189,12 @@ protected PatientDataSetDefinition activePatientsDataSetDefinition(String datase
BloodPressureDataDefinition bloodPressureDataDefinition = new BloodPressureDataDefinition();
bloodPressureDataDefinition.addParameter(new Parameter("endDate", "End Date", Date.class));
bloodPressureDataDefinition.addParameter(new Parameter("startDate", "Start Date", Date.class));
MedicalCoverDataDefinition medicalCoverDataDefinition = new MedicalCoverDataDefinition();
medicalCoverDataDefinition.addParameter(new Parameter("endDate", "End Date", Date.class));
medicalCoverDataDefinition.addParameter(new Parameter("startDate", "Start Date", Date.class));
MedicalCoverStatusDataDefinition medicalCoverStatusDataDefinition = new MedicalCoverStatusDataDefinition();
medicalCoverStatusDataDefinition.addParameter(new Parameter("endDate", "End Date", Date.class));
medicalCoverStatusDataDefinition.addParameter(new Parameter("startDate", "Start Date", Date.class));


DataConverter formatter = new ObjectFormatter("{familyName}, {givenName}");
Expand Down Expand Up @@ -238,6 +246,8 @@ protected PatientDataSetDefinition activePatientsDataSetDefinition(String datase
dsd.addColumn("NCDs Onset Date", ncdDateDataDefinition, "endDate=${endDate}");
dsd.addColumn("NCDs status", ncdStatusDataDefinition, "endDate=${endDate}");
dsd.addColumn("AHD Client", new CalculationDataDefinition("AHD Client", new PatientsWithAdvancedHivDiseaseCalculation()), "", new BooleanResultsConverter());
dsd.addColumn("Medical cover", medicalCoverDataDefinition, "endDate=${endDate}");
dsd.addColumn("Medical cover status", medicalCoverStatusDataDefinition, "endDate=${endDate}");


return dsd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,9 @@
import org.openmrs.module.kenyaemr.reporting.calculation.converter.RDQACalculationResultConverter;
import org.openmrs.module.kenyaemr.reporting.cohort.definition.CCCDefaulterTracingRegisterCohortDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.MissedAppointmentReasonsConverter;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.HIVTestOneDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.ETLLastVisitDateDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.art.ETLNextAppointmentDateDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.FinalOutcomeDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.ProviderCommentsDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.ReasonForMissedAppointmentDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.ReturnToCareDateDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.HonouredAppointmentDateDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.TracingNumberDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.TracingOutcomeDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.TracingTypeDataDefinition;
import org.openmrs.module.kenyaemr.reporting.data.converter.definition.defaulterTracing.*;
import org.openmrs.module.metadatadeploy.MetadataUtils;
import org.openmrs.module.reporting.common.SortCriteria;
import org.openmrs.module.reporting.data.DataDefinition;
Expand Down Expand Up @@ -105,6 +98,21 @@ protected DataSetDefinition datasetColumns() {
providerDataDefinition.setSingleProvider(true);
PersonAttributeType phoneNumber = MetadataUtils.existing(PersonAttributeType.class, CommonMetadata._PersonAttributeType.TELEPHONE_CONTACT);

String dateParams = "startDate=${startDate},endDate=${endDate}";

DateMissedAppointmentBeforeTracingDataDefinition dateMissedAppointment = new DateMissedAppointmentBeforeTracingDataDefinition();
dateMissedAppointment.addParameter(new Parameter("startDate", "Start Date", Date.class));
dateMissedAppointment.addParameter(new Parameter("endDate", "End Date", Date.class));

HonouredAppointmentDateDataDefinition dateHonouredAppointment = new HonouredAppointmentDateDataDefinition();
dateHonouredAppointment.addParameter(new Parameter("startDate", "Start Date", Date.class));
dateHonouredAppointment.addParameter(new Parameter("endDate", "End Date", Date.class));

LastVisitDateBeforeMissedAppointmentDataDefinition lastVisitBeforeMissedApp = new LastVisitDateBeforeMissedAppointmentDataDefinition();
lastVisitBeforeMissedApp.addParameter(new Parameter("startDate", "Start Date", Date.class));
lastVisitBeforeMissedApp.addParameter(new Parameter("endDate", "End Date", Date.class));


dsd.addColumn("Name", nameDef, "");
dsd.addColumn("id", new PatientIdDataDefinition(), "");
dsd.addColumn("Date of Birth", new BirthdateDataDefinition(), "", new BirthdateConverter(DATE_FORMAT));
Expand All @@ -118,16 +126,15 @@ protected DataSetDefinition datasetColumns() {
dsd.addColumn("Outcome", new TracingOutcomeDataDefinition(),"");
dsd.addColumn("Tracing attempt No", new TracingNumberDataDefinition(),"");
dsd.addColumn("Final Outcome", new FinalOutcomeDataDefinition(),"");
dsd.addColumn("Last Visit Date", new ETLLastVisitDateDataDefinition(),"", new DateConverter(DATE_FORMAT));
dsd.addColumn("Last Appointment Date", new ETLNextAppointmentDateDataDefinition(), "", new DateConverter(DATE_FORMAT));
dsd.addColumn("Last Visit Date", lastVisitBeforeMissedApp,dateParams, new DateConverter(DATE_FORMAT));
dsd.addColumn("Last Appointment Date", dateMissedAppointment, dateParams, new DateConverter(DATE_FORMAT));
dsd.addColumn("Reason for missed appointment", new ReasonForMissedAppointmentDataDefinition(),"", new MissedAppointmentReasonsConverter());
dsd.addColumn("Date promised to come", new ReturnToCareDateDataDefinition(),"", new DateConverter(DATE_FORMAT));
dsd.addColumn("Honoured appointment date", new HonouredAppointmentDateDataDefinition(),"", new DateConverter(DATE_FORMAT));
dsd.addColumn("Honoured appointment date", dateHonouredAppointment,dateParams, new DateConverter(DATE_FORMAT));
dsd.addColumn("Comments", new ProviderCommentsDataDefinition(),"");
dsd.addColumn("Provider", providerDataDefinition,"", new EncounterProviderConverter());



CCCDefaulterTracingRegisterCohortDefinition cd = new CCCDefaulterTracingRegisterCohortDefinition();
cd.addParameter(new Parameter("startDate", "Start Date", Date.class));
cd.addParameter(new Parameter("endDate", "End Date", Date.class));
Expand Down
Loading