-
Notifications
You must be signed in to change notification settings - Fork 50
RA-429 : deleting duplicate concepts #39
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
Closed
Closed
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions
20
api/src/main/java/org/openmrs/module/referencemetadata/AdministrativeNotification.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,20 @@ | ||
| package org.openmrs.module.referencemetadata; | ||
|
|
||
| import java.util.Collection; | ||
|
|
||
| import org.openmrs.Concept; | ||
| import org.openmrs.api.context.Context; | ||
|
|
||
| public class AdministrativeNotification { | ||
|
|
||
| public void notify_duplicate_concepts() { | ||
| Collection<Concept> concepts = Context.getConceptService().getConceptsByName("YES"); | ||
|
|
||
| if (concepts.size() == 2) { | ||
|
|
||
|
|
||
| } else { | ||
|
|
||
| } | ||
| } | ||
| } | ||
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 |
|---|---|---|
| @@ -1,8 +1,31 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
|
|
||
| <databaseChangeLog | ||
| xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd"> | ||
|
|
||
| <!-- | ||
| See http://www.liquibase.org/manual/home#available_database_refactorings | ||
| for a list of supported elements and attributes | ||
| --> | ||
|
|
||
| <changeSet id="deleting_duplicate_concept" author="Mutesasira Moses"> | ||
| <preConditions onFail="MARK_RAN"> | ||
| <or> | ||
| <sqlCheck expectedResult="2">select count(*) from concept_name where name = 'YES'</sqlCheck> | ||
| <sqlCheck expectedResult="2">select count(*) from concept_name where name = 'NO'</sqlCheck> | ||
| </or> | ||
| </preConditions> | ||
| <comment> | ||
| it checks whether the duplicate concepts exists and deletes one | ||
| </comment> | ||
|
|
||
|
|
||
| <sql> | ||
| SET FOREIGN_KEY_CHECKS = 0; | ||
| delete from concept_name where concept_id =1 or concept_id =2; | ||
| delete from concept where concept_id =1 or concept_id =2 ; | ||
| SET FOREIGN_KEY_CHECKS = 1; | ||
| </sql> | ||
| </changeSet> | ||
|
|
||
| </databaseChangeLog> |
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.
Has this class got anything to do with the ticket?
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.
well i was just trying to figure out , how i can display an administrative notification on the user UI .. but i failed to get exactly an example of how to use the org.openmrs.module.appframework.factory.AdministrativeNotificationProduce
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.
How is it related to this ticket?
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.
i thought that method can be used to check whether duplicate concepts exists , and then trigers the administration Notification requested by he ticket
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.
though am not yet sure how to display an administration notification on the UI as done in the atlas module. i failed to gt any reference documentation on how to do it
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.
oh ya samwel , acoording to the acceptance criteria ...
Upon upgrading an existing OpenMRS installation, if it has two TRUE or FALSE concepts, the administrator should be shown instructions about how to clean this up in their database.
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.
soi was trying out making a method that will trigger the amin notification
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.
but am soon pushing , i have modified that
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.
hi dan , let me close this PR, i have created a new one
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.
please look at this #40
and openmrs/openmrs-module-referenceapplication#50
am closing this