This repository was archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
GeCo I2b2 data source: implementation of steps 1 and 2 #6
Open
mickmis
wants to merge
82
commits into
dev
Choose a base branch
from
step2
base: dev
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
82 commits
Select commit
Hold shift + click to select a range
d3f87d9
working i2b2 docker image
mickmis 9abcaf5
add geco repo as a submodule
mickmis 7ecdc41
add test scripts for i2b2 docker
mickmis fd266fc
move geco submodule to vendor dir
mickmis 41c9358
reset submodule
mickmis 740e1a6
properly add back geco as submodule
mickmis 89208b9
first attempt at GA CI
mickmis a3d42fb
CI: set up SSH key
mickmis 1ea9be3
CI: set up checkout token
mickmis e1f1e9b
CI: remove sleep between steps and add active check for i2b2 to be up
mickmis 7b10b4e
CI: add xmllint tool
mickmis 091d9d5
add data source interface
mickmis d6d22b1
add i2b2 XML API models
mickmis d0fec19
add i2b2 XML client definition
mickmis 1648c52
add i2b2 data source plugin definition
mickmis 89d1bdf
add go.mod def
mickmis b4c0789
add gitignore in build
mickmis 673c6d4
add test for plugin
mickmis 8a16267
add data source plugin for geco
mickmis 7eb100d
update data source interface implementation
mickmis 8caa1d1
implementation of searchConcept, searchModifier and corresponding i2b…
mickmis 8dd2eae
add/fix test of docker image for ontology query
mickmis e4eb177
fix plugin declaration and test
mickmis 3d86c14
finalize i2b2api package with ont and crc queries for explore queries
mickmis 39a3db0
i2b2 api models modifications
mickmis ca57396
add models for explore query
mickmis 72d2492
change conversion of i2b2 path
mickmis 0b99f41
add explore query implementation
mickmis 54e81e8
add data object functions; update to data source for explore query
mickmis 984394e
cosmetic
mickmis e451dbc
data source test cleanup
mickmis 79ba4ae
data source search model modification
mickmis 46be9ab
go fmt
mickmis 7172288
add test attempt for data source
mickmis 61c9897
consistency changes and go lint
mickmis cf28277
update CI
mickmis 5516e54
update makefile
mickmis 6bc1696
write readme
mickmis 33fa56a
move i2b2 deployment file
mickmis 6e7aaaa
fix tests
mickmis e9cd061
CI: add ssh auth for deps
mickmis b4beab2
CI: add spindle ssh key for deps
mickmis ccb2b38
add description of file
mickmis 6acf76d
add description of file
mickmis 8d82645
test CI to be reverted
mickmis 9831d1e
test CI to be reverted
mickmis f1e948c
Fix CI (#3)
romainbou 580e257
update geco version
mickmis d9b585f
modifications for new SDK package in geco
mickmis 5fac9eb
update to new SDK
mickmis 0e7ccd0
cleanup
mickmis bb0f53f
implement database package
mickmis 3bd0d37
update package names
mickmis 22d948a
formatting
mickmis 09a38fc
update i2b2client package name
mickmis 2d2f8c3
update i2b2api>i2b2client package name
mickmis 6f0a0c8
package names updates and explore query modifications
mickmis ec16ad0
refactor, fix tests; add full test workflow
mickmis b2685af
add loading of test data in DB
mickmis 491650c
add limit to get cohorts
mickmis 7cf8c92
add implementation for cohorts
mickmis ddd7e92
fix ci typo
mickmis b43cdc9
update of geco version to use and expose DataSourceType
mickmis b5430be
update geco version
mickmis 788e9a3
updated go.sum with LFS fix
mickmis 8539c48
update geco version
mickmis 46ddd08
Merge remote-tracking branch 'origin/dev' into step2
mickmis b3539e4
CI: enable push of i2b2 image
mickmis 30f5170
update readme
mickmis 01ac9e7
CI: disable i2b2 logs and fix push
mickmis cc6ea31
CI: show i2b2 deployment logs when CI fails
mickmis 78fd25b
update i2b2 deployment port 8080>8081
mickmis 0edeb6c
Update README.md
mickmis 65b6b4e
Update README.md
mickmis 5fa5787
add API documentation
mickmis 25efc4b
rename field of cohort result for consistency in naming
mickmis c64ca03
update in-code doc of fields of search parameters
mickmis 508940f
add readmes for packages
mickmis 4b13e51
update references medco>geco
mickmis 5945adc
add READMEs to i2b2 docker image
mickmis c78d02f
add env variables of i2b2 docker image in readme
mickmis 0e51ba4
fix links
mickmis 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 hidden or 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,104 @@ | ||
name: Build and test GeCo i2b2 data source | ||
on: | ||
push: | ||
workflow_dispatch: | ||
jobs: | ||
ci-cd: | ||
name: Build and test GeCo i2b2 data source | ||
runs-on: ubuntu-latest | ||
env: | ||
PUSH: ${{ github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags') }} | ||
|
||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.17' | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup SSH deploy key for private repositories | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: | | ||
${{ secrets.SPINDLE_SSH_DEPLOY_KEY }} | ||
${{ secrets.GECO_SSH_DEPLOY_KEY }} | ||
|
||
- name: Get submodules | ||
run: git submodule update --init --recursive | ||
|
||
- name: Environment | ||
run: | | ||
go version | ||
./scripts/version.sh | ||
pushd third_party/geco && ./scripts/version.sh && popd | ||
env | ||
|
||
- name: Setup Git and Golang environment for private repositories | ||
run: | | ||
git config --global url."[email protected]:".insteadOf "https://github.com/" | ||
go env -w GOPRIVATE=github.com/ldsec | ||
|
||
- name: Generate GeCo Swagger files | ||
run: make geco-swagger-gen | ||
|
||
- name: Go sources beautification | ||
run: make go-imports go-lint | ||
|
||
- name: Build data source plugin | ||
run: make go-build-plugin | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Get versions | ||
id: get_versions | ||
run: | | ||
DATASOURCE_VERSION=$(scripts/version.sh) | ||
echo ::set-output name=datasource_version::${DATASOURCE_VERSION} | ||
echo ::set-output name=i2b2_docker_image::ghcr.io/ldsec/i2b2-geco:${DATASOURCE_VERSION} | ||
|
||
- name: Build i2b2 Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./build/package/i2b2 | ||
build-args: BUILD=docker | ||
load: true | ||
ssh: default | ||
tags: ${{ steps.get_versions.outputs.i2b2_docker_image }} | ||
cache-from: type=gha,scope=buildkit | ||
cache-to: type=gha,scope=buildkit,mode=max | ||
|
||
- name: Start deployments | ||
run: | | ||
make geco-docker-compose ARGS="up -d postgresql" | ||
make i2b2-docker-compose ARGS="up -d" | ||
|
||
- name: Run i2b2 docker image test | ||
run: | | ||
sudo apt-get install -y libxml2-utils | ||
make i2b2-test | ||
|
||
- name: Run go unit tests | ||
run: make go-unit-tests | ||
|
||
- name: Show GeCo deployment logs | ||
if: always() | ||
run: make geco-docker-compose ARGS="logs" | ||
|
||
- name: Show i2b2 deployment logs (only in case of failure) | ||
if: failure() | ||
run: make i2b2-docker-compose ARGS="logs" | ||
|
||
- name: Login to GitHub Container Registry | ||
if: ${{ env.PUSH == 'true' }} | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.LDS_PKG_PAT_USERNAME }} | ||
password: ${{ secrets.LDS_PKG_PAT }} | ||
|
||
- name: Push i2b2 Docker image | ||
if: ${{ env.PUSH == 'true' }} | ||
run: docker push ${{ steps.get_versions.outputs.i2b2_docker_image }} |
This file contains hidden or 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,3 @@ | ||
[submodule "third_party/geco"] | ||
path = third_party/geco | ||
url = [email protected]:ldsec/geco.git | ||
This file contains hidden or 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,238 @@ | ||
All the operations exposed by this data source plugin to the GeCo Data Manager | ||
runtime are listed here, with their supported parameters, results, and output | ||
data objects shared IDs. | ||
|
||
# searchConcept | ||
Exploration of the concepts of the tree-like ontology. | ||
|
||
## Parameters | ||
```json | ||
{ | ||
"Path": "/TEST/test", | ||
"Operation": "children|info" | ||
} | ||
``` | ||
|
||
- `Path`: path to the requested concept | ||
- `Operation`: | ||
- `info`: request metadata about the concept itself | ||
- `children`: request children of the concept | ||
|
||
## Results | ||
```json | ||
{ | ||
"SearchResults": [{ | ||
"Path": "/TEST/test", | ||
"AppliedPath": "x", | ||
"Name": "x", | ||
"DisplayName": "x", | ||
"Code": "x", | ||
"Comment": "x", | ||
"Type": "concept|concept_container|concept_folder|modifier|modifier_container|modifier_folder|genomic_annotation", | ||
"Leaf": true, | ||
"Metadata": { | ||
"DataType": "PosInteger|Integer|Float|PosFloat|Enum|String", | ||
"OkToUseValues": "Y", | ||
"UnitValues": { | ||
"NormalUnits": "x" | ||
} | ||
} | ||
}] | ||
} | ||
``` | ||
|
||
- `SearchResults`: array of results, either concepts or modifiers | ||
- `Path`: path to the modifier or concept | ||
- `AppliedPath`: path(s) onto which the modifier applies (if a modifier) | ||
- `Name`: name of the element | ||
- `DisplayName`: nicely formatted name of the element | ||
- `Code`: i2b2 two-elements code | ||
- `Comment`: comment that can be used as tooltip | ||
- `Type`: type of the element | ||
- `concept`: concept | ||
- `concept_container`: concept with children, queryable | ||
- `concept_folder`: concept with children, not queryable | ||
- `modifier`: modifier | ||
- `modifier_container`: modifier with children, queryable | ||
- `modifier_folder`: modifier with children, not queryable | ||
- `genomic_annotations`: genomic annotation | ||
- `Leaf`: true if element is a leaf, i.e. does not have children | ||
- `Metadata`: some additional metadata | ||
- `DataType`: detailed type of data | ||
- `PosInteger`: positive integers | ||
- `Integer`: integers | ||
- `PosFloat`: positive floats | ||
- `Float`: floats | ||
- `Enum`: enumerated values (string) | ||
- `String`: free text (string) | ||
- `OkToUseValues`: is a "Y" if can use values, a message saying why otherwise | ||
- `UnitValues`: metadata about unit of the value | ||
- `NormalUnits`: specify the unit of the value | ||
|
||
# searchModifier | ||
Exploration of the modifiers of the tree-like ontology. | ||
|
||
## Parameters | ||
```json | ||
{ | ||
"Path": "/TEST/modifiers/", | ||
"AppliedPath": "/test/%", | ||
"AppliedConcept": "/TEST/test/1/", | ||
"Operation": "concept|children|info" | ||
} | ||
``` | ||
|
||
- `Path`: path to the requested modifier or concept | ||
- `AppliedPath`: path(s) onto which the modifier applies | ||
- `AppliedConcept`: concept onto which the modifier applies | ||
- `Operation`: | ||
- `info`: request metadata about the modifier itself | ||
- `children`: request children of the modifier | ||
- `concept`: request modifiers of the requested concept | ||
|
||
## Results | ||
See results of `searchConcept`. | ||
|
||
# exploreQuery | ||
Retrieve patient IDs from i2b2 based on explore query terms. | ||
[See i2b2 CRC API for more details.](https://www.i2b2.org/software/files/PDF/current/CRC_Messaging.pdf) | ||
|
||
## Parameters | ||
```json | ||
{ | ||
"ID": "99999999-9999-9999-9999-999999999999", | ||
"Definition": { | ||
"Panels": [{ | ||
"Not": false, | ||
"Timing": "any|samevisit|sameinstancenum", | ||
"CohortItems": ["cohortName0", "cohortName1"], | ||
"ConceptItems": [{ | ||
"QueryTerm": "/TEST/test/1/", | ||
"Operator": "EQ|NE|GT|GE|LT||LE|BETWEEN|IN|LIKE[exact]|LIKE[begin]|LIKE[end]|LIKE[contains]", | ||
"Value": "xxx", | ||
"Type": "NUMBER|TEXT", | ||
"Modifier": { | ||
"AppliedPath": "/test/1/", | ||
"Key": "/TEST/modifiers/1/" | ||
} | ||
}] | ||
}], | ||
"Timing": "any|samevisit|sameinstancenum" | ||
} | ||
} | ||
``` | ||
|
||
- `ID`: ID of the query, must be an UUID | ||
- `Definition`: definition of the explore query | ||
- `Panels`: panels of the explore query (linked together by an AND) | ||
- `Not`: true if the panel is inverted | ||
- `Timing`: timing of the panel | ||
- `any`: no constrain (default) | ||
- `samevisit`: constrain to the same visit | ||
- `sameinstancenum`: constrain to the same instance number | ||
- `CohortItems`: array of cohort names if querying for cohorts (linked together by an OR) | ||
- `ConceptItems`: array of concepts if querying for concepts (linked together by an OR) | ||
- `QueryTerm`: path to the queried concept | ||
- `Operator`: apply an operator to the queried concept | ||
- `EQ`: equal (type=NUMBER) | ||
- `NE`: not equal (type=NUMBER) | ||
- `GT`: greater (type=NUMBER) | ||
- `GE`: greater or equal (type=NUMBER) | ||
- `LT`: less (type=NUMBER) | ||
- `LE`: less or equal (type=NUMBER) | ||
- `BETWEEN`: between values, value example: "100 and 200" (type=NUMBER) | ||
- `IN`: value among set, value example: "('NEG','NEGATIVE')" (type=TEXT) | ||
- `LIKE[exact]`: string is equal to (type=TEXT) | ||
- `LIKE[begin]`: string begins with (type=TEXT) | ||
- `LIKE[end]`: string ends with (type=TEXT) | ||
- `LIKE[contains]`: string contains (type=TEXT) | ||
- `Value`: value to use with operator | ||
- `Type`: type of concept | ||
- `NUMBER`: numeric type | ||
- `TEXT`: string type | ||
- `Modifier`: apply a modifier to the queried concept | ||
- `AppliedPath`: path(s) onto which the modifier applies | ||
- `Key`: path of the modifier | ||
- `Timing`: timing of the query | ||
- `any`: no constrain (default) | ||
- `samevisit`: constrain to the same visit | ||
- `sameinstancenum`: constrain to the same instance number | ||
|
||
## Output Data Objects Shared IDs | ||
- `count`: integer containing the count of patients | ||
- `patientList`: vector of integers containing the patient IDs | ||
|
||
# getCohorts | ||
Retrieve the list of saved cohorts. | ||
|
||
## Parameters | ||
```json | ||
{ | ||
"Limit": 10 | ||
} | ||
``` | ||
|
||
- `Limit`: max number of cohorts to retrieve | ||
|
||
## Results | ||
```json | ||
{ | ||
"Cohorts": [{ | ||
"Name": "Cohort 1", | ||
"CreationDate": "xxx", | ||
"ExploreQuery": { | ||
"ID": "99999999-9999-9999-9999-999999999999", | ||
"CreationDate": "xxx", | ||
"Status": "running|success|error", | ||
"Definition": {}, | ||
"OutputDataObjectsSharedIDs": { | ||
"Count": "xxx", | ||
"PatientList": "xxx" | ||
} | ||
} | ||
}] | ||
} | ||
``` | ||
|
||
- `Cohorts`: array of cohorts | ||
- `Name`: name of the cohort | ||
- `CreationDate`: date of the creation of the cohort | ||
- `ExploreQuery`: the query tied to the cohort | ||
- `ID`: identifier of the query | ||
- `CreationDate`: date of the creation of the query | ||
- `Status`: status of the query | ||
- `running`: query is running | ||
- `success`: query successfully ran | ||
- `error`: query has errored | ||
- `Definition`: definition of the query (see above for syntax) | ||
- `OutputDataObjectsSharedIDs`: | ||
- `Count`: data object shared ID of the count | ||
- `PatientList`: data object shared ID of the patient list | ||
|
||
# addCohort | ||
Add a cohort. | ||
|
||
## Parameters | ||
```json | ||
{ | ||
"Name": "Cohort 1", | ||
"ExploreQueryID": "99999999-9999-9999-9999-999999999999" | ||
} | ||
``` | ||
|
||
- `Name`: name of the cohort | ||
- `ExploreQueryID`: query to associate to the cohort | ||
|
||
# deleteCohort | ||
Delete a cohort. | ||
|
||
## Parameters | ||
```json | ||
{ | ||
"Name": "Cohort 1", | ||
"ExploreQueryID": "99999999-9999-9999-9999-999999999999" | ||
} | ||
``` | ||
|
||
- `Name`: name of the cohort | ||
- `ExploreQueryID`: query associated to the cohort |
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.
to be deleted by extracting to a public repo the geco parts used by this plugin (i.e., as far as I understand, the dev deployment)