diff --git a/api/src/main/java/org/openmrs/module/ipd/api/dao/ReferenceDAO.java b/api/src/main/java/org/openmrs/module/ipd/api/dao/ReferenceDAO.java index 983d639..fc1a7af 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/dao/ReferenceDAO.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/dao/ReferenceDAO.java @@ -6,10 +6,10 @@ import java.util.Optional; -@Repository + public interface ReferenceDAO { - + Optional getReferenceByTypeAndTargetUUID(String type, String targetUUID) throws DAOException; - + Reference saveReference(Reference reference) throws DAOException; } diff --git a/api/src/main/java/org/openmrs/module/ipd/api/dao/ScheduleDAO.java b/api/src/main/java/org/openmrs/module/ipd/api/dao/ScheduleDAO.java index 7d85035..e689487 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/dao/ScheduleDAO.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/dao/ScheduleDAO.java @@ -6,9 +6,9 @@ import org.springframework.stereotype.Repository; -@Repository + public interface ScheduleDAO { - + Schedule getSchedule(Integer scheduleId) throws DAOException; Schedule saveSchedule(Schedule schedule) throws DAOException; diff --git a/api/src/main/java/org/openmrs/module/ipd/api/dao/SlotDAO.java b/api/src/main/java/org/openmrs/module/ipd/api/dao/SlotDAO.java index e28cca8..91dfffd 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/dao/SlotDAO.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/dao/SlotDAO.java @@ -12,7 +12,7 @@ import java.time.LocalDateTime; import java.util.List; -@Repository + public interface SlotDAO { Slot getSlot(Integer slotId) throws DAOException; diff --git a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateCareTeamDAO.java b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateCareTeamDAO.java index f696dbc..f3b0d36 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateCareTeamDAO.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateCareTeamDAO.java @@ -11,14 +11,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -@Repository public class HibernateCareTeamDAO implements CareTeamDAO { private static final Logger log = LoggerFactory.getLogger(HibernateCareTeamDAO.class); - private final SessionFactory sessionFactory; + private SessionFactory sessionFactory; - @Autowired - public HibernateCareTeamDAO(SessionFactory sessionFactory) { + public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } diff --git a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateReferenceDAO.java b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateReferenceDAO.java index 9557690..0cac758 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateReferenceDAO.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateReferenceDAO.java @@ -12,15 +12,13 @@ import java.util.Optional; -@Repository public class HibernateReferenceDAO implements ReferenceDAO { private static final Logger log = LoggerFactory.getLogger(HibernateReferenceDAO.class); - private final SessionFactory sessionFactory; + private SessionFactory sessionFactory; - @Autowired - public HibernateReferenceDAO(SessionFactory sessionFactory) { + public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } diff --git a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateScheduleDAO.java b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateScheduleDAO.java index 5a15768..98fabae 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateScheduleDAO.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateScheduleDAO.java @@ -11,14 +11,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -@Repository public class HibernateScheduleDAO implements ScheduleDAO { - + private static final Logger log = LoggerFactory.getLogger(HibernateScheduleDAO.class); - private final SessionFactory sessionFactory; + private SessionFactory sessionFactory; - @Autowired - public HibernateScheduleDAO(SessionFactory sessionFactory) { + public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } @@ -26,7 +24,7 @@ public HibernateScheduleDAO(SessionFactory sessionFactory) { public Schedule getSchedule(Integer scheduleId) throws DAOException { return sessionFactory.getCurrentSession().get(Schedule.class, scheduleId); } - + @Override public Schedule saveSchedule(Schedule schedule) throws DAOException { sessionFactory.getCurrentSession().saveOrUpdate(schedule); diff --git a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateSlotDAO.java b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateSlotDAO.java index 845e49a..7758bcc 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateSlotDAO.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateSlotDAO.java @@ -20,18 +20,16 @@ import java.time.temporal.ChronoUnit; import java.util.List; -@Repository public class HibernateSlotDAO implements SlotDAO { - + private static final Logger log = LoggerFactory.getLogger(HibernateSlotDAO.class); - - private final SessionFactory sessionFactory; - @Autowired - public HibernateSlotDAO(SessionFactory sessionFactory) { + private SessionFactory sessionFactory; + + public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } - + @Override public Slot getSlot(Integer slotId) throws DAOException { return sessionFactory.getCurrentSession().get(Slot.class, slotId); diff --git a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateWardDAO.java b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateWardDAO.java index af76bbf..381061d 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateWardDAO.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/dao/impl/HibernateWardDAO.java @@ -18,15 +18,13 @@ import java.util.Date; import java.util.List; -@Repository public class HibernateWardDAO implements WardDAO { private static final Logger log = LoggerFactory.getLogger(HibernateWardDAO.class); - private final SessionFactory sessionFactory; + private SessionFactory sessionFactory; - @Autowired - public HibernateWardDAO(SessionFactory sessionFactory) { + public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } diff --git a/api/src/main/java/org/openmrs/module/ipd/api/events/ConfigLoader.java b/api/src/main/java/org/openmrs/module/ipd/api/events/ConfigLoader.java index fc58629..0f2a42c 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/events/ConfigLoader.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/events/ConfigLoader.java @@ -20,8 +20,8 @@ public class ConfigLoader { private ObjectMapper objectMapper = new ObjectMapper(); - @Value("${config-file.path}") - private String routeConfigurationFileLocation; + @Value("${ipd.events_config.file_path:/etc/bahmni_config/openmrs/apps/ipdDashboard/eventsConfig.json}") + private String eventsConfigurationFileLocation; public List getConfigs() { if (configs.isEmpty()) { @@ -32,10 +32,10 @@ public List getConfigs() { private void loadConfiguration() { try { - File routeConfigurationFile = new FileSystemResource(routeConfigurationFileLocation).getFile(); + File routeConfigurationFile = new FileSystemResource(eventsConfigurationFileLocation).getFile(); this.configs = objectMapper.readValue(routeConfigurationFile, new TypeReference>() {}); } catch (IOException exception) { - log.error("Failed to load configuration for file : " + routeConfigurationFileLocation, exception); + log.error("Failed to load configuration for file : " + eventsConfigurationFileLocation, exception); } } } diff --git a/api/src/main/java/org/openmrs/module/ipd/api/scheduler/tasks/RollOverNonMedicationTasks.java b/api/src/main/java/org/openmrs/module/ipd/api/scheduler/tasks/RollOverNonMedicationTasks.java index 4f2615e..3d6952a 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/scheduler/tasks/RollOverNonMedicationTasks.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/scheduler/tasks/RollOverNonMedicationTasks.java @@ -8,7 +8,7 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Component; -@Component + public class RollOverNonMedicationTasks extends AbstractTask implements ApplicationContextAware { private static ApplicationContext context; diff --git a/api/src/main/java/org/openmrs/module/ipd/api/scheduler/tasks/ShiftStartTasks.java b/api/src/main/java/org/openmrs/module/ipd/api/scheduler/tasks/ShiftStartTasks.java index 59ce500..0a72fe7 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/scheduler/tasks/ShiftStartTasks.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/scheduler/tasks/ShiftStartTasks.java @@ -8,7 +8,7 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.stereotype.Component; -@Component + public class ShiftStartTasks extends AbstractTask implements ApplicationContextAware { private static ApplicationContext context; diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/CareTeamService.java b/api/src/main/java/org/openmrs/module/ipd/api/service/CareTeamService.java index 83b235c..c511ad7 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/CareTeamService.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/CareTeamService.java @@ -2,13 +2,11 @@ import org.openmrs.Visit; import org.openmrs.api.APIException; -import org.openmrs.module.ipd.api.model.CareTeam; -import org.openmrs.module.ipd.api.model.Schedule; -import org.springframework.stereotype.Service; import org.openmrs.api.OpenmrsService; +import org.openmrs.module.ipd.api.model.CareTeam; + -@Service public interface CareTeamService extends OpenmrsService { CareTeam saveCareTeam(CareTeam careTeam) throws APIException; diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/ReferenceService.java b/api/src/main/java/org/openmrs/module/ipd/api/service/ReferenceService.java index a006d08..81a0252 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/ReferenceService.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/ReferenceService.java @@ -9,7 +9,7 @@ import java.util.Optional; -@Service + public interface ReferenceService extends OpenmrsService { // @Authorized({ PrivilegeConstants.EDIT_IPD_SCHEDULES }) diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/ScheduleService.java b/api/src/main/java/org/openmrs/module/ipd/api/service/ScheduleService.java index a370215..7e1d0e5 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/ScheduleService.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/ScheduleService.java @@ -7,9 +7,9 @@ import org.springframework.stereotype.Service; -@Service + public interface ScheduleService extends OpenmrsService { - + // @Authorized({ PrivilegeConstants.EDIT_IPD_SCHEDULES }) Schedule getSchedule(Integer scheduleId) throws APIException; diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/SlotService.java b/api/src/main/java/org/openmrs/module/ipd/api/service/SlotService.java index 05856ab..277ea36 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/SlotService.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/SlotService.java @@ -14,7 +14,7 @@ import java.util.List; import java.util.Map; -@Service + public interface SlotService extends OpenmrsService { // @Authorized({ PrivilegeConstants.EDIT_IPD_SLOTS }) diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/CareTeamServiceImpl.java b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/CareTeamServiceImpl.java index 84c253e..51e30b0 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/CareTeamServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/CareTeamServiceImpl.java @@ -14,16 +14,14 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -@Service @Transactional public class CareTeamServiceImpl extends BaseOpenmrsService implements CareTeamService { private static final Logger log = LoggerFactory.getLogger(CareTeamServiceImpl.class); - private final CareTeamDAO careTeamDAO; + private CareTeamDAO careTeamDAO; - @Autowired - public CareTeamServiceImpl(CareTeamDAO careTeamDAO) { + public void setCareTeamDAO(CareTeamDAO careTeamDAO) { this.careTeamDAO = careTeamDAO; } diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/ReferenceServiceImpl.java b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/ReferenceServiceImpl.java index 9895276..c78e2f4 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/ReferenceServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/ReferenceServiceImpl.java @@ -13,16 +13,14 @@ import java.util.Optional; -@Service @Transactional public class ReferenceServiceImpl extends BaseOpenmrsService implements ReferenceService { private static final Logger log = LoggerFactory.getLogger(ReferenceServiceImpl.class); - private final ReferenceDAO referenceDAO; + private ReferenceDAO referenceDAO; - @Autowired - public ReferenceServiceImpl(ReferenceDAO referenceDAO) { + public void setReferenceDAO(ReferenceDAO referenceDAO) { this.referenceDAO = referenceDAO; } diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/ScheduleServiceImpl.java b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/ScheduleServiceImpl.java index 7521211..2cb774b 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/ScheduleServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/ScheduleServiceImpl.java @@ -15,13 +15,12 @@ @Service @Transactional public class ScheduleServiceImpl extends BaseOpenmrsService implements ScheduleService { - + private static final Logger log = LoggerFactory.getLogger(ScheduleServiceImpl.class); - - private final ScheduleDAO scheduleDAO; - @Autowired - public ScheduleServiceImpl(ScheduleDAO scheduleDAO) { + private ScheduleDAO scheduleDAO; + + public void setScheduleDAO(ScheduleDAO scheduleDAO) { this.scheduleDAO = scheduleDAO; } @@ -30,7 +29,7 @@ public ScheduleServiceImpl(ScheduleDAO scheduleDAO) { public Schedule getSchedule(Integer scheduleId) throws APIException { return scheduleDAO.getSchedule(scheduleId); } - + @Override public Schedule saveSchedule(Schedule schedule) throws APIException { return scheduleDAO.saveSchedule(schedule); diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/SlotServiceImpl.java b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/SlotServiceImpl.java index 2f94af5..edb46f0 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/SlotServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/SlotServiceImpl.java @@ -25,23 +25,21 @@ import java.util.List; import java.util.Map; -@Service @Transactional public class SlotServiceImpl extends BaseOpenmrsService implements SlotService { - + private static final Logger log = LoggerFactory.getLogger(SlotServiceImpl.class); - - private final SlotDAO slotDAO; - private ConceptService conceptService; - @Autowired - public SlotServiceImpl(SlotDAO slotDAO, ConceptService conceptService) { + private SlotDAO slotDAO; + private ConceptService conceptService; + public void setSlotDAO(SlotDAO slotDAO) { this.slotDAO = slotDAO; + } + public void setConceptService(ConceptService conceptService) { this.conceptService = conceptService; } - @Override @Transactional(readOnly = true) public Slot getSlot(Integer slotId) throws APIException { diff --git a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/WardServiceImpl.java b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/WardServiceImpl.java index 72dc5dd..379373e 100644 --- a/api/src/main/java/org/openmrs/module/ipd/api/service/impl/WardServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/ipd/api/service/impl/WardServiceImpl.java @@ -15,18 +15,15 @@ import java.util.Date; import java.util.List; -@Service @Transactional public class WardServiceImpl implements WardService { - private final WardDAO wardDAO; + private WardDAO wardDAO; - @Autowired - public WardServiceImpl(WardDAO wardDAO) { + public void setWardDAO(WardDAO wardDAO) { this.wardDAO = wardDAO; } - @Override public WardPatientsSummary getIPDWardPatientSummary(String wardUuid, String providerUuid) { Location location= Context.getService(LocationService.class).getLocationByUuid(wardUuid); diff --git a/api/src/main/resources/application.properties b/api/src/main/resources/application.properties index ed16b69..0a96e1e 100644 --- a/api/src/main/resources/application.properties +++ b/api/src/main/resources/application.properties @@ -1,3 +1,3 @@ # Route definitions -config-file.path=/etc/bahmni_config/openmrs/apps/ipdDashboard/eventsConfig.json \ No newline at end of file +ipd.events_config.file_path=/etc/bahmni_config/openmrs/apps/ipdDashboard/eventsConfig.json diff --git a/api/src/main/resources/moduleApplicationContext.xml b/api/src/main/resources/moduleApplicationContext.xml index c9dd5ed..b533b89 100644 --- a/api/src/main/resources/moduleApplicationContext.xml +++ b/api/src/main/resources/moduleApplicationContext.xml @@ -8,32 +8,122 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + org.openmrs.module.ipd.api.service.SlotService + + - - + + + + + + + + + + + + + + + org.openmrs.module.ipd.api.service.WardService + + - - + + + + + + + + + + + + + + + org.openmrs.module.ipd.api.service.ScheduleService + + - - + + + + + + + + + + + + + + + org.openmrs.module.ipd.api.service.ReferenceService + + + + + + + + + + + + - org.openmrs.module.ipd.api.service.SlotService - + org.openmrs.module.ipd.api.service.CareTeamService + + + + diff --git a/api/src/test/resources/TestingApplicationContext.xml b/api/src/test/resources/TestingApplicationContext.xml index bf8a8fc..9aee781 100644 --- a/api/src/test/resources/TestingApplicationContext.xml +++ b/api/src/test/resources/TestingApplicationContext.xml @@ -8,5 +8,21 @@ http://www.springframework.org/schema/context/spring-context-3.0.xsd"> + + + + + classpath:hibernate.cfg.xml + + + + + org.openmrs + + + + + + diff --git a/omod/src/main/java/org/openmrs/module/ipd/ModuleDescriptor.java b/omod/src/main/java/org/openmrs/module/ipd/ModuleDescriptor.java deleted file mode 100644 index 7b43171..0000000 --- a/omod/src/main/java/org/openmrs/module/ipd/ModuleDescriptor.java +++ /dev/null @@ -1,3 +0,0 @@ -package org.openmrs.module.ipd; - -public class ModuleDescriptor {} diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/IPDCareTeamService.java b/omod/src/main/java/org/openmrs/module/ipd/service/IPDCareTeamService.java deleted file mode 100644 index 42243a8..0000000 --- a/omod/src/main/java/org/openmrs/module/ipd/service/IPDCareTeamService.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.openmrs.module.ipd.service; - -import org.openmrs.module.ipd.api.model.CareTeam; -import org.openmrs.module.ipd.contract.CareTeamParticipantRequest; -import org.openmrs.module.ipd.contract.CareTeamRequest; - -import java.util.List; - -public interface IPDCareTeamService { - - CareTeam saveCareTeamParticipants(CareTeamRequest careTeamRequest); -} diff --git a/omod/src/main/java/org/openmrs/module/ipd/web/ModuleDescriptor.java b/omod/src/main/java/org/openmrs/module/ipd/web/ModuleDescriptor.java new file mode 100644 index 0000000..64d9e14 --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/web/ModuleDescriptor.java @@ -0,0 +1,3 @@ +package org.openmrs.module.ipd.web; + +public class ModuleDescriptor {} diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/AdmittedPatientResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/AdmittedPatientResponse.java similarity index 96% rename from omod/src/main/java/org/openmrs/module/ipd/contract/AdmittedPatientResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/AdmittedPatientResponse.java index 75f7e8b..37539e8 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/AdmittedPatientResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/AdmittedPatientResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.Builder; import lombok.Getter; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamParticipantRequest.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamParticipantRequest.java similarity index 90% rename from omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamParticipantRequest.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamParticipantRequest.java index a98afec..77621c7 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamParticipantRequest.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamParticipantRequest.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamParticipantResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamParticipantResponse.java similarity index 91% rename from omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamParticipantResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamParticipantResponse.java index 427c6c5..e28efe8 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamParticipantResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamParticipantResponse.java @@ -1,9 +1,8 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.Builder; import lombok.Getter; import org.openmrs.module.ipd.api.model.CareTeamParticipant; -import org.openmrs.module.ipd.api.util.DateTimeUtil; import org.openmrs.module.webservices.rest.web.ConversionUtil; import org.openmrs.module.webservices.rest.web.representation.Representation; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamRequest.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamRequest.java similarity index 86% rename from omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamRequest.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamRequest.java index 4073924..4ce32ef 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamRequest.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamRequest.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamResponse.java similarity index 94% rename from omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamResponse.java index ade81b7..8e3f2d3 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/CareTeamResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/CareTeamResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.Builder; import lombok.Getter; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/DrugOrderScheduleResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/DrugOrderScheduleResponse.java similarity index 94% rename from omod/src/main/java/org/openmrs/module/ipd/contract/DrugOrderScheduleResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/DrugOrderScheduleResponse.java index e00077f..e2b6c8c 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/DrugOrderScheduleResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/DrugOrderScheduleResponse.java @@ -1,8 +1,8 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.*; import org.openmrs.module.ipd.api.model.Slot; -import org.openmrs.module.ipd.model.DrugOrderSchedule; +import org.openmrs.module.ipd.web.model.DrugOrderSchedule; import java.time.LocalDateTime; import java.util.List; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDDrugOrderResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDDrugOrderResponse.java similarity index 85% rename from omod/src/main/java/org/openmrs/module/ipd/contract/IPDDrugOrderResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDDrugOrderResponse.java index 548eab5..625780f 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDDrugOrderResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDDrugOrderResponse.java @@ -1,9 +1,9 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.*; import org.openmrs.module.bahmniemrapi.drugorder.contract.BahmniOrderAttribute; import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; -import org.openmrs.module.ipd.model.IPDDrugOrder; +import org.openmrs.module.ipd.web.model.IPDDrugOrder; import java.util.List; @@ -27,7 +27,7 @@ public static IPDDrugOrderResponse createFrom(IPDDrugOrder ipdDrugOrder) { .drugOrderAttributes(ipdDrugOrder.getBahmniDrugOrder().getOrderAttributes()) .build(); if (ipdDrugOrder.getDrugOrderSchedule() != null){ - ipdDrugOrderResponse.setDrugOrderSchedule(DrugOrderScheduleResponse.createFrom(ipdDrugOrder.getDrugOrderSchedule())); + ipdDrugOrderResponse.setDrugOrderSchedule(DrugOrderScheduleResponse.createFrom(ipdDrugOrder.getDrugOrderSchedule())); } return ipdDrugOrderResponse; } diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDPatientDetailsResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDPatientDetailsResponse.java similarity index 94% rename from omod/src/main/java/org/openmrs/module/ipd/contract/IPDPatientDetailsResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDPatientDetailsResponse.java index eebedfd..5a0f1f1 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDPatientDetailsResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDPatientDetailsResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.Builder; import lombok.Getter; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDTreatmentsResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDTreatmentsResponse.java similarity index 94% rename from omod/src/main/java/org/openmrs/module/ipd/contract/IPDTreatmentsResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDTreatmentsResponse.java index 1b9e195..46e58c2 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDTreatmentsResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDTreatmentsResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.AllArgsConstructor; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardPatientDetailsResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardPatientDetailsResponse.java similarity index 94% rename from omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardPatientDetailsResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardPatientDetailsResponse.java index 10e8f33..c102359 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardPatientDetailsResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardPatientDetailsResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.Builder; import lombok.Getter; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardPatientSummaryResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardPatientSummaryResponse.java similarity index 93% rename from omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardPatientSummaryResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardPatientSummaryResponse.java index fc3bfa2..24173be 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardPatientSummaryResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardPatientSummaryResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.Builder; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardResponse.java similarity index 89% rename from omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardResponse.java index e82967e..2919d48 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/IPDWardResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/IPDWardResponse.java @@ -1,10 +1,9 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import org.openmrs.Location; import org.openmrs.module.bedmanagement.AdmissionLocation; @Getter diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationNoteRequest.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationNoteRequest.java similarity index 93% rename from omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationNoteRequest.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationNoteRequest.java index 87fdd58..437fd90 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationNoteRequest.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationNoteRequest.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationNoteResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationNoteResponse.java similarity index 95% rename from omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationNoteResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationNoteResponse.java index b8e2f01..162cc1b 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationNoteResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationNoteResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.*; import org.codehaus.jackson.annotate.JsonIgnoreProperties; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationPerformerRequest.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationPerformerRequest.java similarity index 91% rename from omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationPerformerRequest.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationPerformerRequest.java index c1d5a36..9e2f34e 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationPerformerRequest.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationPerformerRequest.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationPerformerResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationPerformerResponse.java similarity index 96% rename from omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationPerformerResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationPerformerResponse.java index 3b1c1cf..cab5d53 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationPerformerResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationPerformerResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.*; import org.codehaus.jackson.annotate.JsonIgnoreProperties; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationRequest.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationRequest.java similarity index 95% rename from omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationRequest.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationRequest.java index 43402ec..01ad0af 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationRequest.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationRequest.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationResponse.java similarity index 97% rename from omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationResponse.java index 856a047..7e4e009 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationAdministrationResponse.java @@ -1,7 +1,6 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.*; -import org.openmrs.api.context.Context; import org.openmrs.module.ipd.api.model.MedicationAdministrationNote; import org.openmrs.module.ipd.api.model.MedicationAdministrationPerformer; import org.openmrs.module.webservices.rest.web.ConversionUtil; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationScheduleResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationScheduleResponse.java similarity index 96% rename from omod/src/main/java/org/openmrs/module/ipd/contract/MedicationScheduleResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationScheduleResponse.java index 80ba08e..118b97b 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationScheduleResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationScheduleResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationSlotResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationSlotResponse.java similarity index 93% rename from omod/src/main/java/org/openmrs/module/ipd/contract/MedicationSlotResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationSlotResponse.java index 60d103f..cf93f96 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/MedicationSlotResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/MedicationSlotResponse.java @@ -1,13 +1,11 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import com.fasterxml.jackson.annotation.JsonAutoDetect; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import org.hl7.fhir.r4.model.MedicationAdministration; import org.openmrs.module.ipd.api.model.Slot; -import org.openmrs.module.ipd.factory.MedicationAdministrationFactory; import org.openmrs.module.webservices.rest.web.ConversionUtil; import org.openmrs.module.webservices.rest.web.representation.Representation; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/PatientMedicationSummaryResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/PatientMedicationSummaryResponse.java similarity index 93% rename from omod/src/main/java/org/openmrs/module/ipd/contract/PatientMedicationSummaryResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/PatientMedicationSummaryResponse.java index d7b3509..7c888df 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/PatientMedicationSummaryResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/PatientMedicationSummaryResponse.java @@ -1,10 +1,10 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import org.openmrs.module.ipd.model.PatientMedicationSummary; +import org.openmrs.module.ipd.web.model.PatientMedicationSummary; import java.util.List; import java.util.stream.Collectors; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/PrescribedOrderSlotSummaryResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/PrescribedOrderSlotSummaryResponse.java similarity index 92% rename from omod/src/main/java/org/openmrs/module/ipd/contract/PrescribedOrderSlotSummaryResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/PrescribedOrderSlotSummaryResponse.java index bff5a15..41019ea 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/PrescribedOrderSlotSummaryResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/PrescribedOrderSlotSummaryResponse.java @@ -1,10 +1,10 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import org.openmrs.module.ipd.model.PrescribedOrderSlotSummary; +import org.openmrs.module.ipd.web.model.PrescribedOrderSlotSummary; import java.util.List; import java.util.stream.Collectors; diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/ScheduleMedicationRequest.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/ScheduleMedicationRequest.java similarity index 97% rename from omod/src/main/java/org/openmrs/module/ipd/contract/ScheduleMedicationRequest.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/ScheduleMedicationRequest.java index 51080fe..b2ce287 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/ScheduleMedicationRequest.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/ScheduleMedicationRequest.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import lombok.AllArgsConstructor; import lombok.Builder; @@ -52,4 +52,4 @@ public List getDayWiseSlotsStartTimeAsLocalTime() { public List getRemainingDaySlotsStartTimeAsLocalTime() { return remainingDaySlotsStartTime != null ? remainingDaySlotsStartTime.stream().map(DateTimeUtil::convertEpocUTCToLocalTimeZone).collect(Collectors.toList()) : null; } -} \ No newline at end of file +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/contract/ScheduleMedicationResponse.java b/omod/src/main/java/org/openmrs/module/ipd/web/contract/ScheduleMedicationResponse.java similarity index 96% rename from omod/src/main/java/org/openmrs/module/ipd/contract/ScheduleMedicationResponse.java rename to omod/src/main/java/org/openmrs/module/ipd/web/contract/ScheduleMedicationResponse.java index 5478ead..518e251 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/contract/ScheduleMedicationResponse.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/contract/ScheduleMedicationResponse.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.contract; +package org.openmrs.module.ipd.web.contract; import com.fasterxml.jackson.annotation.JsonAutoDetect; import lombok.AllArgsConstructor; diff --git a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDCareTeamController.java b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDCareTeamController.java similarity index 86% rename from omod/src/main/java/org/openmrs/module/ipd/controller/IPDCareTeamController.java rename to omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDCareTeamController.java index e713dcd..2943c28 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDCareTeamController.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDCareTeamController.java @@ -1,11 +1,10 @@ -package org.openmrs.module.ipd.controller; +package org.openmrs.module.ipd.web.controller; import lombok.extern.slf4j.Slf4j; import org.openmrs.module.ipd.api.model.CareTeam; -import org.openmrs.module.ipd.contract.CareTeamRequest; -import org.openmrs.module.ipd.contract.CareTeamResponse; -import org.openmrs.module.ipd.contract.ScheduleMedicationResponse; -import org.openmrs.module.ipd.service.IPDCareTeamService; +import org.openmrs.module.ipd.web.contract.CareTeamRequest; +import org.openmrs.module.ipd.web.contract.CareTeamResponse; +import org.openmrs.module.ipd.web.service.IPDCareTeamService; import org.openmrs.module.webservices.rest.web.RestConstants; import org.openmrs.module.webservices.rest.web.RestUtil; import org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController; diff --git a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDMedicationAdministrationController.java b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDMedicationAdministrationController.java similarity index 93% rename from omod/src/main/java/org/openmrs/module/ipd/controller/IPDMedicationAdministrationController.java rename to omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDMedicationAdministrationController.java index 8caa639..71e5699 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDMedicationAdministrationController.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDMedicationAdministrationController.java @@ -1,15 +1,15 @@ -package org.openmrs.module.ipd.controller; +package org.openmrs.module.ipd.web.controller; import lombok.extern.slf4j.Slf4j; import org.hl7.fhir.r4.model.MedicationAdministration; import org.openmrs.api.context.Context; import org.openmrs.module.fhir2.apiext.dao.FhirMedicationAdministrationDao; import org.openmrs.module.ipd.api.service.SlotService; -import org.openmrs.module.ipd.contract.MedicationAdministrationRequest; -import org.openmrs.module.ipd.contract.MedicationAdministrationResponse; -import org.openmrs.module.ipd.factory.MedicationAdministrationFactory; -import org.openmrs.module.ipd.service.IPDMedicationAdministrationService; -import org.openmrs.module.ipd.util.PrivilegeConstants; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationRequest; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationResponse; +import org.openmrs.module.ipd.web.factory.MedicationAdministrationFactory; +import org.openmrs.module.ipd.web.service.IPDMedicationAdministrationService; +import org.openmrs.module.ipd.web.util.PrivilegeConstants; import org.openmrs.module.webservices.rest.web.RestConstants; import org.openmrs.module.webservices.rest.web.RestUtil; import org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController; diff --git a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDScheduleController.java b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDScheduleController.java similarity index 92% rename from omod/src/main/java/org/openmrs/module/ipd/controller/IPDScheduleController.java rename to omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDScheduleController.java index 01c10cc..b7f1f47 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDScheduleController.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDScheduleController.java @@ -1,8 +1,7 @@ -package org.openmrs.module.ipd.controller; +package org.openmrs.module.ipd.web.controller; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; -import org.bahmni.module.bahmnicore.util.WebUtils; import org.openmrs.Patient; import org.openmrs.Visit; import org.openmrs.api.PatientService; @@ -13,19 +12,18 @@ import org.openmrs.module.ipd.api.model.Slot; import org.openmrs.module.ipd.api.util.IPDConstants; import org.openmrs.module.ipd.api.service.ScheduleService; -import org.openmrs.module.ipd.contract.MedicationScheduleResponse; -import org.openmrs.module.ipd.contract.MedicationSlotResponse; -import org.openmrs.module.ipd.contract.PatientMedicationSummaryResponse; -import org.openmrs.module.ipd.contract.ScheduleMedicationRequest; -import org.openmrs.module.ipd.contract.ScheduleMedicationResponse; -import org.openmrs.module.ipd.model.PatientMedicationSummary; -import org.openmrs.module.ipd.service.IPDScheduleService; -import org.openmrs.module.ipd.util.PrivilegeConstants; +import org.openmrs.module.ipd.web.contract.MedicationScheduleResponse; +import org.openmrs.module.ipd.web.contract.MedicationSlotResponse; +import org.openmrs.module.ipd.web.contract.PatientMedicationSummaryResponse; +import org.openmrs.module.ipd.web.contract.ScheduleMedicationRequest; +import org.openmrs.module.ipd.web.contract.ScheduleMedicationResponse; +import org.openmrs.module.ipd.web.model.PatientMedicationSummary; +import org.openmrs.module.ipd.web.service.IPDScheduleService; +import org.openmrs.module.ipd.web.util.PrivilegeConstants; import org.openmrs.module.webservices.rest.web.RestConstants; import org.openmrs.module.webservices.rest.web.RestUtil; import org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @@ -37,7 +35,6 @@ import static org.openmrs.module.ipd.api.model.ServiceType.MEDICATION_REQUEST; import static org.openmrs.module.ipd.api.util.DateTimeUtil.convertEpocUTCToLocalTimeZone; -import static org.openmrs.module.ipd.contract.MedicationScheduleResponse.createFrom; import static org.springframework.http.HttpStatus.BAD_REQUEST; import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.FORBIDDEN; @@ -171,10 +168,10 @@ public ResponseEntity getSlotsForPatientsAndTime(@RequestParam(value = " private List constructResponse(List slots, Visit visit) { Schedule schedule = scheduleService.getScheduleByVisit(visit); if(slots.isEmpty() && schedule != null){ - return Lists.newArrayList(createFrom(schedule, slots)); + return Lists.newArrayList(MedicationScheduleResponse.createFrom(schedule, slots)); } Map> slotsBySchedule = slots.stream().collect(Collectors.groupingBy(Slot::getSchedule)); - return slotsBySchedule.entrySet().stream().map(entry -> createFrom(entry.getKey(), entry.getValue())).collect(Collectors.toList()); + return slotsBySchedule.entrySet().stream().map(entry -> MedicationScheduleResponse.createFrom(entry.getKey(), entry.getValue())).collect(Collectors.toList()); } } diff --git a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDVisitController.java b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDVisitController.java similarity index 86% rename from omod/src/main/java/org/openmrs/module/ipd/controller/IPDVisitController.java rename to omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDVisitController.java index 79f3757..8b8728a 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDVisitController.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDVisitController.java @@ -1,15 +1,15 @@ -package org.openmrs.module.ipd.controller; +package org.openmrs.module.ipd.web.controller; import lombok.extern.slf4j.Slf4j; import org.openmrs.api.context.Context; import org.openmrs.module.ipd.api.model.ServiceType; import org.openmrs.module.ipd.api.model.Slot; -import org.openmrs.module.ipd.contract.IPDDrugOrderResponse; -import org.openmrs.module.ipd.contract.IPDTreatmentsResponse; -import org.openmrs.module.ipd.contract.MedicationAdministrationResponse; -import org.openmrs.module.ipd.model.IPDDrugOrder; -import org.openmrs.module.ipd.service.IPDVisitService; -import org.openmrs.module.ipd.util.PrivilegeConstants; +import org.openmrs.module.ipd.web.contract.IPDDrugOrderResponse; +import org.openmrs.module.ipd.web.contract.IPDTreatmentsResponse; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationResponse; +import org.openmrs.module.ipd.web.model.IPDDrugOrder; +import org.openmrs.module.ipd.web.service.IPDVisitService; +import org.openmrs.module.ipd.web.util.PrivilegeConstants; import org.openmrs.module.webservices.rest.web.RestConstants; import org.openmrs.module.webservices.rest.web.RestUtil; import org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController; diff --git a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDWardController.java b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDWardController.java similarity index 95% rename from omod/src/main/java/org/openmrs/module/ipd/controller/IPDWardController.java rename to omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDWardController.java index 61f2e7d..1804409 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/controller/IPDWardController.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/controller/IPDWardController.java @@ -1,9 +1,10 @@ -package org.openmrs.module.ipd.controller; +package org.openmrs.module.ipd.web.controller; import lombok.extern.slf4j.Slf4j; import org.openmrs.module.ipd.api.model.*; -import org.openmrs.module.ipd.contract.*; -import org.openmrs.module.ipd.service.IPDWardService; +import org.openmrs.module.ipd.web.contract.IPDPatientDetailsResponse; +import org.openmrs.module.ipd.web.contract.IPDWardPatientSummaryResponse; +import org.openmrs.module.ipd.web.service.IPDWardService; import org.openmrs.module.webservices.rest.web.RestConstants; import org.openmrs.module.webservices.rest.web.RestUtil; import org.openmrs.module.webservices.rest.web.v1_0.controller.BaseRestController; diff --git a/omod/src/main/java/org/openmrs/module/ipd/factory/CareTeamFactory.java b/omod/src/main/java/org/openmrs/module/ipd/web/factory/CareTeamFactory.java similarity index 95% rename from omod/src/main/java/org/openmrs/module/ipd/factory/CareTeamFactory.java rename to omod/src/main/java/org/openmrs/module/ipd/web/factory/CareTeamFactory.java index 7eee78a..df1f0b9 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/factory/CareTeamFactory.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/factory/CareTeamFactory.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.factory; +package org.openmrs.module.ipd.web.factory; import org.openmrs.Patient; import org.openmrs.Visit; @@ -7,8 +7,8 @@ import org.openmrs.module.ipd.api.model.CareTeam; import org.openmrs.module.ipd.api.model.CareTeamParticipant; import org.openmrs.module.ipd.api.util.DateTimeUtil; -import org.openmrs.module.ipd.contract.CareTeamParticipantRequest; -import org.openmrs.module.ipd.contract.CareTeamRequest; +import org.openmrs.module.ipd.web.contract.CareTeamParticipantRequest; +import org.openmrs.module.ipd.web.contract.CareTeamRequest; import org.springframework.stereotype.Component; import java.util.*; diff --git a/omod/src/main/java/org/openmrs/module/ipd/factory/MedicationAdministrationFactory.java b/omod/src/main/java/org/openmrs/module/ipd/web/factory/MedicationAdministrationFactory.java similarity index 93% rename from omod/src/main/java/org/openmrs/module/ipd/factory/MedicationAdministrationFactory.java rename to omod/src/main/java/org/openmrs/module/ipd/web/factory/MedicationAdministrationFactory.java index 06bb312..199fee4 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/factory/MedicationAdministrationFactory.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/factory/MedicationAdministrationFactory.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.factory; +package org.openmrs.module.ipd.web.factory; import org.openmrs.DrugOrder; import org.openmrs.api.context.Context; @@ -6,7 +6,10 @@ import org.openmrs.module.ipd.api.model.MedicationAdministration; import org.openmrs.module.ipd.api.model.MedicationAdministrationNote; import org.openmrs.module.ipd.api.model.MedicationAdministrationPerformer; -import org.openmrs.module.ipd.contract.*; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationNoteRequest; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationPerformerRequest; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationRequest; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/omod/src/main/java/org/openmrs/module/ipd/factory/ScheduleFactory.java b/omod/src/main/java/org/openmrs/module/ipd/web/factory/ScheduleFactory.java similarity index 94% rename from omod/src/main/java/org/openmrs/module/ipd/factory/ScheduleFactory.java rename to omod/src/main/java/org/openmrs/module/ipd/web/factory/ScheduleFactory.java index 8daeb75..652e738 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/factory/ScheduleFactory.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/factory/ScheduleFactory.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.factory; +package org.openmrs.module.ipd.web.factory; import org.openmrs.Concept; import org.openmrs.Patient; @@ -8,7 +8,7 @@ import org.openmrs.module.ipd.api.model.Reference; import org.openmrs.module.ipd.api.model.Schedule; import org.openmrs.module.ipd.api.service.ReferenceService; -import org.openmrs.module.ipd.contract.ScheduleMedicationRequest; +import org.openmrs.module.ipd.web.contract.ScheduleMedicationRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/omod/src/main/java/org/openmrs/module/ipd/factory/SlotFactory.java b/omod/src/main/java/org/openmrs/module/ipd/web/factory/SlotFactory.java similarity index 98% rename from omod/src/main/java/org/openmrs/module/ipd/factory/SlotFactory.java rename to omod/src/main/java/org/openmrs/module/ipd/web/factory/SlotFactory.java index 4f63c5b..5a12ea5 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/factory/SlotFactory.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/factory/SlotFactory.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.factory; +package org.openmrs.module.ipd.web.factory; import org.openmrs.Concept; import org.openmrs.Order; diff --git a/omod/src/main/java/org/openmrs/module/ipd/model/DrugOrderSchedule.java b/omod/src/main/java/org/openmrs/module/ipd/web/model/DrugOrderSchedule.java similarity index 90% rename from omod/src/main/java/org/openmrs/module/ipd/model/DrugOrderSchedule.java rename to omod/src/main/java/org/openmrs/module/ipd/web/model/DrugOrderSchedule.java index 4dec972..157460d 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/model/DrugOrderSchedule.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/model/DrugOrderSchedule.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.model; +package org.openmrs.module.ipd.web.model; import lombok.*; import org.openmrs.module.ipd.api.model.Slot; diff --git a/omod/src/main/java/org/openmrs/module/ipd/model/IPDDrugOrder.java b/omod/src/main/java/org/openmrs/module/ipd/web/model/IPDDrugOrder.java similarity index 79% rename from omod/src/main/java/org/openmrs/module/ipd/model/IPDDrugOrder.java rename to omod/src/main/java/org/openmrs/module/ipd/web/model/IPDDrugOrder.java index d4c809d..ccbb412 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/model/IPDDrugOrder.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/model/IPDDrugOrder.java @@ -1,9 +1,7 @@ -package org.openmrs.module.ipd.model; +package org.openmrs.module.ipd.web.model; import lombok.*; -import org.openmrs.Provider; import org.openmrs.module.bahmniemrapi.drugorder.contract.BahmniDrugOrder; -import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction.DrugOrder; @Getter @Builder diff --git a/omod/src/main/java/org/openmrs/module/ipd/model/PatientMedicationSummary.java b/omod/src/main/java/org/openmrs/module/ipd/web/model/PatientMedicationSummary.java similarity index 89% rename from omod/src/main/java/org/openmrs/module/ipd/model/PatientMedicationSummary.java rename to omod/src/main/java/org/openmrs/module/ipd/web/model/PatientMedicationSummary.java index e9323fd..0ce331e 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/model/PatientMedicationSummary.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/model/PatientMedicationSummary.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.model; +package org.openmrs.module.ipd.web.model; import lombok.*; import org.openmrs.module.ipd.api.model.Slot; diff --git a/omod/src/main/java/org/openmrs/module/ipd/model/PrescribedOrderSlotSummary.java b/omod/src/main/java/org/openmrs/module/ipd/web/model/PrescribedOrderSlotSummary.java similarity index 89% rename from omod/src/main/java/org/openmrs/module/ipd/model/PrescribedOrderSlotSummary.java rename to omod/src/main/java/org/openmrs/module/ipd/web/model/PrescribedOrderSlotSummary.java index 4592f07..c40f9f6 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/model/PrescribedOrderSlotSummary.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/model/PrescribedOrderSlotSummary.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.model; +package org.openmrs.module.ipd.web.model; import lombok.*; import org.openmrs.module.ipd.api.model.Slot; diff --git a/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java b/omod/src/main/java/org/openmrs/module/ipd/web/postprocessor/IPDTransactionHandler.java similarity index 92% rename from omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java rename to omod/src/main/java/org/openmrs/module/ipd/web/postprocessor/IPDTransactionHandler.java index d12737e..2d14d9a 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/postprocessor/IPDTransactionHandler.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/postprocessor/IPDTransactionHandler.java @@ -1,10 +1,10 @@ -package org.openmrs.module.ipd.postprocessor; +package org.openmrs.module.ipd.web.postprocessor; import org.openmrs.Encounter; import org.openmrs.module.emrapi.encounter.domain.EncounterTransaction; import org.openmrs.module.emrapi.encounter.postprocessor.EncounterTransactionHandler; import org.openmrs.module.ipd.api.events.model.IPDEvent; -import org.openmrs.module.ipd.service.IPDScheduleService; +import org.openmrs.module.ipd.web.service.IPDScheduleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.openmrs.module.ipd.api.events.model.IPDEventType; diff --git a/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDCareTeamService.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDCareTeamService.java new file mode 100644 index 0000000..4ae120b --- /dev/null +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDCareTeamService.java @@ -0,0 +1,9 @@ +package org.openmrs.module.ipd.web.service; + +import org.openmrs.module.ipd.api.model.CareTeam; +import org.openmrs.module.ipd.web.contract.CareTeamRequest; + +public interface IPDCareTeamService { + + CareTeam saveCareTeamParticipants(CareTeamRequest careTeamRequest); +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/IPDMedicationAdministrationService.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDMedicationAdministrationService.java similarity index 81% rename from omod/src/main/java/org/openmrs/module/ipd/service/IPDMedicationAdministrationService.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/IPDMedicationAdministrationService.java index 6de9108..77c4008 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/IPDMedicationAdministrationService.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDMedicationAdministrationService.java @@ -1,7 +1,7 @@ -package org.openmrs.module.ipd.service; +package org.openmrs.module.ipd.web.service; import org.hl7.fhir.r4.model.MedicationAdministration; -import org.openmrs.module.ipd.contract.MedicationAdministrationRequest; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationRequest; public interface IPDMedicationAdministrationService { diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/IPDScheduleService.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDScheduleService.java similarity index 88% rename from omod/src/main/java/org/openmrs/module/ipd/service/IPDScheduleService.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/IPDScheduleService.java index c220b51..3f1ea77 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/IPDScheduleService.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDScheduleService.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.service; +package org.openmrs.module.ipd.web.service; import org.openmrs.Visit; import org.openmrs.Encounter; @@ -6,8 +6,8 @@ import org.openmrs.module.ipd.api.model.Schedule; import org.openmrs.module.ipd.api.model.ServiceType; import org.openmrs.module.ipd.api.model.Slot; -import org.openmrs.module.ipd.contract.ScheduleMedicationRequest; -import org.openmrs.module.ipd.model.PatientMedicationSummary; +import org.openmrs.module.ipd.web.contract.ScheduleMedicationRequest; +import org.openmrs.module.ipd.web.model.PatientMedicationSummary; import java.time.LocalDate; import java.time.LocalDateTime; @@ -23,4 +23,4 @@ public interface IPDScheduleService { void handlePostProcessEncounterTransaction(Encounter encounter, EncounterTransaction encounterTransaction); List getSlotsForPatientListByTime(List patientUuidList, LocalDateTime localStartDate, LocalDateTime localEndDate, Boolean includePreviousSlot, Boolean includeSlotDuration); -} \ No newline at end of file +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/IPDVisitService.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDVisitService.java similarity index 81% rename from omod/src/main/java/org/openmrs/module/ipd/service/IPDVisitService.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/IPDVisitService.java index c000f32..1fbe19a 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/IPDVisitService.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDVisitService.java @@ -1,6 +1,6 @@ -package org.openmrs.module.ipd.service; +package org.openmrs.module.ipd.web.service; -import org.openmrs.module.ipd.model.IPDDrugOrder; +import org.openmrs.module.ipd.web.model.IPDDrugOrder; import org.openmrs.module.ipd.api.model.ServiceType; import org.openmrs.module.ipd.api.model.Slot; diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/IPDWardService.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDWardService.java similarity index 93% rename from omod/src/main/java/org/openmrs/module/ipd/service/IPDWardService.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/IPDWardService.java index 97d2b88..dc734c3 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/IPDWardService.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/IPDWardService.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.service; +package org.openmrs.module.ipd.web.service; import org.openmrs.module.ipd.api.model.IPDPatientDetails; diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDCareTeamServiceImpl.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDCareTeamServiceImpl.java similarity index 89% rename from omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDCareTeamServiceImpl.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDCareTeamServiceImpl.java index 48e53db..84232cd 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDCareTeamServiceImpl.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDCareTeamServiceImpl.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.service.impl; +package org.openmrs.module.ipd.web.service.impl; import org.openmrs.Patient; import org.openmrs.Visit; @@ -7,9 +7,9 @@ import org.openmrs.api.VisitService; import org.openmrs.module.ipd.api.model.CareTeam; import org.openmrs.module.ipd.api.service.CareTeamService; -import org.openmrs.module.ipd.contract.CareTeamRequest; -import org.openmrs.module.ipd.factory.CareTeamFactory; -import org.openmrs.module.ipd.service.IPDCareTeamService; +import org.openmrs.module.ipd.web.contract.CareTeamRequest; +import org.openmrs.module.ipd.web.factory.CareTeamFactory; +import org.openmrs.module.ipd.web.service.IPDCareTeamService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDMedicationAdministrationServiceImpl.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDMedicationAdministrationServiceImpl.java similarity index 94% rename from omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDMedicationAdministrationServiceImpl.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDMedicationAdministrationServiceImpl.java index 42f8d22..163b4e1 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDMedicationAdministrationServiceImpl.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDMedicationAdministrationServiceImpl.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.service.impl; +package org.openmrs.module.ipd.web.service.impl; import org.apache.commons.lang.StringUtils; import org.openmrs.Patient; @@ -15,12 +15,12 @@ import org.openmrs.module.ipd.api.service.SlotService; import org.openmrs.module.ipd.api.translators.MedicationAdministrationToSlotStatusTranslator; import org.openmrs.module.ipd.api.util.DateTimeUtil; -import org.openmrs.module.ipd.contract.MedicationAdministrationRequest; -import org.openmrs.module.ipd.contract.ScheduleMedicationRequest; -import org.openmrs.module.ipd.factory.MedicationAdministrationFactory; -import org.openmrs.module.ipd.factory.ScheduleFactory; -import org.openmrs.module.ipd.factory.SlotFactory; -import org.openmrs.module.ipd.service.IPDMedicationAdministrationService; +import org.openmrs.module.ipd.web.contract.MedicationAdministrationRequest; +import org.openmrs.module.ipd.web.contract.ScheduleMedicationRequest; +import org.openmrs.module.ipd.web.factory.MedicationAdministrationFactory; +import org.openmrs.module.ipd.web.factory.ScheduleFactory; +import org.openmrs.module.ipd.web.factory.SlotFactory; +import org.openmrs.module.ipd.web.service.IPDMedicationAdministrationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDScheduleServiceImpl.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDScheduleServiceImpl.java similarity index 97% rename from omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDScheduleServiceImpl.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDScheduleServiceImpl.java index 3e07ce7..c087e0c 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDScheduleServiceImpl.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDScheduleServiceImpl.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.service.impl; +package org.openmrs.module.ipd.web.service.impl; import org.openmrs.*; import org.openmrs.api.ConceptService; @@ -15,12 +15,12 @@ import org.openmrs.module.ipd.api.service.ScheduleService; import org.openmrs.module.ipd.api.service.SlotService; import org.openmrs.module.ipd.api.util.DateTimeUtil; -import org.openmrs.module.ipd.contract.ScheduleMedicationRequest; -import org.openmrs.module.ipd.factory.ScheduleFactory; -import org.openmrs.module.ipd.factory.SlotFactory; -import org.openmrs.module.ipd.model.PrescribedOrderSlotSummary; -import org.openmrs.module.ipd.model.PatientMedicationSummary; -import org.openmrs.module.ipd.service.IPDScheduleService; +import org.openmrs.module.ipd.web.contract.ScheduleMedicationRequest; +import org.openmrs.module.ipd.web.factory.ScheduleFactory; +import org.openmrs.module.ipd.web.factory.SlotFactory; +import org.openmrs.module.ipd.web.model.PrescribedOrderSlotSummary; +import org.openmrs.module.ipd.web.model.PatientMedicationSummary; +import org.openmrs.module.ipd.web.service.IPDScheduleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -244,4 +244,4 @@ private void handleDrugOrderStop(EncounterTransaction encounterTransaction){ } } -} \ No newline at end of file +} diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDVisitServiceImpl.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDVisitServiceImpl.java similarity index 97% rename from omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDVisitServiceImpl.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDVisitServiceImpl.java index 1b3cfc6..4a7a5f3 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDVisitServiceImpl.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDVisitServiceImpl.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.service.impl; +package org.openmrs.module.ipd.web.service.impl; import org.bahmni.module.bahmnicore.service.BahmniDrugOrderService; import org.bahmni.module.bahmnicore.service.BahmniObsService; @@ -12,15 +12,15 @@ import org.openmrs.module.bahmniemrapi.drugorder.contract.BahmniOrderAttribute; import org.openmrs.module.bahmniemrapi.drugorder.mapper.BahmniDrugOrderMapper; import org.openmrs.module.bahmniemrapi.encountertransaction.contract.BahmniObservation; -import org.openmrs.module.ipd.model.DrugOrderSchedule; -import org.openmrs.module.ipd.model.IPDDrugOrder; +import org.openmrs.module.ipd.web.model.DrugOrderSchedule; +import org.openmrs.module.ipd.web.model.IPDDrugOrder; import org.openmrs.module.ipd.api.model.ServiceType; import org.openmrs.module.ipd.api.model.Slot; import org.openmrs.module.ipd.api.model.*; import org.openmrs.module.ipd.api.service.ReferenceService; import org.openmrs.module.ipd.api.service.SlotService; -import org.openmrs.module.ipd.service.IPDVisitService; -import org.openmrs.module.ipd.service.IPDScheduleService; +import org.openmrs.module.ipd.web.service.IPDVisitService; +import org.openmrs.module.ipd.web.service.IPDScheduleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDWardServiceImpl.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDWardServiceImpl.java similarity index 97% rename from omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDWardServiceImpl.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDWardServiceImpl.java index e09998e..d307e27 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/impl/IPDWardServiceImpl.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/IPDWardServiceImpl.java @@ -1,10 +1,10 @@ -package org.openmrs.module.ipd.service.impl; +package org.openmrs.module.ipd.web.service.impl; import org.openmrs.module.ipd.api.model.AdmittedPatient; import org.openmrs.module.ipd.api.model.IPDPatientDetails; import org.openmrs.module.ipd.api.model.WardPatientsSummary; import org.openmrs.module.ipd.api.service.WardService; -import org.openmrs.module.ipd.service.IPDWardService; +import org.openmrs.module.ipd.web.service.IPDWardService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/omod/src/main/java/org/openmrs/module/ipd/service/impl/SlotTimeCreationService.java b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/SlotTimeCreationService.java similarity index 95% rename from omod/src/main/java/org/openmrs/module/ipd/service/impl/SlotTimeCreationService.java rename to omod/src/main/java/org/openmrs/module/ipd/web/service/impl/SlotTimeCreationService.java index 01263cc..b594752 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/service/impl/SlotTimeCreationService.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/service/impl/SlotTimeCreationService.java @@ -1,11 +1,11 @@ -package org.openmrs.module.ipd.service.impl; +package org.openmrs.module.ipd.web.service.impl; import org.openmrs.DrugOrder; import org.openmrs.api.impl.BaseOpenmrsService; import org.openmrs.module.ipd.api.util.DateTimeUtil; -import org.openmrs.module.ipd.model.DrugOrderSchedule; +import org.openmrs.module.ipd.web.model.DrugOrderSchedule; import org.openmrs.module.ipd.api.model.Slot; -import org.openmrs.module.ipd.contract.ScheduleMedicationRequest; +import org.openmrs.module.ipd.web.contract.ScheduleMedicationRequest; import org.springframework.stereotype.Component; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -15,8 +15,8 @@ import java.util.*; import java.util.stream.Collectors; -import static org.openmrs.module.ipd.contract.ScheduleMedicationRequest.MedicationFrequency.FIXED_SCHEDULE_FREQUENCY; -import static org.openmrs.module.ipd.contract.ScheduleMedicationRequest.MedicationFrequency.START_TIME_DURATION_FREQUENCY; +import static org.openmrs.module.ipd.web.contract.ScheduleMedicationRequest.MedicationFrequency.FIXED_SCHEDULE_FREQUENCY; +import static org.openmrs.module.ipd.web.contract.ScheduleMedicationRequest.MedicationFrequency.START_TIME_DURATION_FREQUENCY; @Service @Component diff --git a/omod/src/main/java/org/openmrs/module/ipd/util/PrivilegeConstants.java b/omod/src/main/java/org/openmrs/module/ipd/web/util/PrivilegeConstants.java similarity index 96% rename from omod/src/main/java/org/openmrs/module/ipd/util/PrivilegeConstants.java rename to omod/src/main/java/org/openmrs/module/ipd/web/util/PrivilegeConstants.java index 2fdb09a..16d5d22 100644 --- a/omod/src/main/java/org/openmrs/module/ipd/util/PrivilegeConstants.java +++ b/omod/src/main/java/org/openmrs/module/ipd/web/util/PrivilegeConstants.java @@ -1,4 +1,4 @@ -package org.openmrs.module.ipd.util; +package org.openmrs.module.ipd.web.util; import org.openmrs.annotation.AddOnStartup; diff --git a/omod/src/main/resources/webModuleApplicationContext.xml b/omod/src/main/resources/webModuleApplicationContext.xml index a12d5d4..c248844 100644 --- a/omod/src/main/resources/webModuleApplicationContext.xml +++ b/omod/src/main/resources/webModuleApplicationContext.xml @@ -6,7 +6,5 @@ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - - - + diff --git a/omod/src/test/java/org/openmrs/module/ipd/controller/IPDScheduleControllerIntegrationTest.java b/omod/src/test/java/org/openmrs/module/ipd/controller/IPDScheduleControllerIntegrationTest.java index e135b58..2db2095 100644 --- a/omod/src/test/java/org/openmrs/module/ipd/controller/IPDScheduleControllerIntegrationTest.java +++ b/omod/src/test/java/org/openmrs/module/ipd/controller/IPDScheduleControllerIntegrationTest.java @@ -9,7 +9,7 @@ import org.openmrs.module.ipd.BaseIntegrationTest; import org.openmrs.module.ipd.api.model.Schedule; import org.openmrs.module.ipd.api.service.ScheduleService; -import org.openmrs.module.ipd.contract.ScheduleMedicationResponse; +import org.openmrs.module.ipd.web.contract.ScheduleMedicationResponse; import org.openmrs.module.webservices.rest.web.RestConstants; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mock.web.MockHttpServletResponse;