Package org.openmrs

Examples of org.openmrs.Drug


        results.assertEncounterCreated();
        Encounter e = results.getEncounterCreated();
       
        Set<Order> orders = e.getOrders();
       
        Drug drug = Context.getConceptService().getDrug(2);
        assertThat(orders, contains(allOf(hasProperty("drug", is(drug)), hasProperty("dose", is(1.0)),
          hasProperty("startDate", is(ymdToDate(dateAsString(date)))))));
      }
    }.run();
  }
View Full Code Here


    PatientIdentifierType existing1 = Context.getPatientService().getPatientIdentifierType(4); // Social Security Number
   
    Location incoming2 = Context.getLocationService().getLocation(3)// Never Never Land
    Location existing2 = Context.getLocationService().getLocation(2); // Xanadu
   
    Drug incoming3 = Context.getConceptService().getDrug(3)// Aspirin
    Drug existing3 = Context.getConceptService().getDrug(11); // NyQuil
   
    Role incoming4 = Context.getUserService().getRole(incomingRoleName);
    Role existing4 = Context.getUserService().getRole(existingRoleName);
   
    Map<OpenmrsObject, OpenmrsObject> incomingToExisting = new HashMap<OpenmrsObject, OpenmrsObject>();
View Full Code Here

                  if (stRegimens != null){
                    ConceptService cs = Context.getConceptService();
                    for (RegimenSuggestion rs : stRegimens){
                      if (rs.getCodeName().equals(id) && rs.getDrugComponents() != null){
                        for (DrugSuggestion ds : rs.getDrugComponents()){
                          Drug drug = cs.getDrugByNameOrId(ds.getDrugId());
                          if (drug == null)
                             drug = cs.getDrugByUuid(ds.getDrugId());
                          if (drug != null)
                            dependencies.add(drug);
                        }
View Full Code Here

    return getDrugService().getDrugByUuid(uuid);
  }
 
  @Override
  public Drug newDelegate() {
    return new Drug();
  }
View Full Code Here

    return dao.getDrugInfoByUuid(uuid);
  }
 
  @Override
  public DrugInfo getDrugInfoByDrugUuid(String uuid) {
    Drug d = Context.getConceptService().getDrugByUuid(uuid);
    return dao.getDrugInfoByDrug(d.getId());
  }
View Full Code Here

   * Test of saveDrugInfo method, of class HibernateDrugInfoDAO.
   */
  @Test
  public void testSaveDrugInfo() {
    DrugInfo drugInfo = new DrugInfo();
    Drug drug = new Drug();
    drug.setId(3);
    drugInfo.setDrug(drug);
    drugInfo.setDrugId(drug.getId());
    drugInfo.setName("TestDrugInfo3");
    drugInfo.setDescription("Third Test DrugInfo");
    drugInfo.setCreator(Context.getUserContext().getAuthenticatedUser());
    drugInfo.setDateCreated(new java.util.Date());
    drugInfo.setUuid("68547121-1b70-465c-99ef-c9dfd95e7d30");
View Full Code Here

   */
  @Test
  public void testDeleteDrugInfo() {
    DrugInfo drugInfo = new DrugInfo();
    drugInfo.setId(2);
    Drug drug = new Drug();
    drug.setId(5);
    drug.setDrugId(5);
    drugInfo.setDrugId(5);
    drugInfo.setDrug(drug);
    drugInfo.setName("TestDrugInfo2");
    drugInfo.setDescription("Second Test DrugInfo");
    drugInfo.setCreator(Context.getUserContext().getAuthenticatedUser());
View Full Code Here

    }
    if (post.get("description") != null) {
      drugInventory.setDescription(post.get("description").toString());
    }
    if (post.get("drug") != null) {
      Drug d = Context.getConceptService().getDrugByUuid(post.get("drug").toString());
      drugInventory.setDrugId(d.getDrugId());
      drugInventory.setDrug(d);
    }
    if (post.get("quantity") != null) {
      drugInventory.setQuantity(Integer.parseInt(post.get("quantity").toString()));
    }
View Full Code Here

    SimpleObject obj = new SimpleObject();
    obj.add("uuid", di.getUuid());
    obj.add("name", di.getName());
    obj.add("description", di.getDescription());
    SimpleObject drugObj = new SimpleObject();
    Drug d = di.getDrug();
    if (d != null) {
      drugObj.add("uuid", d.getUuid());
      drugObj.add("display", d.getName());
      if (d.getDosageForm() != null) {
        drugObj.add("dosageForm", d.getDosageForm().getName().getName());
      }
    }
    obj.add("drug", drugObj);
    obj.add("quantity", di.getQuantity());
    obj.add("originalQuantity", di.getOriginalQuantity());
View Full Code Here

 
  @Test
  public void testSaveDrugGroupShouldSaveDrugGroup() throws Exception {
    DrugGroup drugGroup = new DrugGroup();
    Set<Drug> drugs = new HashSet<Drug>();
    Drug drug1 = new Drug();
    Drug drug2 = new Drug();
    drug1.setId(1);
    drug1.setConcept(new Concept(792));
    drug2.setId(2);
    drug2.setConcept(new Concept(792));
    drugs.add(drug1);
    drugs.add(drug2);
    //NOTE: never set Id, will be generated automatically (when saving)
    drugGroup.setName("TestDrugGroup3");
    drugGroup.setDescription("Third Test Drug Group");
View Full Code Here

TOP

Related Classes of org.openmrs.Drug

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.