@Override protected Concept getObjectByUuid(String uuid) { return Context.getConceptService().getConceptByUuid(uuid); } }
/** * @see org.openmrs.api.ConceptService#unretireDrug(org.openmrs.Drug) */ @Override public Drug unretireDrug(Drug drug) throws APIException { return Context.getConceptService().saveDrug(drug); }
/** * @see org.openmrs.api.ConceptService#getAllConceptClasses(boolean) */ @Override @Transactional(readOnly = true) public List<ConceptClass> getAllConceptClasses() throws APIException { return Context.getConceptService().getAllConceptClasses(true); }
/** * @see org.openmrs.api.ConceptService#getAllConceptDatatypes() */ @Override @Transactional(readOnly = true) public List<ConceptDatatype> getAllConceptDatatypes() { return Context.getConceptService().getAllConceptDatatypes(true); }
/** * @see org.openmrs.api.ConceptService#getConceptsByMapping(java.lang.String, java.lang.String) */ @Override @Transactional(readOnly = true) public List<Concept> getConceptsByMapping(String code, String sourceName) throws APIException { return Context.getConceptService().getConceptsByMapping(code, sourceName, true); }
/** * @see org.openmrs.api.ConceptService#getAllConceptReferenceTerms() */ @Override @Transactional(readOnly = true) public List<ConceptReferenceTerm> getAllConceptReferenceTerms() throws APIException { return Context.getConceptService().getConceptReferenceTerms(true); }
/** * @see org.openmrs.api.ConceptService#unretireConceptReferenceTerm(org.openmrs.ConceptReferenceTerm) */ @Override public ConceptReferenceTerm unretireConceptReferenceTerm(ConceptReferenceTerm conceptReferenceTerm) throws APIException { return Context.getConceptService().saveConceptReferenceTerm(conceptReferenceTerm); }
private List<Concept> getSetMembersOfConceptSetFromGP(String globalProperty) { String conceptUuid = Context.getAdministrationService().getGlobalProperty(globalProperty); Concept concept = Context.getConceptService().getConceptByUuid(conceptUuid); if (concept != null && concept.getSet()) { return concept.getSetMembers(); } return Collections.emptyList(); } }
/** * @see ConceptService#getConceptProposalByUuid(String) */ @Test public void getConceptProposalByUuid_shouldReturnNullIfNoObjectFoundWithGivenUuid() { Assert.assertNull(Context.getConceptService().getConceptProposalByUuid("some invalid uuid")); }
/** * @see ConceptService#getConceptSetByUuid(String) */ @Test public void getConceptSetByUuid_shouldReturnNullIfNoObjectFoundWithGivenUuid() { Assert.assertNull(Context.getConceptService().getConceptSetByUuid("some invalid uuid")); }
/** * @see ConceptService#getConceptSourceByUuid(String) */ @Test public void getConceptSourceByUuid_shouldReturnNullIfNoObjectFoundWithGivenUuid() { Assert.assertNull(Context.getConceptService().getConceptSourceByUuid("some invalid uuid")); }
/** * @see FormService#getFormsContainingConcept(Concept) */ @Test public void getFormsContainingConcept_shouldGetAllFormsForConcept() { Concept concept = Context.getConceptService().getConcept(3); assertEquals(1, Context.getFormService().getFormsContainingConcept(concept).size()); }
public OrderBuilder() { patientService = Context.getPatientService(); conceptService = Context.getConceptService(); orderService = Context.getOrderService(); encounterService = Context.getEncounterService(); order = new Order(); }
/** * @see ConceptService#getConceptDescriptionByUuid(String) */ @Test public void getConceptDescriptionByUuid_shouldFindObjectGivenValidUuid() { String uuid = "5f4d710b-d333-40b7-b449-6e0e739d15d0"; ConceptDescription conceptDescription = Context.getConceptService().getConceptDescriptionByUuid(uuid); Assert.assertEquals(1, (int) conceptDescription.getConceptDescriptionId()); }
/** * @see ConceptService#getConceptAttributeType(Integer) */ @Test public void getConceptAttributeType_shouldReturnNullIfNoConceptAttributeTypeExistsWithTheGivenId() { executeDataSet(CONCEPT_ATTRIBUTE_TYPE_XML); Assert.assertNull(Context.getConceptService().getConceptAttributeType(999)); }
/** * @see {@link ConceptService#getDrugIngredientByUuid(String)} */ @Test public void getDrugIngredientByUuid_shouldFindObjectGivenValidUuid() { String uuid = "6519d653-393d-4118-9c83-a3715b82d4dc"; DrugIngredient ingredient = Context.getConceptService().getDrugIngredientByUuid(uuid); Assert.assertEquals(88, (int) ingredient.getIngredient().getConceptId()); }
/** * @see ConceptService#getConceptAttributeType(Integer) */ @Test public void getConceptAttributeType_shouldReturnTheConceptAttributeTypeWithTheGivenId() { executeDataSet(CONCEPT_ATTRIBUTE_TYPE_XML); Assert.assertEquals("Audit Date", Context.getConceptService().getConceptAttributeType(1).getName()); }
/** * @see ConceptService#hasAnyConceptAttribute(ConceptAttributeType) */ @Test public void hasAnyConceptAttribute_shouldReturnTrueIfAnyConceptAttributeIsPresentForGivenConceptAttributeType() { executeDataSet(CONCEPT_ATTRIBUTE_TYPE_XML); ConceptService conceptService = Context.getConceptService(); ConceptAttributeType conceptAttributeType = conceptService.getConceptAttributeType(1); Assert.assertTrue(conceptService.hasAnyConceptAttribute(conceptAttributeType)); }
@Before public void runBeforeEachTest() { executeDataSet(CREATE_PATIENT_PROGRAMS_XML); executeDataSet(PROGRAM_ATTRIBUTES_XML); if (pws == null) { pws = Context.getProgramWorkflowService(); adminService = Context.getAdministrationService(); encounterService = Context.getEncounterService(); cs = Context.getConceptService(); } }
/** * @see ConceptAttributeTypeValidator#validate(Object, Errors) */ @Test public void validate_shouldPassEditingConceptAttributeTypeName() { ConceptAttributeType et = Context.getConceptService().getConceptAttributeTypeByName("Audit Date"); Assert.assertNotNull(et); Errors errors = new BindException(et, "conceptAttributeType"); validator.validate(et, errors); Assert.assertFalse(errors.hasErrors()); }