-
Notifications
You must be signed in to change notification settings - Fork 1
UHM-9514: migrate audit REST end points from pihcore #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0771f01
UHM-9514: migrate audit REST end points from pihcore
cioan 7a75ddb
UHM-9514: address PR review feedback
cioan 2341ad0
UHM-9514: generalize encounter and obs rest endpoints
cioan 0ca14da
UHM-9514: address PR review comments
cioan 2dff26b
UHM-9514: remove sysAdmin privilege requirement
cioan ee7d23f
UHM-9514: obs date ranges are now independent of the filters
cioan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
87 changes: 87 additions & 0 deletions
87
api/src/main/java/org/openmrs/module/pihapps/encounter/EncounterSearchCriteria.java
This file contains hidden or 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,87 @@ | ||
| package org.openmrs.module.pihapps.encounter; | ||
|
|
||
| import lombok.Data; | ||
| import org.openmrs.EncounterType; | ||
| import org.openmrs.Provider; | ||
| import org.openmrs.User; | ||
| import org.openmrs.module.pihapps.SortCriteria; | ||
|
|
||
| import java.util.Date; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Describes an encounter search. Core's own {@link org.openmrs.parameter.EncounterSearchCriteria} | ||
| * carries a providers field that no search handler exposes, and has no creator, changedBy or | ||
| * voidedBy field at all, which is why this exists rather than the module reusing it. | ||
| * | ||
| * <p>Every filter narrows, so naming several asks for the encounters satisfying all of them, and | ||
| * naming none matches every encounter. | ||
| */ | ||
| @Data | ||
| public class EncounterSearchCriteria { | ||
|
|
||
| /** | ||
| * Whether voided encounters are returned alongside the surviving ones. Off by default, since a | ||
| * search is normally asking what a record says now, and callers can tell the two apart by each | ||
| * encounter's voided flag. | ||
| * | ||
| * <p>An audit search turns this on: voided encounters are the whole point of a | ||
| * {@link #voidedBy} search, and what an auditor most wants to see in the others. | ||
| */ | ||
| private boolean includeVoided = false; | ||
|
|
||
| /** Restrict to encounters this user created. */ | ||
| private User createdBy; | ||
|
|
||
| /** Restrict to encounters this user changed. */ | ||
| private User changedBy; | ||
|
|
||
| /** Restrict to encounters this user voided. */ | ||
| private User voidedBy; | ||
|
|
||
| /** Restrict to encounters this provider is recorded on. */ | ||
| private Provider provider; | ||
|
|
||
| /** Restrict to encounters of this type. */ | ||
| private EncounterType encounterType; | ||
|
|
||
| /** | ||
| * Bound when the encounter was created. Each of the four ranges below names the column it | ||
| * applies to, and each is independent of the filters: `createdOnOrAfter` narrows by creation | ||
| * date whether or not `createdBy` is also given, and naming several asks for all of them. | ||
| * | ||
| * <p>Which range a search wants is the caller's to decide. An audit of what a user entered | ||
| * wants the range against that user's action — an encounter backdated to last year but entered | ||
| * this morning was entered this morning — while a provider's caseload is asked about by | ||
| * {@link #encounterDatetimeOnOrAfter}, when the encounters actually happened. | ||
| * | ||
| * <p>Both ends of every range run inclusively and are applied as given, so a caller that means | ||
| * a whole day passes that day's last moment. | ||
| */ | ||
| private Date createdOnOrAfter; | ||
|
|
||
| /** @see #createdOnOrAfter */ | ||
| private Date createdOnOrBefore; | ||
|
|
||
| /** Bound when the encounter was last changed. @see #createdOnOrAfter */ | ||
| private Date changedOnOrAfter; | ||
|
|
||
| /** @see #createdOnOrAfter */ | ||
| private Date changedOnOrBefore; | ||
|
|
||
| /** Bound when the encounter was voided. @see #createdOnOrAfter */ | ||
| private Date voidedOnOrAfter; | ||
|
|
||
| /** @see #createdOnOrAfter */ | ||
| private Date voidedOnOrBefore; | ||
|
|
||
| /** Bound the encounter's own datetime — when it happened. @see #createdOnOrAfter */ | ||
| private Date encounterDatetimeOnOrAfter; | ||
|
|
||
| /** @see #createdOnOrAfter */ | ||
| private Date encounterDatetimeOnOrBefore; | ||
|
|
||
| private List<SortCriteria> sortCriteria; | ||
| private Integer startIndex; | ||
| private Integer limit; | ||
| } |
12 changes: 12 additions & 0 deletions
12
api/src/main/java/org/openmrs/module/pihapps/encounter/EncounterSearchResult.java
This file contains hidden or 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,12 @@ | ||
| package org.openmrs.module.pihapps.encounter; | ||
|
|
||
| import lombok.Data; | ||
| import org.openmrs.Encounter; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Data | ||
| public class EncounterSearchResult { | ||
| Long totalCount; | ||
| List<Encounter> encounters; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.