Codota Logo
ProgramWorkflowService.getWorkflowByUuid
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain ProgramWorkflowService
private void myMethod () {
ProgramWorkflowService p =
  • Codota IconContext.getProgramWorkflowService()
  • Smart code suggestions by Codota
}
origin: openmrs/openmrs-core

  @Override
  protected ProgramWorkflow getObjectByUuid(String uuid) {
    return Context.getProgramWorkflowService().getWorkflowByUuid(uuid);
  }
}
origin: openmrs/openmrs-core

  @Override
  protected ProgramWorkflow getExistingObject() {
    return programWorkflowService.getWorkflowByUuid(EXISTING_UUID);
  }
}
origin: openmrs/openmrs-core

/**
 * @see ProgramWorkflowService#getWorkflowByUuid(String)
 */
@Test
public void getWorkflowByUuid_shouldReturnNullIfNoObjectFoundWithGivenUuid() {
  Assert.assertNull(Context.getProgramWorkflowService().getWorkflowByUuid("some invalid uuid"));
}

origin: openmrs/openmrs-core

/**
 * @see ProgramWorkflowService#getWorkflowByUuid(String)
 */
@Test
public void getWorkflowByUuid_shouldFindObjectGivenValidUuid() {
  String uuid = "84f0effa-dd73-46cb-b931-7cd6be6c5f81";
  ProgramWorkflow programWorkflow = Context.getProgramWorkflowService().getWorkflowByUuid(uuid);
  Assert.assertEquals(1, (int) programWorkflow.getProgramWorkflowId());
}

origin: openmrs/openmrs-core

/**
 * @see PatientProgramValidator#validate(Object,Errors)
 */
@Test
public void validate_shouldPassIfAPatientIsInMultipleStatesInDifferentWorkFlows() {
  PatientProgram program = Context.getProgramWorkflowService().getPatientProgram(1);
  
  //Add another state to another work flow
  PatientState patientState2 = new PatientState();
  patientState2.setStartDate(new Date());
  patientState2.setState(Context.getProgramWorkflowService().getWorkflowByUuid("c66c8713-7df4-40de-96f6-dc4cce3432da")
      .getState(5));
  program.getStates().add(patientState2);
  
  ValidateUtil.validate(program);
}

origin: openmrs/openmrs-core

/**
 * @throws InterruptedException
 * @see PatientProgramValidator#validate(Object,Errors)
 */
@Test
public void validate_shouldFailIfAnyPatientStatesOverlapEachOtherInTheSameWorkFlow() throws InterruptedException {
  PatientProgram program = Context.getProgramWorkflowService().getPatientProgram(1);
  //Addition of new states to this program in the test data can make this test useless, so catch it her
  Assert.assertEquals(1, program.getStates().size());
  PatientState patientState1 = program.getStates().iterator().next();
  
  //Add a state that comes after patientState1
  PatientState patientState2 = new PatientState();
  patientState2.setStartDate(new Date());
  patientState2.setState(Context.getProgramWorkflowService().getWorkflowByUuid("84f0effa-dd73-46cb-b931-7cd6be6c5f81")
      .getState(1));
  //guarantees that startDate of patientState2 is atleast 10ms earlier
  Thread.sleep(10);
  patientState1.setEndDate(new Date());
  
  program.getStates().add(patientState2);
  
  BindException errors = new BindException(program, "");
  new PatientProgramValidator().validate(program, errors);
  Assert.assertEquals(true, errors.hasFieldErrors("states"));
}

origin: openmrs/openmrs-module-webservices.rest

@Override
public ProgramWorkflow getByUniqueId(String uniqueId) {
  return Context.getProgramWorkflowService().getWorkflowByUuid(uniqueId);
}

origin: openmrs/openmrs-module-webservices.rest

@Override
public ProgramWorkflow newObject() {
  return Context.getProgramWorkflowService().getWorkflowByUuid(getUuidProperty());
}

origin: openmrs/openmrs-module-htmlformentry

workflow = Context.getProgramWorkflowService().getWorkflowByUuid(identifier);
origin: openmrs/openmrs-module-htmlformentry

@Override
public void testResults(SubmissionResults results) {
  results.assertNoErrors();
  results.assertEncounterCreated();
  List<PatientProgram> pps = pws.getPatientPrograms(ps.getPatient(patientId), pws.getProgram(programId), null,
    null, null, null, false);
  Assert.assertEquals(1, pps.size());
  
  //the user selected date should have been set
  Assert.assertEquals(ymdToDate(dateAsString(enrollmentDate)), ymdToDate(dateAsString(pps.get(0)
      .getDateEnrolled())));
  
  //the initial state should have been set
  Assert.assertEquals(1, pps.get(0).getStates().size());
  Assert.assertEquals(200,
    pps.get(0).getCurrentState(pws.getWorkflowByUuid("72a90efc-5140-11e1-a3e3-00248140a5eb")).getState()
        .getId().intValue());
};
 
origin: openmrs/openmrs-module-htmlformentry

@Override
public void testResults(SubmissionResults results) {
  results.assertNoErrors();
  results.assertEncounterCreated();
  List<PatientProgram> pps = pws.getPatientPrograms(ps.getPatient(patientId), pws.getProgram(programId), null,
    null, null, null, false);
  Assert.assertEquals(1, pps.size());
  
  //the user selected date should have been set
  Assert.assertEquals(ymdToDate(dateAsString(enrollmentDate)), ymdToDate(dateAsString(pps.get(0)
      .getDateEnrolled())));
  
  //the initial states should have been set for the 2 workflows in the form
  Assert.assertEquals(2, pps.get(0).getCurrentStates().size());
  ProgramWorkflow wf1 = pws.getWorkflowByUuid("67337cdc-53ad-11e1-8cb6-00248140a5eb");
  ProgramWorkflow wf2 = pws.getWorkflowByUuid("6de7ed10-53ad-11e1-8cb6-00248140a5eb");
  Assert.assertNotNull(pps.get(0).getCurrentState(wf1).getState());
  Assert.assertEquals(ymdToDate(dateAsString(enrollmentDate)), ymdToDate(dateAsString(pps.get(0).getCurrentState(wf1).getStartDate())));
  Assert.assertNotNull(pps.get(0).getCurrentState(wf2).getState());
  Assert.assertEquals(ymdToDate(dateAsString(enrollmentDate)), ymdToDate(dateAsString(pps.get(0).getCurrentState(wf2).getStartDate())));
};
 
origin: openmrs/openmrs-module-htmlformentry

Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getWorkflowByUuid(
  "72a90efc-5140-11e1-a3e3-00248140a5eb")));
Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getWorkflowByUuid(
  "7c3e071a-53a7-11e1-8cb6-00248140a5eb")));
origin: openmrs/openmrs-module-htmlformentry

Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getWorkflowByUuid(
  "72a90efc-5140-11e1-a3e3-00248140a5eb")));
Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getWorkflowByUuid(
  "7c3e071a-53a7-11e1-8cb6-00248140a5eb")));
origin: openmrs/openmrs-module-htmlformentry

Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getWorkflowByUuid(
    "72a90efc-5140-11e1-a3e3-00248140a5eb")));
Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getWorkflowByUuid(
    "7c3e071a-53a7-11e1-8cb6-00248140a5eb")));
org.openmrs.apiProgramWorkflowServicegetWorkflowByUuid

Javadoc

Get ProgramWorkflow by its UUID

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

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • JPanel (javax.swing)
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now