Coder Social home page Coder Social logo

circe's People

Contributors

chrisknoll avatar pbr6cornell avatar salmasian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

circe's Issues

'Concept selector' should show 'standard concept' field

When I click 'Add' from 'with gender of:' , the 'concept selector' opens up with the domain restricted to 'Gender', which is a very nice feature. However, the list includes all standard and non-standard concepts. It'd be nice to show the standard field to allow sorting/filtering on the value.

Many enhancements to concept selector would likely be addressed once CIRCE is fully integrated with HERMES, so perhaps these can be de-prioritized until that integration is complete.

Add webAPI selector control

Add the hermes-like endpoint selector to topnav.

Visible and selectable when on Definition list
Read-only view of selected endpoint when in details.

On change of endpoint, refresh definition list.

Import textbox is too small in certain browsers

Using latest release version of Firefox in Linux, or latest release version of Safari in Mac, when you click on the Import button in the Concept Set editor, the textbox shown is very small. Screenshots available below:

Firefox:
Firefox

Safari:
Safari

Possible issue with dates when DBMS is Oracle

Hi,

I set up the multihome WebAPI for the first time today using CDM and OHDSI schemas in our Oracle DBMS. Doing various tests with Circe and ran into a possible problem. When generating a cohort that uses any kind of specific date restriction, the generated SQL triggers ORA-01861: literal does not match format string. See a specific example below. I found this did run after wrapping dates with to_date() e.g.,

C.drug_exposure_start_date <=  C.drug_exposure_start_date <= to_date('2016-01-01','YYYY-MM-DD')

QUERY THAT FAILED:

CREATE TABLE  b804zh31Codesets
  AS
SELECT
   codeset_id, concept_id 

FROM

(SELECT   0 as codeset_id, c.concept_id  FROM  (SELECT   distinct I.concept_id  FROM 
(SELECT    DISTINCT concept_id  FROM  DIKB_DEV.CONCEPT   WHERE  concept_id in (40231804) and invalid_reason is null
    UNION 

  SELECT  c.concept_id
   FROM  DIKB_DEV.CONCEPT c
  join DIKB_DEV.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
  and ca.ancestor_concept_id in (40231804)
  and c.invalid_reason is null

 ) I
 ) C
 ) C
 ; CREATE TABLE  b804zh31PrimaryCriteriaEvents
   AS
SELECT
     row_number() over (order by P.person_id, P.start_date) as event_id, P.person_id, P.start_date, P.end_date, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date

FROM

(SELECT   P.person_id, P.start_date, P.end_date, ROW_NUMBER() OVER (PARTITION BY person_id ORDER BY start_date ASC) ordinal
   FROM  
  (SELECT     C.person_id, C.drug_exposure_start_date as start_date, COALESCE(C.drug_exposure_end_date, ( C.drug_exposure_start_date +  1)) as end_date, C.drug_concept_id as TARGET_CONCEPT_ID
  FROM   
(SELECT     de.*, ROW_NUMBER() over (PARTITION BY de.person_id ORDER BY de.drug_exposure_start_date) as ordinal
    FROM   DIKB_DEV.DRUG_EXPOSURE de
  WHERE  de.drug_concept_id in (SELECT     concept_id   FROM    b804zh31Codesets   WHERE  codeset_id = 0 )
 ) C

  WHERE  C.drug_exposure_start_date <= '2016-01-01'

   ) P
 ) P
JOIN DIKB_DEV.observation_period OP on P.person_id = OP.person_id and P.start_date between OP.observation_period_start_date and op.observation_period_end_date
  WHERE  (OP.OBSERVATION_PERIOD_START_DATE + 0) <= P.START_DATE AND (P.START_DATE + 0) <= OP.OBSERVATION_PERIOD_END_DATE
 ; DELETE FROM OHDSI.cohort where cohort_definition_id = 3; INSERT INTO OHDSI.cohort (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date)
SELECT   3 as cohort_definition_id, person_id as subject_id, start_date as cohort_start_date, end_date as cohort_end_date
 FROM  
(SELECT   RawEvents.*, row_number() over (partition by RawEvents.person_id order by RawEvents.start_date ASC) as ordinal
   FROM 
  (SELECT   pe.person_id, pe.start_date, pe.end_date
     FROM  b804zh31PrimaryCriteriaEvents pe

   ) RawEvents
 ) Results

OBSERVATION_PERIOD filter as inclusion criteria need to include _start_date and _end_date

use case I ran into: I want to define primary criteria based on existance of various observations, and apply additional criteria (as includion rules in CALYPSO) based on how much observation period time exists before the cohort start date and observation period time after cohort start date. Ex: amongst patients with Disease X, how many have at least 6mo of observation prior? how many have at least 12mo of observation after cohort start date?

Allow user to choose the date that should be used as the cohort_end_date

Currently, each cohort expression criteria determines which field to use as the cohort end date. For example, for condition_occurrence criteria, it uses condition_end_date. For drug_era, it uses drug_era_end_date. One option that was requested was to use the observation_period_end_date that was associated with the event of interest. Another option could be to have the user provide an end date. Still another option could be the user adds a fixed number of days to the end date.

The possibilities are endless, so we need to determine how to give the user this endless flexibility in a webapp.

Concept Set repository

It might be a good idea to allow users to search within concept sets that are already defined in other cohorts, to reuse them rather than have to recreate them.

Import button does not work in Firefox

Using latest release version of Firefox (regardless of OS) when you click on the Import button in the Concept Sets editor, and type or copy-paste a concept ID and click on Done either nothing happens, or the concept ID is replaced with "undefined" (see screenshot). You will be stuck in this situation; even if you clear the textbox and press Done to get back to the previous state, nothing happens.

Firefox

Incorporate Era building logic in primary event selection

Related to selecting the cohort end_date #34 , some cases may require that we construct eras from the primary events in order to define the cohort_end_date. Need to decide if this era logic is across all primary event criteria, within the criteria itself, of some other option, as well as how to present the user the interface to set these options.

Labeling criteria vs. criterion

Currently, all buttons say 'Add Criterion...'. Due to prior conversations and confusion around the singular vs. plural, I would suggest revising this text to say : 'Add A Criterion...'. That way, its clear you are either adding a criterion and not a set of multiple criteria.

Import should split on any non-numeric value

If we split the imported concept set list on any non-numeric, we could support importing comma, tab, newline, dash, or any other type of non-numeric separator. Currently, this only supports commas as the delimiter.

Measurement ratio filter....need to check for 'divide by zero' error

the measurement ratio filters (low range ratio and high range ratio) do not check for if the range value > 0, so can hit divide-by-zero errors. Need to perfrorm error check so query doesn't fail.

Work-around for the time-being: I added extra criteria that requires value_as_number > 0 and high_range > 0.

Generate n-size Subset of Matching Patients

Request for ability to generate a cohort of limited size. This is not just for slow environments, but for testing other application in development thats utilize cohorts.

The requested function is an input box under generate tab:

Limit cohort to maximum [ ] persons

Revision to readme regarding webapi

Hi,

Currently the README says:

"The application is configured to access a WebAPI instance running locally on port 8084"

But it seems that it actually configured to hit port 8080. Might be nice to point to where that configuration can be changed like the Atlas README does.

CIRCE codeset 'Select concept...' should use a case insensitive search

Currently, 'Select concept...' uses a case sensitive search, so 'Acute myocardial infarction' returns a different set than 'acute myocardial infarction'. In HERMES, I think we settled on making search case-insensitive. I'd apply the same convention here (not sure if this issue should be moved to WebAPI).

Support for more meta-data

Please consider adding support for more meta-data. For instance, it would be ideal to be able to assign version numbers to cohort definitions, and associate them with external citations and/or URL of the place where the cohort definition comes from.

Import concepts should not add existing concepts

When importing concepts, we should check the existing list for duplicates. Duplicates should not be added. Currently, we only check the imported list for duplicates, but if the concept was already in the existing concpet set, the concept ID is added again.

Import JSON button bug

When importing a new concept with JSON, there are 2 Import buttons. Each produce a popup window for JSON entry, but the Done button only functions when using the top Import button. The bottom Import button brings the popup, but the Done button does not appear to work--the JSON popup remains open and the concept cannot be submitted.

Default 'descendant concept' selection to TRUE when importing concepts

When importing a large concept set, it is the typical case that the imported concepts should use the descendant concepts. This means that the user needs to click each concept individually to select the descendants.

The preferred behavior is to have imported concepts use descendants by default.

Importing invalid concept ID leads to empty row in codeset editor

I have a CIRCE cohort (id 58) (TSH tested people).
I am trying to specify all people who had this CPT code CPT-4 84443.
It is CDMV ConceptID (=CID) of 2212593.

How I define a code set consisting of one code and simply type the code.

Because I am not able to find it due to so many domains and it is not found in any of them.

2015-04-15 11_02_51-achilles

Implement Print Friendly

Provide a way to export the cohort expression in a print friendly form.

The purpose of this feature is that after identifying the population and doing an analysis, you want to put into a manuscript the definition of the population along with the statistical results. With a print friendly function, the user could copy-paste the friendly form of the cohort expression into a manuscript.

The reason why you can't do this today with the existing HTML is that there are UI controls such as buttons, dropdowns and textboxes that wouldn't copy over properly to a text document. We need a completely separate view of the cohort expression that is read-only and does not contain any HTML form controls at all.

Additionally, exporting an expression should include all concept sets that have been defined for this cohort expression.

Adding criteria to define 'overlap' of inclusion criteria within primary event cohort duration (cohort start to cohort end)

A use case that's come up a couple times for me:

I want to find patients who have concomitant medications, as defined by a drug era of drug A that 'overlaps' the drug era of a different drug B, where overlap = B.end_date > A.start_date AND B.start_date < A.end_date.

More generically, when we define 'primary events', we are producing a cohort-like construct that has COHORT_START_DATE and COHORT_END_DATE. We then allow inclusion criteria to determine qualification based on either a calendar date window, or some defined interval relative to COHORT_START_DATE. It would be useful to also allow the user to defined an interval relative to the COHORT_END_DATE. In this way, for any inclusion criteria from a table that has both a start_date and end_date (CONDITION_OCCURRENCE, CONDITION_ERA, DRUG_EXPOSURE, DRUG_ERA, VISIT_OCCURRENCE), a user could construct criteria to find 'overlapping' episodes.

Implement Progress Indicators

There is currently no approach for progress indicators in CIRCE, and ideally we would wan to use the same approach across all OHDSI tools. However, for this issue, the development task is to implement a localized (re: in CIRCE) mechanism for displaying a indicator when work is happening, and a way to signal the indicator when the work is done (so that it clears). Once we have a general approach we can create new issues to address specific work-intensive operations that require indicators. (such as saving/loading an expression, importing concept sets, etc.

Issue with Oracle generated SQL

Not sure where to put this Chris, but if this is the wrong place, let me know. Also, not sure if these are SqlRender. Or, if you want me to put under WebAPI, as the core issue is probably fixed there. Anyway.

Jon and I were generating Cohort SQL from the latest Circe, and we had a couple problems with the Oracle SQL.

Here's the SQL:

CREATE GLOBAL TEMPORARY TABLE Codesets
 (
  codeset_id int not null,
  concept_id int not null
) ON COMMIT PRESERVE ROWS
;

INSERT INTO Codesets
select codeset_id, concept_id 
FROM
(
 SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
( 
  select DISTINCT concept_id from @CDM_schema.CONCEPT where concept_id in (4115276) and invalid_reason is null
    UNION 

  select c.concept_id
  from @CDM_schema.CONCEPT c
  join @CDM_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
  and ca.ancestor_concept_id in (4115276)
  and c.invalid_reason is null

) I

UNION
select distinct cr.concept_id_2 as concept_id
FROM
(
  select distinct I.concept_id FROM
( 
  select DISTINCT concept_id from @CDM_schema.CONCEPT where concept_id in (4115276) and invalid_reason is null
    UNION 

  select c.concept_id
  from @CDM_schema.CONCEPT c
  join @CDM_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
  and ca.ancestor_concept_id in (4115276)
  and c.invalid_reason is null

) I

) C
join @CDM_schema.concept_relationship cr on C.concept_id = cr.concept_id_1 and cr.relationship_id = 'Mapped from'
) C
) C
;

CREATE GLOBAL TEMPORARY TABLE PrimaryCriteriaEvents
 (
    person_id NUMBER(19),
    start_date datetime,
    end_date datetime,
    op_start_date datetime,
    op_end_date datetime
) ON COMMIT PRESERVE ROWS
;

INSERT INTO PrimaryCriteriaEvents (person_id, start_date, end_date, op_start_date, op_end_date)
SELECT   P.person_id, P.start_date, P.end_date, OP.observation_period_start_date, OP.observation_period_end_date
 FROM 
(
  select P.person_id, P.start_date, P.end_date, ROW_NUMBER() OVER (PARTITION BY person_id ORDER BY start_date ASC) ordinal
  FROM 
  (
  select C.person_id, C.condition_start_date as start_date, C.condition_end_date as end_date, C.CONDITION_CONCEPT_ID as TARGET_CONCEPT_ID
from 
(
        select co.*, ROW_NUMBER() over (PARTITION BY co.person_id ORDER BY co.condition_start_date) as ordinal
        FROM @CDM_schema.CONDITION_OCCURRENCE co
where co.condition_concept_id in (SELECT concept_id from  Codesets where codeset_id = 0)
) C



  ) P
) P
JOIN @CDM_schema.observation_period OP on P.person_id = OP.person_id and P.start_date between OP.observation_period_start_date and op.observation_period_end_date
  WHERE  (OP.OBSERVATION_PERIOD_START_DATE + 0) <= P.START_DATE AND (P.START_DATE + 0) <= OP.OBSERVATION_PERIOD_END_DATE
;


DELETE FROM @targetSchema.@targetTable where cohort_definition_id = @cohortDefinitionId;
INSERT INTO @targetSchema.@targetTable (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date)
select @cohortDefinitionId as cohort_definition_id, person_id as subject_id, start_date as cohort_start_date, end_date as cohort_end_date
FROM 
(
  select Raw.*, row_number() over (partition by Raw.person_id order by Raw.start_date ASC) as ordinal
  FROM
  (
    select person_id, start_date, end_date
    FROM PrimaryCriteriaEvents

  ) Raw
) Results

;

DROP TABLE Codesets;
DROP TABLE PrimaryCriteriaEvents;

The 2 issues we had were:

  • datetime should be timestamp in Oracle
  • You have truncate codesets and PrimaryCriteriaEvents before dropping them

Circe not working: empty frontpage

Hi all,

I am currently busy installing all the OHDSI tools. This is working out fine, WebAPI is running and all other tools are showing up fine in the browser.

The only tool I cannot get to work is CIRCE. I see an empty page (see attachment). I checked the config.js and the webapi is set correctly (same as in the other tools). The source_daimon settings are:

INSERT INTO ohdsi.source (source_id, source_name, source_key, source_connection, source_dialect) VALUES (1, 'cdm_ipci_dopey', 'cdm_ipci_dopey', 'jdbc:postgresql://localhost:5432/CDM-IPCI-DOPEY?user=postgres&password=####', 'postgresql');

Cdm:
INSERT INTO ohdsi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (1,1,0, 'cdm', 0);
Vocab:
INSERT INTO ohdsi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (2,1,1, 'cdm', 0);
Results
INSERT INTO ohdsi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority) VALUES (3,1,2, 'cdm', 0);

All ohdsi webapi tables are in a separate schema 'ohdsi'

Any thoughts what might be the problem?

I also tried to install via OLYMPUS and got it working there (after figuring out the the cdm, cohort and results cannot be the same schema..). However, there is no daimon_type for cohort in the instructions on the forum is this not needed when installing standalone. Could this be the problem??

Thanks

Show loading indicator while importing concept IDs

Depends on #38 .

When importing a large concept ID list, there could be several hundred lookups against the service. The UI is still responsive and could allow the user to perform other actions while this operation is in progress (saving while importing would be bad!). Therefore, we need to have a 'working' indicator in place to hold the user off from interacting with the tool until the work is complete.

Measurement 'abnormal' criteria not implemented

Measurement criteiria 'has an abnormal value' is not implemented: the WHERE clause is not set with the appropriate sql logic to find abnormal values. The sql should look like this:

where m.value_as_number < m.range_low or m.value_as_number > range high

Implement error handling

Currently, CIRCE error handling is shown as a console log. This is barely adequate for developers, but completely unusable for end users. Need to develop some framework or approach for error handling that gives the users the proper feedback when errors occur, and make a best effort in code to recover.

When selecting OBSERVATION PERIOD as primary event criteria, allow user to define cohort start date and cohort end date within the period

Use case: I want to define my cohort as patients who have continuous coverage from 1Jan2010 to 31Dec2012, and use that time period as my cohort definition and as the basis for my analysis. So, I want to select all observation periods with observation period start < 1Jan2010 and observation period end > 31Dec2012, but I don't want the cohort start date to become the observation period start date, i want it set to 1Jan2010. this would support analysis requiring incidence/prevalence calculations during defined intervals of time-at-risk.

Add PERSON_ID to PERSON inclusion critieria

Use case: a group already has a cohort, which is defined by a set of PERSON_ID. we should be able to import a comma-separated list of PERSON_IDs, and then apply zero or more additional criteria to those patients. The list of PERSON_ID should be joined to OBSERVATION_PERIOD to set cohort_start_date = OBSERVATION_PERIOD_START_DATE and cohort_end_date= OBSERVATION_PERIOD_END_DATE.

Have the CIRCE SQL output lightly commented

CIRCE can help me define a cohort that I can use in my manually crafted SQL code.

I need a query that produces a
select distinct person_id from (pasted-CIRCE-CODE)

But the outputed code has no comments and is hard to follow. (and there is no help)

Occur Between dates not sticking

I am unable to save before / after dates for matching events on Circe. They keep resetting to All and All.

To see the error, go to this example:
http://www.ohdsi.org/web/circe/#/976

Try to change the "occurring between" days to any two numbers.

I am unable to get it to stick either locally or on ohdsi.org version of Circe.

Adding selected concepts from ConceptPicker only adds visible page

When opening up the Concept Picker and you select concepts from page 1 and then switch to another page, only the selected concepts on the page get added to the Concept Set/Concept List.

Steps to Reproduce:

  1. Open a Definition
  2. Go to Concept Set tab
  3. Click Add New Concept Set
  4. Click Add button.
  5. Search for Warfarin in the Condition Domain
  6. Selected first 3 on page 1, and first 3 on page 2.
  7. Click add.

Expected Results:
6 Concepts should be added to the concept set.

Actual Results:
Only the selected, visible concepts (on page 2) are added.

Tags

Enhancement Request:

A very helpful feature in CIRCE would be tags, so that cohort definitions could be organized and categorized for specific efforts. In my use case, I am interesting in keeping track of a number of phenotypes for the PENELOPE project. The alphabetical list could be hacked (e.g., PENELOPE- Whatever Cohort) but it's not ideal.

How to define the input of CIRCE using eligibility criteria

Now I'm trying to parse the raw-text clinical trial eligibility criteria into a structured format. I wonder is is possible to structure the eligibility criteria into a format that can be the input of CIRCE so the free-text criteria can be used to define cohort. Some examples of the parsing results are:

Input Eligibility criteria text:
1. Age: 18-60 years.
2. Patients with CNS disease or testicular disease are eligible.

Output after parsing:
Concept, Semantic group, Constraints
age, Person, 18-60 yo
CNS disease, Condition, /
testicular disease, Condition, /

The problem is that some concepts in criteria are not covered in existing terminologies and can’t be mapped to a concept id. So I wonder is there anyway to structure my parsing results (e.g. a SQL format) so that they can be directly used by CIRCE?

Thanks.

Concept Set Annotation / Attachment Option #enhancement

Since unique choices and circumstances are often involved in creating a concept set, it may be helpful to be able to include a description and, perhaps even better, attach a document that describes how this concept set was defined.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.