-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vocabulary search common classes (#56)
Referencing the latest Standardized Analysis Utils and Circe
- Loading branch information
1 parent
6dd922f
commit 1da4e72
Showing
5 changed files
with
108 additions
and
10 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
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,16 @@ | ||
package org.ohdsi.info; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public abstract class ConfigurationInfo { | ||
|
||
protected final Map<String, Object> properties = new HashMap<>(); | ||
|
||
public abstract String getKey(); | ||
|
||
public Map<String, Object> getProperties() { | ||
|
||
return properties; | ||
} | ||
} |
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,48 @@ | ||
package org.ohdsi.vocabulary; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
|
||
import java.util.Date; | ||
import java.util.Objects; | ||
|
||
@JsonInclude() | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonPropertyOrder({ | ||
"CONCEPT_ID", "CONCEPT_NAME", "STANDARD_CONCEPT", | ||
"STANDARD_CONCEPT_CAPTION", "INVALID_REASON", "INVALID_REASON_CAPTION", | ||
"CONCEPT_CODE", "DOMAIN_ID", "VOCABULARY_ID", "CONCEPT_CLASS_ID", | ||
"VALID_START_DATE", "VALID_END_DATE" | ||
}) | ||
public class Concept extends org.ohdsi.circe.vocabulary.Concept { | ||
|
||
@JsonProperty("VALID_START_DATE") | ||
public Date validStartDate; | ||
|
||
@JsonProperty("VALID_END_DATE") | ||
public Date validEndDate; | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (!(o instanceof Concept)) { | ||
return false; | ||
} | ||
final Concept other = (Concept) o; | ||
return Objects.equals(conceptId, other.conceptId) && Objects.equals(conceptName, other.conceptName) && | ||
Objects.equals(standardConcept, other.standardConcept) && Objects.equals(invalidReason, other.invalidReason) && | ||
Objects.equals(conceptCode, other.conceptCode) && Objects.equals(domainId, other.domainId) && | ||
Objects.equals(vocabularyId, other.vocabularyId) && Objects.equals(conceptClassId, other.conceptClassId) && | ||
Objects.equals(validStartDate, other.validStartDate) && Objects.equals(validEndDate, other.validEndDate); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(conceptId, conceptName, standardConcept, invalidReason, conceptCode, | ||
domainId, vocabularyId, conceptClassId, validStartDate, validEndDate); | ||
} | ||
} |
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,9 @@ | ||
package org.ohdsi.vocabulary; | ||
|
||
import java.util.Collection; | ||
|
||
public interface SearchProvider { | ||
boolean supports(String vocabularyVersionKey); | ||
int getPriority(); | ||
Collection<Concept> executeSearch(SearchProviderConfig config, String query, String rows) throws Exception; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/org/ohdsi/vocabulary/SearchProviderConfig.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,19 @@ | ||
package org.ohdsi.vocabulary; | ||
|
||
public class SearchProviderConfig { | ||
private String sourceKey; | ||
private String versionKey; | ||
|
||
public SearchProviderConfig(String sourceKey, String versionKey) { | ||
this.sourceKey = sourceKey; | ||
this.versionKey = versionKey; | ||
} | ||
|
||
public String getVersionKey() { | ||
return versionKey; | ||
} | ||
|
||
public String getSourceKey() { | ||
return sourceKey; | ||
} | ||
} |