Skip to content

Commit

Permalink
Merge pull request #23 from ga4gh/develop
Browse files Browse the repository at this point in the history
Merge branch 'develop'
  • Loading branch information
sdelatorrep authored Mar 26, 2019
2 parents aff918a + 161f81c commit 6e496f7
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 405 deletions.
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
*.py[cod]
target
*~
#*
doc/source/schemas/*.avpr
build

#********** windows template**********

# Windows image file caches
Expand Down Expand Up @@ -75,4 +68,4 @@ target/


#********** Dependency files ********
src/avro-schema-test-base
src/avro-schema-test-base
37 changes: 29 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
language: python
python:
- 2.7
branches:
only:
- master
- develop
language: java
dist: trusty
sudo: false
jdk:
- oraclejdk8
env:
- GH_URL=https://raw.githubusercontent.com VALIDATOR_URL=http://localhost:8080/validator/debug?url FILE_TO_VALIDATE=consent_code.yaml URL_TO_VALIDATE=$GH_URL/${TRAVIS_PULL_REQUEST_SLUG:-$TRAVIS_REPO_SLUG}/${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}/$FILE_TO_VALIDATE
before_install:
# This setup will not be needed once the online version of validator-badge supports OAS 3.0. Until then we'll need to set up a local version.

# build and start validator-badge
- git clone --branch=v2.0.0 https://github.com/swagger-api/validator-badge.git
- cd validator-badge
- mvn package -q -DskipTests=true -Dmaven.javadoc.skip=true -B -V jetty:run &
- cd ..
- sleep 60
script:
- nosetests -v $VIRTUAL_ENV/src/avro-schema-test-base
# validate
- echo "Validating $URL_TO_VALIDATE:"
- VALIDATION_OUTPUT=`curl -sS "$VALIDATOR_URL=$URL_TO_VALIDATE"`

# print validation errors
- echo $VALIDATION_OUTPUT

# check if the validation output ignoring warnings is an empty array
- VALIDATION_ERROR_COUNT=`echo "$VALIDATION_OUTPUT" |jq -c '.schemaValidationMessages // [] | map(select(.level != "warning"))' |jq length`
- test "$VALIDATION_ERROR_COUNT" == 0
notifications:
slack:
secure: CC5cismvKIZLHwwuPdBfJTlPddCpPzMyF2IQIZHCuDAkPNMWqmWU0osHn8V2cD/sReFBeOfJaj19gj2bzHbhBrKkttuSMMzLoR5LbXTfdviuJOzWP1g5kUg4Tm8jGdq+GdgxfpB1lL7gLD2TlD1Oa6HKMrF6s9PBUjJE6dZnli7ZE7aSOmAmoJ+JZP99Q3tcJiErrSP89Yp+G8/kv+IL6EYhoXRtgCYMoh45ECqx1hOopwjGVCjqrMYbJu0yEtKRtU9G2QV5zSqEaPNgOqrkz5yNNd7VWGks/AmcgsCPLvMRd7ruH5myfylqtDDznoXvmMyPUdQyZXngmN1VCuOWeHyd7BginvrQNiDJANbwwD+Xj4akX86rP0N/k7Q9osNEQU2138zG14S18yeN2E0vfTKxzVcJuIb660ujReycdKAr7NnKdXJZITtaJW91o2unh6Fu2Hs0jMW4DN5mhQWr/eGtVXagqDhjDiWM+VU96sJO/ZPrljiSaeFpUR5fNO3ZoYz8S1H5I9uZAmsN5aqTvMboCxd3m3n2bn5gy3u47j5jaLnOWFhktNiKg3M4WPupENfr827Lbq+xQeEJCqbcOVjxIRsJ72Q9esxQaIbYAbcDzppkFlesqFyVPiZSD/lmUKrk8y/I1zYn8lX7T19B3niUIH/7xJUmdnBVWnvWZe4=
40 changes: 6 additions & 34 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,45 +30,17 @@ Once a pull request or issue have been submitted, anyone can comment or vote on
- It's okay to have input without voting.
- Silence gives assent.

A pull request with at least two **+1** votes, no **-1** votes, that has been open for at least 3 days is ready to be merged. We sometimes waive the 3 days for cosmetic-only changes -- use good judgment. If an issue gets any **-1** votes, the comments on the issue need to reach consensus before the issue can be resolved one way or the other. There isn't any strict time limit on a contentious issue.
A pull request is ready to be merged when either of the following is true:
- A pull request has at least two **+1** votes, no **-1** votes, and has been open for at least 3 days.
- A pull request has no **-1** votes, and has been open for at least 14 days.

We sometimes waive the time constraint for cosmetic-only changes -- use good judgment. If an issue gets any **-1** votes, the comments on the issue need to reach consensus before the issue can be resolved one way or the other. There isn't any strict time limit on a contentious issue.

The project will strive for full consensus on everything until it runs into a problem with this model.

## Syntax Style and Conventions

The current code conventions for the source files are as follows:

- Use two-space indentation, and no tabs.
- Hard-wrap code to 80 characters per line.
- Use `UpperCamelCase` for object or record names.
- Use `lowerCamelCase` for attribute or method names.
- Use `CONSTANT_CASE` for global and constant values.
- Comments:
- Comments should be indented at the same level as the surrounding code.
- Comments should precede the code that they make a comment on. Documentation comments will not work otherwise.
- Documentation comments, which are intended to be processed by avrodoc and displayed in the user-facing API documentation, must use the `/** ... */` style, and must not have a leading `*` on each internal line:

/**
This documentation comment will be
processed correctly by avrodoc.
*/

/**
* This documentation comment will have a
* bullet point at the start of every line
* when processed by avrodoc.
*/

- Block and multi-line non-documentation comments, intended for schema developers only, must use the `/* ... */` style.

/*
This multi-line comment will not appear in the
avrodoc documentation and is intended for
schema developers.
*/

- All multi-line comments should have the comment text at the same indent level as the comment delimeters.
- One-line non-documentation comments, intended for schema developers only, must use the `// ...` style.
The code should conform to the [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification/tree/master/versions).

## Gitflow Workflow

Expand Down
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
# Consent Code Schemas [![Build Status](https://travis-ci.org/ga4gh/ga4gh-consent-policy.svg?branch=develop)](https://travis-ci.org/ga4gh/ga4gh-consent-policy) [![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/ga4gh/ga4gh-consent-policy/develop/LICENSE)
# Consent Code Schemas [![](https://travis-ci.org/ga4gh/ga4gh-consent-policy.svg?branch=develop)](https://travis-ci.org/ga4gh/ga4gh-consent-policy) [![](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/ga4gh/ga4gh-consent-policy/develop/LICENSE) [![](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.com)

Data model for the data use conditions based on consent codes as introduced in [Consent Codes: Upholding Standard Data Use Conditions](http://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1005772).

## How to contribute

Guidelines for contributing to this repository are listed in the [CONTRIBUTING.md](CONTRIBUTING.md) document.

## How to build

Prerequisites: Maven 3+, Java 1.6+.

To generate Java code, run `mvn package` and check the output in the `target` directory.

## How to test

Prerequisites: Python 2.7 (incl. Pip 7+).

Install dependencies with `pip install -r requirements.txt`. To run the test suite, use `nosetests -v`.
Use [Swagger Validator Badge](https://github.com/swagger-api/validator-badge) to validate the YAML file.
183 changes: 183 additions & 0 deletions consent_code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
openapi: 3.0.0
servers: []
info:
version: "1.1.0"
title: Consent Codes
description: |
Data use conditions based on consent codes have been divided into data use categories and requirements. Requirements are conditions that would require some form of additional agreement on the part of the data provider or data user or additional criteria in order for the data to be reused. Data use categories were further divided into primary and secondary categories. Each resource should fall into only one primary category, whereas a number of secondary categories and requirements may also be applied.
Primary data use categories:
<table>
<tr>
<th>Abbreviation</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>NRES</td>
<td>no restrictions</td>
<td>No restrictions on data use.</td>
</tr>
<tr>
<td>GRU(CC)</td>
<td>general research use and clinical care</td>
<td>For health/medical/biomedical purposes and other biological research, including the study of population origins or ancestry.</td>
</tr>
<tr>
<td>HMB(CC)</td>
<td>health/medical/biomedical research and clinical care</td>
<td>Use of the data is limited to health/medical/biomedical purposes, does not include the study of population origins or ancestry.</td>
</tr>
<tr>
<td>DS-[XX](CC)</td>
<td>disease-specific research and clinical care</td>
<td>Use of the data
must be related to [disease].</td>
</tr>
<tr>
<td>POA</td>
<td>population origins/ancestry research</td>
<td>Use of the data is limited to
the study of population origins or ancestry.</td>
</tr>
</table>
<br/>
Secondary data use categories:
<table>
<tr>
<th>Abbreviation</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>RS-[XX]</td>
<td>other research-specific restrictions</td>
<td>Use of the data is limited to studies of [research type] (e.g., pediatric research).</td>
</tr>
<tr>
<td>RUO</td>
<td>research use only</td>
<td>Use of data is limited to research purposes (e.g., does not include its use in clinical care).</td>
</tr>
<tr>
<td>NMDS</td>
<td>no “general methods” research</td>
<td>Use of the data includes methods development research (e.g., development of software or algorithms) ONLY within the bounds of other data use limitations.</td>
</tr>
<tr>
<td>GSO</td>
<td>genetic studies only</td>
<td>Use of the data is limited to genetic studies only (i.e., no research using only the phenotype data).</td>
</tr>
</table>
<br/>
Data use requirements:
<table>
<tr>
<th>Abbreviation</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>NPU</td>
<td>not-for-profit use only</td>
<td>Use of the data is limited to not-for-profit organizations.</td>
</tr>
<tr>
<td>PUB</td>
<td>publication required</td>
<td>Requestor agrees to make results of studies using the data available to the larger scientific community.</td>
</tr>
<tr>
<td>COL-[XX]</td>
<td>collaboration required</td>
<td>Requestor must agree to collaboration with the primary study investigator(s).</td>
</tr>
<tr>
<td>RTN</td>
<td>return data to database/resource</td>
<td>Requestor must return derived/enriched data to the database/resource.</td>
</tr>
<tr>
<td>IRB</td>
<td>ethics approval required</td>
<td>Requestor must provide documentation of local IRB/REC approval.</td>
</tr>
<tr>
<td>GS-[XX]</td>
<td>geographical restrictions</td>
<td>Use of the data is limited to within [geographic region].</td>
</tr>
<tr>
<td>MOR-[XX]</td>
<td>publication moratorium/embargo</td>
<td>Requestor agrees not to publish results of studies until [date].</td>
</tr>
<tr>
<td>TS-[XX]</td>
<td>time limits on use</td>
<td>Use of data is approved for [x months].</td>
</tr>
<tr>
<td>US</td>
<td>user-specific restrictions</td>
<td>Use of data is limited to use by approved users.</td>
</tr>
<tr>
<td>PS</td>
<td>project-specific restrictions</td>
<td>Use of data is limited to use within an approved project.</td>
</tr>
<tr>
<td>IS</td>
<td>institution-specific restrictions</td>
<td>Use of data is limited to use within an approved institution.</td>
</tr>
</table>
contact:
email: [email protected]
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
externalDocs:
description: 'Consent Codes: Upholding Standard Data Use Conditions'
url: 'http://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1005772'
paths: {}
components:
schemas:
ConsentCodeDataUse:
type: object
required:
- primaryCategory
- version
properties:
primaryCategory:
$ref: '#/components/schemas/ConsentCodeDataUseCondition'
secondaryCategories:
type: array
items:
$ref: '#/components/schemas/ConsentCodeDataUseCondition'
requirements:
type: array
items:
$ref: '#/components/schemas/ConsentCodeDataUseCondition'
version:
type: string
description: Version of the data use specification.
example: 0.1
description: Data use of a resource based on consent codes.
ConsentCodeDataUseCondition:
type: object
required:
- code
properties:
code:
type: string
description: Consent code abbreviation.
example: NRES
description:
type: string
description: Description of the condition.
description: Data use condition.
Loading

0 comments on commit 6e496f7

Please sign in to comment.