Skip to content

Commit

Permalink
Kavitha | Update ipd branch with latest master changes (#82)
Browse files Browse the repository at this point in the history
* Parvathy | BAH-4017 | Add. Global Property bahmni-ipd.allowSlotStopOnDrugOrderStop (#69)

* BAH-4001 | Add. Set flag to mark system generated tasks (#70)

* BAH-4033 | Refactor. Get task type for system generated tasks from configuration (#71)

* BAH-4062 | Refactor. Move privilege creation to config.xml (#72)

* BAH-4062 | Refactor. Extract privilege creation to config.xml

* BAH-4062 | Fix. Error messages for privilege check failures

* BAH-4073 | Refactor. Change LICENSE to OMRS MPLv2 (#74)

* BAH-4073 | Refactor. Change LICENSE to OMRS MPLv2

* BAH-4073 | Fix. License information in pom.xml

* BAH-4061 | Refactor. Change Medication Administration Status Type As VarChar (#73)

* [Rahul] | BAH-4061 | Refactor. Change Medication Administration Status Type As VarChar

* [Rahul] | BAH-4061 | Refactor. Remove Unused Dependencies

* [Rahul] | BAH-4061 | Refactor. Change Status Value In Test

* [Rahul] | BAH-4061 | Refactor. Remove MedicationAdministration Status Null Check

* [Rahul] | BAH-4061 | Fix. MedicationAdministrationStatus Test Data

* BAH-4093 | Add. Workflow to release artifacts on push of a tag (#77)

* BAH-4093 | Upgrade depencies for release

* BAH-4093 | Release of version 1.0.0

* BAH-4093 | Incrementing dev version to 1.1.0-SNAPSHOT

* BAH-4093 | Add. Default value for config file path property. (#80)

* BAH-4093 | Add. Default value for config file path property.

* BAH-4093 | Refactor. Update property name

* BAH-4096 | Use xml based bean creations and removed annotations (#79)

* BAH-4096 | Use xml based bean creations and removed annotations

* BAH-4096 | Fix. Remove unused component scans

* BAH-4096 | Refactor. Remove ununsed properties files in OMOD

* BAH-4096 | Refactor. Move OMOD class files inside web package

* BAH-4096 | Fix. Import path in OMOD test

* Kavitha,Vikram|add emergency medication check for care view (#75) (#81)

* BAH-4093 | Release of version 1.1.0

* updated drug order response

* updated pom and workflow file

* add beans for ipd schedulers

---------

Co-authored-by: Arjun-Go <[email protected]>
Co-authored-by: Rahul Ramesh <[email protected]>
Co-authored-by: Parvathy Babu <[email protected]>
Co-authored-by: MOHANKUMAR T <[email protected]>
Co-authored-by: MOHANKUMAR T <[email protected]>
  • Loading branch information
6 people authored Sep 15, 2024
1 parent 03b4703 commit dfa4ece
Show file tree
Hide file tree
Showing 78 changed files with 305 additions and 233 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import java.util.Optional;

@Repository

public interface ReferenceDAO {

Optional<Reference> getReferenceByTypeAndTargetUUID(String type, String targetUUID) throws DAOException;

Reference saveReference(Reference reference) throws DAOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.time.LocalDateTime;
import java.util.List;

@Repository

public interface SlotDAO {

Slot getSlot(Integer slotId) throws DAOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@
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;
}

@Override
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConfigDetail> getConfigs() {
if (configs.isEmpty()) {
Expand All @@ -32,10 +32,10 @@ public List<ConfigDetail> getConfigs() {

private void loadConfiguration() {
try {
File routeConfigurationFile = new FileSystemResource(routeConfigurationFileLocation).getFile();
File routeConfigurationFile = new FileSystemResource(eventsConfigurationFileLocation).getFile();
this.configs = objectMapper.readValue(routeConfigurationFile, new TypeReference<List<ConfigDetail>>() {});
} catch (IOException exception) {
log.error("Failed to load configuration for file : " + routeConfigurationFileLocation, exception);
log.error("Failed to load configuration for file : " + eventsConfigurationFileLocation, exception);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import java.util.Optional;

@Service

public interface ReferenceService extends OpenmrsService {

// @Authorized({ PrivilegeConstants.EDIT_IPD_SCHEDULES })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.List;
import java.util.Map;

@Service

public interface SlotService extends OpenmrsService {

// @Authorized({ PrivilegeConstants.EDIT_IPD_SLOTS })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

# Route definitions
config-file.path=/etc/bahmni_config/openmrs/apps/ipdDashboard/eventsConfig.json
ipd.events_config.file_path=/etc/bahmni_config/openmrs/apps/ipdDashboard/eventsConfig.json
Loading

0 comments on commit dfa4ece

Please sign in to comment.