Skip to content

Commit

Permalink
Format the code
Browse files Browse the repository at this point in the history
  • Loading branch information
jayasanka-sack committed Oct 25, 2024
1 parent 0828b67 commit 2ede16b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

public interface VisitWithDiagnosesService {
/**
* Fetches visits of a patient by patient ID.
* Fetches visits with note encounters and diagnoses of a patient by patient ID.
*
* @param patientUuid the UUID of the patient
* @return a list of visits
* @return a list of visits that has note encounters and diagnoses
*/
List<VisitWithDiagnoses> getVisitsByPatientId(String patientUuid, int startIndex, int limit);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ public ResponseEntity<?> getVisitsByPatientId(
List<VisitWithDiagnoses> visits;
visits = visitWithDiagnosesService.getVisitsByPatientId(patientUuid, context.getStartIndex(), context.getLimit());

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

for (VisitWithDiagnoses visit : visits) {
SimpleObject visitObject = (SimpleObject) ConversionUtil.convertToRepresentation(visit, context.getRepresentation());
List<SimpleObject> convertedDiagnoses = new ArrayList<>();

for (Diagnosis diagnosis : visit.getDiagnoses()) {
convertedDiagnoses.add((SimpleObject) ConversionUtil.convertToRepresentation(diagnosis, context.getRepresentation()));
}
visitObject.put("diagnoses", convertedDiagnoses);

convertedVisits.add(visitObject);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public void shouldGetVisitsByPatientId() throws Exception {
String firstVisitUuid = "1esd5218-6b78-11e0-93c3-18a905e044dc";
String secondVisitUuid = "1c72e1ac-9b18-11e0-93c3-18a905e044dc";

// extract the response from the mockMvc

MvcResult response = mockMvc.perform(get("/rest/v1/emrapi/patient/" + patientUuid + "/visit")
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
Expand Down

0 comments on commit 2ede16b

Please sign in to comment.