diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55a9008..c4c4f30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: pull_request: env: - docker_repository: docker.synapse.org/syn22277123/date-annotator-example-java + docker_repository: docker.synapse.org/syn22277123/phi-annotator-example-java jobs: configure: diff --git a/README.md b/README.md index 976b38c..801e85b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ [![nlpsandbox.io](https://nlpsandbox.github.io/nlpsandbox-themes/banner/Banner@3x.png)](https://nlpsandbox.io) -# NLP Sandbox Date Annotator Example for Java +# NLP Sandbox PHI Annotator Example for Java -[![GitHub Release](https://img.shields.io/github/release/nlpsandbox/date-annotator-example-java.svg?include_prereleases&color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/date-annotator-example-java/releases) -[![GitHub CI](https://img.shields.io/github/workflow/status/nlpsandbox/date-annotator-example-java/CI.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/date-annotator-example-java/actions) -[![GitHub License](https://img.shields.io/github/license/nlpsandbox/date-annotator-example-java.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/date-annotator-example-java/blob/main/LICENSE) +[![GitHub Release](https://img.shields.io/github/release/nlpsandbox/phi-annotator-example-java.svg?include_prereleases&color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/phi-annotator-example-java/releases) +[![GitHub CI](https://img.shields.io/github/workflow/status/nlpsandbox/phi-annotator-example-java/CI.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/phi-annotator-example-java/actions) +[![GitHub License](https://img.shields.io/github/license/nlpsandbox/phi-annotator-example-java.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/nlpsandbox/phi-annotator-example-java/blob/main/LICENSE) [![Docker](https://img.shields.io/badge/docker-blue.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=nlpsandbox&logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMy4yIDcuOS0xLjctMXYxMS40bDkuOSA1LjdWMTIuNkw1LjYgOS4zIDMuMiA3Ljl6bTE3LjEtMS4zIDEuNS0uOUwxMiAwIDIuMiA1LjdsMi42IDEuNS4xLjEgMS43IDEgNS41IDMuMiA1LjEtMyAzLjEtMS45ek0xMiA5LjUgOS4zIDcuOSA3LjQgNi44bC0xLjctMS0uMS0uMWgtLjFMMTIgMS45bDYuNSAzLjhMMTYuMyA3IDEyIDkuNXptOC44LTEuNi0yLjQgMS40LS41LjItNS4zIDMuMVYyNGw5LjktNS43VjYuOWwtMS43IDF6IiBmaWxsPSIjZmZmIi8+PC9zdmc+)](https://www.synapse.org/#!Synapse:syn25830787 "Get the Docker image of this tool on NLPSandbox.io") [![Leaderboard](https://img.shields.io/badge/leaderboard-blue.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=nlpsandbox&logo=data:image/svg%2bxml;base64,PHN2ZyByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMy4yIDcuOS0xLjctMXYxMS40bDkuOSA1LjdWMTIuNkw1LjYgOS4zIDMuMiA3Ljl6bTE3LjEtMS4zIDEuNS0uOUwxMiAwIDIuMiA1LjdsMi42IDEuNS4xLjEgMS43IDEgNS41IDMuMiA1LjEtMyAzLjEtMS45ek0xMiA5LjUgOS4zIDcuOSA3LjQgNi44bC0xLjctMS0uMS0uMWgtLjFMMTIgMS45bDYuNSAzLjhMMTYuMyA3IDEyIDkuNXptOC44LTEuNi0yLjQgMS40LS41LjItNS4zIDMuMVYyNGw5LjktNS43VjYuOWwtMS43IDF6IiBmaWxsPSIjZmZmIi8+PC9zdmc+)](https://www.synapse.org/#!Synapse:syn22277123/wiki/608544 "View the performance of this tool on NLPSandbox.io") [![Discord](https://img.shields.io/discord/770484164393828373.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Discord&logo=discord)](https://nlpsandbox.io/discord "Realtime support / chat with the community and the team") @@ -16,20 +16,23 @@ processing (NLP) tools on both public and private datasets. Academics, students, and industry professionals are invited to browse the available tasks and participate by developing and submitting an NLP Sandbox tool. -This repository provides an example implementation of the [NLP Sandbox Date +This repository provides an example implementation of the [NLP Sandbox PHI Annotator API] written in Java-Spring. An NLP Sandbox date annotator takes as -input a clinical note (text) and outputs a list of predicted date annotations -found in the clinical note. Here dates are identified using regular expressions. - -This tool is provided to NLP developers who develop in Python as a starting -point to package their own date annotator as an NLP Sandbox tool (see section -[Development](#Development)). This section also describes how to generate a tool -"stub" using [openapi-generator] for 50+ programming languages-frameworks. This -repository includes a GitHub CI/CD workflow that lints, tests, builds and pushes -a Docker image of this tool to Synapse Docker Registry. This image of this -example tool can be submitted as-is on [NLPSandbox.io] to benchmark its +input a clinical note (text) and outputs a list of predicted PHI annotations +found in the clinical note. + +This tool is provided to NLP developers who develop in Java as a starting +point to package their own PHI annotator as an NLP Sandbox tool (see section +[Development](#Development)). + +This repository includes a GitHub CI/CD workflow that lints, tests, builds and +pushes a Docker image of this tool to Synapse Docker Registry. This image of +this example tool can be submitted as-is on [NLPSandbox.io] to benchmark its performance -- just don't expect a high performance! +> See the GitHub repository [nlpsandbox/phi-annotator-example] of a similar tool +for Python. The README of this repository also document how to create a new PHI +annotator using [openapi-generator] for 50+ programming languages-frameworks. ## Contents @@ -45,8 +48,6 @@ performance -- just don't expect a high performance! - [Creating a GitHub repository](#Creating-a-GitHub-repository) - [Configuring the CI/CD workflow](#Configuring-the-CI/CD-workflow) - [Enabling version updates](#Enabling-version-updates) - - [Generating a new NLP Sandbox tool using - openapi-generator](#Generating-a-new-NLP-Sandbox-tool-using-openapi-generator) - [Keeping your tool up-to-date](#Keeping-your-tool-up-to-date) - [Testing](#Testing) - [Preventing an NLP Sandbox tool from connecting to remote @@ -60,9 +61,9 @@ performance -- just don't expect a high performance! ## Specification +- NLP Sandbox tool version: 1.0.0 - NLP Sandbox schemas version: 1.2.0 -- NLP Sandbox tool version: 1.2.0 -- Docker image: [docker.synapse.org/syn22277123/date-annotator-example-java] +- Docker image: [docker.synapse.org/syn22277123/phi-annotator-example-java] ## Requirements @@ -82,6 +83,9 @@ docker compose up --build You can stop the container run with `Ctrl+C`, followed by `docker compose down`. +> Note: `docker compose` is not yet available on Linux. Use `docker-compose` +> instead. + ### Running with Maven Build and start the example date annotator. @@ -118,7 +122,7 @@ the tool using Docker (production) or Java (development). This section describes how to develop your own NLP Sandbox date annotator in Python-Flask and other programming languages-frameworks. This example tool is also available in Java in the GitHub repository -[nlpsandbox/date-annotator-example-java]. +[nlpsandbox/phi-annotator-example-java]. ### Development requirements @@ -129,18 +133,7 @@ also available in Java in the GitHub repository ### Creating a GitHub repository -Depending on the language-frameworks you want to develop with: - -- Java-Spring: create a new repository from this [this GitHub template]. -- Python-Flask: create a new repository from the GitHub repository - [nlpsandbox/date-annotator-example]. -- Other languages-frameworks: create a brand-new GitHub repository before - generating a NLP Sandbox tool stub in section [Generating a new NLP Sandbox - tool using - openapi-generator](#Generating-a-new-NLP-Sandbox-tool-using-openapi-generator). - -You can also use a different code repository hosting service like [GitLab] and -[Bitbucket]. +Create a new repository from this [this GitHub template]. ### Configuring the CI/CD workflow @@ -176,43 +169,6 @@ making the update effective. For more information on Dependabot, please visit the GitHub page [Enabling and disabling version updates]. -### Generating a new NLP Sandbox tool using openapi-generator - -The development of new NLP Sandbox tools is streamlined by using the -[openapi-generator] to generate tool "stubs" for more than 50 programming -languages and frameworks. Here a date annotator stub refers to an initial -implementation that has been automatically generated by [openapi-generator] from -the [NLP Sandbox Date Annotator API] specification. - -Run the command below to get the list of languages-framework supported by the -[openapi-generator] (under the section `SERVER generators`). - -```console -npx @openapitools/openapi-generator-cli list -``` - -Generate the date annotator stub from an empty GitHub repository (here in -Java-Spring): - -```console -mkdir server -npx @openapitools/openapi-generator-cli generate \ - -g spring \ - -o server \ - -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/latest/openapi.json -``` - -where the option `-i` refers to the OpenAPI specification of the [NLP Sandbox -Date Annotator API]. - -The URL is composed of different elements: - -- `date-annotator` - The type of NLP Sandbox tool to generate. The list of all - the NLP Sandbox tool types available is defined in the [NLP Sandbox schemas]. -- `latest` - The latest stable version of the [NLP Sandbox schemas]. This token - can be replaced by a specific release version `x.y.z` of the [NLP Sandbox - schemas]. - ### Keeping your tool up-to-date The NLP Sandbox schemas is updated after receiving contribution from the @@ -241,7 +197,7 @@ Follow the steps listed below to update your tool. npm run generate:server:latest -3. Review the updates made to this tool in the [NLP Sandbox schemas CHANGELOG]. +3. Review the updates made to this tool in the NLP Sandbox schemas CHANGELOG. 4. Review and merge the changes. If you are using VS Code, this step can be performed relatively easily using the section named "Source Control". This @@ -321,31 +277,25 @@ Thinking about contributing to this project? Get started by reading our [nlpsandbox.io]: https://www.synapse.org/nlpsandbox -[docker.synapse.org/syn22277123/date-annotator-example-java]: https://www.synapse.org/#!Synapse:syn25830787 +[docker.synapse.org/syn22277123/phi-annotator-example-java]: https://www.synapse.org/TBA [Synapse.org]: https://synapse.org [openapi-generator]: https://github.com/OpenAPITools/openapi-generator [contribution guide]: .github/CONTRIBUTING.md -[Apache License 2.0]: https://github.com/nlpsandbox/date-annotator-example-java/blob/main/LICENSE +[Apache License 2.0]: https://github.com/nlpsandbox/phi-annotator-example-java/blob/main/LICENSE [Docker Engine]: https://docs.docker.com/engine/install/ [Node]: https://nodejs.org/en/ [Java]: https://www.java.com/en/download/help/download_options.html -[Conda]: https://conda.io/projects/conda/en/latest/user-guide/install/index.html -[Python]: https://www.python.org/downloads/ [docker.synapse.org]: https://synapse.org -[GitLab]: https://about.gitlab.com/ -[Bitbucket]: https://bitbucket.org/product [GitHub secrets]: https://docs.github.com/en/actions/reference/encrypted-secrets [personal access token]: https://help.synapse.org/docs/Managing-Your-Account.2055405596.html [CI/CD workflow]: .github/workflows/ci.yml [Dependabot configuration]: .github/dependabot.yml -[Enabling and disabling version updates]: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/enabling-and-disabling-version-updates [NLP Sandbox schemas]: https://github.com/nlpsandbox/nlpsandbox-schemas [nlpsandbox/nlpsandbox-schemas]: https://github.com/nlpsandbox/nlpsandbox-schemas -[NLP Sandbox Date Annotator API]: https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/latest/docs/ -[this GitHub template]: https://github.com/nlpsandbox/date-annotator-example/generate -[nlpsandbox/date-annotator-example-java]: https://github.com/nlpsandbox/date-annotator-example-java -[nlpsandbox/date-annotator-example]: https://github.com/nlpsandbox/date-annotator-example +[NLP Sandbox PHI Annotator API]: https://nlpsandbox.github.io/nlpsandbox-schemas/phi-annotator/latest/docs/ +[this GitHub template]: https://github.com/nlpsandbox/phi-annotator-example-java/generate +[nlpsandbox/phi-annotator-example-java]: https://github.com/nlpsandbox/phi-annotator-example-java +[nlpsandbox/phi-annotator-example]: https://github.com/nlpsandbox/phi-annotator-example [Patient schema]: https://github.com/nlpsandbox/nlpsandbox-schemas/blob/main/openapi/commons/components/schemas/Patient.yaml [semantic versioning]: https://semver.org/ -[NLP Sandbox schemas CHANGELOG]: .github/CHANGELOG.md [Apache Maven]: https://maven.apache.org/install.html diff --git a/package.json b/package.json index e005356..4fa09f9 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "private": true, "scripts": { "generate:server": "openapi-generator-cli generate -g spring -o server -i $npm_config_openapi", - "generate:server:latest": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/latest/openapi.json", - "generate:server:edge": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/edge/openapi.json", - "generate:server:version": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/$npm_config_schemas_version/openapi.json", + "generate:server:latest": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/phi-annotator/latest/openapi.json", + "generate:server:edge": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/phi-annotator/edge/openapi.json", + "generate:server:version": "openapi-generator-cli generate -g spring -o server -i https://nlpsandbox.github.io/nlpsandbox-schemas/phi-annotator/$npm_config_schemas_version/openapi.json", "install:dependencies": "npm ci", "start:dev": "cd server && mvn clean package && java -jar target/openapi-spring-1.2.0.jar", "start:prod": "docker compose up --build" diff --git a/server/src/main/java/org/example/ContactAnnotator.java b/server/src/main/java/org/example/ContactAnnotator.java new file mode 100644 index 0000000..067d894 --- /dev/null +++ b/server/src/main/java/org/example/ContactAnnotator.java @@ -0,0 +1,57 @@ +package org.example; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.model.TextContactAnnotation; + +public class ContactAnnotator { + + class NamedPattern{ + public String name; + public Pattern pattern; + + public NamedPattern(String name, Pattern pattern){ + this.name = name; + this.pattern = pattern; + } + } + + class Span{ + int begin; + int end; + int length; + + public Span(int begin, int end){ + this.begin = begin; + this.end = end; + this.length = end - begin; + } + } + + static List patterns; + + public ContactAnnotator(){ + patterns = new ArrayList<>(); + // TODO Add contact patterns + } + + public List annotate(String text){ + List annotations = new ArrayList<>(); + for (NamedPattern np: patterns) { + // Now create matcher object. + Matcher m = np.pattern.matcher(text); + while (m.find()) { + annotations.add(new TextContactAnnotation() + .start(m.start(0)) + .length(m.group(0).length()) + .text(m.group(0)) + .contactType(TextContactAnnotation.ContactTypeEnum.OTHER) + .confidence(95.5f)); + } + } + return annotations; + } +} diff --git a/server/src/main/java/org/nlpsandbox/DateExtractor.java b/server/src/main/java/org/example/DateAnnotator.java similarity index 73% rename from server/src/main/java/org/nlpsandbox/DateExtractor.java rename to server/src/main/java/org/example/DateAnnotator.java index 14061a9..73a9d19 100644 --- a/server/src/main/java/org/nlpsandbox/DateExtractor.java +++ b/server/src/main/java/org/example/DateAnnotator.java @@ -1,4 +1,4 @@ -package org.nlpsandbox; +package org.example; import java.util.ArrayList; import java.util.List; @@ -7,7 +7,7 @@ import org.openapitools.model.TextDateAnnotation; -public class DateExtractor { +public class DateAnnotator { class NamedPattern{ public String name; @@ -31,34 +31,33 @@ public Span(int begin, int end){ } } - static List datePatterns; + static List patterns; - public DateExtractor(){ - datePatterns = new ArrayList<>(); - datePatterns.add(new NamedPattern("MM/DD/YYYY", + public DateAnnotator() { + patterns = new ArrayList<>(); + patterns.add(new NamedPattern("MM/DD/YYYY", Pattern.compile( "\\b([1-9]|0[1-9]|1[0-2])(/)([1-9]|0[1-9]|1[0-9]|2[0-9]|3[0-1])(/)(19[0-9][0-9]|20[0-9][0-9])"))); - datePatterns.add(new NamedPattern("DD.MM.YYYY", + patterns.add(new NamedPattern("DD.MM.YYYY", Pattern.compile( "\\b([1-9]|0[1-9]|1[0-9]|2[0-9]|3[0-1])(.)([1-9]|0[1-9]|1[0-2])(.)(19[0-9][0-9]|20[0-9][0-9])"))); - datePatterns.add(new NamedPattern("YYYY", + patterns.add(new NamedPattern("YYYY", Pattern.compile( "\\b([1-9][1-9][0-9][0-9]|2[0-9][0-9][0-9])"))); - datePatterns.add(new NamedPattern("MMMM", + patterns.add(new NamedPattern("MMMM", Pattern.compile("\\b(January|February|March|April|May|June|" + "July|August|September|October|November|" + "December)"))); } - public List findDatesFromString(String sentence){ - + public List annotate(String text){ List annotations = new ArrayList<>(); - for (NamedPattern np: datePatterns) { + for (NamedPattern np: patterns) { // Now create matcher object. - Matcher m = np.pattern.matcher(sentence); + Matcher m = np.pattern.matcher(text); while (m.find()) { annotations.add(new TextDateAnnotation() .start(m.start(0)) @@ -72,11 +71,11 @@ public List findDatesFromString(String sentence){ } public static void main(String[] args) { - DateExtractor de = new DateExtractor(); + DateAnnotator dateAnnotator = new DateAnnotator(); String str1 = "Today is 10/26/2020, and yesterday is 10/25/2020. "; - de.findDatesFromString(str1); + dateAnnotator.annotate(str1); String str2 = "Today is 26/11/2020. "; - de.findDatesFromString(str2); + dateAnnotator.annotate(str2); } } diff --git a/server/src/main/java/org/example/IdAnnotator.java b/server/src/main/java/org/example/IdAnnotator.java new file mode 100644 index 0000000..58fda13 --- /dev/null +++ b/server/src/main/java/org/example/IdAnnotator.java @@ -0,0 +1,57 @@ +package org.example; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.model.TextIdAnnotation; + +public class IdAnnotator { + + class NamedPattern{ + public String name; + public Pattern pattern; + + public NamedPattern(String name, Pattern pattern){ + this.name = name; + this.pattern = pattern; + } + } + + class Span{ + int begin; + int end; + int length; + + public Span(int begin, int end){ + this.begin = begin; + this.end = end; + this.length = end - begin; + } + } + + static List patterns; + + public IdAnnotator(){ + patterns = new ArrayList<>(); + // TODO Add identifier patterns + } + + public List annotate(String text){ + List annotations = new ArrayList<>(); + for (NamedPattern np: patterns) { + // Now create matcher object. + Matcher m = np.pattern.matcher(text); + while (m.find()) { + annotations.add(new TextIdAnnotation() + .start(m.start(0)) + .length(m.group(0).length()) + .text(m.group(0)) + .idType(TextIdAnnotation.IdTypeEnum.OTHER) + .confidence(95.5f)); + } + } + return annotations; + } +} diff --git a/server/src/main/java/org/example/LocationAnnotator.java b/server/src/main/java/org/example/LocationAnnotator.java new file mode 100644 index 0000000..ee6ebcf --- /dev/null +++ b/server/src/main/java/org/example/LocationAnnotator.java @@ -0,0 +1,57 @@ +package org.example; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.model.TextLocationAnnotation; + +public class LocationAnnotator { + + class NamedPattern{ + public String name; + public Pattern pattern; + + public NamedPattern(String name, Pattern pattern){ + this.name = name; + this.pattern = pattern; + } + } + + class Span{ + int begin; + int end; + int length; + + public Span(int begin, int end){ + this.begin = begin; + this.end = end; + this.length = end - begin; + } + } + + static List patterns; + + public LocationAnnotator(){ + patterns = new ArrayList<>(); + // TODO Add location patterns + } + + public List annotate(String text){ + List annotations = new ArrayList<>(); + for (NamedPattern np: patterns) { + // Now create matcher object. + Matcher m = np.pattern.matcher(text); + while (m.find()) { + annotations.add(new TextLocationAnnotation() + .start(m.start(0)) + .length(m.group(0).length()) + .text(m.group(0)) + .locationType(TextLocationAnnotation.LocationTypeEnum.OTHER) + .confidence(95.5f)); + } + } + return annotations; + } +} diff --git a/server/src/main/java/org/example/PersonNameAnnotator.java b/server/src/main/java/org/example/PersonNameAnnotator.java new file mode 100644 index 0000000..591352a --- /dev/null +++ b/server/src/main/java/org/example/PersonNameAnnotator.java @@ -0,0 +1,56 @@ +package org.example; + +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.model.TextPersonNameAnnotation; + +public class PersonNameAnnotator { + + class NamedPattern{ + public String name; + public Pattern pattern; + + public NamedPattern(String name, Pattern pattern){ + this.name = name; + this.pattern = pattern; + } + } + + class Span{ + int begin; + int end; + int length; + + public Span(int begin, int end){ + this.begin = begin; + this.end = end; + this.length = end - begin; + } + } + + static List patterns; + + public PersonNameAnnotator() { + patterns = new ArrayList<>(); + // TODO Add person name patterns + } + + public List annotate(String text){ + List annotations = new ArrayList<>(); + for (NamedPattern np: patterns) { + // Now create matcher object. + Matcher m = np.pattern.matcher(text); + while (m.find()) { + annotations.add(new TextPersonNameAnnotation() + .start(m.start(0)) + .length(m.group(0).length()) + .text(m.group(0)) + .confidence(95.5f)); + } + } + return annotations; + } +} diff --git a/server/src/main/java/org/openapitools/api/HealthCheckApi.java b/server/src/main/java/org/openapitools/api/HealthCheckApi.java index a0def57..a0f9d1f 100644 --- a/server/src/main/java/org/openapitools/api/HealthCheckApi.java +++ b/server/src/main/java/org/openapitools/api/HealthCheckApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -12,7 +12,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; -import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -23,7 +22,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-12T21:49:56.981797-08:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") @Validated @Api(value = "healthCheck", description = "the healthCheck API") public interface HealthCheckApi { diff --git a/server/src/main/java/org/openapitools/api/HealthCheckApiController.java b/server/src/main/java/org/openapitools/api/HealthCheckApiController.java index 60b195f..0d44de4 100644 --- a/server/src/main/java/org/openapitools/api/HealthCheckApiController.java +++ b/server/src/main/java/org/openapitools/api/HealthCheckApiController.java @@ -4,9 +4,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") @Controller -@RequestMapping("${openapi.nLPSandboxDateAnnotator.base-path:/api/v1}") +@RequestMapping("${openapi.nLPSandboxPHIAnnotator.base-path:/api/v1}") public class HealthCheckApiController implements HealthCheckApi { private final NativeWebRequest request; diff --git a/server/src/main/java/org/openapitools/api/TextContactAnnotationsApi.java b/server/src/main/java/org/openapitools/api/TextContactAnnotationsApi.java new file mode 100644 index 0000000..46f0041 --- /dev/null +++ b/server/src/main/java/org/openapitools/api/TextContactAnnotationsApi.java @@ -0,0 +1,68 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.Error; +import org.openapitools.model.TextContactAnnotation; +import org.openapitools.model.TextContactAnnotationRequest; +import org.openapitools.model.TextContactAnnotationResponse; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import springfox.documentation.annotations.ApiIgnore; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.example.ContactAnnotator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +@Validated +@Api(value = "textContactAnnotations", description = "the textContactAnnotations API") +public interface TextContactAnnotationsApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /textContactAnnotations : Annotate contact information in a clinical note + * Return the contact annotations found in a clinical note + * + * @param textContactAnnotationRequest (optional) + * @return Success (status code 200) + * or Invalid request (status code 400) + * or The request cannot be fulfilled due to an unexpected server error (status code 500) + */ + @ApiOperation(value = "Annotate contact information in a clinical note", nickname = "createTextContactAnnotations", notes = "Return the contact annotations found in a clinical note", response = TextContactAnnotationResponse.class, tags={ "TextContactAnnotation", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = TextContactAnnotationResponse.class), + @ApiResponse(code = 400, message = "Invalid request", response = Error.class), + @ApiResponse(code = 500, message = "The request cannot be fulfilled due to an unexpected server error", response = Error.class) }) + @PostMapping( + value = "/textContactAnnotations", + produces = { "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity createTextContactAnnotations(@ApiParam(value = "" ) @Valid @RequestBody(required = false) TextContactAnnotationRequest textContactAnnotationRequest) { + String text = textContactAnnotationRequest.getNote().getText(); + List annotations = new ContactAnnotator() + .annotate(text); + TextContactAnnotationResponse res = new TextContactAnnotationResponse() + .textContactAnnotations(annotations); + + return new ResponseEntity(res, HttpStatus.OK); + } + +} diff --git a/server/src/main/java/org/openapitools/api/TextContactAnnotationsApiController.java b/server/src/main/java/org/openapitools/api/TextContactAnnotationsApiController.java new file mode 100644 index 0000000..49b2454 --- /dev/null +++ b/server/src/main/java/org/openapitools/api/TextContactAnnotationsApiController.java @@ -0,0 +1,24 @@ +package org.openapitools.api; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.context.request.NativeWebRequest; +import java.util.Optional; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +@Controller +@RequestMapping("${openapi.nLPSandboxPHIAnnotator.base-path:/api/v1}") +public class TextContactAnnotationsApiController implements TextContactAnnotationsApi { + + private final NativeWebRequest request; + + @org.springframework.beans.factory.annotation.Autowired + public TextContactAnnotationsApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/server/src/main/java/org/openapitools/api/TextDateAnnotationsApi.java b/server/src/main/java/org/openapitools/api/TextDateAnnotationsApi.java index 616e3fe..3aa526f 100644 --- a/server/src/main/java/org/openapitools/api/TextDateAnnotationsApi.java +++ b/server/src/main/java/org/openapitools/api/TextDateAnnotationsApi.java @@ -1,20 +1,19 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.api; import org.openapitools.model.Error; -import org.openapitools.model.TextDateAnnotationRequest; import org.openapitools.model.TextDateAnnotation; +import org.openapitools.model.TextDateAnnotationRequest; import org.openapitools.model.TextDateAnnotationResponse; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; -import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; @@ -26,9 +25,9 @@ import java.util.Map; import java.util.Optional; -import org.nlpsandbox.DateExtractor; +import org.example.DateAnnotator; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-12T21:49:56.981797-08:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") @Validated @Api(value = "textDateAnnotations", description = "the textDateAnnotations API") public interface TextDateAnnotationsApi { @@ -58,8 +57,8 @@ default Optional getRequest() { ) default ResponseEntity createTextDateAnnotations(@ApiParam(value = "" ) @Valid @RequestBody(required = false) TextDateAnnotationRequest textDateAnnotationRequest) { String text = textDateAnnotationRequest.getNote().getText(); - List annotations = new DateExtractor() - .findDatesFromString(text); + List annotations = new DateAnnotator() + .annotate(text); TextDateAnnotationResponse res = new TextDateAnnotationResponse() .textDateAnnotations(annotations); diff --git a/server/src/main/java/org/openapitools/api/TextDateAnnotationsApiController.java b/server/src/main/java/org/openapitools/api/TextDateAnnotationsApiController.java index a091334..c8ad0a5 100644 --- a/server/src/main/java/org/openapitools/api/TextDateAnnotationsApiController.java +++ b/server/src/main/java/org/openapitools/api/TextDateAnnotationsApiController.java @@ -4,9 +4,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") @Controller -@RequestMapping("${openapi.nLPSandboxDateAnnotator.base-path:/api/v1}") +@RequestMapping("${openapi.nLPSandboxPHIAnnotator.base-path:/api/v1}") public class TextDateAnnotationsApiController implements TextDateAnnotationsApi { private final NativeWebRequest request; diff --git a/server/src/main/java/org/openapitools/api/TextIdAnnotationsApi.java b/server/src/main/java/org/openapitools/api/TextIdAnnotationsApi.java new file mode 100644 index 0000000..327bcc9 --- /dev/null +++ b/server/src/main/java/org/openapitools/api/TextIdAnnotationsApi.java @@ -0,0 +1,68 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.Error; +import org.openapitools.model.TextIdAnnotation; +import org.openapitools.model.TextIdAnnotationRequest; +import org.openapitools.model.TextIdAnnotationResponse; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import springfox.documentation.annotations.ApiIgnore; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.example.IdAnnotator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +@Validated +@Api(value = "textIdAnnotations", description = "the textIdAnnotations API") +public interface TextIdAnnotationsApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /textIdAnnotations : Annotate IDs in a clinical note + * Return the ID annotations found in a clinical note + * + * @param textIdAnnotationRequest (optional) + * @return Success (status code 200) + * or Invalid request (status code 400) + * or The request cannot be fulfilled due to an unexpected server error (status code 500) + */ + @ApiOperation(value = "Annotate IDs in a clinical note", nickname = "createTextIdAnnotations", notes = "Return the ID annotations found in a clinical note", response = TextIdAnnotationResponse.class, tags={ "TextIdAnnotation", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = TextIdAnnotationResponse.class), + @ApiResponse(code = 400, message = "Invalid request", response = Error.class), + @ApiResponse(code = 500, message = "The request cannot be fulfilled due to an unexpected server error", response = Error.class) }) + @PostMapping( + value = "/textIdAnnotations", + produces = { "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity createTextIdAnnotations(@ApiParam(value = "" ) @Valid @RequestBody(required = false) TextIdAnnotationRequest textIdAnnotationRequest) { + String text = textIdAnnotationRequest.getNote().getText(); + List annotations = new IdAnnotator() + .annotate(text); + TextIdAnnotationResponse res = new TextIdAnnotationResponse() + .textIdAnnotations(annotations); + + return new ResponseEntity(res, HttpStatus.OK); + } + +} diff --git a/server/src/main/java/org/openapitools/api/TextIdAnnotationsApiController.java b/server/src/main/java/org/openapitools/api/TextIdAnnotationsApiController.java new file mode 100644 index 0000000..92a2c16 --- /dev/null +++ b/server/src/main/java/org/openapitools/api/TextIdAnnotationsApiController.java @@ -0,0 +1,24 @@ +package org.openapitools.api; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.context.request.NativeWebRequest; +import java.util.Optional; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +@Controller +@RequestMapping("${openapi.nLPSandboxPHIAnnotator.base-path:/api/v1}") +public class TextIdAnnotationsApiController implements TextIdAnnotationsApi { + + private final NativeWebRequest request; + + @org.springframework.beans.factory.annotation.Autowired + public TextIdAnnotationsApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/server/src/main/java/org/openapitools/api/TextLocationAnnotationsApi.java b/server/src/main/java/org/openapitools/api/TextLocationAnnotationsApi.java new file mode 100644 index 0000000..9bab4a2 --- /dev/null +++ b/server/src/main/java/org/openapitools/api/TextLocationAnnotationsApi.java @@ -0,0 +1,68 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.Error; +import org.openapitools.model.TextLocationAnnotation; +import org.openapitools.model.TextLocationAnnotationRequest; +import org.openapitools.model.TextLocationAnnotationResponse; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import springfox.documentation.annotations.ApiIgnore; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.example.LocationAnnotator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +@Validated +@Api(value = "textLocationAnnotations", description = "the textLocationAnnotations API") +public interface TextLocationAnnotationsApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /textLocationAnnotations : Annotate locations in a clinical note + * Return the location annotations found in a clinical note + * + * @param textLocationAnnotationRequest (optional) + * @return Success (status code 200) + * or Invalid request (status code 400) + * or The request cannot be fulfilled due to an unexpected server error (status code 500) + */ + @ApiOperation(value = "Annotate locations in a clinical note", nickname = "createTextLocationAnnotations", notes = "Return the location annotations found in a clinical note", response = TextLocationAnnotationResponse.class, tags={ "TextLocationAnnotation", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = TextLocationAnnotationResponse.class), + @ApiResponse(code = 400, message = "Invalid request", response = Error.class), + @ApiResponse(code = 500, message = "The request cannot be fulfilled due to an unexpected server error", response = Error.class) }) + @PostMapping( + value = "/textLocationAnnotations", + produces = { "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity createTextLocationAnnotations(@ApiParam(value = "" ) @Valid @RequestBody(required = false) TextLocationAnnotationRequest textLocationAnnotationRequest) { + String text = textLocationAnnotationRequest.getNote().getText(); + List annotations = new LocationAnnotator() + .annotate(text); + TextLocationAnnotationResponse res = new TextLocationAnnotationResponse() + .textLocationAnnotations(annotations); + + return new ResponseEntity(res, HttpStatus.OK); + } + +} diff --git a/server/src/main/java/org/openapitools/api/TextLocationAnnotationsApiController.java b/server/src/main/java/org/openapitools/api/TextLocationAnnotationsApiController.java new file mode 100644 index 0000000..a5f24c5 --- /dev/null +++ b/server/src/main/java/org/openapitools/api/TextLocationAnnotationsApiController.java @@ -0,0 +1,24 @@ +package org.openapitools.api; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.context.request.NativeWebRequest; +import java.util.Optional; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +@Controller +@RequestMapping("${openapi.nLPSandboxPHIAnnotator.base-path:/api/v1}") +public class TextLocationAnnotationsApiController implements TextLocationAnnotationsApi { + + private final NativeWebRequest request; + + @org.springframework.beans.factory.annotation.Autowired + public TextLocationAnnotationsApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/server/src/main/java/org/openapitools/api/TextPersonNameAnnotationsApi.java b/server/src/main/java/org/openapitools/api/TextPersonNameAnnotationsApi.java new file mode 100644 index 0000000..13a61f6 --- /dev/null +++ b/server/src/main/java/org/openapitools/api/TextPersonNameAnnotationsApi.java @@ -0,0 +1,68 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.Error; +import org.openapitools.model.TextPersonNameAnnotation; +import org.openapitools.model.TextPersonNameAnnotationRequest; +import org.openapitools.model.TextPersonNameAnnotationResponse; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; +import springfox.documentation.annotations.ApiIgnore; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.example.PersonNameAnnotator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +@Validated +@Api(value = "textPersonNameAnnotations", description = "the textPersonNameAnnotations API") +public interface TextPersonNameAnnotationsApi { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /textPersonNameAnnotations : Annotate person names in a clinical note + * Return the person name annotations found in a clinical note + * + * @param textPersonNameAnnotationRequest (optional) + * @return Success (status code 200) + * or Invalid request (status code 400) + * or The request cannot be fulfilled due to an unexpected server error (status code 500) + */ + @ApiOperation(value = "Annotate person names in a clinical note", nickname = "createTextPersonNameAnnotations", notes = "Return the person name annotations found in a clinical note", response = TextPersonNameAnnotationResponse.class, tags={ "TextPersonNameAnnotation", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = TextPersonNameAnnotationResponse.class), + @ApiResponse(code = 400, message = "Invalid request", response = Error.class), + @ApiResponse(code = 500, message = "The request cannot be fulfilled due to an unexpected server error", response = Error.class) }) + @PostMapping( + value = "/textPersonNameAnnotations", + produces = { "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity createTextPersonNameAnnotations(@ApiParam(value = "" ) @Valid @RequestBody(required = false) TextPersonNameAnnotationRequest textPersonNameAnnotationRequest) { + String text = textPersonNameAnnotationRequest.getNote().getText(); + List annotations = new PersonNameAnnotator() + .annotate(text); + TextPersonNameAnnotationResponse res = new TextPersonNameAnnotationResponse() + .textPersonNameAnnotations(annotations); + + return new ResponseEntity(res, HttpStatus.OK); + } + +} diff --git a/server/src/main/java/org/openapitools/api/TextPersonNameAnnotationsApiController.java b/server/src/main/java/org/openapitools/api/TextPersonNameAnnotationsApiController.java new file mode 100644 index 0000000..fba2ac4 --- /dev/null +++ b/server/src/main/java/org/openapitools/api/TextPersonNameAnnotationsApiController.java @@ -0,0 +1,24 @@ +package org.openapitools.api; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.context.request.NativeWebRequest; +import java.util.Optional; +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +@Controller +@RequestMapping("${openapi.nLPSandboxPHIAnnotator.base-path:/api/v1}") +public class TextPersonNameAnnotationsApiController implements TextPersonNameAnnotationsApi { + + private final NativeWebRequest request; + + @org.springframework.beans.factory.annotation.Autowired + public TextPersonNameAnnotationsApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/server/src/main/java/org/openapitools/api/ToolApi.java b/server/src/main/java/org/openapitools/api/ToolApi.java index fae60e6..9c6ea85 100644 --- a/server/src/main/java/org/openapitools/api/ToolApi.java +++ b/server/src/main/java/org/openapitools/api/ToolApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.0.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.1.1). * https://openapi-generator.tech * Do not edit the class manually. */ @@ -15,7 +15,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; -import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.*; import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.multipart.MultipartFile; diff --git a/server/src/main/java/org/openapitools/api/ToolApiController.java b/server/src/main/java/org/openapitools/api/ToolApiController.java index 11627b5..b3397ab 100644 --- a/server/src/main/java/org/openapitools/api/ToolApiController.java +++ b/server/src/main/java/org/openapitools/api/ToolApiController.java @@ -4,9 +4,9 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.context.request.NativeWebRequest; import java.util.Optional; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-02-25T15:53:35.186246-08:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") @Controller -@RequestMapping("${openapi.nLPSandboxDateAnnotator.base-path:/api/v1}") +@RequestMapping("${openapi.nLPSandboxPHIAnnotator.base-path:/api/v1}") public class ToolApiController implements ToolApi { private final NativeWebRequest request; diff --git a/server/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/server/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java index ac8ee8a..198dadb 100644 --- a/server/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +++ b/server/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java @@ -17,15 +17,14 @@ import javax.servlet.ServletContext; -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-20T21:46:49.832722-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") @Configuration @EnableSwagger2 public class OpenAPIDocumentationConfig { ApiInfo apiInfo() { return new ApiInfoBuilder() - .title("NLP Sandbox Date Annotator API") - .description("") + .title("NLP Sandbox PHI Annotator API") .license("Apache 2.0") .licenseUrl("https://github.com/nlpsandbox/nlpsandbox-schemas/blob/main/LICENSE") .termsOfServiceUrl("https://nlpsandbox.io") @@ -35,7 +34,7 @@ ApiInfo apiInfo() { } @Bean - public Docket customImplementation(ServletContext servletContext, @Value("${openapi.nLPSandboxDateAnnotator.base-path:/api/v1}") String basePath) { + public Docket customImplementation(ServletContext servletContext, @Value("${openapi.nLPSandboxPHIAnnotator.base-path:/api/v1}") String basePath) { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) diff --git a/server/src/main/java/org/openapitools/model/Error.java b/server/src/main/java/org/openapitools/model/Error.java index b24f646..aba9533 100644 --- a/server/src/main/java/org/openapitools/model/Error.java +++ b/server/src/main/java/org/openapitools/model/Error.java @@ -13,7 +13,7 @@ * Problem details (tools.ietf.org/html/rfc7807) */ @ApiModel(description = "Problem details (tools.ietf.org/html/rfc7807)") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class Error { @JsonProperty("title") private String title; diff --git a/server/src/main/java/org/openapitools/model/HealthCheck.java b/server/src/main/java/org/openapitools/model/HealthCheck.java index baca701..c988382 100644 --- a/server/src/main/java/org/openapitools/model/HealthCheck.java +++ b/server/src/main/java/org/openapitools/model/HealthCheck.java @@ -14,7 +14,7 @@ * Represents the health of a service */ @ApiModel(description = "Represents the health of a service") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class HealthCheck { /** * Indicates whether the service status is acceptable or not diff --git a/server/src/main/java/org/openapitools/model/Note.java b/server/src/main/java/org/openapitools/model/Note.java index cece859..a77d265 100644 --- a/server/src/main/java/org/openapitools/model/Note.java +++ b/server/src/main/java/org/openapitools/model/Note.java @@ -13,7 +13,7 @@ * A clinical note */ @ApiModel(description = "A clinical note") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class Note { @JsonProperty("identifier") private String identifier; diff --git a/server/src/main/java/org/openapitools/model/TextAnnotation.java b/server/src/main/java/org/openapitools/model/TextAnnotation.java index a79d57f..3169278 100644 --- a/server/src/main/java/org/openapitools/model/TextAnnotation.java +++ b/server/src/main/java/org/openapitools/model/TextAnnotation.java @@ -13,7 +13,7 @@ * An annotation in a text */ @ApiModel(description = "An annotation in a text") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class TextAnnotation { @JsonProperty("start") private Integer start; diff --git a/server/src/main/java/org/openapitools/model/TextContactAnnotation.java b/server/src/main/java/org/openapitools/model/TextContactAnnotation.java new file mode 100644 index 0000000..1f680c5 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextContactAnnotation.java @@ -0,0 +1,233 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.TextAnnotation; +import org.openapitools.model.TextContactAnnotationAllOf; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A contact annotation in a text + */ +@ApiModel(description = "A contact annotation in a text") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextContactAnnotation { + @JsonProperty("start") + private Integer start; + + @JsonProperty("length") + private Integer length; + + @JsonProperty("text") + private String text; + + @JsonProperty("confidence") + private Float confidence; + + /** + * Type of contact information + */ + public enum ContactTypeEnum { + EMAIL("email"), + + FAX("fax"), + + IP_ADDRESS("ip_address"), + + PHONE("phone"), + + URL("url"), + + OTHER("other"); + + private String value; + + ContactTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ContactTypeEnum fromValue(String value) { + for (ContactTypeEnum b : ContactTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("contactType") + private ContactTypeEnum contactType; + + public TextContactAnnotation start(Integer start) { + this.start = start; + return this; + } + + /** + * The position of the first character + * @return start + */ + @ApiModelProperty(required = true, value = "The position of the first character") + @NotNull + + + public Integer getStart() { + return start; + } + + public void setStart(Integer start) { + this.start = start; + } + + public TextContactAnnotation length(Integer length) { + this.length = length; + return this; + } + + /** + * The length of the annotation + * @return length + */ + @ApiModelProperty(required = true, value = "The length of the annotation") + @NotNull + + + public Integer getLength() { + return length; + } + + public void setLength(Integer length) { + this.length = length; + } + + public TextContactAnnotation text(String text) { + this.text = text; + return this; + } + + /** + * The string annotated + * @return text + */ + @ApiModelProperty(required = true, value = "The string annotated") + @NotNull + + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public TextContactAnnotation confidence(Float confidence) { + this.confidence = confidence; + return this; + } + + /** + * The confidence in the accuracy of the annotation + * minimum: 0 + * maximum: 100 + * @return confidence + */ + @ApiModelProperty(required = true, value = "The confidence in the accuracy of the annotation") + @NotNull + +@DecimalMin("0") @DecimalMax("100") + public Float getConfidence() { + return confidence; + } + + public void setConfidence(Float confidence) { + this.confidence = confidence; + } + + public TextContactAnnotation contactType(ContactTypeEnum contactType) { + this.contactType = contactType; + return this; + } + + /** + * Type of contact information + * @return contactType + */ + @ApiModelProperty(required = true, value = "Type of contact information") + @NotNull + + + public ContactTypeEnum getContactType() { + return contactType; + } + + public void setContactType(ContactTypeEnum contactType) { + this.contactType = contactType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextContactAnnotation textContactAnnotation = (TextContactAnnotation) o; + return Objects.equals(this.start, textContactAnnotation.start) && + Objects.equals(this.length, textContactAnnotation.length) && + Objects.equals(this.text, textContactAnnotation.text) && + Objects.equals(this.confidence, textContactAnnotation.confidence) && + Objects.equals(this.contactType, textContactAnnotation.contactType); + } + + @Override + public int hashCode() { + return Objects.hash(start, length, text, confidence, contactType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextContactAnnotation {\n"); + + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" length: ").append(toIndentedString(length)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); + sb.append(" contactType: ").append(toIndentedString(contactType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextContactAnnotationAllOf.java b/server/src/main/java/org/openapitools/model/TextContactAnnotationAllOf.java new file mode 100644 index 0000000..cc33ac2 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextContactAnnotationAllOf.java @@ -0,0 +1,124 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * TextContactAnnotationAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextContactAnnotationAllOf { + /** + * Type of contact information + */ + public enum ContactTypeEnum { + EMAIL("email"), + + FAX("fax"), + + IP_ADDRESS("ip_address"), + + PHONE("phone"), + + URL("url"), + + OTHER("other"); + + private String value; + + ContactTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ContactTypeEnum fromValue(String value) { + for (ContactTypeEnum b : ContactTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("contactType") + private ContactTypeEnum contactType; + + public TextContactAnnotationAllOf contactType(ContactTypeEnum contactType) { + this.contactType = contactType; + return this; + } + + /** + * Type of contact information + * @return contactType + */ + @ApiModelProperty(required = true, value = "Type of contact information") + @NotNull + + + public ContactTypeEnum getContactType() { + return contactType; + } + + public void setContactType(ContactTypeEnum contactType) { + this.contactType = contactType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextContactAnnotationAllOf textContactAnnotationAllOf = (TextContactAnnotationAllOf) o; + return Objects.equals(this.contactType, textContactAnnotationAllOf.contactType); + } + + @Override + public int hashCode() { + return Objects.hash(contactType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextContactAnnotationAllOf {\n"); + + sb.append(" contactType: ").append(toIndentedString(contactType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextContactAnnotationRequest.java b/server/src/main/java/org/openapitools/model/TextContactAnnotationRequest.java new file mode 100644 index 0000000..9a79ede --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextContactAnnotationRequest.java @@ -0,0 +1,83 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Note; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A request to annotate contacts in a clinical note + */ +@ApiModel(description = "A request to annotate contacts in a clinical note") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextContactAnnotationRequest { + @JsonProperty("note") + private Note note; + + public TextContactAnnotationRequest note(Note note) { + this.note = note; + return this; + } + + /** + * Get note + * @return note + */ + @ApiModelProperty(required = true, value = "") + @NotNull + + @Valid + + public Note getNote() { + return note; + } + + public void setNote(Note note) { + this.note = note; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextContactAnnotationRequest textContactAnnotationRequest = (TextContactAnnotationRequest) o; + return Objects.equals(this.note, textContactAnnotationRequest.note); + } + + @Override + public int hashCode() { + return Objects.hash(note); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextContactAnnotationRequest {\n"); + + sb.append(" note: ").append(toIndentedString(note)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextContactAnnotationResponse.java b/server/src/main/java/org/openapitools/model/TextContactAnnotationResponse.java new file mode 100644 index 0000000..fb42f69 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextContactAnnotationResponse.java @@ -0,0 +1,91 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.TextContactAnnotation; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * The response to a contact annotation request + */ +@ApiModel(description = "The response to a contact annotation request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextContactAnnotationResponse { + @JsonProperty("textContactAnnotations") + @Valid + private List textContactAnnotations = new ArrayList<>(); + + public TextContactAnnotationResponse textContactAnnotations(List textContactAnnotations) { + this.textContactAnnotations = textContactAnnotations; + return this; + } + + public TextContactAnnotationResponse addTextContactAnnotationsItem(TextContactAnnotation textContactAnnotationsItem) { + this.textContactAnnotations.add(textContactAnnotationsItem); + return this; + } + + /** + * A list of contact annotations + * @return textContactAnnotations + */ + @ApiModelProperty(required = true, value = "A list of contact annotations") + @NotNull + + @Valid + + public List getTextContactAnnotations() { + return textContactAnnotations; + } + + public void setTextContactAnnotations(List textContactAnnotations) { + this.textContactAnnotations = textContactAnnotations; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextContactAnnotationResponse textContactAnnotationResponse = (TextContactAnnotationResponse) o; + return Objects.equals(this.textContactAnnotations, textContactAnnotationResponse.textContactAnnotations); + } + + @Override + public int hashCode() { + return Objects.hash(textContactAnnotations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextContactAnnotationResponse {\n"); + + sb.append(" textContactAnnotations: ").append(toIndentedString(textContactAnnotations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextDateAnnotation.java b/server/src/main/java/org/openapitools/model/TextDateAnnotation.java index 9be1d03..0314fff 100644 --- a/server/src/main/java/org/openapitools/model/TextDateAnnotation.java +++ b/server/src/main/java/org/openapitools/model/TextDateAnnotation.java @@ -15,7 +15,7 @@ * A date annotation in a text */ @ApiModel(description = "A date annotation in a text") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class TextDateAnnotation { @JsonProperty("start") private Integer start; diff --git a/server/src/main/java/org/openapitools/model/TextDateAnnotationAllOf.java b/server/src/main/java/org/openapitools/model/TextDateAnnotationAllOf.java index 7d5a1e8..a6804dc 100644 --- a/server/src/main/java/org/openapitools/model/TextDateAnnotationAllOf.java +++ b/server/src/main/java/org/openapitools/model/TextDateAnnotationAllOf.java @@ -12,7 +12,7 @@ /** * TextDateAnnotationAllOf */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class TextDateAnnotationAllOf { @JsonProperty("dateFormat") private String dateFormat; diff --git a/server/src/main/java/org/openapitools/model/TextDateAnnotationRequest.java b/server/src/main/java/org/openapitools/model/TextDateAnnotationRequest.java index 8b87791..02fb949 100644 --- a/server/src/main/java/org/openapitools/model/TextDateAnnotationRequest.java +++ b/server/src/main/java/org/openapitools/model/TextDateAnnotationRequest.java @@ -14,7 +14,7 @@ * A request to annotate dates in a clinical note */ @ApiModel(description = "A request to annotate dates in a clinical note") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class TextDateAnnotationRequest { @JsonProperty("note") private Note note; diff --git a/server/src/main/java/org/openapitools/model/TextDateAnnotationResponse.java b/server/src/main/java/org/openapitools/model/TextDateAnnotationResponse.java index 7a277cb..816f80b 100644 --- a/server/src/main/java/org/openapitools/model/TextDateAnnotationResponse.java +++ b/server/src/main/java/org/openapitools/model/TextDateAnnotationResponse.java @@ -16,7 +16,7 @@ * The response to a dates annotation request */ @ApiModel(description = "The response to a dates annotation request") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-02T14:41:13.852686-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class TextDateAnnotationResponse { @JsonProperty("textDateAnnotations") @Valid diff --git a/server/src/main/java/org/openapitools/model/TextIdAnnotation.java b/server/src/main/java/org/openapitools/model/TextIdAnnotation.java new file mode 100644 index 0000000..c1cf982 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextIdAnnotation.java @@ -0,0 +1,241 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.TextAnnotation; +import org.openapitools.model.TextIdAnnotationAllOf; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * An ID annotation in a text + */ +@ApiModel(description = "An ID annotation in a text") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextIdAnnotation { + @JsonProperty("start") + private Integer start; + + @JsonProperty("length") + private Integer length; + + @JsonProperty("text") + private String text; + + @JsonProperty("confidence") + private Float confidence; + + /** + * Type of ID information + */ + public enum IdTypeEnum { + ACCOUNT("account"), + + BIO_ID("bio_id"), + + DEVICE("device"), + + HEALTH_PLAN("health_plan"), + + ID_NUMBER("id_number"), + + LICENSE("license"), + + MEDICAL_RECORD("medical_record"), + + SSN("ssn"), + + VEHICLE("vehicle"), + + OTHER("other"); + + private String value; + + IdTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IdTypeEnum fromValue(String value) { + for (IdTypeEnum b : IdTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("idType") + private IdTypeEnum idType; + + public TextIdAnnotation start(Integer start) { + this.start = start; + return this; + } + + /** + * The position of the first character + * @return start + */ + @ApiModelProperty(required = true, value = "The position of the first character") + @NotNull + + + public Integer getStart() { + return start; + } + + public void setStart(Integer start) { + this.start = start; + } + + public TextIdAnnotation length(Integer length) { + this.length = length; + return this; + } + + /** + * The length of the annotation + * @return length + */ + @ApiModelProperty(required = true, value = "The length of the annotation") + @NotNull + + + public Integer getLength() { + return length; + } + + public void setLength(Integer length) { + this.length = length; + } + + public TextIdAnnotation text(String text) { + this.text = text; + return this; + } + + /** + * The string annotated + * @return text + */ + @ApiModelProperty(required = true, value = "The string annotated") + @NotNull + + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public TextIdAnnotation confidence(Float confidence) { + this.confidence = confidence; + return this; + } + + /** + * The confidence in the accuracy of the annotation + * minimum: 0 + * maximum: 100 + * @return confidence + */ + @ApiModelProperty(required = true, value = "The confidence in the accuracy of the annotation") + @NotNull + +@DecimalMin("0") @DecimalMax("100") + public Float getConfidence() { + return confidence; + } + + public void setConfidence(Float confidence) { + this.confidence = confidence; + } + + public TextIdAnnotation idType(IdTypeEnum idType) { + this.idType = idType; + return this; + } + + /** + * Type of ID information + * @return idType + */ + @ApiModelProperty(required = true, value = "Type of ID information") + @NotNull + + + public IdTypeEnum getIdType() { + return idType; + } + + public void setIdType(IdTypeEnum idType) { + this.idType = idType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextIdAnnotation textIdAnnotation = (TextIdAnnotation) o; + return Objects.equals(this.start, textIdAnnotation.start) && + Objects.equals(this.length, textIdAnnotation.length) && + Objects.equals(this.text, textIdAnnotation.text) && + Objects.equals(this.confidence, textIdAnnotation.confidence) && + Objects.equals(this.idType, textIdAnnotation.idType); + } + + @Override + public int hashCode() { + return Objects.hash(start, length, text, confidence, idType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextIdAnnotation {\n"); + + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" length: ").append(toIndentedString(length)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); + sb.append(" idType: ").append(toIndentedString(idType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextIdAnnotationAllOf.java b/server/src/main/java/org/openapitools/model/TextIdAnnotationAllOf.java new file mode 100644 index 0000000..84661e2 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextIdAnnotationAllOf.java @@ -0,0 +1,132 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * TextIdAnnotationAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextIdAnnotationAllOf { + /** + * Type of ID information + */ + public enum IdTypeEnum { + ACCOUNT("account"), + + BIO_ID("bio_id"), + + DEVICE("device"), + + HEALTH_PLAN("health_plan"), + + ID_NUMBER("id_number"), + + LICENSE("license"), + + MEDICAL_RECORD("medical_record"), + + SSN("ssn"), + + VEHICLE("vehicle"), + + OTHER("other"); + + private String value; + + IdTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static IdTypeEnum fromValue(String value) { + for (IdTypeEnum b : IdTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("idType") + private IdTypeEnum idType; + + public TextIdAnnotationAllOf idType(IdTypeEnum idType) { + this.idType = idType; + return this; + } + + /** + * Type of ID information + * @return idType + */ + @ApiModelProperty(required = true, value = "Type of ID information") + @NotNull + + + public IdTypeEnum getIdType() { + return idType; + } + + public void setIdType(IdTypeEnum idType) { + this.idType = idType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextIdAnnotationAllOf textIdAnnotationAllOf = (TextIdAnnotationAllOf) o; + return Objects.equals(this.idType, textIdAnnotationAllOf.idType); + } + + @Override + public int hashCode() { + return Objects.hash(idType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextIdAnnotationAllOf {\n"); + + sb.append(" idType: ").append(toIndentedString(idType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextIdAnnotationRequest.java b/server/src/main/java/org/openapitools/model/TextIdAnnotationRequest.java new file mode 100644 index 0000000..01c78d7 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextIdAnnotationRequest.java @@ -0,0 +1,83 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Note; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A request to annotate IDs in a clinical note + */ +@ApiModel(description = "A request to annotate IDs in a clinical note") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextIdAnnotationRequest { + @JsonProperty("note") + private Note note; + + public TextIdAnnotationRequest note(Note note) { + this.note = note; + return this; + } + + /** + * Get note + * @return note + */ + @ApiModelProperty(required = true, value = "") + @NotNull + + @Valid + + public Note getNote() { + return note; + } + + public void setNote(Note note) { + this.note = note; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextIdAnnotationRequest textIdAnnotationRequest = (TextIdAnnotationRequest) o; + return Objects.equals(this.note, textIdAnnotationRequest.note); + } + + @Override + public int hashCode() { + return Objects.hash(note); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextIdAnnotationRequest {\n"); + + sb.append(" note: ").append(toIndentedString(note)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextIdAnnotationResponse.java b/server/src/main/java/org/openapitools/model/TextIdAnnotationResponse.java new file mode 100644 index 0000000..54f6d67 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextIdAnnotationResponse.java @@ -0,0 +1,91 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.TextIdAnnotation; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * The response to an ID annotation request + */ +@ApiModel(description = "The response to an ID annotation request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextIdAnnotationResponse { + @JsonProperty("textIdAnnotations") + @Valid + private List textIdAnnotations = new ArrayList<>(); + + public TextIdAnnotationResponse textIdAnnotations(List textIdAnnotations) { + this.textIdAnnotations = textIdAnnotations; + return this; + } + + public TextIdAnnotationResponse addTextIdAnnotationsItem(TextIdAnnotation textIdAnnotationsItem) { + this.textIdAnnotations.add(textIdAnnotationsItem); + return this; + } + + /** + * A list of ID annotations + * @return textIdAnnotations + */ + @ApiModelProperty(required = true, value = "A list of ID annotations") + @NotNull + + @Valid + + public List getTextIdAnnotations() { + return textIdAnnotations; + } + + public void setTextIdAnnotations(List textIdAnnotations) { + this.textIdAnnotations = textIdAnnotations; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextIdAnnotationResponse textIdAnnotationResponse = (TextIdAnnotationResponse) o; + return Objects.equals(this.textIdAnnotations, textIdAnnotationResponse.textIdAnnotations); + } + + @Override + public int hashCode() { + return Objects.hash(textIdAnnotations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextIdAnnotationResponse {\n"); + + sb.append(" textIdAnnotations: ").append(toIndentedString(textIdAnnotations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextLocationAnnotation.java b/server/src/main/java/org/openapitools/model/TextLocationAnnotation.java new file mode 100644 index 0000000..a8e575e --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextLocationAnnotation.java @@ -0,0 +1,241 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.TextAnnotation; +import org.openapitools.model.TextLocationAnnotationAllOf; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A location annotation in a text + */ +@ApiModel(description = "A location annotation in a text") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextLocationAnnotation { + @JsonProperty("start") + private Integer start; + + @JsonProperty("length") + private Integer length; + + @JsonProperty("text") + private String text; + + @JsonProperty("confidence") + private Float confidence; + + /** + * Type of location + */ + public enum LocationTypeEnum { + CITY("city"), + + COUNTRY("country"), + + DEPARTMENT("department"), + + HOSPITAL("hospital"), + + ORGANIZATION("organization"), + + OTHER("other"), + + ROOM("room"), + + STATE("state"), + + STREET("street"), + + ZIP("zip"); + + private String value; + + LocationTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LocationTypeEnum fromValue(String value) { + for (LocationTypeEnum b : LocationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("locationType") + private LocationTypeEnum locationType; + + public TextLocationAnnotation start(Integer start) { + this.start = start; + return this; + } + + /** + * The position of the first character + * @return start + */ + @ApiModelProperty(required = true, value = "The position of the first character") + @NotNull + + + public Integer getStart() { + return start; + } + + public void setStart(Integer start) { + this.start = start; + } + + public TextLocationAnnotation length(Integer length) { + this.length = length; + return this; + } + + /** + * The length of the annotation + * @return length + */ + @ApiModelProperty(required = true, value = "The length of the annotation") + @NotNull + + + public Integer getLength() { + return length; + } + + public void setLength(Integer length) { + this.length = length; + } + + public TextLocationAnnotation text(String text) { + this.text = text; + return this; + } + + /** + * The string annotated + * @return text + */ + @ApiModelProperty(required = true, value = "The string annotated") + @NotNull + + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public TextLocationAnnotation confidence(Float confidence) { + this.confidence = confidence; + return this; + } + + /** + * The confidence in the accuracy of the annotation + * minimum: 0 + * maximum: 100 + * @return confidence + */ + @ApiModelProperty(required = true, value = "The confidence in the accuracy of the annotation") + @NotNull + +@DecimalMin("0") @DecimalMax("100") + public Float getConfidence() { + return confidence; + } + + public void setConfidence(Float confidence) { + this.confidence = confidence; + } + + public TextLocationAnnotation locationType(LocationTypeEnum locationType) { + this.locationType = locationType; + return this; + } + + /** + * Type of location + * @return locationType + */ + @ApiModelProperty(required = true, value = "Type of location") + @NotNull + + + public LocationTypeEnum getLocationType() { + return locationType; + } + + public void setLocationType(LocationTypeEnum locationType) { + this.locationType = locationType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextLocationAnnotation textLocationAnnotation = (TextLocationAnnotation) o; + return Objects.equals(this.start, textLocationAnnotation.start) && + Objects.equals(this.length, textLocationAnnotation.length) && + Objects.equals(this.text, textLocationAnnotation.text) && + Objects.equals(this.confidence, textLocationAnnotation.confidence) && + Objects.equals(this.locationType, textLocationAnnotation.locationType); + } + + @Override + public int hashCode() { + return Objects.hash(start, length, text, confidence, locationType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextLocationAnnotation {\n"); + + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" length: ").append(toIndentedString(length)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); + sb.append(" locationType: ").append(toIndentedString(locationType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextLocationAnnotationAllOf.java b/server/src/main/java/org/openapitools/model/TextLocationAnnotationAllOf.java new file mode 100644 index 0000000..cefc77a --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextLocationAnnotationAllOf.java @@ -0,0 +1,132 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * TextLocationAnnotationAllOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextLocationAnnotationAllOf { + /** + * Type of location + */ + public enum LocationTypeEnum { + CITY("city"), + + COUNTRY("country"), + + DEPARTMENT("department"), + + HOSPITAL("hospital"), + + ORGANIZATION("organization"), + + OTHER("other"), + + ROOM("room"), + + STATE("state"), + + STREET("street"), + + ZIP("zip"); + + private String value; + + LocationTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LocationTypeEnum fromValue(String value) { + for (LocationTypeEnum b : LocationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @JsonProperty("locationType") + private LocationTypeEnum locationType; + + public TextLocationAnnotationAllOf locationType(LocationTypeEnum locationType) { + this.locationType = locationType; + return this; + } + + /** + * Type of location + * @return locationType + */ + @ApiModelProperty(required = true, value = "Type of location") + @NotNull + + + public LocationTypeEnum getLocationType() { + return locationType; + } + + public void setLocationType(LocationTypeEnum locationType) { + this.locationType = locationType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextLocationAnnotationAllOf textLocationAnnotationAllOf = (TextLocationAnnotationAllOf) o; + return Objects.equals(this.locationType, textLocationAnnotationAllOf.locationType); + } + + @Override + public int hashCode() { + return Objects.hash(locationType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextLocationAnnotationAllOf {\n"); + + sb.append(" locationType: ").append(toIndentedString(locationType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextLocationAnnotationRequest.java b/server/src/main/java/org/openapitools/model/TextLocationAnnotationRequest.java new file mode 100644 index 0000000..a7fa08d --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextLocationAnnotationRequest.java @@ -0,0 +1,83 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Note; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A request to annotate locations in a clinical note + */ +@ApiModel(description = "A request to annotate locations in a clinical note") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextLocationAnnotationRequest { + @JsonProperty("note") + private Note note; + + public TextLocationAnnotationRequest note(Note note) { + this.note = note; + return this; + } + + /** + * Get note + * @return note + */ + @ApiModelProperty(required = true, value = "") + @NotNull + + @Valid + + public Note getNote() { + return note; + } + + public void setNote(Note note) { + this.note = note; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextLocationAnnotationRequest textLocationAnnotationRequest = (TextLocationAnnotationRequest) o; + return Objects.equals(this.note, textLocationAnnotationRequest.note); + } + + @Override + public int hashCode() { + return Objects.hash(note); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextLocationAnnotationRequest {\n"); + + sb.append(" note: ").append(toIndentedString(note)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextLocationAnnotationResponse.java b/server/src/main/java/org/openapitools/model/TextLocationAnnotationResponse.java new file mode 100644 index 0000000..e7ad15c --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextLocationAnnotationResponse.java @@ -0,0 +1,91 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.TextLocationAnnotation; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * The response to a locations annotation request + */ +@ApiModel(description = "The response to a locations annotation request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextLocationAnnotationResponse { + @JsonProperty("textLocationAnnotations") + @Valid + private List textLocationAnnotations = new ArrayList<>(); + + public TextLocationAnnotationResponse textLocationAnnotations(List textLocationAnnotations) { + this.textLocationAnnotations = textLocationAnnotations; + return this; + } + + public TextLocationAnnotationResponse addTextLocationAnnotationsItem(TextLocationAnnotation textLocationAnnotationsItem) { + this.textLocationAnnotations.add(textLocationAnnotationsItem); + return this; + } + + /** + * A list of location annotations + * @return textLocationAnnotations + */ + @ApiModelProperty(required = true, value = "A list of location annotations") + @NotNull + + @Valid + + public List getTextLocationAnnotations() { + return textLocationAnnotations; + } + + public void setTextLocationAnnotations(List textLocationAnnotations) { + this.textLocationAnnotations = textLocationAnnotations; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextLocationAnnotationResponse textLocationAnnotationResponse = (TextLocationAnnotationResponse) o; + return Objects.equals(this.textLocationAnnotations, textLocationAnnotationResponse.textLocationAnnotations); + } + + @Override + public int hashCode() { + return Objects.hash(textLocationAnnotations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextLocationAnnotationResponse {\n"); + + sb.append(" textLocationAnnotations: ").append(toIndentedString(textLocationAnnotations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextPersonNameAnnotation.java b/server/src/main/java/org/openapitools/model/TextPersonNameAnnotation.java new file mode 100644 index 0000000..d94b3b8 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextPersonNameAnnotation.java @@ -0,0 +1,162 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.TextAnnotation; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A person name annotation in a text + */ +@ApiModel(description = "A person name annotation in a text") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextPersonNameAnnotation { + @JsonProperty("start") + private Integer start; + + @JsonProperty("length") + private Integer length; + + @JsonProperty("text") + private String text; + + @JsonProperty("confidence") + private Float confidence; + + public TextPersonNameAnnotation start(Integer start) { + this.start = start; + return this; + } + + /** + * The position of the first character + * @return start + */ + @ApiModelProperty(required = true, value = "The position of the first character") + @NotNull + + + public Integer getStart() { + return start; + } + + public void setStart(Integer start) { + this.start = start; + } + + public TextPersonNameAnnotation length(Integer length) { + this.length = length; + return this; + } + + /** + * The length of the annotation + * @return length + */ + @ApiModelProperty(required = true, value = "The length of the annotation") + @NotNull + + + public Integer getLength() { + return length; + } + + public void setLength(Integer length) { + this.length = length; + } + + public TextPersonNameAnnotation text(String text) { + this.text = text; + return this; + } + + /** + * The string annotated + * @return text + */ + @ApiModelProperty(required = true, value = "The string annotated") + @NotNull + + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public TextPersonNameAnnotation confidence(Float confidence) { + this.confidence = confidence; + return this; + } + + /** + * The confidence in the accuracy of the annotation + * minimum: 0 + * maximum: 100 + * @return confidence + */ + @ApiModelProperty(required = true, value = "The confidence in the accuracy of the annotation") + @NotNull + +@DecimalMin("0") @DecimalMax("100") + public Float getConfidence() { + return confidence; + } + + public void setConfidence(Float confidence) { + this.confidence = confidence; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextPersonNameAnnotation textPersonNameAnnotation = (TextPersonNameAnnotation) o; + return Objects.equals(this.start, textPersonNameAnnotation.start) && + Objects.equals(this.length, textPersonNameAnnotation.length) && + Objects.equals(this.text, textPersonNameAnnotation.text) && + Objects.equals(this.confidence, textPersonNameAnnotation.confidence); + } + + @Override + public int hashCode() { + return Objects.hash(start, length, text, confidence); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextPersonNameAnnotation {\n"); + + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" length: ").append(toIndentedString(length)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextPersonNameAnnotationRequest.java b/server/src/main/java/org/openapitools/model/TextPersonNameAnnotationRequest.java new file mode 100644 index 0000000..6e10c74 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextPersonNameAnnotationRequest.java @@ -0,0 +1,83 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Note; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * A request to annotate person names in a clinical note + */ +@ApiModel(description = "A request to annotate person names in a clinical note") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextPersonNameAnnotationRequest { + @JsonProperty("note") + private Note note; + + public TextPersonNameAnnotationRequest note(Note note) { + this.note = note; + return this; + } + + /** + * Get note + * @return note + */ + @ApiModelProperty(required = true, value = "") + @NotNull + + @Valid + + public Note getNote() { + return note; + } + + public void setNote(Note note) { + this.note = note; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextPersonNameAnnotationRequest textPersonNameAnnotationRequest = (TextPersonNameAnnotationRequest) o; + return Objects.equals(this.note, textPersonNameAnnotationRequest.note); + } + + @Override + public int hashCode() { + return Objects.hash(note); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextPersonNameAnnotationRequest {\n"); + + sb.append(" note: ").append(toIndentedString(note)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/TextPersonNameAnnotationResponse.java b/server/src/main/java/org/openapitools/model/TextPersonNameAnnotationResponse.java new file mode 100644 index 0000000..88e4214 --- /dev/null +++ b/server/src/main/java/org/openapitools/model/TextPersonNameAnnotationResponse.java @@ -0,0 +1,91 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.model.TextPersonNameAnnotation; +import org.openapitools.jackson.nullable.JsonNullable; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * The response to a person names annotation request + */ +@ApiModel(description = "The response to a person names annotation request") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") +public class TextPersonNameAnnotationResponse { + @JsonProperty("textPersonNameAnnotations") + @Valid + private List textPersonNameAnnotations = new ArrayList<>(); + + public TextPersonNameAnnotationResponse textPersonNameAnnotations(List textPersonNameAnnotations) { + this.textPersonNameAnnotations = textPersonNameAnnotations; + return this; + } + + public TextPersonNameAnnotationResponse addTextPersonNameAnnotationsItem(TextPersonNameAnnotation textPersonNameAnnotationsItem) { + this.textPersonNameAnnotations.add(textPersonNameAnnotationsItem); + return this; + } + + /** + * A list of person name annotations + * @return textPersonNameAnnotations + */ + @ApiModelProperty(required = true, value = "A list of person name annotations") + @NotNull + + @Valid + + public List getTextPersonNameAnnotations() { + return textPersonNameAnnotations; + } + + public void setTextPersonNameAnnotations(List textPersonNameAnnotations) { + this.textPersonNameAnnotations = textPersonNameAnnotations; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextPersonNameAnnotationResponse textPersonNameAnnotationResponse = (TextPersonNameAnnotationResponse) o; + return Objects.equals(this.textPersonNameAnnotations, textPersonNameAnnotationResponse.textPersonNameAnnotations); + } + + @Override + public int hashCode() { + return Objects.hash(textPersonNameAnnotations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextPersonNameAnnotationResponse {\n"); + + sb.append(" textPersonNameAnnotations: ").append(toIndentedString(textPersonNameAnnotations)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/server/src/main/java/org/openapitools/model/Tool.java b/server/src/main/java/org/openapitools/model/Tool.java index 8ac0145..9701937 100644 --- a/server/src/main/java/org/openapitools/model/Tool.java +++ b/server/src/main/java/org/openapitools/model/Tool.java @@ -16,7 +16,7 @@ * Information about an NLP tool */ @ApiModel(description = "Information about an NLP tool") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-20T21:46:49.832722-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class Tool { @JsonProperty("name") private String name; diff --git a/server/src/main/java/org/openapitools/model/ToolDependencies.java b/server/src/main/java/org/openapitools/model/ToolDependencies.java index 01016ec..1edd5a7 100644 --- a/server/src/main/java/org/openapitools/model/ToolDependencies.java +++ b/server/src/main/java/org/openapitools/model/ToolDependencies.java @@ -16,7 +16,7 @@ * A list of tool dependencies */ @ApiModel(description = "A list of tool dependencies") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-06-20T21:46:49.832722-07:00[America/Los_Angeles]") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2021-08-11T13:52:26.252409-07:00[America/Los_Angeles]") public class ToolDependencies { @JsonProperty("tools") @Valid