Skip to content

Commit

Permalink
Bindu, Kavitha | Merge code from Bahmni-IPD-master branch to main bra…
Browse files Browse the repository at this point in the history
…nch (#56)

* [Ritesh] | BAH-3148 | Create and fetch medication task (#1)

* [Ritesh] | 1. Repo set up. 2. Created Slot and Schedule entity 3.Saving IPD Medication Schedule without creating slots.

* [Ritesh] | 1. Update package name 2. Added Dao and Service layer for reference 3. Minor fixes

* [Ritesh] | 1.Rename Schedule Strategy to MedicationFrequency

* [Ritesh] | 1. Migration for slot. 2. Slot creation from schedule

* [Ritesh] | 1. Refactor SlotTimeCreationService

* [Ritesh] | 1. Handle time zone issue while creating slots and schedule.

* [Ritesh] | 1. Changing the url of saving medication

* [Ritesh] | 1. Returning slots

* [Ritesh] | Get schedule for Drug chart

* [Ritesh] | Fix date time issue in slots response

* [Ritesh] | Refactoring and Added test

* [Ritesh] | 1. Change for reference id to subject reference id and by reference id to actor reference id. 2. Also added pre-condition before adding medication concept for ipd.

* [Ritesh] | 1. Refactoring ServiceType

* [Ritesh] | 1. Bug Fix return empty list if now slots are not present for a  patient on specific day.

* [Ritesh] | 1. Updated README file

* [Ritesh] | 1. Fixed time zone issue in test

* add. endpoint to get list of IPD medications scheduled for a patient

* refactor. endpoint and updated tests in DAO and service classes

* refactor. namings for schedule DAO methods

* fix. test failures in ScheduleImpl

---------

Co-authored-by: Arjun-Go <[email protected]>
Co-authored-by: Arjun G <[email protected]>

* A-1205974389432443 | Feedbacks on Medication Schedule (#3)

* [Ritesh] | 1. Repo set up. 2. Created Slot and Schedule entity 3.Saving IPD Medication Schedule without creating slots.

* [Ritesh] | 1. Update package name 2. Added Dao and Service layer for reference 3. Minor fixes

* [Ritesh] | 1.Rename Schedule Strategy to MedicationFrequency

* [Ritesh] | 1. Migration for slot. 2. Slot creation from schedule

* [Ritesh] | 1. Refactor SlotTimeCreationService

* [Ritesh] | 1. Handle time zone issue while creating slots and schedule.

* [Ritesh] | 1. Changing the url of saving medication

* [Ritesh] | 1. Returning slots

* [Ritesh] | Get schedule for Drug chart

* [Ritesh] | Fix date time issue in slots response

* [Ritesh] | Refactoring and Added test

* [Ritesh] | 1. Change for reference id to subject reference id and by reference id to actor reference id. 2. Also added pre-condition before adding medication concept for ipd.

* [Ritesh] | 1. Refactoring ServiceType

* [Ritesh] | 1. Bug Fix return empty list if now slots are not present for a  patient on specific day.

* [Ritesh] | 1. Updated README file

* [Ritesh] | 1. Fixed time zone issue in test

* add. endpoint to get list of IPD medications scheduled for a patient

* refactor. endpoint and updated tests in DAO and service classes

* refactor. namings for schedule DAO methods

* fix. test failures in ScheduleImpl

* add. changes to create one schedule for a patient

* update. columns in Schedule and Slot table

* update. set end date as null

* fix tests for Slot and Schedule Hiberate and DAOs. Updated responses for GET calls

* fix tests Schedule DAO

* remove unnecessary fields

* API Change to accomodate Editable Remaining day slot start time for medication

---------

Co-authored-by: Ritesh Ghiya <[email protected]>
Co-authored-by: Kalaiyarasan Raja <[email protected]>

* add. changes to automate omod publish for Bahmni-IPD-master branch (#4)

* Arjun | Fix deployment workflow (#5)

* test. ipd publish workflow

* revert. testing changes in deploy workflow

* test changes with maven wrapper

* revert. deploy for test branch

* Medication Administration Feature (#7)

* [Ritesh] | 1. Repo set up. 2. Created Slot and Schedule entity 3.Saving IPD Medication Schedule without creating slots.

* [Ritesh] | 1. Update package name 2. Added Dao and Service layer for reference 3. Minor fixes

* [Ritesh] | 1.Rename Schedule Strategy to MedicationFrequency

* [Ritesh] | 1. Migration for slot. 2. Slot creation from schedule

* [Ritesh] | 1. Refactor SlotTimeCreationService

* [Ritesh] | 1. Handle time zone issue while creating slots and schedule.

* [Ritesh] | 1. Changing the url of saving medication

* [Ritesh] | 1. Returning slots

* [Ritesh] | Get schedule for Drug chart

* [Ritesh] | Fix date time issue in slots response

* [Ritesh] | Refactoring and Added test

* [Ritesh] | 1. Change for reference id to subject reference id and by reference id to actor reference id. 2. Also added pre-condition before adding medication concept for ipd.

* [Ritesh] | 1. Refactoring ServiceType

* [Ritesh] | 1. Bug Fix return empty list if now slots are not present for a  patient on specific day.

* [Ritesh] | 1. Updated README file

* [Ritesh] | 1. Fixed time zone issue in test

* add. endpoint to get list of IPD medications scheduled for a patient

* refactor. endpoint and updated tests in DAO and service classes

* refactor. namings for schedule DAO methods

* fix. test failures in ScheduleImpl

* add. changes to create one schedule for a patient

* update. columns in Schedule and Slot table

* update. set end date as null

* fix tests for Slot and Schedule Hiberate and DAOs. Updated responses for GET calls

* fix tests Schedule DAO

* remove unnecessary fields

* API Change to accomodate Editable Remaining day slot start time for medication

* Kavitha|Kalai Add Change for Medication Administration Save

* Kavitha|Kalai - Medication Administration Create API Changes

* Kavitha|Kalai - Medication Administration Create API Changes

* Kavitha, Kalai | refactored patient reference param

* Kavitha|Kalai - Medication Administration Create API Changes

* Kavitha|Kalai - Medication Administration Create API Changes

* Kavitha|Kalai - Medication Administration Create API Changes

* Kavitha|Kalai - Medication Administration Create API Changes

* Kavitha, Kalai | add medication administration reference in slot db and api

* Kavitha|Kalai - Medication Administration Create API Changes

* Kavitha, Kalai | added provider mapper and time converter

* Kavitha | add adhoc and refactored scheduled medication administration

* refactored schedule from medication administration request

* Kavitha | refactored medication administration request and response

* Kavitha | refactored annotation to medicationAdministrationNote

* Kavitha | removed unused methods

---------

Co-authored-by: Ritesh Ghiya <[email protected]>
Co-authored-by: Arjun-Go <[email protected]>
Co-authored-by: Kalaiyarasan Raja <[email protected]>

* IPD Treatment Display Control Get API Changes & Edit Drug Chart API Changes (#8)


* IPD Drug Order Fetch API changes

* IPD Drug Order schedule update API changes

* IPD Drug Order schedule update API changes

* IPD Drug Order schedule update API changes

* IPD Drug Order schedule update API changes

* Fix to convert time to UTC intead of Local Time

* Kavitha | refactored treatments API to include emergency medications

* Kavitha,Kalai | add provider as part of drug order response

---------

Co-authored-by: Kavitha S <[email protected]>

* A-1206156796138532 | Abi | add. functionality to return slot information based on given time frame

* Abi | fix. method name based on functionality

* Abi | fix. filter non-voided slots for the iven time frame (#10)

* Changes to accomodate Drugchart view where we need to intended and actual administered time

Changes to accomodate Drugchart view where we need to intended and actual administered time

* BAH-3460 | Kavitha | refactor save adhoc medications (#13)

* Changes to stop/void slots associated with drugorder when its stopped (#12)

Changes to stop/void slots associated with drugorder when its stopped

* BAH-3460 | fix provider uuid issue for schedule creation (#14)

* Nursing task enhancement (#15)

* Abi | fix. schedule notes issue (#17)

* Provider acknowledge flow changes - Update API Introduced for Medication Administration

Provider acknowledge flow changes - Update API Introduced for Medication Administration

* Kavitha | fix slot creation logic for 1 day (#19)

* Kavitha | add void condition in fetching slots (#20)

* Abi | update. status as Stopped once administered and stopped a medicine (#21)

* Changes to bring drug order one visit previous to current visit

Changes to bring drug order one visit previous to current visit

* update. shift api to return slots based on visitUuid

* add. check to avoid multiple save (#23)

* update. filter slots for drugChart based on visit uuid

* Test Case Fix for new change added

* API to save/schedule the placeholder Tasks for PRN (#24)

* add. logic for creating placeholder for as needed medications

* add. test for getting medications in given time frame

* add. logic to fetch medications of particular service type

* update. name of variable

* update. modify imports to have static imports

* pendingSlotsAvailable Key added to know whether any pending slots is available for drug Order

* condition added to check if slotstart time is after current time (#27)

* [Sri/kalai] - get the pending slots after the current time in drug order schedule response

* Change to consider MedicationRequest as a default serviceType if is not sent in payload

* MAde Visit UUid as non-mandatory Param, if visit is not send consider Active  Visit of the patient

* Change to consider MedicationRequest as a default serviceType if is not sent in payload (#29)

* Change to consider MedicationRequest as a default serviceType if is not sent in payload

* MAde Visit UUid as non-mandatory Param, if visit is not send consider Active  Visit of the patient

* Backend changed to accomodate prn slots

* added First Slot Start time to response in DrugOrderSchedule

* Kavitha | add api to fetch slots by patient list with custom includes (#32)

* Ward Level DashBoard API Changes (#30)

* Ward Level DashBoard API Changes

* Kavitha | add null check to get slots for list of patients (#34)

* Search functionality API added & Refactor get patients API (#33)

* Add boolean key to show if all slots are attended (#35)

* Add totalPatient in Patient List & Search API response

* Add missing classes

* Kavitha | refactored slot creation logic for continuous medication (#38)

* add. scheduler to mark non-administered slots as missed (#39)

* Bookmarking API - API To Create Care Team & its Participants (#37)

Bookmarking API - API To Create Care Team & its Participants (#37)

* Adds careTeam information to AdmittedPatient (#40)

* Adds visitDetails to AdmittedPatientResponse

* Removed starttime,endtime & provider in update flow (#42)

* Adds provider details and time check for getAdmittedPatients

* Change LocalDateTime to Date

* Rename methods

* Adds ability to sort by Bed Number

* CareTeam info added to search API as well (#44)

CareTeam info added to search API as well (#44)

* Removed CareTeam Particpants join condition (#45)

Removed CareTeam Particpants join condition (#45)

* Changes Inner join to left outer join

* Makes sortBy optional parameter

* Add a check in generateGroupByClauseForSorting to handle null values

* Extract ORDER BY from GROUP BY

* Add myPatient count for provider in summary API

* Include void check for provider patients

* Include currentDateTime for provider shift validation

* BAH-3723|Kavitha| Event handling model & create task for admit event (#48)

* BAH-3723|Kavitha| add event handling model and create task for admit event

* Kavitha| add null check for event type

* Kavitha | update fhir2 extension module version

* Add scheduler, liquibase and handleEvent for shift start task

* Move Events to api, refactor and include shift start task scheduler

* Update api pom.xml

* Add scheduler task for rollover medication tasks

* Gets rollover tasks from fhir task service using task names and status

* Add migration top add scheduler for rollover tasks

* Create start shift scheduler and roll over tasks

* Update and Refactor the rollover and shift start task

* Remove the emrapi dependency

* Refactor the method names

* Rename the scheduler name

* Add filters on drugorder while showing count (#51)

* [Ashish]Add. Two new frequencies are added to medications

* Abi | add. privilege checks for endpoints (#54)

* Changes to Show the medication of Immediate Previous Visit Only if it is an OPD Visit

Changes to Show the medication of Immediate Previous Visit Only if it is an OPD Visit

* Upgrade Fhir2 version & Fhir2 Extension Version (#57)

* Bindu | Remove feature branch from workflow

---------

Co-authored-by: Ritesh Ghiya <[email protected]>
Co-authored-by: Arjun-Go <[email protected]>
Co-authored-by: Arjun G <[email protected]>
Co-authored-by: Ritesh Ghiya <[email protected]>
Co-authored-by: Kalaiyarasan Raja <[email protected]>
Co-authored-by: kavitha-sundararajan <[email protected]>
Co-authored-by: kalai-tw <[email protected]>
Co-authored-by: Kavitha S <[email protected]>
Co-authored-by: Abinaya U <[email protected]>
Co-authored-by: Abinaya U <[email protected]>
Co-authored-by: Soorya Kumaran C <[email protected]>
Co-authored-by: srinithishg <[email protected]>
Co-authored-by: srinithishg <[email protected]>
Co-authored-by: Umair Fayaz <[email protected]>
Co-authored-by: Umair Fayaz <[email protected]>
Co-authored-by: AshishkurianTw <[email protected]>
Co-authored-by: AshishkurianTw <[email protected]>
  • Loading branch information
18 people authored May 31, 2024
1 parent 0e9bb69 commit 5e30a5a
Show file tree
Hide file tree
Showing 137 changed files with 9,383 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Publish package
on:
push:
branches:
- main
workflow_dispatch:

jobs:
build-publish-package:
name: Build and Publish package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: nexus-sonatype
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD
- name: Build and deploy with Maven
run: ./mvnw --no-transfer-progress clean -U deploy
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
22 changes: 22 additions & 0 deletions .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn clean package
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*.class
.settings
.project
.classpath
.talismanrc
target

# Package Files #
*.jar
*.marker
*.war
*.ear
.idea
.DS_Store

/omod/target/*
/api/target/*
*.iml
*/logs/*
logs/*
classes/
.mvn/wrapper/*.jar
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# openmrs-module-ipd
Openmrs module for Bahmni IPD Care and Monitoring

OpenMRS Module Bahmni-events Backend
=================================
This repository handles Bahmni IPD Care and Monitoring.

## Packaging
```mvn clean package```

### Prerequisite
JDK 1.8

## Deploy

Copy ```openmrs-module-ipd/omod/target/bahmni-ipd-1.0.0-SNAPSHOT.omod``` into OpenMRS modules directory and restart OpenMRS
219 changes: 219 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.bahmni.module</groupId>
<artifactId>bahmni-ipd</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<artifactId>bahmni-ipd-api</artifactId>
<packaging>jar</packaging>
<name>Bahmni IPD API</name>
<description>Bahmni IPD API contains all backend APIs for IPD</description>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!--<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacocoVersion}</version>
<configuration>
<includes>
<include>**/*</include>
<include>**/*</include>
</includes>
<excludes>
<exclude>**/*Activator.class</exclude>
<exclude>**/configuration/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacocoVersion}</version>
<executions>
<execution>
<id>check</id>
<goals>
<goal>report</goal>
<goal>check</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/jacoco-reports</outputDirectory>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>LINE</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
<limit>
<counter>BRANCH</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>-->
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.openmrs.api</groupId>
<artifactId>openmrs-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>bedmanagement-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openmrs.web</groupId>
<artifactId>openmrs-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>webservices.rest-omod-common</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>webservices.rest-omod-2.0</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>fhir2-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>fhir2-omod</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.bahmni.module</groupId>
<artifactId>fhir2Extension-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.bahmni.module</groupId>
<artifactId>fhir2Extension-omod</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.bahmni.module</groupId>
<artifactId>medication-administration-api</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>webservices.rest-omod-common</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openmrs.test</groupId>
<artifactId>openmrs-test</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.openmrs.web</groupId>
<artifactId>openmrs-web</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openmrs.api</groupId>
<artifactId>openmrs-api</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
</dependencies>

</project>


22 changes: 22 additions & 0 deletions api/src/main/java/org/openmrs/module/ipd/api/IPDActivator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.openmrs.module.ipd.api;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.module.BaseModuleActivator;

/**
* This class contains the logic that is run every time this module is either started or shutdown
*/
public class IPDActivator extends BaseModuleActivator {

private final Log log = LogFactory.getLog(this.getClass());

public void startup() {
log.info("Starting Basic Module");
}

public void shutdown() {
log.info("Shutting down Basic Module");
}

}
14 changes: 14 additions & 0 deletions api/src/main/java/org/openmrs/module/ipd/api/dao/CareTeamDAO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.openmrs.module.ipd.api.dao;

import org.openmrs.Visit;
import org.openmrs.api.db.DAOException;
import org.openmrs.module.ipd.api.model.CareTeam;
import org.openmrs.module.ipd.api.model.Schedule;

public interface CareTeamDAO {

CareTeam saveCareTeam(CareTeam careTeam) throws DAOException;

CareTeam getCareTeamByVisit(Visit visit) throws DAOException;

}
15 changes: 15 additions & 0 deletions api/src/main/java/org/openmrs/module/ipd/api/dao/ReferenceDAO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.openmrs.module.ipd.api.dao;

import org.openmrs.api.db.DAOException;
import org.openmrs.module.ipd.api.model.Reference;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface ReferenceDAO {

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

Reference saveReference(Reference reference) throws DAOException;
}
Loading

0 comments on commit 5e30a5a

Please sign in to comment.