Tabnine Logo
ProgramWorkflowService.purgeProgram
Code IndexAdd Tabnine to your IDE (free)

How to use
purgeProgram
method
in
org.openmrs.api.ProgramWorkflowService

Best Java code snippets using org.openmrs.api.ProgramWorkflowService.purgeProgram (Showing top 4 results out of 315)

origin: openmrs/openmrs-core

/**
 * @see org.openmrs.api.ProgramWorkflowService#purgeProgram(org.openmrs.Program)
 */
@Override
public void purgeProgram(Program program) throws APIException {
  Context.getProgramWorkflowService().purgeProgram(program, false);
}

origin: openmrs/openmrs-core

  @Test
  public void purgeProgram_shouldFailGivenNonEmptyWorkFlowsAndTrueCascade() {
    
    exception.expect(APIException.class);
    exception.expectMessage("Cascade purging of Programs is not implemented yet");
    
    Program program = new Program(1);
    ProgramWorkflow workflow = new ProgramWorkflow(1);
    program.addWorkflow(workflow);
    
    pws.purgeProgram(program, true);
  }
}
origin: openmrs/openmrs-module-webservices.rest

@Override
public void purge(Program program, RequestContext context) throws ResponseException {
  Context.getProgramWorkflowService().purgeProgram(program);
}

origin: openmrs/openmrs-core

@Test
public void purgeProgram_shouldPurgeProgramWithPatientsEnrolled() {
  Program program = Context.getProgramWorkflowService().getProgram(2);
  
  // program has at least one patient enrolled
  List<PatientProgram> patientPrograms = Context.getProgramWorkflowService().getPatientPrograms(null, program, null,
    null, null, null, true);
  assertTrue(patientPrograms.size() > 0);
  
  Context.getProgramWorkflowService().purgeProgram(program);
  
  // should cascade to patient programs
  for (PatientProgram patientProgram : patientPrograms) {
    assertNull(Context.getProgramWorkflowService().getPatientProgram(patientProgram.getId()));
  }
  // make sure that the program was deleted properly
  assertNull(Context.getProgramWorkflowService().getProgram(2));
}
@Test
org.openmrs.apiProgramWorkflowServicepurgeProgram

Javadoc

Completely remove a program from the database (not reversible) This method delegates to #purgeProgram(program, boolean) method

Popular methods of ProgramWorkflowService

  • getProgramByUuid
    Get a program by its uuid. There should be only one of these in the database. If multiple are found,
  • getPatientPrograms
    Returns PatientPrograms that match the input parameters. If an input parameter is set to null, the p
  • getStateByUuid
    Get a state by its uuid. There should be only one of these in the database. If multiple are found, a
  • getAllPrograms
    Returns all programs
  • getPatientProgramByUuid
    Get a patient program by its uuid. There should be only one of these in the database. If multiple ar
  • getProgram
    Returns a program given that programs primary key programId A null value is returned if no program e
  • getProgramByName
    Returns a program given the program's exact name A null value is returned if there is no program wit
  • getWorkflowByUuid
    Get ProgramWorkflow by its UUID
  • savePatientProgram
    Save patientProgram to database (create if new or update if changed)
  • getPatientStateByUuid
    Get a program state by its uuid. There should be only one of these in the database. If multiple are
  • getProgramAttributeTypeByUuid
  • getWorkflow
    Get ProgramWorkflow by internal identifier.
  • getProgramAttributeTypeByUuid,
  • getWorkflow,
  • purgePatientProgram,
  • getAllProgramAttributeTypes,
  • getPatientProgram,
  • getPatientProgramAttributeByUuid,
  • getState,
  • purgeProgramAttributeType,
  • saveProgram

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now