Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 3440

Show
Ignore:
Timestamp:
02/20/08 21:11:56 (11 months ago)
Author:
bmckown
Message:

Fixing #627 - Adding ability to set a creator when enrolling patient in a program.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/trunk/src/api/org/openmrs/api/ProgramWorkflowService.java

    r2965 r3440  
    1414import org.openmrs.ProgramWorkflow; 
    1515import org.openmrs.ProgramWorkflowState; 
     16import org.openmrs.User; 
    1617import org.openmrs.api.db.ProgramWorkflowDAO; 
    1718import org.springframework.transaction.annotation.Transactional; 
     
    7374 
    7475        public void enrollPatientInProgram(Patient patient, Program program, 
    75                         Date enrollmentDate, Date completionDate); 
     76                        Date enrollmentDate, Date completionDate, User creator); 
    7677 
    7778        public void voidPatientProgram(PatientProgram p, String reason); 
  • openmrs/trunk/src/api/org/openmrs/api/impl/ProgramWorkflowServiceImpl.java

    r2965 r3440  
    1818import org.openmrs.ProgramWorkflow; 
    1919import org.openmrs.ProgramWorkflowState; 
     20import org.openmrs.User; 
    2021import org.openmrs.api.APIAuthenticationException; 
    2122import org.openmrs.api.APIException; 
     
    330331         * @see org.openmrs.api.impl.ProgramWorkflowService#enrollPatientInProgram(org.openmrs.Patient, org.openmrs.Program, java.util.Date, java.util.Date) 
    331332         */ 
    332         public void enrollPatientInProgram(Patient patient, Program program, Date enrollmentDate, Date completionDate) { 
     333        public void enrollPatientInProgram(Patient patient, Program program, Date enrollmentDate, Date completionDate, User creator) { 
    333334                if (!Context.getUserContext().hasPrivilege(OpenmrsConstants.PRIV_EDIT_PATIENT_PROGRAMS)) 
    334335                        throw new APIAuthenticationException("Privilege required: " + OpenmrsConstants.PRIV_EDIT_PATIENT_PROGRAMS); 
     
    341342                p.setProgram(program); 
    342343                p.setDateEnrolled(enrollmentDate); 
     344                if (null != creator) { 
     345                        p.setCreator(creator); 
     346                } 
    343347                createPatientProgram(p); 
    344348        } 
  • openmrs/trunk/src/web/org/openmrs/web/controller/program/PatientProgramFormController.java

    r1776 r3440  
    5959                        request.getSession().setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Program.error.already"); 
    6060                else 
    61                         Context.getProgramWorkflowService().enrollPatientInProgram(patient, program, enrollmentDate, completionDate); 
     61                        Context.getProgramWorkflowService().enrollPatientInProgram(patient, program, enrollmentDate, completionDate, null); 
    6262 
    6363                return new ModelAndView(new RedirectView(returnPage));