Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dataset, FHIR stores and annotations stores and related resources #71

Merged
merged 50 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e072737
Add Text, make Note extend Text, update date-annotator to take as inp…
tschaffter Nov 4, 2020
eb8b578
The date annotator takes as input Text instead of Notes
tschaffter Nov 4, 2020
5977c5b
Add post and get all datasets
tschaffter Nov 4, 2020
13668f2
Add get one dataset by id and delete one dataset
tschaffter Nov 4, 2020
deb638b
Add annotation store
tschaffter Nov 5, 2020
8560b9e
Add endpoints to manage annotations
tschaffter Nov 5, 2020
7946afe
Shave Annotation and DateAnnotation schemas from DB-related fields
tschaffter Nov 5, 2020
5c1dcc4
Add note stores and notes
tschaffter Nov 5, 2020
e42fac5
Date annotator now takes one Text object as input
tschaffter Nov 5, 2020
12d1976
Add StoredAnnotation and StoredDateAnnotation schemas
tschaffter Nov 5, 2020
7fe9734
Add IBM OpenAPI Validator
tschaffter Nov 6, 2020
c1b82c1
Fix errors reported by IBM validators
tschaffter Nov 6, 2020
b7a76ed
Fix some warnings returned by IBM OpenAPI Validator
tschaffter Nov 7, 2020
60a7403
Fix operationIds
tschaffter Nov 7, 2020
f70b240
Fix pagination AllOf
tschaffter Nov 7, 2020
6b93d53
Add missing descriptions
tschaffter Nov 7, 2020
6d66a77
Fix last warnings returned by IBM validator for the data node API
tschaffter Nov 7, 2020
20ff9ce
Update before refactoring dataset endpoints
tschaffter Nov 11, 2020
57dfb9c
Add endpoints to create and list FHIR stores
tschaffter Nov 11, 2020
d99f3ce
Add endpoint to get and delete a FHIR store
tschaffter Nov 11, 2020
8add208
Add endpoints to create and list FHIR patients
tschaffter Nov 11, 2020
8a66656
Add endpoints to get and delete a FHIR patient
tschaffter Nov 11, 2020
dd86fb9
Add endpoints to manipulate notes in FHIR store
tschaffter Nov 11, 2020
b37244d
Restore annotation store endpoints
tschaffter Nov 11, 2020
d1d4aff
Major update after introduction of readOnly
tschaffter Nov 11, 2020
9f66c47
Keep only CI/CD for data-node for now
tschaffter Nov 11, 2020
eebaf21
Update annotation schemas
tschaffter Nov 11, 2020
ecd9f34
Dataset and store names are no longer readOnly
tschaffter Nov 13, 2020
09be54d
Array in page now named according to the type of objects
tschaffter Nov 13, 2020
1fe4a45
Successful post request now returns 201
tschaffter Nov 13, 2020
2df4b06
Note path comes ../fhir/Note
tschaffter Nov 13, 2020
8f8e60a
Now returning paginated annotation stores
tschaffter Nov 13, 2020
793b8fb
Update annotation schemas and endpoints
tschaffter Nov 14, 2020
c959791
Add option to filter annotations to be returned by annotationType
tschaffter Nov 14, 2020
327ae45
Enable poster to set annotation id; rename PageResponse to ResponsePa…
tschaffter Nov 16, 2020
b36faab
Text annotation object is now a property of the annotation record
tschaffter Nov 16, 2020
33f80c7
Merge branch 'develop' into add-text-schema
tschaffter Nov 16, 2020
fe0260d
Remove health endpoint from date annotator
tschaffter Nov 16, 2020
1772729
Remove commons path health
tschaffter Nov 16, 2020
f54ba33
Merge branch 'develop' into add-text-schema
tschaffter Nov 16, 2020
4abc830
Fix case sensitive issue
tschaffter Nov 16, 2020
2462111
Fix date annotator API
tschaffter Nov 16, 2020
0d6f1d9
Use Google bundle schema approach for Annotation
tschaffter Nov 17, 2020
3fb838d
Make name of dataset and stores readOnly
tschaffter Nov 17, 2020
94bc009
The poster no longer specify an annotationId
tschaffter Nov 17, 2020
0c3f4bf
Merge branch 'develop' into add-text-schema
tschaffter Nov 17, 2020
86d9e23
Fix PageOfAnnotations
tschaffter Nov 17, 2020
311e447
Add annotation examples
tschaffter Nov 17, 2020
0a6c76d
Merge branch 'add-text-schema' of github.com:Sage-Bionetworks/nlp-san…
tschaffter Nov 17, 2020
7c4bae4
Replace PageOfAnnotations.items by PageOfAnnotations.annotations
tschaffter Nov 18, 2020
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
108 changes: 108 additions & 0 deletions .validaterc
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"shared": {
"operations": {
"no_operation_id": "error",
"operation_id_case_convention": [
"warning",
"lower_camel_case"
],
"no_summary": "warning",
"no_array_responses": "error",
"parameter_order": "warning",
"undefined_tag": "warning",
"unused_tag": "warning",
"operation_id_naming_convention": "warning"
},
"pagination": {
"pagination_style": "error"
},
"parameters": {
"no_parameter_description": "error",
"param_name_case_convention": [
"error",
"lower_camel_case"
],
"invalid_type_format_pair": "error",
"content_type_parameter": "error",
"accept_type_parameter": "error",
"authorization_parameter": "warning",
"required_param_has_default": "warning"
},
"paths": {
"missing_path_parameter": "error",
"duplicate_path_parameter": "error",
"snake_case_only": "off",
"paths_case_convention": [
"warning",
"lower_camel_case"
]
},
"responses": {
"inline_response_schema": "error"
},
"security_definitions": {
"unused_security_schemes": "warning",
"unused_security_scopes": "warning"
},
"security": {
"invalid_non_empty_security_array": "error"
},
"schemas": {
"invalid_type_format_pair": "warning",
"snake_case_only": "off",
"no_schema_description": "warning",
"no_property_description": "warning",
"description_mentions_json": "warning",
"array_of_arrays": "warning",
"inconsistent_property_type": "off",
"property_case_convention": [
"error",
"lower_camel_case"
],
"property_case_collision": "error",
"enum_case_convention": [
"error",
"lower_snake_case"
],
"undefined_required_properties": "warning"
},
"walker": {
"no_empty_descriptions": "error",
"has_circular_references": "warning",
"$ref_siblings": "off",
"duplicate_sibling_description": "warning",
"incorrect_ref_pattern": "warning"
}
},
"swagger2": {
"operations": {
"no_consumes_for_put_or_post": "error",
"get_op_has_consumes": "warning",
"no_produces": "warning"
}
},
"oas3": {
"operations": {
"no_request_body_content": "error",
"no_request_body_name": "warning"
},
"parameters": {
"no_in_property": "error",
"invalid_in_property": "error",
"missing_schema_or_content": "error",
"has_schema_and_content": "error"
},
"responses": {
"no_response_codes": "error",
"no_success_response_codes": "warning",
"no_response_body": "warning",
"ibm_status_code_guidelines": "warning"
},
"schemas": {
"json_or_param_binary_string": "warning"
}
},
"spectral": {
"rules": {}
}
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ TBA
- List paths in alphanumerical order
- Add schemas and paths used in more than one API to `commons`

## TODO

> "description": "Creates a new Annotation record. It is valid to create Annotation objects for the same source more than once since a unique ID is assigned to each record by this service.",

<!-- Definitions -->

[data_node_yaml]: https://Sage-Bionetworks.github.io//nlp-sandbox-schemas/data-node/develop/openapi.yaml
Expand Down
40 changes: 23 additions & 17 deletions openapi/commons/components/schemas/Annotation.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
type: object
description: An annotation in a text
allOf:
- $ref: Entity.yaml
- type: object
properties:
noteId:
description: The note ID
type: integer
start:
description: The position of the first character
type: integer
length:
description: The length of the annotation
type: integer
text:
description: The string annotated
type: string
description: An annotation record
properties:
name:
description: Resource name of the annotation record, of the form datasets/{datasetId}/annotationStores/{annotationStoreId}/annotations/{annotationId}
type: string
readOnly: true
annotationSource:
$ref: AnnotationSource.yaml
textDateAnnotations:
description: Date annotations in a text
type: array
items:
$ref: TextDateAnnotation.yaml
textPersonNameAnnotations:
description: Person name annotations in a text
type: array
items:
$ref: TextPersonNameAnnotation.yaml
textPhysicalAddressAnnotations:
description: Physical address annotations in a text
type: array
items:
$ref: TextPhysicalAddressAnnotation.yaml
6 changes: 6 additions & 0 deletions openapi/commons/components/schemas/AnnotationSource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: object
description: The source of an annotation record
properties:
name:
description: The source of the annotation record
type: string
4 changes: 0 additions & 4 deletions openapi/commons/components/schemas/Email.yaml

This file was deleted.

1 change: 1 addition & 0 deletions openapi/commons/components/schemas/Error.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: object
description: Problem details (tools.ietf.org/html/rfc7807)
properties:
title:
type: string
Expand Down
6 changes: 0 additions & 6 deletions openapi/commons/components/schemas/Health.yaml

This file was deleted.

32 changes: 16 additions & 16 deletions openapi/commons/components/schemas/Note.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
type: object
description: A clinical note
allOf:
- $ref: Entity.yaml
- type: object
properties:
text:
description: The content of the note
type: string
example: On 09-03-1999, Ms Chloe Price met with Dr Joe.
type:
description: The note type
type: string
enum:
- pathology
- phone_call
# required:
# - text
properties:
id:
description: The ID of the note
type: string
readOnly: true
text:
description: A text
type: string
example: "This is a text."
noteType:
description: The note type (LOINC concept)
type: string
example: "loinc:LP29684-5"
patientId:
description: The patient ID
type: string
15 changes: 0 additions & 15 deletions openapi/commons/components/schemas/PageResponse.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions openapi/commons/components/schemas/Patient.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type: object
description: A FHIR Patient
properties:
id:
description: The patient ID
type: string
readOnly: true
identifier:
description: An identifier for this patient
type: string
gender:
description: Gender of the patient
type: string
enum:
- male
- female
- other
- unknown
21 changes: 0 additions & 21 deletions openapi/commons/components/schemas/Patient.yml

This file was deleted.

4 changes: 0 additions & 4 deletions openapi/commons/components/schemas/PatientPublicId.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions openapi/commons/components/schemas/PersonNameAnnotation.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions openapi/commons/components/schemas/PhysicalAddressAnnotation.yaml

This file was deleted.

21 changes: 21 additions & 0 deletions openapi/commons/components/schemas/ResponsePageMetadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
type: object
description: A page of results
properties:
offset:
description: Index of the first result that must be returned
type: integer
limit:
description: Maximum number of results returned
type: integer
links:
description: Links to navigate to different pages of results
type: object
properties:
next:
description: Link to the next page of results
type: string
format: uri
required:
- offset
- limit
- links
12 changes: 12 additions & 0 deletions openapi/commons/components/schemas/TextAnnotation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
type: object
description: An annotation in a text
properties:
start:
description: The position of the first character
type: integer
length:
description: The length of the annotation
type: integer
text:
description: The string annotated
type: string
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
type: object
description: A date annotation in a text
allOf:
- $ref: Annotation.yaml
- $ref: TextAnnotation.yaml
- type: object
properties:
format:
dateFormat:
description: Date format (ISO 8601)
type: string
example:
start: 42
length: 10
text: 10/26/2020
dateFormat: "MM/DD/YYYY"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
description: A person name annotation in a text
allOf:
- $ref: TextAnnotation.yaml
example:
start: 42
length: 11
text: Chloe Price
Loading