-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extending Concept Set Items with Annotations (#2403)
Co-authored-by: Hernaldo Urbina <[email protected]> Co-authored-by: hernaldo.urbina <mailto:[email protected]> Co-authored-by: oleg-odysseus <[email protected]>
- Loading branch information
1 parent
02a9c9f
commit 67f8816
Showing
19 changed files
with
813 additions
and
106 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
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 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 Integer 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 Integer getConceptSetVersion() { | ||
return conceptSetVersion; | ||
} | ||
|
||
public void setConceptSetVersion(Integer 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); | ||
} |
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
Oops, something went wrong.