Skip to content

Commit

Permalink
Formatting changes only after running mvn clean install, due to forma…
Browse files Browse the repository at this point in the history
…tter maven plugin
  • Loading branch information
mseaton committed Dec 8, 2020
1 parent ac9aac7 commit 1130e48
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ public interface LegacyUIService extends OpenmrsService {
/**
* @see OrderExtensionService#getProviderForUser(User)
*/
public Provider getProviderForUser(User user) ;
public Provider getProviderForUser(User user);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ public class LegacyUIImpl extends BaseOpenmrsService implements LegacyUIService
private final Log log = LogFactory.getLog(this.getClass());

/**
* Copied from OpenMRS core 1.12.1 and added back #discontinueAllDrugOrders from 1.9.13
* See https://github.com/openmrs/openmrs-core/blob/1.12.1/api/src/main/java/org/openmrs/api/impl/PatientServiceImpl.java#L1191
* See https://github.com/openmrs/openmrs-core/blob/1.9.13/api/src/main/java/org/openmrs/api/impl/PatientServiceImpl.java#L1092
*
* This is the way to establish that a patient has left the care center. This API call is
* responsible for:
* Copied from OpenMRS core 1.12.1 and added back #discontinueAllDrugOrders from 1.9.13 See
* https://github.com/openmrs/openmrs-core/blob/1.12.1/api/src/main/java/org/openmrs/api/impl/
* PatientServiceImpl.java#L1191 See
* https://github.com/openmrs/openmrs-core/blob/1.9.13/api/src/
* main/java/org/openmrs/api/impl/PatientServiceImpl.java#L1092 This is the way to establish
* that a patient has left the care center. This API call is responsible for:
* <ol>
* <li>Closing workflow statuses</li>
* <li>Terminating programs</li>
Expand Down Expand Up @@ -89,10 +89,10 @@ public void exitFromCare(Patient patient, Date dateExited, Concept reasonForExit
}

/**
* Copied from OpenMRS core 1.12.1
* See https://github.com/openmrs/openmrs-core/blob/1.12.1/api/src/main/java/org/openmrs/api/impl/PatientServiceImpl.java#L1219
*
* TODO: Patients should actually be allowed to exit multiple times
* Copied from OpenMRS core 1.12.1 See
* https://github.com/openmrs/openmrs-core/blob/1.12.1/api/src
* /main/java/org/openmrs/api/impl/PatientServiceImpl.java#L1219 TODO: Patients should actually
* be allowed to exit multiple times
*
* @param patient
* @param exitDate
Expand Down Expand Up @@ -164,8 +164,9 @@ private void saveReasonForExitObs(Patient patient, Date exitDate, Concept cause)
}

/**
* Copied from OpenMRS core 1.12.1
* See https://github.com/openmrs/openmrs-core/blob/1.12.1/api/src/main/java/org/openmrs/api/impl/ProgramWorkflowServiceImpl.java#L450
* Copied from OpenMRS core 1.12.1 See
* https://github.com/openmrs/openmrs-core/blob/1.12.1/api/src
* /main/java/org/openmrs/api/impl/ProgramWorkflowServiceImpl.java#L450
*
* @see org.openmrs.api.ProgramWorkflowService#triggerStateConversion(org.openmrs.Patient,
* org.openmrs.Concept, java.util.Date)
Expand Down Expand Up @@ -233,10 +234,10 @@ public Provider getProviderForUser(User user) {
}

/**
* Copied from OpenMRS core 1.9.13
* See https://github.com/openmrs/openmrs-core/blob/1.9.13/api/src/main/java/org/openmrs/order/OrderUtil.java#L52
*
* Discontinues all current orders for the given <code>patient</code>
* Copied from OpenMRS core 1.9.13 See
* https://github.com/openmrs/openmrs-core/blob/1.9.13/api/src
* /main/java/org/openmrs/order/OrderUtil.java#L52 Discontinues all current orders for the given
* <code>patient</code>
*
* @param patient
* @param discontinueReason
Expand Down Expand Up @@ -271,8 +272,10 @@ public void discontinueAllDrugOrders(Patient patient, Concept discontinueReason,
// do the stuff to the database
if (drugOrder.isActive() || drugOrder.getEffectiveStopDate() == null) {
try {
Provider provider = Context.getService(LegacyUIService.class).getProviderForUser(Context.getAuthenticatedUser());
Context.getOrderService().discontinueOrder(drugOrder, discontinueReason, discontinueDate,provider, drugOrder.getEncounter());
Provider provider = Context.getService(LegacyUIService.class).getProviderForUser(
Context.getAuthenticatedUser());
Context.getOrderService().discontinueOrder(drugOrder, discontinueReason, discontinueDate, provider,
drugOrder.getEncounter());
}
catch (Exception e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ public ModelAndView handleRequest(HttpServletRequest request, HttpServletRespons
model.put("patientObs", new HashSet<Obs>());
}
/**
* Copied from OpenMRS core 1.9.13
* See https://github.com/openmrs/openmrs-core/blob/1.9.13/web/src/main/java/org/openmrs/web/controller/PortletController.java#L267
* Copied from OpenMRS core 1.9.13 See
* https://github.com/openmrs/openmrs-core/blob
* /1.9.13/web/src/main/java/org/openmrs
* /web/controller/PortletController.java#L267
*/
// information about whether or not the patient has exited care
Obs reasonForExitObs = null;
Expand Down
6 changes: 4 additions & 2 deletions omod/src/main/java/org/openmrs/web/dwr/DWRPatientService.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@ public String addIdentifier(Integer patientId, String identifierType, String ide
}

/**
* Copied from OpenMRS core 1.12.1 and modified the method to use {@link LegacyUIService#exitFromCare(Patient, Date, Concept)}
* See https://github.com/openmrs/openmrs-core/blob/1.12.1/web/src/main/java/org/openmrs/web/dwr/DWRPatientService.java#L466
* Copied from OpenMRS core 1.12.1 and modified the method to use
* {@link LegacyUIService#exitFromCare(Patient, Date, Concept)} See
* https://github.com/openmrs/openmrs
* -core/blob/1.12.1/web/src/main/java/org/openmrs/web/dwr/DWRPatientService.java#L466
*
* @param patientId
* @param exitReasonId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ public ProgramWorkflow getProgramWorkflow(Program program, String workflowLookup
if (wf == null) {
for (ProgramWorkflow programWorkflow : program.getAllWorkflows()) {
if (workflowLookup.equalsIgnoreCase(programWorkflow.getConcept().getName().toString())) {
wf = programWorkflow;
}
else if (workflowLookup.equalsIgnoreCase(programWorkflow.getUuid())) {
wf = programWorkflow;
}
else if (workflowLookup.equalsIgnoreCase(programWorkflow.getId().toString())) {
wf = programWorkflow;
wf = programWorkflow;
} else if (workflowLookup.equalsIgnoreCase(programWorkflow.getUuid())) {
wf = programWorkflow;
} else if (workflowLookup.equalsIgnoreCase(programWorkflow.getId().toString())) {
wf = programWorkflow;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void getPossibleNextStates_shouldReturnNonRetiredStates() throws Exceptio
@Verifies(value = "should return a ProgramWorkflow for the given ID", method = "getProgramWorkflow")
public void getWorkflowById_shouldFindObjectGivenValidId() throws Exception {
executeDataSet(PROGRAM_NEXT_STATES_XML);
int programWorkflowId= 501;
int programWorkflowId = 501;
ProgramWorkflow programWorkflow = dwrProgramWorkflowService.getProgramWorkflow(String.valueOf(programWorkflowId));
assertNotNull(programWorkflow);
assertEquals("79fbc48b-215f-41af-982c-5071978be018", programWorkflow.getUuid());
Expand Down

0 comments on commit 1130e48

Please sign in to comment.