Skip to content

Commit

Permalink
Fix method namings
Browse files Browse the repository at this point in the history
  • Loading branch information
jayasanka-sack committed Dec 12, 2024
1 parent 7f8fe94 commit a23b7c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.openmrs.module.emrapi.visit;

import org.openmrs.Patient;

import java.util.List;

public interface VisitWithDiagnosesService {
Expand All @@ -11,5 +9,5 @@ public interface VisitWithDiagnosesService {
* @param patientUuid the UUID of the patient
* @return a list of visits that has note encounters and diagnoses
*/
List<VisitWithDiagnoses> getVisitsByPatientId(String patientUuid, int startIndex, int limit);
List<VisitWithDiagnoses> getVisitsWithNotesAndDiagnosesByPatient(String patientUuid, int startIndex, int limit);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class VisitWithDiagnosesServiceImpl extends BaseOpenmrsService implements
EmrApiDAO emrApiDAO;

@Override
public List<VisitWithDiagnoses> getVisitsByPatientId(String patientUuid, int startIndex, int limit) {
public List<VisitWithDiagnoses> getVisitsWithNotesAndDiagnosesByPatient(String patientUuid, int startIndex, int limit) {

Patient patient = patientService.getPatientByUuid(patientUuid);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.openmrs.module.emrapi.web.controller;

import org.hibernate.ObjectNotFoundException;
import org.openmrs.Diagnosis;
import org.openmrs.Patient;
import org.openmrs.module.emrapi.visit.VisitWithDiagnoses;
import org.openmrs.module.emrapi.visit.VisitWithDiagnosesService;
import org.openmrs.module.webservices.rest.SimpleObject;
Expand Down Expand Up @@ -37,7 +35,7 @@ public ResponseEntity<?> getVisitsByPatientId(
@PathVariable("patientUuid") String patientUuid) {
RequestContext context = RestUtil.getRequestContext(request, response, Representation.DEFAULT);
List<VisitWithDiagnoses> visitsEntries;
visitsEntries = visitWithDiagnosesService.getVisitsByPatientId(patientUuid, context.getStartIndex(), context.getLimit());
visitsEntries = visitWithDiagnosesService.getVisitsWithNotesAndDiagnosesByPatient(patientUuid, context.getStartIndex(), context.getLimit());

// Convert the visits and diagnoses to SimpleObjects
List<SimpleObject> convertedVisits = new ArrayList<>();
Expand Down

0 comments on commit a23b7c0

Please sign in to comment.