-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
e2bcd0a
commit c978be7
Showing
27 changed files
with
670 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
api/src/main/java/org/openmrs/module/ipd/api/model/ServiceType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
api/src/main/java/org/openmrs/module/ipd/api/service/ScheduleService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationNoteRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.openmrs.module.ipd.contract; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.codehaus.jackson.annotate.JsonIgnoreProperties; | ||
|
||
import java.util.Date; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties | ||
public class MedicationAdministrationNoteRequest { | ||
private String uuid; | ||
private String authorUuid; | ||
private Long recordedTime; | ||
private String text; | ||
|
||
public Date getRecordedTimeAsLocaltime() { | ||
return this.recordedTime != null ? new Date(TimeUnit.SECONDS.toMillis(this.recordedTime)): new Date(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
omod/src/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationNoteResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.openmrs.module.ipd.contract; | ||
|
||
import lombok.*; | ||
import org.codehaus.jackson.annotate.JsonIgnoreProperties; | ||
import org.openmrs.module.ipd.api.model.MedicationAdministrationNote; | ||
import org.openmrs.module.webservices.rest.web.ConversionUtil; | ||
import org.openmrs.module.webservices.rest.web.representation.Representation; | ||
|
||
import java.util.Date; | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties | ||
public class MedicationAdministrationNoteResponse { | ||
private String uuid; | ||
private Object author; | ||
private Date recordedTime; | ||
private String text; | ||
|
||
public static MedicationAdministrationNoteResponse createFrom(MedicationAdministrationNote openmrsObject) { | ||
return MedicationAdministrationNoteResponse.builder() | ||
.uuid(openmrsObject.getUuid()) | ||
.author(ConversionUtil.convertToRepresentation(openmrsObject.getAuthor(), Representation.REF)) | ||
.recordedTime(openmrsObject.getRecordedTime()) | ||
.text(openmrsObject.getText()) | ||
.build(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...c/main/java/org/openmrs/module/ipd/contract/MedicationAdministrationPerformerRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.openmrs.module.ipd.contract; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.codehaus.jackson.annotate.JsonIgnoreProperties; | ||
|
||
import java.util.Date; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties | ||
public class MedicationAdministrationPerformerRequest { | ||
private String uuid; | ||
private String providerUuid; | ||
private String function; | ||
} |
28 changes: 28 additions & 0 deletions
28
.../main/java/org/openmrs/module/ipd/contract/MedicationAdministrationPerformerResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.openmrs.module.ipd.contract; | ||
|
||
import lombok.*; | ||
import org.codehaus.jackson.annotate.JsonIgnoreProperties; | ||
import org.openmrs.module.ipd.api.model.MedicationAdministrationPerformer; | ||
import org.openmrs.module.webservices.rest.web.ConversionUtil; | ||
import org.openmrs.module.webservices.rest.web.representation.Representation; | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@JsonIgnoreProperties | ||
public class MedicationAdministrationPerformerResponse { | ||
private String uuid; | ||
private Object provider; | ||
private String function; | ||
|
||
public static MedicationAdministrationPerformerResponse createFrom(MedicationAdministrationPerformer openmrsMedicationAdministrationPerformer) { | ||
String function = openmrsMedicationAdministrationPerformer.getFunction() != null ? openmrsMedicationAdministrationPerformer.getFunction().getDisplayString() : null; | ||
return MedicationAdministrationPerformerResponse.builder() | ||
.uuid(openmrsMedicationAdministrationPerformer.getUuid()) | ||
.provider(ConversionUtil.convertToRepresentation(openmrsMedicationAdministrationPerformer.getActor(), Representation.REF)) | ||
.function(function) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.