/** * @see OrderService#getCareSettingByUuid(String) */ @Test public void getCareSettingByUuid_shouldReturnTheCareSettingWithTheSpecifiedUuid() { CareSetting cs = orderService.getCareSettingByUuid("6f0c9a92-6f24-11e3-af88-005056821db0"); assertEquals(1, cs.getId().intValue()); }
/** * Fetches a careSettings by uuid or name * * @see org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource#getByUniqueId(String) */ @Override public CareSetting getByUniqueId(String uniqueId) { CareSetting cs = Context.getOrderService().getCareSettingByUuid(uniqueId); if (cs == null) { cs = Context.getOrderService().getCareSettingByName(uniqueId); } return cs; }
@Override public CareSetting newObject() { return Context.getOrderService().getCareSettingByUuid(getUuidProperty()); }
careSetting = orderService.getCareSettingByUuid(careSettingUuid); if (careSetting == null) { throw new ObjectNotFoundException();
@Test public void shouldGetAnCareSettingByUuid() throws Exception { SimpleObject result = deserialize(handle(newGetRequest(getURI() + "/" + getUuid()))); CareSetting expectedCareSetting = service.getCareSettingByUuid(getUuid()); assertEquals(expectedCareSetting.getUuid(), PropertyUtils.getProperty(result, "uuid")); assertEquals(expectedCareSetting.getName(), PropertyUtils.getProperty(result, "name")); assertEquals(expectedCareSetting.getCareSettingType().name(), PropertyUtils.getProperty(result, "careSettingType")); assertEquals(expectedCareSetting.getDescription(), PropertyUtils.getProperty(result, "description")); assertEquals(expectedCareSetting.isRetired(), PropertyUtils.getProperty(result, "retired")); assertNull(PropertyUtils.getProperty(result, "auditInfo")); }
@Test public void shouldPlaceANewOrder() throws Exception { executeDataSet("OrderController1_10Test-orderTypeAndConceptClassMap.xml"); CareSetting outPatient = orderService.getCareSettingByUuid(RestTestConstants1_10.CARE_SETTING_UUID); Patient patient = patientService.getPatientByUuid(PATIENT_UUID); int originalActiveOrderCount = orderService.getActiveOrders(patient, null, outPatient, null).size();
executeDataSet(ORDER_ENTRY_DATASET_XML); executeDataSet("OrderController1_10Test-conceptMappings.xml"); CareSetting outPatient = orderService.getCareSettingByUuid(RestTestConstants1_10.CARE_SETTING_UUID); Patient patient = patientService.getPatientByUuid(PATIENT_UUID); OrderType drugOrderType = orderService.getOrderTypeByName("Drug order");
CareSetting outPatient = orderService.getCareSettingByUuid(RestTestConstants1_10.CARE_SETTING_UUID); Patient patient = patientService.getPatientByUuid(PATIENT_UUID); OrderType drugOrderType = orderService.getOrderTypeByName("Drug order");
executeDataSet(ORDER_ENTRY_DATASET_XML); executeDataSet("OrderController1_10Test-conceptMappings.xml"); CareSetting outPatient = orderService.getCareSettingByUuid(RestTestConstants1_10.CARE_SETTING_UUID); Patient patient = patientService.getPatientByUuid(PATIENT_UUID); OrderType drugOrderType = orderService.getOrderTypeByName("Drug order");
executeDataSet(ORDER_ENTRY_DATASET_XML); OrderType testOrderType = orderService.getOrderTypeByName("Test order"); CareSetting outPatient = orderService.getCareSettingByUuid(RestTestConstants1_10.CARE_SETTING_UUID); Patient patient = patientService.getPatientByUuid(PATIENT_UUID); int originalActiveTestOrderCount = orderService.getActiveOrders(patient,
executeDataSet(ORDER_ENTRY_DATASET_XML); executeDataSet("OrderController1_10Test-conceptMappings.xml"); CareSetting outPatient = orderService.getCareSettingByUuid(RestTestConstants1_10.CARE_SETTING_UUID); Patient patient = patientService.getPatientByUuid(PATIENT_UUID); OrderType drugOrderType = orderService.getOrderTypeByName("Drug order");