Advertisement
Guest User

Untitled

a guest
Jan 13th, 2023
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. /**
  2. * This Source Code Form is subject to the terms of the Mozilla Public License,
  3. * v. 2.0. If a copy of the MPL was not distributed with this file, You can
  4. * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
  5. * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
  6. *
  7. * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
  8. * graphic logo is a trademark of OpenMRS Inc.
  9. */
  10. package org.openmrs.module.receivedrugs.api.impl;
  11.  
  12. import java.util.List;
  13.  
  14. import org.openmrs.api.APIException;
  15. import org.openmrs.api.UserService;
  16. import org.openmrs.api.impl.BaseOpenmrsService;
  17. import org.openmrs.module.receivedrugs.Item;
  18. import org.openmrs.module.receivedrugs.api.ReceivedrugsService;
  19. import org.openmrs.module.receivedrugs.api.dao.ReceivedrugsDao;
  20. import org.openmrs.module.receivedrugs.api.pojo.ReceiveDrugDetails;
  21. import org.openmrs.module.receivedrugs.api.pojo.ReceiveDrugs;
  22.  
  23. public class ReceivedrugsServiceImpl extends BaseOpenmrsService implements ReceivedrugsService {
  24.  
  25. ReceivedrugsDao dao;
  26.  
  27. UserService userService;
  28.  
  29. /**
  30. * Injected in moduleApplicationContext.xml
  31. */
  32. public void setDao(ReceivedrugsDao dao) {
  33. this.dao = dao;
  34. }
  35.  
  36. /**
  37. * Injected in moduleApplicationContext.xml
  38. */
  39. public void setUserService(UserService userService) {
  40. this.userService = userService;
  41. }
  42.  
  43. @Override
  44. public Item getItemByUuid(String uuid) throws APIException {
  45. return dao.getItemByUuid(uuid);
  46. }
  47.  
  48. @Override
  49. public Item saveItem(Item item) throws APIException {
  50. if (item.getOwner() == null) {
  51. item.setOwner(userService.getUser(1));
  52. }
  53.  
  54. return dao.saveItem(item);
  55. }
  56.  
  57. @Override
  58. public ReceiveDrugs SaveReceiveDrugs(ReceiveDrugs t) {
  59. return dao.SaveReceiveDrugs(t);
  60. }
  61.  
  62. @Override
  63. public ReceiveDrugDetails SaveReceiveDrugDetails(ReceiveDrugDetails t) {
  64. return dao.SaveReceiveDrugDetails(t);
  65. }
  66.  
  67. @Override
  68. public List<ReceiveDrugs> GetGrnList(String uuid) {
  69. return dao.GetGrnList(uuid);
  70. }
  71.  
  72. @Override
  73. public List<ReceiveDrugDetails> GetReceiveDrugDetails(String id) {
  74. return dao.GetReceiveDrugDetails(id);
  75. }
  76. }
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement