-
Notifications
You must be signed in to change notification settings - Fork 3
Clinical remarks data source #250
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
labkey-martyp
merged 3 commits into
release21.7-SNAPSHOT
from
21.7_fb_etl_breeder_comments
Oct 8, 2021
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package org.labkey.ehr.query; | ||
|
|
||
| import org.labkey.api.data.Container; | ||
| import org.labkey.api.data.ContainerFilter; | ||
| import org.labkey.api.data.TableInfo; | ||
| import org.labkey.api.ldk.table.ContainerScopedTable; | ||
| import org.labkey.api.query.BatchValidationException; | ||
| import org.labkey.api.query.InvalidKeyException; | ||
| import org.labkey.api.query.QueryUpdateService; | ||
| import org.labkey.api.query.QueryUpdateServiceException; | ||
| import org.labkey.api.query.SimpleUserSchema; | ||
| import org.labkey.api.query.UserSchema; | ||
| import org.labkey.api.security.User; | ||
| import org.labkey.ehr.dataentry.DataEntryManager; | ||
|
|
||
| import java.sql.SQLException; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * This TableInfo is for the actual ehr.lookupsets table. It is not a duplicate of LookupSetTable which | ||
| * is for the virtual tables created from the data in ehr.lookupsets. | ||
| */ | ||
| public class LookupSetsTable<SchemaType extends UserSchema> extends ContainerScopedTable<SchemaType> | ||
| { | ||
| public LookupSetsTable(SchemaType schema, TableInfo st, ContainerFilter cf, String newPk) | ||
| { | ||
| super(schema, st, cf, newPk); | ||
| } | ||
|
|
||
| @Override | ||
| public QueryUpdateService getUpdateService() | ||
| { | ||
| return new UpdateService(this); | ||
| } | ||
|
|
||
| private class UpdateService extends ContainerScopedTable<SchemaType>.UpdateService | ||
| { | ||
| public UpdateService(SimpleUserSchema.SimpleTable<SchemaType> ti) | ||
| { | ||
| super(ti); | ||
| } | ||
|
|
||
| @Override | ||
| protected void afterInsertUpdate(int count, BatchValidationException errors) | ||
| { | ||
| DataEntryManager.get().getCache().clear(); | ||
| } | ||
|
|
||
| @Override | ||
| protected Map<String, Object> deleteRow(User user, Container container, Map<String, Object> oldRowMap) throws QueryUpdateServiceException, SQLException, InvalidKeyException | ||
| { | ||
| Map<String, Object> row = super.deleteRow(user, container, oldRowMap); | ||
| DataEntryManager.get().getCache().clear(); | ||
| return row; | ||
| } | ||
|
|
||
| @Override | ||
| protected int truncateRows(User user, Container container) throws QueryUpdateServiceException, SQLException | ||
| { | ||
| int i = super.truncateRows(user, container); | ||
| DataEntryManager.get().getCache().clear(); | ||
| return i; | ||
| } | ||
| } | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness should hook into deleteRows() as well. truncateRows() gets called when the whole table is being cleared, but won't be invoked for individual rows being deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, added.