Skip to content
This repository was archived by the owner on Sep 20, 2022. It is now read-only.

GeCo I2b2 data source: implementation of steps 1 and 2 #6

Open
wants to merge 82 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
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 Dec 2, 2021
9abcaf5
add geco repo as a submodule
mickmis Dec 2, 2021
7ecdc41
add test scripts for i2b2 docker
mickmis Dec 2, 2021
fd266fc
move geco submodule to vendor dir
mickmis Dec 3, 2021
41c9358
reset submodule
mickmis Dec 3, 2021
740e1a6
properly add back geco as submodule
mickmis Dec 3, 2021
89208b9
first attempt at GA CI
mickmis Dec 3, 2021
a3d42fb
CI: set up SSH key
mickmis Dec 3, 2021
1ea9be3
CI: set up checkout token
mickmis Dec 3, 2021
e1f1e9b
CI: remove sleep between steps and add active check for i2b2 to be up
mickmis Dec 4, 2021
7b10b4e
CI: add xmllint tool
mickmis Dec 4, 2021
091d9d5
add data source interface
mickmis Dec 5, 2021
d6d22b1
add i2b2 XML API models
mickmis Dec 5, 2021
d0fec19
add i2b2 XML client definition
mickmis Dec 5, 2021
1648c52
add i2b2 data source plugin definition
mickmis Dec 5, 2021
89d1bdf
add go.mod def
mickmis Dec 5, 2021
b4c0789
add gitignore in build
mickmis Dec 5, 2021
673c6d4
add test for plugin
mickmis Dec 5, 2021
8a16267
add data source plugin for geco
mickmis Dec 5, 2021
7eb100d
update data source interface implementation
mickmis Dec 5, 2021
8caa1d1
implementation of searchConcept, searchModifier and corresponding i2b…
mickmis Dec 9, 2021
8dd2eae
add/fix test of docker image for ontology query
mickmis Dec 9, 2021
e4eb177
fix plugin declaration and test
mickmis Dec 9, 2021
3d86c14
finalize i2b2api package with ont and crc queries for explore queries
mickmis Dec 9, 2021
39a3db0
i2b2 api models modifications
mickmis Dec 9, 2021
ca57396
add models for explore query
mickmis Dec 9, 2021
72d2492
change conversion of i2b2 path
mickmis Dec 9, 2021
0b99f41
add explore query implementation
mickmis Dec 9, 2021
54e81e8
add data object functions; update to data source for explore query
mickmis Dec 9, 2021
984394e
cosmetic
mickmis Dec 9, 2021
e451dbc
data source test cleanup
mickmis Dec 10, 2021
79ba4ae
data source search model modification
mickmis Dec 10, 2021
46be9ab
go fmt
mickmis Dec 10, 2021
7172288
add test attempt for data source
mickmis Dec 10, 2021
61c9897
consistency changes and go lint
mickmis Dec 10, 2021
cf28277
update CI
mickmis Dec 10, 2021
5516e54
update makefile
mickmis Dec 10, 2021
6bc1696
write readme
mickmis Dec 10, 2021
33fa56a
move i2b2 deployment file
mickmis Dec 10, 2021
6e7aaaa
fix tests
mickmis Dec 10, 2021
e9cd061
CI: add ssh auth for deps
mickmis Dec 10, 2021
b4beab2
CI: add spindle ssh key for deps
mickmis Dec 10, 2021
ccb2b38
add description of file
mickmis Dec 10, 2021
6acf76d
add description of file
mickmis Dec 10, 2021
8d82645
test CI to be reverted
mickmis Dec 10, 2021
9831d1e
test CI to be reverted
mickmis Dec 10, 2021
f1e948c
Fix CI (#3)
romainbou Dec 17, 2021
580e257
update geco version
mickmis Dec 17, 2021
d9b585f
modifications for new SDK package in geco
mickmis Dec 17, 2021
5fac9eb
update to new SDK
mickmis Dec 17, 2021
0e7ccd0
cleanup
mickmis Dec 17, 2021
bb0f53f
implement database package
mickmis Dec 21, 2021
3bd0d37
update package names
mickmis Dec 22, 2021
22d948a
formatting
mickmis Dec 22, 2021
09a38fc
update i2b2client package name
mickmis Dec 22, 2021
2d2f8c3
update i2b2api>i2b2client package name
mickmis Dec 22, 2021
6f0a0c8
package names updates and explore query modifications
mickmis Dec 22, 2021
ec16ad0
refactor, fix tests; add full test workflow
mickmis Dec 22, 2021
b2685af
add loading of test data in DB
mickmis Dec 22, 2021
491650c
add limit to get cohorts
mickmis Dec 22, 2021
7cf8c92
add implementation for cohorts
mickmis Dec 22, 2021
ddd7e92
fix ci typo
mickmis Dec 22, 2021
b43cdc9
update of geco version to use and expose DataSourceType
mickmis Dec 22, 2021
b5430be
update geco version
mickmis Dec 22, 2021
788e9a3
updated go.sum with LFS fix
mickmis Dec 23, 2021
8539c48
update geco version
mickmis Dec 23, 2021
46ddd08
Merge remote-tracking branch 'origin/dev' into step2
mickmis Dec 23, 2021
b3539e4
CI: enable push of i2b2 image
mickmis Dec 23, 2021
30f5170
update readme
mickmis Dec 23, 2021
01ac9e7
CI: disable i2b2 logs and fix push
mickmis Dec 23, 2021
cc6ea31
CI: show i2b2 deployment logs when CI fails
mickmis Jan 18, 2022
78fd25b
update i2b2 deployment port 8080>8081
mickmis Jan 18, 2022
0edeb6c
Update README.md
mickmis Jan 18, 2022
65b6b4e
Update README.md
mickmis Jan 18, 2022
5fa5787
add API documentation
mickmis Jan 18, 2022
25efc4b
rename field of cohort result for consistency in naming
mickmis Jan 18, 2022
c64ca03
update in-code doc of fields of search parameters
mickmis Jan 18, 2022
508940f
add readmes for packages
mickmis Jan 18, 2022
4b13e51
update references medco>geco
mickmis Jan 19, 2022
5945adc
add READMEs to i2b2 docker image
mickmis Feb 18, 2022
c78d02f
add env variables of i2b2 docker image in readme
mickmis Feb 18, 2022
0e51ba4
fix links
mickmis Feb 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/ci-cd.yml
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 }}
3 changes: 3 additions & 0 deletions .gitmodules
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

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)

238 changes: 238 additions & 0 deletions API.md
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
Loading