-
Notifications
You must be signed in to change notification settings - Fork 169
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
Extending Concept Set Items with Annotations #2403
Open
alex-odysseus
wants to merge
15
commits into
master
Choose a base branch
from
concept-set-annotations
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e6c3857
ATL-17: Updating branch with latest release
hernaldourbina 633eb78
ATL-17: Add feature about the metadata in concept set
757929a
Fixing migration scripts and Concept Set Service to save and update m…
alex-odysseus 83579dd
[ATL-17] Refactored the annotations feature. Renamed metadata to anno…
oleg-odysseus 7e9359c
[ATL-17] Fixed issue with clashing endpoints for conceptset delete op…
oleg-odysseus 25f44ae
Correcting newly adjusted DELETE endpoint notation
alex-odysseus 948fde3
Fixing the previous commit as the endpoint is DELETE /conceptset/anno…
alex-odysseus 0fff858
Fixing the notation as the endpoint is DELETE /conceptset/annotation/…
alex-odysseus 7adb69b
[ATL-58] Added concept set version to annotations
oleg-odysseus f40a666
[ATL-58] Implemented copying of annotations along with ConceptSet
oleg-odysseus 2b9c35a
[ATL-58] Fixed permissions issues for annotations feature, transforme…
oleg-odysseus 485b41a
Fix for annotation search data shown as JSON instead of human readabl…
oleg-odysseus 937c72e
Added 'Copied From' list of concept set ids for concept set annotations
oleg-odysseus 6a88e5d
Added i18n records for Origin Concept Sets ('Copied From' feature in …
oleg-odysseus deed559
A combined migration script has been assembled
alex-odysseus 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 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
108 changes: 108 additions & 0 deletions
108
src/main/java/org/ohdsi/webapi/conceptset/annotation/ConceptSetAnnotation.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,108 @@ | ||
package org.ohdsi.webapi.conceptset.annotation; | ||
|
||
import org.hibernate.annotations.GenericGenerator; | ||
import org.hibernate.annotations.Parameter; | ||
import org.ohdsi.webapi.model.CommonEntity; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import java.io.Serializable; | ||
|
||
@Entity(name = "ConceptSetAnnotation") | ||
@Table(name = "concept_set_annotation") | ||
public class ConceptSetAnnotation extends CommonEntity<Integer> implements Serializable { | ||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
|
||
@Id | ||
@GenericGenerator( | ||
name = "concept_set_annotation_generator", | ||
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator", | ||
parameters = { | ||
@Parameter(name = "sequence_name", value = "concept_set_annotation_sequence"), | ||
@Parameter(name = "increment_size", value = "1") | ||
} | ||
) | ||
@GeneratedValue(generator = "concept_set_annotation_generator") | ||
@Column(name = "concept_set_annotation_id") | ||
private Integer id; | ||
|
||
@Column(name = "concept_set_id", nullable = false) | ||
private Integer conceptSetId; | ||
|
||
@Column(name = "concept_id") | ||
private Integer conceptId; | ||
|
||
@Column(name = "annotation_details") | ||
private String annotationDetails; | ||
|
||
@Column(name = "vocabulary_version") | ||
private String vocabularyVersion; | ||
|
||
@Column(name = "concept_set_version") | ||
private String conceptSetVersion; | ||
|
||
@Column(name = "copied_from_concept_set_ids") | ||
private String copiedFromConceptSetIds; | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public Integer getConceptSetId() { | ||
return conceptSetId; | ||
} | ||
|
||
public void setConceptSetId(Integer conceptSetId) { | ||
this.conceptSetId = conceptSetId; | ||
} | ||
|
||
public Integer getConceptId() { | ||
return conceptId; | ||
} | ||
|
||
public void setConceptId(Integer conceptId) { | ||
this.conceptId = conceptId; | ||
} | ||
|
||
public String getAnnotationDetails() { | ||
return annotationDetails; | ||
} | ||
|
||
public void setAnnotationDetails(String annotationDetails) { | ||
this.annotationDetails = annotationDetails; | ||
} | ||
|
||
public String getVocabularyVersion() { | ||
return vocabularyVersion; | ||
} | ||
|
||
public void setVocabularyVersion(String vocabularyVersion) { | ||
this.vocabularyVersion = vocabularyVersion; | ||
} | ||
|
||
public String getConceptSetVersion() { | ||
return conceptSetVersion; | ||
} | ||
|
||
public void setConceptSetVersion(String conceptSetVersion) { | ||
this.conceptSetVersion = conceptSetVersion; | ||
} | ||
|
||
public String getCopiedFromConceptSetIds() { | ||
return copiedFromConceptSetIds; | ||
} | ||
|
||
public void setCopiedFromConceptSetIds(String copiedFromConceptSetIds) { | ||
this.copiedFromConceptSetIds = copiedFromConceptSetIds; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/org/ohdsi/webapi/conceptset/annotation/ConceptSetAnnotationRepository.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,20 @@ | ||
package org.ohdsi.webapi.conceptset.annotation; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
public interface ConceptSetAnnotationRepository extends JpaRepository<ConceptSetAnnotation, Integer> { | ||
|
||
@Query("DELETE FROM ConceptSetAnnotation cc WHERE cc.conceptSetId = :conceptSetId and cc.conceptId in :conceptId") | ||
void deleteAnnotationByConceptSetIdAndInConceptId(int conceptSetId, List<Integer> conceptId); | ||
|
||
void deleteAnnotationByConceptSetIdAndConceptId(int conceptSetId, int conceptId); | ||
|
||
List<ConceptSetAnnotation> findByConceptSetId(int conceptSetId); | ||
ConceptSetAnnotation findById(int id); | ||
void deleteById(int id); | ||
Optional<ConceptSetAnnotation> findConceptSetAnnotationByConceptIdAndConceptId(int conceptSetId, int conceptId); | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/org/ohdsi/webapi/security/model/ConceptSetAnnotationPermissionSchema.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,25 @@ | ||
package org.ohdsi.webapi.security.model; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@Component | ||
public class ConceptSetAnnotationPermissionSchema extends EntityPermissionSchema { | ||
|
||
private static Map<String, String> writePermissions = new HashMap<String, String>() { | ||
{ | ||
put("conceptset:annotation:%s:delete", "Delete Concept Set Annotation with ID %s"); | ||
} | ||
}; | ||
|
||
private static Map<String, String> readPermissions = new HashMap<String, String>() { | ||
{ | ||
} | ||
}; | ||
|
||
public ConceptSetAnnotationPermissionSchema() { | ||
super(EntityType.CONCEPT_SET_ANNOTATION, readPermissions, writePermissions); | ||
} | ||
} |
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
Oops, something went wrong.
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.
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.
This is odd to me:
Shouldn't the writePermissions contain all permissions related to creating annotations and the read have the ones related to reading annotations?