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

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

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

origin: openmrs/openmrs-core

  /**
   * @see org.openmrs.customdatatype.SerializingCustomDatatype#deserialize(java.lang.String)
   * @should return the object by given uuid string
   * @override
   */
  @Override
  public Program deserialize(String uuid) {
    if (StringUtils.isBlank(uuid)) {
      return null;
    }
    return Context.getProgramWorkflowService().getProgramByUuid(uuid);
  }
}
origin: openmrs/openmrs-core

  p = Context.getProgramWorkflowService().getProgramByName(c.getName().getName());
} else {
  p = Context.getProgramWorkflowService().getProgramByUuid(text);
origin: openmrs/openmrs-core

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

origin: openmrs/openmrs-core

/**
 * @see ProgramWorkflowService#getProgramByUuid(String)
 */
@Test
public void getProgramByUuid_shouldFindObjectGivenValidUuid() {
  String uuid = "eae98b4c-e195-403b-b34a-82d94103b2c0";
  Program program = Context.getProgramWorkflowService().getProgramByUuid(uuid);
  Assert.assertEquals(1, (int) program.getProgramId());
}

origin: openmrs/openmrs-core

/**
 * @see ProgramWorkflowService#saveProgram(Program)
 */
@Test
public void saveProgram_shouldUpdateDetachedProgram() {
  Program program = Context.getProgramWorkflowService().getProgramByUuid("eae98b4c-e195-403b-b34a-82d94103b2c0");
  program.setDescription("new description");
  Context.evictFromSession(program);
  
  program = Context.getProgramWorkflowService().saveProgram(program);
  Assert.assertEquals("new description", program.getDescription());
}

origin: openmrs/openmrs-core

@Test
public void retireProgram_shouldSaveTheRetiredProgramWithReason() throws APIException {
  String reason = "Feeling well.";
  
  String uuid = "eae98b4c-e195-403b-b34a-82d94103b2c0";
  Program program = Context.getProgramWorkflowService().getProgramByUuid(uuid);
  
  Program retireProgram = pws.retireProgram(program, reason);
  
  assertTrue(retireProgram.getRetired());
  assertEquals(reason, retireProgram.getRetireReason());
  for (ProgramWorkflow programWorkflow : program.getAllWorkflows()) {
    assertTrue(programWorkflow.getRetired());
    for (ProgramWorkflowState programWorkflowState : programWorkflow.getStates()) {
      assertTrue(programWorkflowState.getRetired());
    }
  }
  
}

origin: openmrs/openmrs-module-webservices.rest

@Override
public Program getByUniqueId(String uniqueId) {
  Program programByUuid = Context.getProgramWorkflowService().getProgramByUuid(uniqueId);
  //We assume the caller was fetching by name
  if (programByUuid == null) {
    programByUuid = Context.getProgramWorkflowService().getProgramByName(uniqueId);
  }
  return programByUuid;
}

origin: openmrs/openmrs-module-webservices.rest

@Override
public Program newObject() {
  return Context.getProgramWorkflowService().getProgramByUuid(getUuidProperty());
}

origin: openmrs/openmrs-module-htmlformentry

if(prog != null && prog.trim().length() > 0)
  Program personProgram = Context.getProgramWorkflowService().getProgramByUuid(prog);
  if(personProgram == null)
origin: openmrs/openmrs-module-htmlformentry

program = Context.getProgramWorkflowService().getProgramByUuid(id);
origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldGetAProgramByUuid() throws Exception {
  MockHttpServletRequest req = request(RequestMethod.GET, getURI() + "/" + getUuid());
  SimpleObject result = deserialize(handle(req));
  
  Program program = service.getProgramByUuid(getUuid());
  Assert.assertNotNull(result);
  Assert.assertEquals(program.getUuid(), PropertyUtils.getProperty(result, "uuid"));
  Assert.assertEquals(program.getName(), PropertyUtils.getProperty(result, "name"));
  Assert.assertEquals(program.getOutcomesConcept(), PropertyUtils.getProperty(result, "outcomesConcept"));
}

origin: openmrs/openmrs-module-htmlformentry

Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getProgramByUuid(
    "da4a0391-ba62-4fad-ad66-1e3722d16380")));
Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getProgramByUuid(
    "71779c39-d289-4dfe-91b5-e7cfaa27c78b")));
origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldEditAProgram() throws Exception {
  
  final String editedName = "Malaria Program Edited";
  String json = "{ \"name\":\"" + editedName + "\" }";
  MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid());
  req.setContent(json.getBytes());
  handle(req);
  
  Program editedProgram = service.getProgramByUuid(getUuid());
  Assert.assertNotNull(editedProgram);
  Assert.assertEquals(editedName, editedProgram.getName());
}

origin: openmrs/openmrs-module-htmlformentry

Assert.assertFalse(dependencies.contains(Context.getProgramWorkflowService().getProgramByUuid(
  "da4a0391-ba62-4fad-ad66-1e3722d16380")));
Assert.assertFalse(dependencies.contains(Context.getProgramWorkflowService().getProgramByUuid(
  "71779c39-d289-4dfe-91b5-e7cfaa27c78b")));
origin: openmrs/openmrs-module-webservices.rest

@Test
public void shouldGetAProgramByUuid() throws Exception {
  
  MockHttpServletRequest req = request(RequestMethod.GET, getURI() + "/" + getUuid());
  SimpleObject result = deserialize(handle(req));
  
  Program program = service.getProgramByUuid(getUuid());
  Assert.assertNotNull(result);
  Assert.assertEquals(program.getUuid(), PropertyUtils.getProperty(result, "uuid"));
  Assert.assertEquals(program.getName(), PropertyUtils.getProperty(result, "name"));
}

origin: openmrs/openmrs-module-htmlformentry

Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getProgramByUuid(
  "da4a0391-ba62-4fad-ad66-1e3722d16380")));
Assert.assertTrue(dependencies.contains(Context.getProgramWorkflowService().getProgramByUuid(
  "71779c39-d289-4dfe-91b5-e7cfaa27c78b")));
org.openmrs.apiProgramWorkflowServicegetProgramByUuid

Javadoc

Get a program by its uuid. There should be only one of these in the database. If multiple are found, an error is thrown.

Popular methods of ProgramWorkflowService

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

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Top plugins for Android Studio
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