Skip to content

Commit

Permalink
🙉 Fix test and make the search clearable.
Browse files Browse the repository at this point in the history
  • Loading branch information
psbrandt committed Mar 18, 2021
1 parent ba8e070 commit 368be05
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 164 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>edu.phema</groupId>
<artifactId>phema-elm-to-ohdsi</artifactId>
<version>0.4.5-SNAPSHOT</version>
<version>0.4.5</version>
<packaging>jar</packaging>

<name>phema-elm-to-ohdsi</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,90 +13,92 @@
* Represents and instance of an OMOP server
*/
public interface IOmopRepositoryService {
/**
* Gets concept metadata for a given concept ID
*
* @param id The concept ID
* @return The concept metadata
* @throws OmopRepositoryException
*/
public Concept getConceptMetadata(String id) throws OmopRepositoryException;
public void emptyCache();

/**
* Submits a query to the WebAPIs /vocabulary/search endpoint
* that specifies a query and a vocabularyId
*
* @param query The code, or partial code from the vocabulary
* @param vocabularyId The ID of the vocabulary (e.g. "CPT4)
* @return
* @throws OmopRepositoryException
*/
public List<Concept> vocabularySearch(String query, String vocabularyId) throws OmopRepositoryException;
/**
* Gets concept metadata for a given concept ID
*
* @param id The concept ID
* @return The concept metadata
* @throws OmopRepositoryException
*/
public Concept getConceptMetadata(String id) throws OmopRepositoryException;

/**
* Create a new cohort definition in the OMOP database. This only creates
* the definition, and does not actually generate the cohort.
*
* @param cohortDefintion The cohort definition to create
* @return The created cohort definition
* @throws OmopRepositoryException
*/
public CohortDefinitionDTO createCohortDefinition(CohortDefinitionDTO cohortDefintion) throws OmopRepositoryException;
/**
* Submits a query to the WebAPIs /vocabulary/search endpoint
* that specifies a query and a vocabularyId
*
* @param query The code, or partial code from the vocabulary
* @param vocabularyId The ID of the vocabulary (e.g. "CPT4)
* @return
* @throws OmopRepositoryException
*/
public List<Concept> vocabularySearch(String query, String vocabularyId) throws OmopRepositoryException;

/**
* Gets the cohort definition for a given id
*
* @param id The cohort definition id
* @return The cohort definition
* @throws OmopRepositoryException
*/
public CohortDefinitionDTO getCohortDefinition(Integer id) throws OmopRepositoryException;
/**
* Create a new cohort definition in the OMOP database. This only creates
* the definition, and does not actually generate the cohort.
*
* @param cohortDefintion The cohort definition to create
* @return The created cohort definition
* @throws OmopRepositoryException
*/
public CohortDefinitionDTO createCohortDefinition(CohortDefinitionDTO cohortDefintion) throws OmopRepositoryException;

/**
* Queue up a specific cohort definition for generation. This will return
* the created cohort definition job.
*
* @param id The ID of the cohort definition to generate
* @return The cohort generation job
* @throws OmopRepositoryException
*/
public JobExecutionResource queueCohortGeneration(Integer id) throws OmopRepositoryException;
/**
* Gets the cohort definition for a given id
*
* @param id The cohort definition id
* @return The cohort definition
* @throws OmopRepositoryException
*/
public CohortDefinitionDTO getCohortDefinition(Integer id) throws OmopRepositoryException;

/**
* Get information about the cohort definition, such as the generation status.
*
* @param id The cohort definition id
* @return A list of cohort definition info objects
* @throws OmopRepositoryException
*/
public List<CohortGenerationInfo> getCohortDefinitionInfo(Integer id) throws OmopRepositoryException;
/**
* Queue up a specific cohort definition for generation. This will return
* the created cohort definition job.
*
* @param id The ID of the cohort definition to generate
* @return The cohort generation job
* @throws OmopRepositoryException
*/
public JobExecutionResource queueCohortGeneration(Integer id) throws OmopRepositoryException;

/**
* Get a report for a given cohort definition, including statistics for
* each inclusion rule.
*
* @param id The cohort definition id
* @return The report object
* @throws OmopRepositoryException
*/
public InclusionRuleReport getCohortDefinitionReport(Integer id) throws OmopRepositoryException;
/**
* Get information about the cohort definition, such as the generation status.
*
* @param id The cohort definition id
* @return A list of cohort definition info objects
* @throws OmopRepositoryException
*/
public List<CohortGenerationInfo> getCohortDefinitionInfo(Integer id) throws OmopRepositoryException;

/**
* Get the CQL for a given cohort definition. One of the following target dialects may optionally
* be specified:
* <p>
* - "sql server"
* - "pdw"
* - "oracle"
* - "postgresql"
* - "redshift"
* - "impala"
* - "netezza"
* </p>
*
* @param id The cohort definition id
* @return The generation result obejct
* @throws OmopRepositoryException
*/
public GenerateSqlResult getCohortDefinitionSql(Integer id, String targetDialect) throws OmopRepositoryException;
/**
* Get a report for a given cohort definition, including statistics for
* each inclusion rule.
*
* @param id The cohort definition id
* @return The report object
* @throws OmopRepositoryException
*/
public InclusionRuleReport getCohortDefinitionReport(Integer id) throws OmopRepositoryException;

/**
* Get the CQL for a given cohort definition. One of the following target dialects may optionally
* be specified:
* <p>
* - "sql server"
* - "pdw"
* - "oracle"
* - "postgresql"
* - "redshift"
* - "impala"
* - "netezza"
* </p>
*
* @param id The cohort definition id
* @return The generation result obejct
* @throws OmopRepositoryException
*/
public GenerateSqlResult getCohortDefinitionSql(Integer id, String targetDialect) throws OmopRepositoryException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public OmopRepositoryService(String domain, String source) {
client.register(ObjectMapperContextResolver.class);
}

@Override
public void emptyCache() {
searchCache.clear();
}

/**
* Gets concept metadata for a given concept ID
*
Expand Down
Loading

0 comments on commit 368be05

Please sign in to comment.