congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ProgramWorkflowService.getWorkflow
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: openmrs/openmrs-core

@Override
protected ProgramWorkflow getObjectById(Integer id) {
  return Context.getProgramWorkflowService().getWorkflow(id);
}

origin: openmrs/openmrs-core

@Test
public void getWorkflow_shouldReturnNullIfGivenWorkflowIdDoesNotExists() {
  
  assertNull(pws.getWorkflow(99999));
}

origin: openmrs/openmrs-core

@Test
public void getWorkflow_shouldGetWorkflowAssociatedWithGivenIdIfWorkflowIdExists() {
  
  final Integer EXISTING_WORKFLOW_ID = 1;
  
  ProgramWorkflow workflow = pws.getWorkflow(EXISTING_WORKFLOW_ID);
  
  assertNotNull("ProgramWorkflow not found", workflow);
  assertThat(workflow.getId(), is(EXISTING_WORKFLOW_ID));
}

origin: openmrs/openmrs-module-htmlformentry

/**
 * @see {@link HtmlFormEntryUtil#getState(String,Program)}
 */
@SuppressWarnings("deprecation")
@Test
@Verifies(value = "should return the state with the matching uuid", method = "getState(String,ProgramWorkflow)")
public void getStateWorkflow_shouldReturnTheStateWithTheMatchingUuid() throws Exception {
  Assert.assertEquals("1",HtmlFormEntryUtil.getState("92584cdc-6a20-4c84-a659-e035e45d36b0", Context.getProgramWorkflowService().getWorkflow(1)).getId().toString());
}
 
origin: openmrs/openmrs-module-htmlformentry

/**
 * @see {@link HtmlFormEntryUtil#getState(String,Program)}
 */
@SuppressWarnings("deprecation")
@Test
@Verifies(value = "should return the state with the matching id", method = "getState(String,ProgramWorkflow)")
public void getStateWorkflow_shouldReturnTheStateWithTheMatchingId() throws Exception {
  Assert.assertEquals("92584cdc-6a20-4c84-a659-e035e45d36b0",
    HtmlFormEntryUtil.getState("1", Context.getProgramWorkflowService().getWorkflow(1)).getUuid());
}
 
origin: openmrs/openmrs-module-htmlformentry

/**
 * @see {@link HtmlFormEntryUtil#getState(String,Program)}
 */
@SuppressWarnings("deprecation")
@Test
@Verifies(value = "should look up a state by a concept mapping", method = "getState(String,ProgramWorkflow)")
public void getStateWorkflow_shouldLookUpAStateByAConceptMapping() throws Exception {
  // load this data set so that we get the additional patient program with concept mapping
  executeDataSet(XML_DATASET_PATH + new TestUtil().getTestDatasetFilename(XML_REGRESSION_TEST_DATASET));
  Assert.assertEquals("6de7ed10-53ad-11e1-8cb6-00248140a5eb",HtmlFormEntryUtil.getState("SNOMED CT: Test Code", Context.getProgramWorkflowService().getWorkflow(108)).getUuid());
}
 
origin: openmrs/openmrs-module-htmlformentry

@SuppressWarnings("deprecation")
@Override
public void testResults(SubmissionResults results) {
  results.assertNoErrors();
  results.assertEncounterCreated();
  results.assertProvider(502);
  results.assertLocation(2);
  
  // make sure the enrollment date has NOT been changed (since no state was set)
  ProgramWorkflow workflow = Context.getProgramWorkflowService().getWorkflow(100);
  Assert.assertEquals(1, Context.getProgramWorkflowService().getPatientPrograms(patient, workflow.getProgram(), null, null, null, null, false).size());
  PatientProgram patientProgram = Context.getProgramWorkflowService().getPatientPrograms(patient, workflow.getProgram(), null, null, null, null, false).get(0);
  Assert.assertNotNull(patientProgram);    
  Assert.assertEquals(dateAsString(DATE), dateAsString(patientProgram.getDateEnrolled()));
  
  // assert that no states have been associated
  Assert.assertEquals(0, patientProgram.getStates().size());
}
 
origin: openmrs/openmrs-module-htmlformentry

@SuppressWarnings("deprecation")
public void testEditedResults(SubmissionResults results) {
  results.assertNoErrors();
  
  ProgramWorkflowState state = Context.getProgramWorkflowService().getStateByUuid(START_STATE);
  
  // we should now have two program enrollments, one on PAST_DATE and one on DATE
  ProgramWorkflow workflow = Context.getProgramWorkflowService().getWorkflow(100);
  Assert.assertEquals(2, Context.getProgramWorkflowService().getPatientPrograms(patient, workflow.getProgram(), null, null, null, null, false).size());
  
  // now verify that new state is correct
  PatientProgram patientProgram = getPatientProgramByState(results.getPatient(), state, PAST_DATE);
  Assert.assertNotNull(patientProgram);
  Assert.assertEquals(dateAsString(PAST_DATE), dateAsString(patientProgram.getDateEnrolled()));
  
  // assert that the program has only one state
  Assert.assertEquals(1, patientProgram.getStates().size());
  
  // assert that the start state of the state is correct
  PatientState patientState = getPatientState(patientProgram, state, PAST_DATE);
  Assert.assertNotNull(patientState);
  Assert.assertEquals(dateAsString(PAST_DATE), dateAsString(patientState.getStartDate()));
  Assert.assertNull(patientState.getEndDate());
}
 
origin: openmrs/openmrs-module-htmlformentry

@SuppressWarnings("deprecation")
public void testEditedResults(SubmissionResults results) {
  results.assertNoErrors();
  
  ProgramWorkflow workflow = Context.getProgramWorkflowService().getWorkflow(100);
  
  ProgramWorkflowState startState = Context.getProgramWorkflowService().getStateByUuid(START_STATE);
  ProgramWorkflowState endState = Context.getProgramWorkflowService().getStateByUuid(END_STATE);
  
  PatientProgram patientProgram = Context.getProgramWorkflowService().getPatientPrograms(patient, workflow.getProgram(), null, null, null, null, false).get(0);
  Assert.assertNotNull(patientProgram);
  
  // assert that the patient program only has two states
  Assert.assertEquals(2, patientProgram.statesInWorkflow(workflow, false).size());
  
  // verify that the start state
  PatientState patientState = getPatientState(patientProgram, startState, FURTHER_PAST_DATE);
  Assert.assertNotNull(patientState);
  Assert.assertEquals(dateAsString(FURTHER_PAST_DATE), dateAsString(patientState.getStartDate()));
  Assert.assertEquals(dateAsString(DATE), dateAsString(patientState.getEndDate()));
  
  // verify that the end state starts on DATE and has no current end date
  patientState = getPatientState(patientProgram, endState, DATE);
  Assert.assertNotNull(patientState);
  Assert.assertEquals(dateAsString(DATE), dateAsString(patientState.getStartDate()));
  Assert.assertNull(patientState.getEndDate());
}
 
origin: openmrs/openmrs-module-htmlformentry

results.assertNoErrors();
ProgramWorkflow workflow = Context.getProgramWorkflowService().getWorkflow(100);
org.openmrs.apiProgramWorkflowServicegetWorkflow

Javadoc

Get ProgramWorkflow by internal identifier.

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
  • purgePatientProgram
    Completely remove a patientProgram from the database (not reversible)
  • getProgramAttributeTypeByUuid,
  • purgePatientProgram,
  • purgeProgram,
  • getAllProgramAttributeTypes,
  • getPatientProgram,
  • getPatientProgramAttributeByUuid,
  • getState,
  • purgeProgramAttributeType,
  • saveProgram

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • 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
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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