diff --git a/opencga-app/app/analysis/resources/README b/opencga-app/app/analysis/resources/README index fa335694428..ed41c2e6f38 100644 --- a/opencga-app/app/analysis/resources/README +++ b/opencga-app/app/analysis/resources/README @@ -1,55 +1,6 @@ README - -In this folder, users should store external files to be used by some OpenCGA analysis. - -1) roleInCancer.txt[.gz] - -This file is used by interpretation clinical analysis, e.g., Tiering and TEAM analysis. - -It stores those genes which contain mutations that have been casually implicated in cancer. This information can be downloaded -from the Cancer Gene Census (CGC) at https://cancer.sanger.ac.uk/census - -The file consists of two tab-separated columns: the first one contains the gene name, and the second, the role in cancer, i.e.: oncogne, -TSG, fusion. In addition, lines starting with # are considered comments and will be ignored. - -Sample of a roleInCancer file: - -#Gene name Role in Cancer -A1CF oncogene -ABI1 TSG, fusion -ABL1 oncogene, fusion -ABL2 oncogene, fusion -ACKR3 oncogene, fusion -ACSL3 fusion -... -... - - -2) actionableVariants_xxx.txt[.gz] where xxx = assembly, e.g.: grch37 - -This file is used by interpretation clinical analysis, e.g., TEAM analysis. - -It stores variants that were identified as clinically actionable variants. The file consists of the following twelve tab-separated columns: - - Chromosome - - Start - - Stop - - Reference allele - - Alternate allele - - dbSNP ID - - ClinVar Variant ID - - HGVS - - Phenotype list - - Clinical significance - - Review status - - Submitter categories - -In addition, lines starting with # are considered comments and will be ignored. - -Sample fo an actionableVariants file: - -#Chromosome Start Stop ReferenceAllele AlternateAllele dbSNP ID ClinVar Variant ID hgvs PhenotypeList ClinicalSignificance ReviewStatus SubmitterCategories -2 47702269 47702269 C T rs28929483 1753 NM_000251.2(MSH2):c.1865C>T (p.Pro622Leu) Hereditary cancer-predisposing syndrome;Hereditary nonpolyposis colon cancer;Lynch syndrome;Lynch syndrome I Pathogenic reviewed by expert panel 3 -2 47657020 47657020 C T rs63751108 1755 NM_000251.2(MSH2):c.1216C>T (p.Arg406Ter) Carcinoma of colon;Hereditary cancer-predisposing syndrome;Hereditary nonpolyposis colon cancer;Lynch syndrome;Lynch syndrome I;not provided Pathogenic reviewed by expert panel 3 -... -... +This directory is designated for OpenCGA analyses to download the necessary external data. +For instance, during the first Exomiser analysis, the files '2109_hg38.zip' and '2109_phenotype.zip' will be downloaded +from the OpenCGA analysis URL and stored in the 'exomiser' folder within this directory. Subsequent Exomiser analyses will +then access this folder to read these files. diff --git a/opencga-app/app/cloud/docker/opencga-ext-tools/Dockerfile b/opencga-app/app/cloud/docker/opencga-ext-tools/Dockerfile index ff1298c64d0..ab261b25c2f 100644 --- a/opencga-app/app/cloud/docker/opencga-ext-tools/Dockerfile +++ b/opencga-app/app/cloud/docker/opencga-ext-tools/Dockerfile @@ -25,11 +25,11 @@ RUN apt-get update -y && DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" apt WORKDIR /opt/opencga/signature.tools.lib RUN git fetch origin --tags && \ - git checkout tags/v2.4.2 && \ + git checkout tags/v2.4.4 && \ sed -i '/Mmusculus/d' DESCRIPTION && \ sed -i '/Cfamiliaris/d' DESCRIPTION && \ sed -i '/1000genomes/d' DESCRIPTION && \ - R -e 'options(timeout = 300);devtools::install(repos="https://www.stats.bris.ac.uk/R/")' && \ + R -e 'options(timeout = 3600);devtools::install(repos="https://www.stats.bris.ac.uk/R/")' && \ ## Clean up rm -rf /var/lib/apt/lists/* /tmp/* /opt/opencga/signature.tools.lib/.git && \ strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 diff --git a/opencga-app/app/misc/scripts/hadoop-ssh.sh b/opencga-app/app/misc/scripts/hadoop-ssh.sh index c39152339a9..30141a04074 100755 --- a/opencga-app/app/misc/scripts/hadoop-ssh.sh +++ b/opencga-app/app/misc/scripts/hadoop-ssh.sh @@ -1,45 +1,45 @@ #!/usr/bin/env sh -if [ -z ${HADOOP_SSH_USER} ] ; then +if [ -z "${HADOOP_SSH_USER}" ] ; then echo "Undefined HADOOP_SSH_USER" 1>&2 exit 1 fi -if [ -z ${HADOOP_SSH_HOST} ] ; then +if [ -z "${HADOOP_SSH_HOST}" ] ; then echo "Undefined HADOOP_SSH_HOST" 1>&2 exit 1 fi SSHPASS_CMD= -if [ -z ${SSHPASS} ] ; then +if [ -z "${SSHPASS}" ] ; then # If empty, assume ssh-key exists in the system SSHPASS_CMD="" else # If non zero, use sshpass command - SSHPASS_CMD="sshpass -e" + SSHPASS_CMD="sshpass -e " fi SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ServerAliveInterval=60" -if [ ! -z ${HADOOP_SSH_KEY} ] && [ -f ${HADOOP_SSH_KEY} ] ; then +if [ -n "${HADOOP_SSH_KEY}" ] && [ -f "${HADOOP_SSH_KEY}" ] ; then SSH_OPTS="${SSH_OPTS} -i ${HADOOP_SSH_KEY}" fi echo "Connect to Hadoop edge node ${HADOOP_SSH_USER}@${HADOOP_SSH_HOST}" 1>&2 -echo "${SSHPASS_CMD} ssh ${SSH_OPTS} ${HADOOP_SSH_USER}@${HADOOP_SSH_HOST}" 1>&2 +echo "${SSHPASS_CMD}ssh ${SSH_OPTS} ${HADOOP_SSH_USER}@${HADOOP_SSH_HOST}" 1>&2 # Escape args with single quotes CMD= -for arg in $@ ; do +for arg in "$@" ; do # Escape single quote, if any : # arg=`echo $arg | sed "s/'/'\"'\"'/g"` # aaa'aaa --> 'aaa'"'"'aaa' - arg=`echo $arg | sed "s/'/'\\\\\\''/g"` # aaa'aaa --> 'aaa'\''aaa' + arg=$(echo "$arg" | sed "s/'/'\\\\\\''/g") # aaa'aaa --> 'aaa'\''aaa' CMD="${CMD}'${arg}' " done echo ${CMD} -${SSHPASS_CMD} ssh ${SSH_OPTS} ${HADOOP_SSH_USER}@${HADOOP_SSH_HOST} /bin/bash << EOF +${SSHPASS_CMD} ssh ${SSH_OPTS} "${HADOOP_SSH_USER}@${HADOOP_SSH_HOST}" /bin/bash << EOF export HADOOP_CLASSPATH=${HADOOP_CLASSPATH} export HADOOP_USER_CLASSPATH_FIRST=${HADOOP_USER_CLASSPATH_FIRST} diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/CommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/CommandExecutor.java index d4877431f35..cd532449d4e 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/CommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/CommandExecutor.java @@ -17,16 +17,25 @@ package org.opencb.opencga.app.cli; import com.beust.jcommander.JCommander; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.core.config.Configurator; +import org.opencb.commons.datastore.core.ObjectMap; import org.opencb.commons.utils.FileUtils; import org.opencb.commons.utils.PrintUtils; +import org.opencb.opencga.app.cli.main.utils.CommandLineUtils; import org.opencb.opencga.app.cli.session.SessionManager; import org.opencb.opencga.client.config.ClientConfiguration; import org.opencb.opencga.client.exceptions.ClientException; +import org.opencb.opencga.client.rest.OpenCGAClient; import org.opencb.opencga.core.config.Configuration; import org.opencb.opencga.core.config.storage.StorageConfiguration; +import org.opencb.opencga.core.response.RestResponse; +import org.opencb.opencga.server.generator.models.RestCategory; +import org.opencb.opencga.server.generator.models.RestEndpoint; +import org.opencb.opencga.server.generator.models.RestParameter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,6 +45,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.List; /** * Created by imedina on 19/04/16. @@ -281,6 +291,95 @@ public CommandExecutor setSessionManager(SessionManager sessionManager) { return this; } + + public String getObjectAsJSON(String objectCategory, String objectPath, OpenCGAClient openCGAClient) throws Exception { + StringBuilder jsonInString = new StringBuilder("\n"); + try { + ObjectMap queryParams = new ObjectMap(); + queryParams.putIfNotEmpty("category", objectCategory); + RestResponse response = openCGAClient.getMetaClient().api(queryParams); + ObjectMapper jsonObjectMapper = new ObjectMapper(); + for (List list : response.getResponses().get(0).getResults()) { + List categories = jsonObjectMapper.convertValue(list, new TypeReference>() {}); + for (RestCategory category : categories) { + for (RestEndpoint endpoint : category.getEndpoints()) { + if (objectPath.equals(endpoint.getPath())) { + boolean enc = false; + for (RestParameter parameter : endpoint.getParameters()) { + //jsonInString += parameter.getName()+":"+parameter.getAllowedValues()+"\n"; + if (parameter.getData() != null) { + enc = true; + jsonInString.append(printBody(parameter.getData(), "")); + } + } + if (!enc) { + jsonInString.append("No model available"); + } + // + } + } + } + } + } catch (Exception e) { + jsonInString = new StringBuilder("Data model not found."); + CommandLineUtils.error(e); + } + return jsonInString.toString(); + } + + private String printBody(List data, String tabs) { + String res = ""; + res += "{\n"; + String tab = " " + tabs; + for (RestParameter parameter : data) { + if (parameter.getData() == null) { + res += printParameter(parameter, tab); + } else { + res += tab + "\"" +parameter.getName() + "\"" + ": [" + printBody(parameter.getData(), tab) + "],\n"; + } + } + res += tabs + "}"; + return res; + + } + + private String printParameter(RestParameter parameter, String tab) { + + return tab + "\"" + parameter.getName() + "\"" + ":" + printParameterValue(parameter) + ",\n"; + } + + private String printParameterValue(RestParameter parameter) { + + if(!StringUtils.isEmpty(parameter.getAllowedValues())){ + return parameter.getAllowedValues().replace(" ", "|"); + } + switch (parameter.getType()) { + case "Boolean": + case "java.lang.Boolean": + return "false"; + case "Long": + case "Float": + case "Double": + case "Integer": + case "int": + case "double": + case "float": + case "long": + return "0"; + case "List": + return "[\"\"]"; + case "Date": + return "\"dd/mm/yyyy\""; + case "Map": + return "{\"key\": \"value\"}"; + case "String": + return "\"\""; + default: + return "\"-\""; + } + } + + public Logger getLogger() { return logger; } diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java index a39ab4aea61..0f009f6ab08 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpenCgaCompleter.java @@ -1,5 +1,5 @@ /* -* Copyright 2015-2024-03-04 OpenCB +* Copyright 2015-2024-03-06 OpenCB * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public abstract class OpenCgaCompleter implements Completer { .map(Candidate::new) .collect(toList()); - private List clinicalList = asList( "acl-update","annotation-sets-load","clinical-configuration-update","create","distinct","interpretation-distinct","interpretation-search","interpretation-info","interpreter-cancer-tiering-run","interpreter-exomiser-run","interpreter-team-run","interpreter-tiering-run","interpreter-zetta-run","load","rga-aggregation-stats","rga-gene-query","rga-gene-summary","rga-index-run","rga-individual-query","rga-individual-summary","rga-variant-query","rga-variant-summary","search","variant-query","acl","delete","update","annotation-sets-annotations-update","info","interpretation-create","interpretation-clear","interpretation-delete","interpretation-revert","interpretation-update") + private List clinicalList = asList( "acl-update","annotation-sets-load","clinical-configuration-update","create","distinct","interpretation-distinct","interpretation-search","interpretation-info","interpreter-cancer-tiering-run","interpreter-exomiser-run","interpreter-team-run","interpreter-tiering-run","interpreter-zetta-run","load","rga-aggregation-stats","rga-gene-query","rga-gene-summary","rga-index-run","rga-individual-query","rga-individual-summary","rga-variant-query","rga-variant-summary","search","variant-query","acl","delete","update","annotation-sets-annotations-update","info","interpretation-create","interpretation-clear","interpretation-delete","interpretation-revert","interpretation-update","report-update") .stream() .map(Candidate::new) .collect(toList()); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java index 249139a1608..cde7fcb1c81 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/OpencgaCliOptionsParser.java @@ -1,5 +1,5 @@ /* -* Copyright 2015-2024-03-04 OpenCB +* Copyright 2015-2024-03-06 OpenCB * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -161,6 +161,7 @@ public OpencgaCliOptionsParser() { analysisClinicalSubCommands.addCommand("interpretation-delete", analysisClinicalCommandOptions.deleteInterpretationCommandOptions); analysisClinicalSubCommands.addCommand("interpretation-revert", analysisClinicalCommandOptions.revertInterpretationCommandOptions); analysisClinicalSubCommands.addCommand("interpretation-update", analysisClinicalCommandOptions.updateInterpretationCommandOptions); + analysisClinicalSubCommands.addCommand("report-update", analysisClinicalCommandOptions.updateReportCommandOptions); jobsCommandOptions = new JobsCommandOptions(commonCommandOptions, jCommander); jCommander.addCommand("jobs", jobsCommandOptions); diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java index 97f7bb98c30..e96ddce01c2 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/AnalysisClinicalCommandExecutor.java @@ -202,6 +202,9 @@ public void execute() throws Exception { case "interpretation-update": queryResponse = updateInterpretation(); break; + case "report-update": + queryResponse = updateReport(); + break; default: logger.error("Subcommand not valid"); break; @@ -1485,4 +1488,48 @@ private RestResponse updateInterpretation() throws Exception { } return openCGAClient.getClinicalAnalysisClient().updateInterpretation(commandOptions.clinicalAnalysis, commandOptions.interpretation, interpretationUpdateParams, queryParams); } + + private RestResponse updateReport() throws Exception { + logger.debug("Executing updateReport in Analysis - Clinical command line"); + + AnalysisClinicalCommandOptions.UpdateReportCommandOptions commandOptions = analysisClinicalCommandOptions.updateReportCommandOptions; + + ObjectMap queryParams = new ObjectMap(); + queryParams.putIfNotEmpty("include", commandOptions.include); + queryParams.putIfNotEmpty("exclude", commandOptions.exclude); + queryParams.putIfNotEmpty("study", commandOptions.study); + queryParams.putIfNotNull("supportingEvidencesAction", commandOptions.supportingEvidencesAction); + queryParams.putIfNotNull("includeResult", commandOptions.includeResult); + if (queryParams.get("study") == null && OpencgaMain.isShellMode()) { + queryParams.putIfNotEmpty("study", sessionManager.getSession().getCurrentStudy()); + } + + + ClinicalReport clinicalReport = null; + if (commandOptions.jsonDataModel) { + RestResponse res = new RestResponse<>(); + res.setType(QueryType.VOID); + PrintUtils.println(getObjectAsJSON(categoryName,"/{apiVersion}/analysis/clinical/{clinicalAnalysis}/report/update")); + return res; + } else if (commandOptions.jsonFile != null) { + clinicalReport = JacksonUtils.getDefaultObjectMapper() + .readValue(new java.io.File(commandOptions.jsonFile), ClinicalReport.class); + } else { + ObjectMap beanParams = new ObjectMap(); + putNestedIfNotEmpty(beanParams, "title",commandOptions.title, true); + putNestedIfNotEmpty(beanParams, "overview",commandOptions.overview, true); + putNestedIfNotEmpty(beanParams, "discussion.author",commandOptions.discussionAuthor, true); + putNestedIfNotEmpty(beanParams, "discussion.date",commandOptions.discussionDate, true); + putNestedIfNotEmpty(beanParams, "discussion.text",commandOptions.discussionText, true); + putNestedIfNotEmpty(beanParams, "logo",commandOptions.logo, true); + putNestedIfNotEmpty(beanParams, "signedBy",commandOptions.signedBy, true); + putNestedIfNotEmpty(beanParams, "signature",commandOptions.signature, true); + putNestedIfNotEmpty(beanParams, "date",commandOptions.date, true); + + clinicalReport = JacksonUtils.getDefaultObjectMapper().copy() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true) + .readValue(beanParams.toJson(), ClinicalReport.class); + } + return openCGAClient.getClinicalAnalysisClient().updateReport(commandOptions.clinicalAnalysis, clinicalReport, queryParams); + } } \ No newline at end of file diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/MetaCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/MetaCommandExecutor.java index 0d8987f61d6..3a674a32c68 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/MetaCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/MetaCommandExecutor.java @@ -106,7 +106,11 @@ private RestResponse model() throws Exception { logger.debug("Executing model in Meta command line"); MetaCommandOptions.ModelCommandOptions commandOptions = metaCommandOptions.modelCommandOptions; - return openCGAClient.getMetaClient().model(); + + ObjectMap queryParams = new ObjectMap(); + queryParams.putIfNotEmpty("model", commandOptions.model); + + return openCGAClient.getMetaClient().model(queryParams); } private RestResponse ping() throws Exception { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OpencgaCommandExecutor.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OpencgaCommandExecutor.java index 8f935c36ff8..72f9bdd0e8c 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OpencgaCommandExecutor.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/executors/OpencgaCommandExecutor.java @@ -225,90 +225,7 @@ public OpencgaCommandExecutor setOpenCGAClient(OpenCGAClient openCGAClient) { } public String getObjectAsJSON(String objectCategory, String objectPath) throws Exception { - StringBuilder jsonInString = new StringBuilder("\n"); - try { - ObjectMap queryParams = new ObjectMap(); - queryParams.putIfNotEmpty("category", objectCategory); - RestResponse response = openCGAClient.getMetaClient().api(queryParams); - ObjectMapper jsonObjectMapper = new ObjectMapper(); - for (List list : response.getResponses().get(0).getResults()) { - List categories = jsonObjectMapper.convertValue(list, new TypeReference>() {}); - for (RestCategory category : categories) { - for (RestEndpoint endpoint : category.getEndpoints()) { - if (objectPath.equals(endpoint.getPath())) { - boolean enc = false; - for (RestParameter parameter : endpoint.getParameters()) { - //jsonInString += parameter.getName()+":"+parameter.getAllowedValues()+"\n"; - if (parameter.getData() != null) { - enc = true; - jsonInString.append(printBody(parameter.getData(), "")); - } - } - if (!enc) { - jsonInString.append("No model available"); - } - // - } - } - } - } - } catch (Exception e) { - jsonInString = new StringBuilder("Data model not found."); - CommandLineUtils.error(e); - } - return jsonInString.toString(); - } - - private String printBody(List data, String tabs) { - String res = ""; - res += "{\n"; - String tab = " " + tabs; - for (RestParameter parameter : data) { - if (parameter.getData() == null) { - res += printParameter(parameter, tab); - } else { - res += tab + parameter.getName() + "\"" + ": [" + printBody(parameter.getData(), tab) + "],\n"; - } - } - res += tabs + "}"; - return res; - - } - - private String printParameter(RestParameter parameter, String tab) { - - return tab + "\"" + parameter.getName() + "\"" + ":" + printParameterValue(parameter) + ",\n"; - } - - private String printParameterValue(RestParameter parameter) { - - if(!StringUtils.isEmpty(parameter.getAllowedValues())){ - return parameter.getAllowedValues().replace(" ", "|"); - } - switch (parameter.getType()) { - case "Boolean": - case "java.lang.Boolean": - return "false"; - case "Long": - case "Float": - case "Double": - case "Integer": - case "int": - case "double": - case "float": - case "long": - return "0"; - case "List": - return "[\"\"]"; - case "Date": - return "\"dd/mm/yyyy\""; - case "Map": - return "{\"key\": \"value\"}"; - case "String": - return "\"\""; - default: - return "\"-\""; - } + return super.getObjectAsJSON(objectCategory, objectPath, openCGAClient); } private boolean isNumeric(String type) { diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java index 5249bdedd46..fcfe1679c19 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/AnalysisClinicalCommandOptions.java @@ -67,6 +67,7 @@ public class AnalysisClinicalCommandOptions { public DeleteInterpretationCommandOptions deleteInterpretationCommandOptions; public RevertInterpretationCommandOptions revertInterpretationCommandOptions; public UpdateInterpretationCommandOptions updateInterpretationCommandOptions; + public UpdateReportCommandOptions updateReportCommandOptions; public AnalysisClinicalCommandOptions(CommonCommandOptions commonCommandOptions, JCommander jCommander) { @@ -107,6 +108,7 @@ public AnalysisClinicalCommandOptions(CommonCommandOptions commonCommandOptions, this.deleteInterpretationCommandOptions = new DeleteInterpretationCommandOptions(); this.revertInterpretationCommandOptions = new RevertInterpretationCommandOptions(); this.updateInterpretationCommandOptions = new UpdateInterpretationCommandOptions(); + this.updateReportCommandOptions = new UpdateReportCommandOptions(); } @@ -2308,4 +2310,63 @@ public class UpdateInterpretationCommandOptions { } + @Parameters(commandNames = {"report-update"}, commandDescription ="Update clinical analysis report") + public class UpdateReportCommandOptions { + + @ParametersDelegate + public CommonCommandOptions commonOptions = commonCommandOptions; + + @Parameter(names = {"--json-file"}, description = "File with the body data in JSON format. Note, that using this parameter will ignore all the other parameters.", required = false, arity = 1) + public String jsonFile; + + @Parameter(names = {"--json-data-model"}, description = "Show example of file structure for body data.", help = true, arity = 0) + public Boolean jsonDataModel = false; + + @Parameter(names = {"--include", "-I"}, description = "Fields included in the response, whole JSON path must be provided", required = false, arity = 1) + public String include; + + @Parameter(names = {"--exclude", "-E"}, description = "Fields excluded in the response, whole JSON path must be provided", required = false, arity = 1) + public String exclude; + + @Parameter(names = {"--clinical-analysis"}, description = "Clinical analysis ID", required = true, arity = 1) + public String clinicalAnalysis; + + @Parameter(names = {"--study", "-s"}, description = "Study [[organization@]project:]study where study and project can be either the ID or UUID", required = false, arity = 1) + public String study; + + @Parameter(names = {"--supporting-evidences-action"}, description = "Action to be performed if the array of supporting evidences is being updated.", required = false, arity = 1) + public String supportingEvidencesAction = "ADD"; + + @Parameter(names = {"--include-result"}, description = "Flag indicating to include the created or updated document result in the response", required = false, help = true, arity = 0) + public boolean includeResult = false; + + @Parameter(names = {"--title"}, description = "Report title.", required = false, arity = 1) + public String title; + + @Parameter(names = {"--overview"}, description = "Report overview.", required = false, arity = 1) + public String overview; + + @Parameter(names = {"--discussion-author"}, description = "The body web service author parameter", required = false, arity = 1) + public String discussionAuthor; + + @Parameter(names = {"--discussion-date"}, description = "The body web service date parameter", required = false, arity = 1) + public String discussionDate; + + @Parameter(names = {"--discussion-text"}, description = "The body web service text parameter", required = false, arity = 1) + public String discussionText; + + @Parameter(names = {"--logo"}, description = "Report logo.", required = false, arity = 1) + public String logo; + + @Parameter(names = {"--signed-by"}, description = "Indicates who has signed the report.", required = false, arity = 1) + public String signedBy; + + @Parameter(names = {"--signature"}, description = "Report signature.", required = false, arity = 1) + public String signature; + + @Parameter(names = {"--date"}, description = "Report date.", required = false, arity = 1) + public String date; + + } + } \ No newline at end of file diff --git a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/MetaCommandOptions.java b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/MetaCommandOptions.java index 4cb695c9e32..c72e4325362 100644 --- a/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/MetaCommandOptions.java +++ b/opencga-app/src/main/java/org/opencb/opencga/app/cli/main/options/MetaCommandOptions.java @@ -87,6 +87,9 @@ public class ModelCommandOptions { @ParametersDelegate public CommonCommandOptions commonOptions = commonCommandOptions; + @Parameter(names = {"--model"}, description = "Model description", required = false, arity = 1) + public String model; + } @Parameters(commandNames = {"ping"}, commandDescription ="Ping Opencga webservices.") diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/ClinicalAnalysisDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/ClinicalAnalysisDBAdaptor.java index a4b3d8f19b4..9ba04a571c1 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/ClinicalAnalysisDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/api/ClinicalAnalysisDBAdaptor.java @@ -73,6 +73,7 @@ enum QueryParams implements QueryParam { ANALYSTS_ID("analysts.id", TEXT, ""), ANALYSTS_ASSIGNED_BY("analysts.assignedBy", TEXT, ""), REPORT("report", OBJECT, ""), + REPORT_UPDATE("report_update", OBJECT, ""), // Made up key to be able to set inner fields and not the entire object REPORT_SUPPORTING_EVIDENCES("report.supportingEvidences", TEXT_ARRAY, ""), REPORT_FILES("report.files", TEXT_ARRAY, ""), REQUEST("request", OBJECT, ""), @@ -165,6 +166,13 @@ public static QueryParams getParam(String key) { } enum ReportQueryParams implements QueryParam { + TITLE("title", STRING, ""), + OVERVIEW("overview", STRING, ""), + DISCUSSION("discussion", OBJECT, ""), + LOGO("logo", STRING, ""), + SIGNED_BY("signedBy", STRING, ""), + SIGNATURE("signature", STRING, ""), + DATE("date", STRING, ""), COMMENTS("comments", OBJECT, ""), SUPPORTING_EVIDENCES("supportingEvidences", TEXT_ARRAY, ""), FILES("files", TEXT_ARRAY, ""); diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/ClinicalAnalysisMongoDBAdaptor.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/ClinicalAnalysisMongoDBAdaptor.java index 8aaeacc769f..59fc3d56df9 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/ClinicalAnalysisMongoDBAdaptor.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/ClinicalAnalysisMongoDBAdaptor.java @@ -142,18 +142,18 @@ static void fixPanelsForRemoval(ObjectMap parameters) { parameters.put(PANELS.key(), panelParamList); } - static void fixFilesForRemoval(ObjectMap parameters) { - if (parameters.get(FILES.key()) == null) { + static void fixFilesForRemoval(ObjectMap parameters, String key) { + if (parameters.get(key) == null) { return; } List fileParamList = new LinkedList<>(); - for (Object file : parameters.getAsList(FILES.key())) { + for (Object file : parameters.getAsList(key)) { if (file instanceof File) { fileParamList.add(new Document("uid", ((File) file).getUid())); } } - parameters.put(FILES.key(), fileParamList); + parameters.put(key, fileParamList); } static void fixAnalystsForRemoval(ObjectMap parameters) { @@ -410,13 +410,87 @@ UpdateDocument parseAndValidateUpdateParams(ObjectMap parameters, List actionMap = queryOptions.getMap(Constants.ACTIONS, new HashMap<>()); + + if (parameters.containsKey(REPORT_UPDATE.key())) { + ObjectMap reportParameters = parameters.getNestedMap(REPORT_UPDATE.key()); + reportParameters.put(ReportQueryParams.DATE.key(), TimeUtils.getTime()); + String[] stringParams = {ReportQueryParams.TITLE.key(), ReportQueryParams.OVERVIEW.key(), ReportQueryParams.LOGO.key(), + ReportQueryParams.SIGNED_BY.key(), ReportQueryParams.SIGNATURE.key(), ReportQueryParams.DATE.key(), }; + filterStringParams(reportParameters, document.getSet(), stringParams, REPORT.key() + "."); + + String[] objectParams = {ReportQueryParams.DISCUSSION.key()}; + filterObjectParams(reportParameters, document.getSet(), objectParams, REPORT.key() + "."); + + String[] commentParams = {ReportQueryParams.COMMENTS.key()}; + ParamUtils.AddRemoveReplaceAction basicOperation = ParamUtils.AddRemoveReplaceAction + .from(actionMap, ReportQueryParams.COMMENTS.key(), ParamUtils.AddRemoveReplaceAction.ADD); + switch (basicOperation) { + case REMOVE: + fixCommentsForRemoval(reportParameters); + filterObjectParams(reportParameters, document.getPull(), commentParams, REPORT.key() + "."); + break; + case ADD: + filterObjectParams(reportParameters, document.getAddToSet(), commentParams, REPORT.key() + "."); + break; + case REPLACE: + filterReplaceParams(reportParameters.getAsList(ReportQueryParams.COMMENTS.key(), ClinicalComment.class), document, + ClinicalComment::getDate, QueryParams.REPORT.key() + "." + QueryParams.COMMENTS_DATE.key()); + break; + default: + throw new IllegalStateException("Unknown operation " + basicOperation); + } + + String[] filesParams = new String[]{ReportQueryParams.FILES.key()}; + ParamUtils.BasicUpdateAction operation = ParamUtils.BasicUpdateAction.from(actionMap, ReportQueryParams.FILES.key(), + ParamUtils.BasicUpdateAction.ADD); + switch (operation) { + case SET: + filterObjectParams(reportParameters, document.getSet(), filesParams, QueryParams.REPORT.key() + "."); + clinicalConverter.validateFilesToUpdate(document.getSet(), QueryParams.REPORT.key() + "." + + ReportQueryParams.FILES.key()); + break; + case REMOVE: + fixFilesForRemoval(reportParameters, ReportQueryParams.FILES.key()); + filterObjectParams(reportParameters, document.getPull(), filesParams, QueryParams.REPORT.key() + "."); + break; + case ADD: + filterObjectParams(reportParameters, document.getAddToSet(), filesParams, QueryParams.REPORT.key() + "."); + clinicalConverter.validateFilesToUpdate(document.getAddToSet(), QueryParams.REPORT.key() + "." + + ReportQueryParams.FILES.key()); + break; + default: + throw new IllegalStateException("Unknown operation " + basicOperation); + } + + String[] supportingEvidencesParams = new String[]{ReportQueryParams.SUPPORTING_EVIDENCES.key()}; + operation = ParamUtils.BasicUpdateAction.from(actionMap, ReportQueryParams.SUPPORTING_EVIDENCES.key(), + ParamUtils.BasicUpdateAction.ADD); + switch (operation) { + case SET: + filterObjectParams(reportParameters, document.getSet(), supportingEvidencesParams, QueryParams.REPORT.key() + "."); + clinicalConverter.validateFilesToUpdate(document.getSet(), QueryParams.REPORT.key() + "." + + ReportQueryParams.SUPPORTING_EVIDENCES.key()); + break; + case REMOVE: + fixFilesForRemoval(reportParameters, ReportQueryParams.SUPPORTING_EVIDENCES.key()); + filterObjectParams(reportParameters, document.getPull(), supportingEvidencesParams, QueryParams.REPORT.key() + "."); + break; + case ADD: + filterObjectParams(reportParameters, document.getAddToSet(), supportingEvidencesParams, QueryParams.REPORT.key() + "."); + clinicalConverter.validateFilesToUpdate(document.getAddToSet(), QueryParams.REPORT.key() + "." + + ReportQueryParams.SUPPORTING_EVIDENCES.key()); + break; + default: + throw new IllegalStateException("Unknown operation " + basicOperation); + } + } + clinicalConverter.validateInterpretationToUpdate(document.getSet()); clinicalConverter.validateFamilyToUpdate(document.getSet()); clinicalConverter.validateProbandToUpdate(document.getSet()); clinicalConverter.validateReportToUpdate(document.getSet()); - Map actionMap = queryOptions.getMap(Constants.ACTIONS, new HashMap<>()); - String[] objectAcceptedParams = new String[]{QueryParams.COMMENTS.key()}; ParamUtils.AddRemoveReplaceAction basicOperation = ParamUtils.AddRemoveReplaceAction.from(actionMap, QueryParams.COMMENTS.key(), ParamUtils.AddRemoveReplaceAction.ADD); @@ -463,7 +537,7 @@ UpdateDocument parseAndValidateUpdateParams(ObjectMap parameters, List filter } static void filterStringParams(ObjectMap parameters, Map filteredParams, String[] acceptedParams) { + filterStringParams(parameters, filteredParams, acceptedParams, ""); + } + + static void filterStringParams(ObjectMap parameters, Map filteredParams, String[] acceptedParams, String dbKeyPrefix) { for (String s : acceptedParams) { if (parameters.containsKey(s)) { - filteredParams.put(s, parameters.getString(s)); + filteredParams.put(dbKeyPrefix + s, parameters.getString(s)); } } } @@ -361,6 +365,11 @@ static void filterMapParams(ObjectMap parameters, Map filteredPa } static void filterObjectParams(ObjectMap parameters, Map filteredParams, String[] acceptedMapParams) { + filterObjectParams(parameters, filteredParams, acceptedMapParams, ""); + } + + static void filterObjectParams(ObjectMap parameters, Map filteredParams, String[] acceptedMapParams, + String dbKeyPrefix) { for (String s : acceptedMapParams) { if (parameters.containsKey(s)) { Document document; @@ -371,10 +380,10 @@ static void filterObjectParams(ObjectMap parameters, Map filtere for (Object object : originalList) { documentList.add(getMongoDBDocument(object, s)); } - filteredParams.put(s, documentList); + filteredParams.put(dbKeyPrefix + s, documentList); } else { document = getMongoDBDocument(parameters.get(s), s); - filteredParams.put(s, document); + filteredParams.put(dbKeyPrefix + s, document); } } catch (CatalogDBException e) { logger.warn("Skipping key '" + s + "': " + e.getMessage(), e); diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/converters/ClinicalAnalysisConverter.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/converters/ClinicalAnalysisConverter.java index 45fff9dd2f3..ed7494ae2c9 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/converters/ClinicalAnalysisConverter.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/db/mongodb/converters/ClinicalAnalysisConverter.java @@ -156,10 +156,14 @@ public void validatePanelsToUpdate(Document document) { } } - public void validateFilesToUpdate(Document document) { - List files = (List) document.get(ClinicalAnalysisDBAdaptor.QueryParams.FILES.key()); + public void validateFilesToUpdate(Document document, String key) { + List files = (List) document.get(key); List reducedFiles = getReducedFileDocuments(files); - document.put(ClinicalAnalysisDBAdaptor.QueryParams.FILES.key(), reducedFiles); + document.put(key, reducedFiles); + } + + public void validateFilesToUpdate(Document document) { + validateFilesToUpdate(document, ClinicalAnalysisDBAdaptor.QueryParams.FILES.key()); } private static List getReducedFileDocuments(List files) { diff --git a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/ClinicalAnalysisManager.java b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/ClinicalAnalysisManager.java index 0636b147a58..5640aeae5ed 100644 --- a/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/ClinicalAnalysisManager.java +++ b/opencga-catalog/src/main/java/org/opencb/opencga/catalog/managers/ClinicalAnalysisManager.java @@ -1696,6 +1696,94 @@ private OpenCGAResult update(String organizationId, Study stud return update; } + public OpenCGAResult updateReport(String studyStr, String clinicalAnalysisId, ClinicalReport report, + QueryOptions options, String token) throws CatalogException { + JwtPayload tokenPayload = catalogManager.getUserManager().validateToken(token); + CatalogFqn studyFqn = CatalogFqn.extractFqnFromStudy(studyStr, tokenPayload); + + String operationId = UuidUtils.generateOpenCgaUuid(UuidUtils.Entity.AUDIT); + + ObjectMap auditParams = new ObjectMap() + .append("study", studyStr) + .append("clinicalAnalysisId", clinicalAnalysisId) + .append("report", report) + .append("options", options) + .append("token", token); + + String caseId = clinicalAnalysisId; + String caseUuid = ""; + String organizationId = studyFqn.getOrganizationId(); + String userId = tokenPayload.getUserId(organizationId); + String studyId = studyFqn.getStudyId(); + String studyUuid = studyFqn.getStudyUuid(); + try { + Study study = catalogManager.getStudyManager().resolveId(studyFqn, StudyManager.INCLUDE_VARIABLE_SET, tokenPayload); + options = ParamUtils.defaultObject(options, QueryOptions::new); + ClinicalAnalysis clinicalAnalysis = internalGet(organizationId, study.getUid(), clinicalAnalysisId, INCLUDE_CLINICAL_IDS, + userId).first(); + authorizationManager.checkClinicalAnalysisPermission(organizationId, study.getUid(), clinicalAnalysis.getUid(), userId, + ClinicalAnalysisPermissions.WRITE); + caseId = clinicalAnalysis.getId(); + caseUuid = clinicalAnalysis.getUuid(); + + ObjectMap updateMap; + try { + updateMap = new ObjectMap(getUpdateObjectMapper().writeValueAsString(report)); + } catch (JsonProcessingException e) { + throw new CatalogException("Could not parse report object: " + e.getMessage(), e); + } + + Map actionMap = options.getMap(ParamConstants.ACTION, new HashMap<>()); + if (report.getComments() != null) { + ParamUtils.AddRemoveReplaceAction basicOperation = ParamUtils.AddRemoveReplaceAction + .from(actionMap, ClinicalAnalysisDBAdaptor.ReportQueryParams.COMMENTS.key(), ParamUtils.AddRemoveReplaceAction.ADD); + if (basicOperation != ParamUtils.AddRemoveReplaceAction.ADD) { + for (ClinicalComment comment : report.getComments()) { + comment.setDate(TimeUtils.getTime()); + comment.setAuthor(userId); + } + } + updateMap.put(ClinicalAnalysisDBAdaptor.ReportQueryParams.COMMENTS.key(), report.getComments()); + } + if (CollectionUtils.isNotEmpty(report.getFiles())) { + List files = obtainFiles(organizationId, study, userId, report.getFiles()); + updateMap.put(ClinicalAnalysisDBAdaptor.ReportQueryParams.FILES.key(), files, false); + } + if (CollectionUtils.isNotEmpty(report.getSupportingEvidences())) { + List files = obtainFiles(organizationId, study, userId, report.getSupportingEvidences()); + updateMap.put(ClinicalAnalysisDBAdaptor.ReportQueryParams.SUPPORTING_EVIDENCES.key(), files, false); + } + ClinicalAudit clinicalAudit = new ClinicalAudit(userId, ClinicalAudit.Action.UPDATE_CLINICAL_ANALYSIS, + "Update ClinicalAnalysis '" + clinicalAnalysis.getId() + "' report.", TimeUtils.getTime()); + + // Add custom key to ensure it is properly updated + updateMap = new ObjectMap(ClinicalAnalysisDBAdaptor.QueryParams.REPORT_UPDATE.key(), updateMap); + OpenCGAResult update = getClinicalAnalysisDBAdaptor(organizationId) + .update(clinicalAnalysis.getUid(), updateMap, null, Collections.singletonList(clinicalAudit), options); + auditManager.auditUpdate(operationId, userId, Enums.Resource.CLINICAL_ANALYSIS, caseId, caseUuid, study.getId(), + study.getUuid(), auditParams, new AuditRecord.Status(AuditRecord.Status.Result.SUCCESS)); + if (options.getBoolean(ParamConstants.INCLUDE_RESULT_PARAM)) { + // Fetch updated clinical analysis + OpenCGAResult result = getClinicalAnalysisDBAdaptor(organizationId).get(study.getUid(), + new Query(ClinicalAnalysisDBAdaptor.QueryParams.UID.key(), clinicalAnalysis.getUid()), options, userId); + update.setResults(result.getResults()); + } + List reportList = new ArrayList<>(update.getResults().size()); + if (update.getNumResults() > 0) { + for (ClinicalAnalysis result : update.getResults()) { + reportList.add(result.getReport()); + } + } + return new OpenCGAResult<>(update.getTime(), update.getEvents(), update.getNumResults(), reportList, + update.getNumMatches(), update.getNumInserted(), update.getNumUpdated(), update.getNumDeleted(), + update.getNumErrors(), update.getAttributes(), update.getFederationNode()); + } catch (CatalogException e) { + auditManager.auditUpdate(operationId, userId, Enums.Resource.CLINICAL_ANALYSIS, caseId, caseUuid, studyId, studyUuid, + auditParams, new AuditRecord.Status(AuditRecord.Status.Result.ERROR, e.getError())); + throw e; + } + } + /** * Sort the family members in the following order: proband, father, mother, others. * diff --git a/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/ClinicalAnalysisManagerTest.java b/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/ClinicalAnalysisManagerTest.java index 350dcc4bf9d..cf267f04b71 100644 --- a/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/ClinicalAnalysisManagerTest.java +++ b/opencga-catalog/src/test/java/org/opencb/opencga/catalog/managers/ClinicalAnalysisManagerTest.java @@ -446,6 +446,151 @@ public void updateClinicalAnalysisReport() throws CatalogException { new ClinicalAnalysisUpdateParams().setReport(report), INCLUDE_RESULT, ownerToken); } + @Test + public void updateClinicalAnalysisReportWithActions() throws CatalogException { + ClinicalAnalysis case1 = createDummyEnvironment(true, true).first(); + assertNull(case1.getReport()); + + // Add files + catalogManager.getFileManager().create(studyFqn, + new FileCreateParams() + .setContent(RandomStringUtils.randomAlphanumeric(1000)) + .setPath("/data/file1.txt") + .setType(File.Type.FILE), + true, ownerToken); + catalogManager.getFileManager().create(studyFqn, + new FileCreateParams() + .setContent(RandomStringUtils.randomAlphanumeric(1000)) + .setPath("/data/file2.txt") + .setType(File.Type.FILE), + true, ownerToken); + catalogManager.getFileManager().create(studyFqn, + new FileCreateParams() + .setContent(RandomStringUtils.randomAlphanumeric(1000)) + .setPath("/data/file3.txt") + .setType(File.Type.FILE), + true, ownerToken); + + ClinicalReport report = new ClinicalReport("title", "overview", new ClinicalDiscussion("me", TimeUtils.getTime(), "text"), "logo", + "me", "signature", TimeUtils.getTime(), Arrays.asList( + new ClinicalComment().setMessage("comment1"), + new ClinicalComment().setMessage("comment2") + ), + Collections.singletonList(new File().setId("data:file1.txt")), + Collections.singletonList(new File().setId("data:file2.txt"))); + OpenCGAResult result = catalogManager.getClinicalAnalysisManager().update(studyFqn, case1.getId(), + new ClinicalAnalysisUpdateParams().setReport(report), INCLUDE_RESULT, ownerToken); + assertNotNull(result.first().getReport()); + assertEquals(report.getTitle(), result.first().getReport().getTitle()); + assertEquals(report.getOverview(), result.first().getReport().getOverview()); + assertEquals(report.getDate(), result.first().getReport().getDate()); + assertEquals(report.getLogo(), result.first().getReport().getLogo()); + assertEquals(report.getSignature(), result.first().getReport().getSignature()); + assertEquals(report.getSignedBy(), result.first().getReport().getSignedBy()); + assertEquals(2, result.first().getReport().getComments().size()); + assertEquals(1, result.first().getReport().getFiles().size()); + assertEquals(1, result.first().getReport().getSupportingEvidences().size()); + + // Add comment + // Set files + // Remove supporting evidence + ObjectMap actionMap = new ObjectMap() + .append(ClinicalAnalysisDBAdaptor.ReportQueryParams.COMMENTS.key(), ParamUtils.AddRemoveAction.ADD) + .append(ClinicalAnalysisDBAdaptor.ReportQueryParams.FILES.key(), ParamUtils.BasicUpdateAction.SET) + .append(ClinicalAnalysisDBAdaptor.ReportQueryParams.SUPPORTING_EVIDENCES.key(), ParamUtils.BasicUpdateAction.REMOVE); + QueryOptions options = new QueryOptions() + .append(Constants.ACTIONS, actionMap) + .append(ParamConstants.INCLUDE_RESULT_PARAM, true); + ClinicalReport reportToUpdate = new ClinicalReport() + .setComments(Collections.singletonList(new ClinicalComment().setMessage("comment3"))) + .setFiles(Arrays.asList( + new File().setId("data:file2.txt"), + new File().setId("data:file3.txt") + )) + .setSupportingEvidences(Collections.singletonList(new File().setId("data:file1.txt"))); + ClinicalReport reportResult = catalogManager.getClinicalAnalysisManager().updateReport(studyFqn, case1.getId(), reportToUpdate, + options, ownerToken).first(); + // Check comments + assertEquals(3, reportResult.getComments().size()); + assertEquals("comment1", reportResult.getComments().get(0).getMessage()); + assertEquals("comment2", reportResult.getComments().get(1).getMessage()); + assertEquals("comment3", reportResult.getComments().get(2).getMessage()); + + // Check files + assertEquals(2, reportResult.getFiles().size()); + assertTrue(reportResult.getFiles().stream().map(File::getPath).collect(Collectors.toSet()).containsAll(Arrays.asList("data/file2.txt", "data/file3.txt"))); + + // Check supporting evidences + assertEquals(0, reportResult.getSupportingEvidences().size()); + + + // Remove comment + // Remove file + // Set supporting evidences + actionMap = new ObjectMap() + .append(ClinicalAnalysisDBAdaptor.ReportQueryParams.COMMENTS.key(), ParamUtils.AddRemoveAction.REMOVE) + .append(ClinicalAnalysisDBAdaptor.ReportQueryParams.FILES.key(), ParamUtils.BasicUpdateAction.REMOVE) + .append(ClinicalAnalysisDBAdaptor.ReportQueryParams.SUPPORTING_EVIDENCES.key(), ParamUtils.BasicUpdateAction.SET); + options = new QueryOptions() + .append(Constants.ACTIONS, actionMap) + .append(ParamConstants.INCLUDE_RESULT_PARAM, true); + reportToUpdate = new ClinicalReport() + .setComments(Arrays.asList(reportResult.getComments().get(0), reportResult.getComments().get(1))) + .setFiles(Collections.singletonList(new File().setId("data:file3.txt"))) + .setSupportingEvidences(Arrays.asList( + new File().setId("data:file1.txt"), + new File().setId("data:file3.txt") + )); + ClinicalComment pendingComment = reportResult.getComments().get(2); + reportResult = catalogManager.getClinicalAnalysisManager().updateReport(studyFqn, case1.getId(), reportToUpdate, + options, ownerToken).first(); + // Check comments + assertEquals(1, reportResult.getComments().size()); + assertEquals(pendingComment.getMessage(), reportResult.getComments().get(0).getMessage()); + + // Check supporting evidences + assertEquals(2, reportResult.getSupportingEvidences().size()); + assertTrue(reportResult.getSupportingEvidences().stream().map(File::getPath).collect(Collectors.toSet()) + .containsAll(Arrays.asList("data/file1.txt", "data/file3.txt"))); + + // Check files + assertEquals(1, reportResult.getFiles().size()); + assertEquals("data/file2.txt", reportResult.getFiles().get(0).getPath()); + + + // Add file + // Add supporting evidences + actionMap = new ObjectMap() + .append(ClinicalAnalysisDBAdaptor.ReportQueryParams.FILES.key(), ParamUtils.BasicUpdateAction.ADD) + .append(ClinicalAnalysisDBAdaptor.ReportQueryParams.SUPPORTING_EVIDENCES.key(), ParamUtils.BasicUpdateAction.ADD); + options = new QueryOptions() + .append(Constants.ACTIONS, actionMap) + .append(ParamConstants.INCLUDE_RESULT_PARAM, true); + reportToUpdate = new ClinicalReport() + .setFiles(Arrays.asList( + new File().setId("data:file1.txt"), + new File().setId("data:file3.txt") + )) + .setSupportingEvidences(Collections.singletonList( + new File().setId("data:file2.txt") + )); + reportResult = catalogManager.getClinicalAnalysisManager().updateReport(studyFqn, case1.getId(), reportToUpdate, + options, ownerToken).first(); + // Check comments + assertEquals(1, reportResult.getComments().size()); + assertEquals("comment3", reportResult.getComments().get(0).getMessage()); + + // Check files + assertEquals(3, reportResult.getFiles().size()); + assertTrue(reportResult.getFiles().stream().map(File::getPath).collect(Collectors.toSet()) + .containsAll(Arrays.asList("data/file1.txt", "data/file2.txt", "data/file3.txt"))); + + // Check supporting evidences + assertEquals(3, reportResult.getSupportingEvidences().size()); + assertTrue(reportResult.getSupportingEvidences().stream().map(File::getPath).collect(Collectors.toSet()) + .containsAll(Arrays.asList("data/file1.txt", "data/file2.txt", "data/file3.txt"))); + } + @Test public void createAndUpdateClinicalAnalysisWithQualityControl() throws CatalogException, InterruptedException { Individual individual = new Individual().setId("child1").setSamples(Arrays.asList(new Sample().setId("sample2"))); diff --git a/opencga-client/src/main/R/R/Admin-methods.R b/opencga-client/src/main/R/R/Admin-methods.R index 707daa2b23b..43589f23862 100644 --- a/opencga-client/src/main/R/R/Admin-methods.R +++ b/opencga-client/src/main/R/R/Admin-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/Alignment-methods.R b/opencga-client/src/main/R/R/Alignment-methods.R index c8659700389..a4737b602d6 100644 --- a/opencga-client/src/main/R/R/Alignment-methods.R +++ b/opencga-client/src/main/R/R/Alignment-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/AllGenerics.R b/opencga-client/src/main/R/R/AllGenerics.R index 9b9e50d376b..46e1629cd2e 100644 --- a/opencga-client/src/main/R/R/AllGenerics.R +++ b/opencga-client/src/main/R/R/AllGenerics.R @@ -10,47 +10,47 @@ setGeneric("userClient", function(OpencgaR, user, filterId, users, endpointName, # ############################################################################## ## ProjectClient -setGeneric("projectClient", function(OpencgaR, project, projects, endpointName, params=NULL, ...) +setGeneric("projectClient", function(OpencgaR, projects, project, endpointName, params=NULL, ...) standardGeneric("projectClient")) # ############################################################################## ## StudyClient -setGeneric("studyClient", function(OpencgaR, group, members, templateId, studies, study, variableSet, endpointName, params=NULL, ...) +setGeneric("studyClient", function(OpencgaR, group, variableSet, studies, templateId, study, members, endpointName, params=NULL, ...) standardGeneric("studyClient")) # ############################################################################## ## FileClient -setGeneric("fileClient", function(OpencgaR, file, annotationSet, members, files, folder, endpointName, params=NULL, ...) +setGeneric("fileClient", function(OpencgaR, files, folder, file, members, annotationSet, endpointName, params=NULL, ...) standardGeneric("fileClient")) # ############################################################################## ## JobClient -setGeneric("jobClient", function(OpencgaR, job, members, jobs, endpointName, params=NULL, ...) +setGeneric("jobClient", function(OpencgaR, jobs, job, members, endpointName, params=NULL, ...) standardGeneric("jobClient")) # ############################################################################## ## SampleClient -setGeneric("sampleClient", function(OpencgaR, members, annotationSet, sample, samples, endpointName, params=NULL, ...) +setGeneric("sampleClient", function(OpencgaR, annotationSet, sample, samples, members, endpointName, params=NULL, ...) standardGeneric("sampleClient")) # ############################################################################## ## IndividualClient -setGeneric("individualClient", function(OpencgaR, individual, members, annotationSet, individuals, endpointName, params=NULL, ...) +setGeneric("individualClient", function(OpencgaR, individuals, individual, annotationSet, members, endpointName, params=NULL, ...) standardGeneric("individualClient")) # ############################################################################## ## FamilyClient -setGeneric("familyClient", function(OpencgaR, members, annotationSet, families, family, endpointName, params=NULL, ...) +setGeneric("familyClient", function(OpencgaR, annotationSet, families, family, members, endpointName, params=NULL, ...) standardGeneric("familyClient")) # ############################################################################## ## CohortClient -setGeneric("cohortClient", function(OpencgaR, cohort, members, annotationSet, cohorts, endpointName, params=NULL, ...) +setGeneric("cohortClient", function(OpencgaR, annotationSet, cohort, cohorts, members, endpointName, params=NULL, ...) standardGeneric("cohortClient")) # ############################################################################## ## PanelClient -setGeneric("panelClient", function(OpencgaR, members, panels, endpointName, params=NULL, ...) +setGeneric("panelClient", function(OpencgaR, panels, members, endpointName, params=NULL, ...) standardGeneric("panelClient")) # ############################################################################## @@ -65,7 +65,7 @@ setGeneric("variantClient", function(OpencgaR, endpointName, params=NULL, ...) # ############################################################################## ## ClinicalClient -setGeneric("clinicalClient", function(OpencgaR, annotationSet, clinicalAnalysis, interpretations, members, clinicalAnalyses, interpretation, endpointName, params=NULL, ...) +setGeneric("clinicalClient", function(OpencgaR, interpretation, clinicalAnalyses, interpretations, members, annotationSet, clinicalAnalysis, endpointName, params=NULL, ...) standardGeneric("clinicalClient")) # ############################################################################## @@ -80,7 +80,7 @@ setGeneric("metaClient", function(OpencgaR, endpointName, params=NULL, ...) # ############################################################################## ## GA4GHClient -setGeneric("ga4ghClient", function(OpencgaR, file, study, endpointName, params=NULL, ...) +setGeneric("ga4ghClient", function(OpencgaR, study, file, endpointName, params=NULL, ...) standardGeneric("ga4ghClient")) # ############################################################################## diff --git a/opencga-client/src/main/R/R/Clinical-methods.R b/opencga-client/src/main/R/R/Clinical-methods.R index 87f8857e184..344b137d60b 100644 --- a/opencga-client/src/main/R/R/Clinical-methods.R +++ b/opencga-client/src/main/R/R/Clinical-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -54,6 +54,7 @@ #' | deleteInterpretation | /{apiVersion}/analysis/clinical/{clinicalAnalysis}/interpretation/{interpretations}/delete | study, clinicalAnalysis[*], interpretations[*], setAsPrimary | #' | revertInterpretation | /{apiVersion}/analysis/clinical/{clinicalAnalysis}/interpretation/{interpretation}/revert | study, clinicalAnalysis[*], interpretation[*], version[*] | #' | updateInterpretation | /{apiVersion}/analysis/clinical/{clinicalAnalysis}/interpretation/{interpretation}/update | include, exclude, study, primaryFindingsAction, methodsAction, secondaryFindingsAction, commentsAction, panelsAction, setAs, clinicalAnalysis[*], interpretation[*], includeResult, body[*] | +#' | updateReport | /{apiVersion}/analysis/clinical/{clinicalAnalysis}/report/update | include, exclude, clinicalAnalysis[*], study, commentsAction, supportingEvidencesAction, filesAction, includeResult, body[*] | #' #' @md #' @seealso \url{http://docs.opencb.org/display/opencga/Using+OpenCGA} and the RESTful API documentation @@ -61,7 +62,7 @@ #' [*]: Required parameter #' @export -setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinicalAnalysis, interpretations, members, clinicalAnalyses, interpretation, endpointName, params=NULL, ...) { +setMethod("clinicalClient", "OpencgaR", function(OpencgaR, interpretation, clinicalAnalyses, interpretations, members, annotationSet, clinicalAnalysis, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/analysis/clinical/acl/{members}/update: @@ -727,5 +728,20 @@ setMethod("clinicalClient", "OpencgaR", function(OpencgaR, annotationSet, clinic updateInterpretation=fetchOpenCGA(object=OpencgaR, category="analysis/clinical", categoryId=clinicalAnalysis, subcategory="interpretation", subcategoryId=interpretation, action="update", params=params, httpMethod="POST", as.queryParam=NULL, ...), + + #' @section Endpoint /{apiVersion}/analysis/clinical/{clinicalAnalysis}/report/update: + #' Update clinical analysis report. + #' @param include Fields included in the response, whole JSON path must be provided. + #' @param exclude Fields excluded in the response, whole JSON path must be provided. + #' @param clinicalAnalysis Clinical analysis ID. + #' @param study Study [[organization@]project:]study where study and project can be either the ID or UUID. + #' @param commentsAction Action to be performed if the array of comments is being updated. Allowed values: ['ADD REMOVE REPLACE'] + #' @param supportingEvidencesAction Action to be performed if the array of supporting evidences is being updated. Allowed values: ['ADD SET REMOVE'] + #' @param filesAction Action to be performed if the array of files is being updated. Allowed values: ['ADD SET REMOVE'] + #' @param includeResult Flag indicating to include the created or updated document result in the response. + #' @param data JSON containing clinical report information. + updateReport=fetchOpenCGA(object=OpencgaR, category="analysis/clinical", categoryId=clinicalAnalysis, + subcategory="report", subcategoryId=NULL, action="update", params=params, httpMethod="POST", + as.queryParam=NULL, ...), ) }) \ No newline at end of file diff --git a/opencga-client/src/main/R/R/Cohort-methods.R b/opencga-client/src/main/R/R/Cohort-methods.R index 8ecc2a2a569..3ce27c32038 100644 --- a/opencga-client/src/main/R/R/Cohort-methods.R +++ b/opencga-client/src/main/R/R/Cohort-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -38,7 +38,7 @@ #' [*]: Required parameter #' @export -setMethod("cohortClient", "OpencgaR", function(OpencgaR, cohort, members, annotationSet, cohorts, endpointName, params=NULL, ...) { +setMethod("cohortClient", "OpencgaR", function(OpencgaR, annotationSet, cohort, cohorts, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/cohorts/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Family-methods.R b/opencga-client/src/main/R/R/Family-methods.R index 09fa66b277b..dbcce8bb0f4 100644 --- a/opencga-client/src/main/R/R/Family-methods.R +++ b/opencga-client/src/main/R/R/Family-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -37,7 +37,7 @@ #' [*]: Required parameter #' @export -setMethod("familyClient", "OpencgaR", function(OpencgaR, members, annotationSet, families, family, endpointName, params=NULL, ...) { +setMethod("familyClient", "OpencgaR", function(OpencgaR, annotationSet, families, family, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/families/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/File-methods.R b/opencga-client/src/main/R/R/File-methods.R index e7fd203262e..eef565b95bd 100644 --- a/opencga-client/src/main/R/R/File-methods.R +++ b/opencga-client/src/main/R/R/File-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -53,7 +53,7 @@ #' [*]: Required parameter #' @export -setMethod("fileClient", "OpencgaR", function(OpencgaR, file, annotationSet, members, files, folder, endpointName, params=NULL, ...) { +setMethod("fileClient", "OpencgaR", function(OpencgaR, files, folder, file, members, annotationSet, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/files/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/GA4GH-methods.R b/opencga-client/src/main/R/R/GA4GH-methods.R index 0798244b349..17d147c2798 100644 --- a/opencga-client/src/main/R/R/GA4GH-methods.R +++ b/opencga-client/src/main/R/R/GA4GH-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -31,7 +31,7 @@ #' [*]: Required parameter #' @export -setMethod("ga4ghClient", "OpencgaR", function(OpencgaR, file, study, endpointName, params=NULL, ...) { +setMethod("ga4ghClient", "OpencgaR", function(OpencgaR, study, file, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/ga4gh/reads/search: diff --git a/opencga-client/src/main/R/R/Individual-methods.R b/opencga-client/src/main/R/R/Individual-methods.R index 82244dd5909..a30c8ceea99 100644 --- a/opencga-client/src/main/R/R/Individual-methods.R +++ b/opencga-client/src/main/R/R/Individual-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -38,7 +38,7 @@ #' [*]: Required parameter #' @export -setMethod("individualClient", "OpencgaR", function(OpencgaR, individual, members, annotationSet, individuals, endpointName, params=NULL, ...) { +setMethod("individualClient", "OpencgaR", function(OpencgaR, individuals, individual, annotationSet, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/individuals/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Job-methods.R b/opencga-client/src/main/R/R/Job-methods.R index a7875bc8330..160c20df412 100644 --- a/opencga-client/src/main/R/R/Job-methods.R +++ b/opencga-client/src/main/R/R/Job-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -39,7 +39,7 @@ #' [*]: Required parameter #' @export -setMethod("jobClient", "OpencgaR", function(OpencgaR, job, members, jobs, endpointName, params=NULL, ...) { +setMethod("jobClient", "OpencgaR", function(OpencgaR, jobs, job, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/jobs/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Meta-methods.R b/opencga-client/src/main/R/R/Meta-methods.R index e730fbeba31..fcc109a5112 100644 --- a/opencga-client/src/main/R/R/Meta-methods.R +++ b/opencga-client/src/main/R/R/Meta-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -23,7 +23,7 @@ #' | about | /{apiVersion}/meta/about | | #' | api | /{apiVersion}/meta/api | category | #' | fail | /{apiVersion}/meta/fail | | -#' | model | /{apiVersion}/meta/model | | +#' | model | /{apiVersion}/meta/model | model | #' | ping | /{apiVersion}/meta/ping | | #' | status | /{apiVersion}/meta/status | | #' @@ -56,7 +56,7 @@ setMethod("metaClient", "OpencgaR", function(OpencgaR, endpointName, params=NULL #' @section Endpoint /{apiVersion}/meta/model: #' Opencga model webservices. - + #' @param model Model description. model=fetchOpenCGA(object=OpencgaR, category="meta", categoryId=NULL, subcategory=NULL, subcategoryId=NULL, action="model", params=params, httpMethod="GET", as.queryParam=NULL, ...), diff --git a/opencga-client/src/main/R/R/Operation-methods.R b/opencga-client/src/main/R/R/Operation-methods.R index f0481f21a19..c737760155a 100644 --- a/opencga-client/src/main/R/R/Operation-methods.R +++ b/opencga-client/src/main/R/R/Operation-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/Organization-methods.R b/opencga-client/src/main/R/R/Organization-methods.R index 016e3650dab..1b95ae54c73 100644 --- a/opencga-client/src/main/R/R/Organization-methods.R +++ b/opencga-client/src/main/R/R/Organization-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/Panel-methods.R b/opencga-client/src/main/R/R/Panel-methods.R index ab0a4245978..4cd2e9a9026 100644 --- a/opencga-client/src/main/R/R/Panel-methods.R +++ b/opencga-client/src/main/R/R/Panel-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -36,7 +36,7 @@ #' [*]: Required parameter #' @export -setMethod("panelClient", "OpencgaR", function(OpencgaR, members, panels, endpointName, params=NULL, ...) { +setMethod("panelClient", "OpencgaR", function(OpencgaR, panels, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/panels/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Project-methods.R b/opencga-client/src/main/R/R/Project-methods.R index c8e201907e7..893fbbb0b03 100644 --- a/opencga-client/src/main/R/R/Project-methods.R +++ b/opencga-client/src/main/R/R/Project-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -33,7 +33,7 @@ #' [*]: Required parameter #' @export -setMethod("projectClient", "OpencgaR", function(OpencgaR, project, projects, endpointName, params=NULL, ...) { +setMethod("projectClient", "OpencgaR", function(OpencgaR, projects, project, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/projects/create: diff --git a/opencga-client/src/main/R/R/Sample-methods.R b/opencga-client/src/main/R/R/Sample-methods.R index b8769eb9ed5..b224bd8f5bb 100644 --- a/opencga-client/src/main/R/R/Sample-methods.R +++ b/opencga-client/src/main/R/R/Sample-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -38,7 +38,7 @@ #' [*]: Required parameter #' @export -setMethod("sampleClient", "OpencgaR", function(OpencgaR, members, annotationSet, sample, samples, endpointName, params=NULL, ...) { +setMethod("sampleClient", "OpencgaR", function(OpencgaR, annotationSet, sample, samples, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/samples/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/Study-methods.R b/opencga-client/src/main/R/R/Study-methods.R index d5cf5e23190..afd4f0b0ac8 100644 --- a/opencga-client/src/main/R/R/Study-methods.R +++ b/opencga-client/src/main/R/R/Study-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. @@ -45,7 +45,7 @@ #' [*]: Required parameter #' @export -setMethod("studyClient", "OpencgaR", function(OpencgaR, group, members, templateId, studies, study, variableSet, endpointName, params=NULL, ...) { +setMethod("studyClient", "OpencgaR", function(OpencgaR, group, variableSet, studies, templateId, study, members, endpointName, params=NULL, ...) { switch(endpointName, #' @section Endpoint /{apiVersion}/studies/acl/{members}/update: diff --git a/opencga-client/src/main/R/R/User-methods.R b/opencga-client/src/main/R/R/User-methods.R index 17748045ad9..25617309de6 100644 --- a/opencga-client/src/main/R/R/User-methods.R +++ b/opencga-client/src/main/R/R/User-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/R/R/Variant-methods.R b/opencga-client/src/main/R/R/Variant-methods.R index 02a4587345a..264763867fa 100644 --- a/opencga-client/src/main/R/R/Variant-methods.R +++ b/opencga-client/src/main/R/R/Variant-methods.R @@ -2,7 +2,7 @@ # WARNING: AUTOGENERATED CODE # # This code was generated by a tool. -# Autogenerated on: 2024-03-04 +# Autogenerated on: 2024-03-06 # # Manual changes to this file may cause unexpected behavior in your application. # Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java index 12ae402b6fd..cece90a3732 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AdminClient.java @@ -37,7 +37,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java index 1d5978075e9..14eea5a5950 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/AlignmentClient.java @@ -40,7 +40,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java index bce7a38809a..1b7b219afe9 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ClinicalAnalysisClient.java @@ -35,6 +35,7 @@ import org.opencb.opencga.core.models.clinical.ClinicalAnalysisCreateParams; import org.opencb.opencga.core.models.clinical.ClinicalAnalysisLoadParams; import org.opencb.opencga.core.models.clinical.ClinicalAnalysisUpdateParams; +import org.opencb.opencga.core.models.clinical.ClinicalReport; import org.opencb.opencga.core.models.clinical.ExomiserInterpretationAnalysisParams; import org.opencb.opencga.core.models.clinical.Interpretation; import org.opencb.opencga.core.models.clinical.InterpretationCreateParams; @@ -54,7 +55,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -997,4 +998,26 @@ public RestResponse updateInterpretation(String clinicalAnalysis return execute("analysis/clinical", clinicalAnalysis, "interpretation", interpretation, "update", params, POST, Interpretation.class); } + + /** + * Update clinical analysis report. + * @param clinicalAnalysis Clinical analysis ID. + * @param data JSON containing clinical report information. + * @param params Map containing any of the following optional parameters. + * include: Fields included in the response, whole JSON path must be provided. + * exclude: Fields excluded in the response, whole JSON path must be provided. + * study: Study [[organization@]project:]study where study and project can be either the ID or UUID. + * commentsAction: Action to be performed if the array of comments is being updated. + * supportingEvidencesAction: Action to be performed if the array of supporting evidences is being updated. + * filesAction: Action to be performed if the array of files is being updated. + * includeResult: Flag indicating to include the created or updated document result in the response. + * @return a RestResponse object. + * @throws ClientException ClientException if there is any server error. + */ + public RestResponse updateReport(String clinicalAnalysis, ClinicalReport data, ObjectMap params) + throws ClientException { + params = params != null ? params : new ObjectMap(); + params.put("body", data); + return execute("analysis/clinical", clinicalAnalysis, "report", null, "update", params, POST, ClinicalReport.class); + } } diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java index ff8b862c90e..db414f80780 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/CohortClient.java @@ -36,7 +36,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java index 1338bd481c3..f196e712076 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/DiseasePanelClient.java @@ -35,7 +35,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java index 5c2a1cc5b26..0687b39811e 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FamilyClient.java @@ -35,7 +35,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java index 51d75ccbf27..680e134178f 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/FileClient.java @@ -42,7 +42,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java index 02563c65a5e..f60884bfc32 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/GA4GHClient.java @@ -27,7 +27,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java index fd639f51b5b..2377d530fb4 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/IndividualClient.java @@ -35,7 +35,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java index b30b0645561..eec7ad233d3 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/JobClient.java @@ -36,7 +36,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java index abc9ab92cc1..edc9bfa3dd7 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/MetaClient.java @@ -28,7 +28,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -80,11 +80,13 @@ public RestResponse fail() throws ClientException { /** * Opencga model webservices. + * @param params Map containing any of the following optional parameters. + * model: Model description. * @return a RestResponse object. * @throws ClientException ClientException if there is any server error. */ - public RestResponse model() throws ClientException { - ObjectMap params = new ObjectMap(); + public RestResponse model(ObjectMap params) throws ClientException { + params = params != null ? params : new ObjectMap(); return execute("meta", null, null, null, "model", params, GET, String.class); } diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/OrganizationClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/OrganizationClient.java index ac14662b2fc..55330d49dcc 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/OrganizationClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/OrganizationClient.java @@ -30,7 +30,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java index 3ffc498d075..878a3d679e9 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/ProjectClient.java @@ -31,7 +31,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java index ccc25dc7587..3426ea51565 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/SampleClient.java @@ -35,7 +35,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java index 33ad71249c0..81a4a7bbc85 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/StudyClient.java @@ -44,7 +44,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java index 8e75b697355..b2e525f244b 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/UserClient.java @@ -36,7 +36,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java index 5caa76bc51b..fbd8a7f28f3 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantClient.java @@ -62,7 +62,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java index faf5f3c633f..9dea80db8ff 100644 --- a/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java +++ b/opencga-client/src/main/java/org/opencb/opencga/client/rest/clients/VariantOperationClient.java @@ -50,7 +50,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. -* Autogenerated on: 2024-03-04 +* Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Admin.js b/opencga-client/src/main/javascript/Admin.js index c7e969ce00a..5997bed882d 100644 --- a/opencga-client/src/main/javascript/Admin.js +++ b/opencga-client/src/main/javascript/Admin.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Alignment.js b/opencga-client/src/main/javascript/Alignment.js index cd0c803073c..9173d6738dc 100644 --- a/opencga-client/src/main/javascript/Alignment.js +++ b/opencga-client/src/main/javascript/Alignment.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Clinical.js b/opencga-client/src/main/javascript/Clinical.js deleted file mode 100644 index 2c695aacd91..00000000000 --- a/opencga-client/src/main/javascript/Clinical.js +++ /dev/null @@ -1,807 +0,0 @@ -/** - * Copyright 2015-2020 OpenCB - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * WARNING: AUTOGENERATED CODE - * - * This code was generated by a tool. - * Autogenerated on: 2022-08-02 08:25:32 ->>>>>>> develop ->>>>>>> release-2.4.x ->>>>>>> release-2.4.x - * - * Manual changes to this file may cause unexpected behavior in your application. - * Manual changes to this file will be overwritten if the code is regenerated. - * -**/ - -import OpenCGAParentClass from "./../opencga-parent-class.js"; - - -/** - * This class contains the methods for the "Clinical" resource - */ - -export default class Clinical extends OpenCGAParentClass { - - constructor(config) { - super(config); - } - - /** Update the set of permissions granted for the member - * @param {String} members - Comma separated list of user or group IDs. - * @param {Object} data - JSON containing the parameters to add ACLs. - * @param {String} action = "ADD" - Action to be performed [ADD, SET, REMOVE or RESET]. The default value is ADD. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {Boolean} [params.propagate = "false"] - Propagate permissions to related families, individuals, samples and files. The default - * value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - updateAcl(members, action, data, params) { - return this._post("analysis", null, "clinical/acl", members, "update", data, {action, ...params}); - } - - /** Update Clinical Analysis configuration. - * @param {Object} [data] - Configuration params to update. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - updateClinicalConfiguration(data, params) { - return this._post("analysis", null, "clinical/clinical/configuration", null, "update", data, params); - } - - /** Create a new clinical analysis - * @param {Object} data - JSON containing clinical analysis information. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {Boolean} [params.skipCreateDefaultInterpretation] - Flag to skip creating and initialise an empty default primary - * interpretation (Id will be '{clinicalAnalysisId}.1'). This flag is only considered if no Interpretation object is passed. - * @param {Boolean} [params.includeResult = "false"] - Flag indicating to include the created or updated document result in the response. - * The default value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - create(data, params) { - return this._post("analysis", null, "clinical", null, "create", data, params); - } - - /** Clinical Analysis distinct method - * @param {String} field - Field for which to obtain the distinct values. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.id] - Comma separated list of Clinical Analysis IDs up to a maximum of 100. - * @param {String} [params.uuid] - Comma separated list of Clinical Analysis UUIDs up to a maximum of 100. - * @param {String} [params.type] - Clinical Analysis type. - * @param {String} [params.disorder] - Clinical Analysis disorder. - * @param {String} [params.files] - Clinical Analysis files. - * @param {String} [params.sample] - Sample associated to the proband or any member of a family. - * @param {String} [params.individual] - Proband or any member of a family. - * @param {String} [params.proband] - Clinical Analysis proband. - * @param {String} [params.probandSamples] - Clinical Analysis proband samples. - * @param {String} [params.family] - Clinical Analysis family. - * @param {String} [params.familyMembers] - Clinical Analysis family members. - * @param {String} [params.familyMemberSamples] - Clinical Analysis family members samples. - * @param {String} [params.panels] - Clinical Analysis panels. - * @param {Boolean} [params.locked] - Locked Clinical Analyses. - * @param {String} [params.analystId] - Clinical Analysis analyst id. - * @param {String} [params.priority] - Clinical Analysis priority. - * @param {String} [params.flags] - Clinical Analysis flags. - * @param {String} [params.creationDate] - Clinical Analysis Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * @param {String} [params.modificationDate] - Clinical Analysis Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, - * <201805. - * @param {String} [params.dueDate] - Clinical Analysis due date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * @param {String} [params.qualityControlSummary] - Clinical Analysis quality control summary. - * @param {String} [params.release] - Release when it was created. - * @param {String} [params.status] - Filter by status. - * @param {String} [params.internalStatus] - Filter by internal status. - * @param {Boolean} [params.deleted] - Boolean to retrieve deleted entries. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - distinct(field, params) { - return this._get("analysis", null, "clinical", null, "distinct", {field, ...params}); - } - - /** Interpretation distinct method - * @param {String} field - Field for which to obtain the distinct values. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.id] - Comma separated list of Interpretation IDs up to a maximum of 100. - * @param {String} [params.uuid] - Comma separated list of Interpretation UUIDs up to a maximum of 100. - * @param {String} [params.clinicalAnalysisId] - Clinical Analysis id. - * @param {String} [params.analystId] - Analyst ID. - * @param {String} [params.methodName] - Interpretation method name. - * @param {String} [params.panels] - Interpretation panels. - * @param {String} [params.primaryFindings] - Interpretation primary findings. - * @param {String} [params.secondaryFindings] - Interpretation secondary findings. - * @param {String} [params.creationDate] - Interpretation Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * @param {String} [params.modificationDate] - Interpretation Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, - * <201805. - * @param {String} [params.status] - Filter by status. - * @param {String} [params.internalStatus] - Filter by internal status. - * @param {String} [params.release] - Release when it was created. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - distinctInterpretation(field, params) { - return this._get("analysis", null, "clinical/interpretation", null, "distinct", {field, ...params}); - } - - /** Search clinical interpretations - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.sort] - Sort the results. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.id] - Comma separated list of Interpretation IDs up to a maximum of 100. - * @param {String} [params.uuid] - Comma separated list of Interpretation UUIDs up to a maximum of 100. - * @param {String} [params.clinicalAnalysisId] - Clinical Analysis id. - * @param {String} [params.analystId] - Analyst ID. - * @param {String} [params.methodName] - Interpretation method name. - * @param {String} [params.panels] - Interpretation panels. - * @param {String} [params.primaryFindings] - Interpretation primary findings. - * @param {String} [params.secondaryFindings] - Interpretation secondary findings. - * @param {String} [params.creationDate] - Interpretation Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * @param {String} [params.modificationDate] - Interpretation Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, - * <201805. - * @param {String} [params.status] - Filter by status. - * @param {String} [params.internalStatus] - Filter by internal status. - * @param {String} [params.release] - Release when it was created. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - searchInterpretation(params) { - return this._get("analysis", null, "clinical/interpretation", null, "search", params); - } - - /** Clinical interpretation information - * @param {String} interpretations - Comma separated list of clinical interpretation IDs up to a maximum of 100. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.version] - Comma separated list of interpretation versions. 'all' to get all the interpretation versions. Not - * supported if multiple interpretation ids are provided. - * @param {Boolean} [params.deleted = "false"] - Boolean to retrieve deleted entries. The default value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - infoInterpretation(interpretations, params) { - return this._get("analysis", null, "clinical/interpretation", interpretations, "info", params); - } - - /** Run cancer tiering interpretation analysis - * @param {Object} data - Cancer tiering interpretation analysis params. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not - * provided. - * @param {String} [params.jobDescription] - Job description. - * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. - * @param {String} [params.jobTags] - Job tags. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - runInterpreterCancerTiering(data, params) { - return this._post("analysis", null, "clinical/interpreter/cancerTiering", null, "run", data, params); - } - - /** Run exomiser interpretation analysis - * @param {Object} data - Exomizer interpretation analysis params. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not - * provided. - * @param {String} [params.jobDescription] - Job description. - * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. - * @param {String} [params.jobTags] - Job tags. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - runInterpreterExomiser(data, params) { - return this._post("analysis", null, "clinical/interpreter/exomiser", null, "run", data, params); - } - - /** Run TEAM interpretation analysis - * @param {Object} data - TEAM interpretation analysis params. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not - * provided. - * @param {String} [params.jobDescription] - Job description. - * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. - * @param {String} [params.jobTags] - Job tags. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - runInterpreterTeam(data, params) { - return this._post("analysis", null, "clinical/interpreter/team", null, "run", data, params); - } - - /** Run tiering interpretation analysis - * @param {Object} data - Tiering interpretation analysis params. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not - * provided. - * @param {String} [params.jobDescription] - Job description. - * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. - * @param {String} [params.jobTags] - Job tags. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - runInterpreterTiering(data, params) { - return this._post("analysis", null, "clinical/interpreter/tiering", null, "run", data, params); - } - - /** Run Zetta interpretation analysis - * @param {Object} data - Zetta interpretation analysis params. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not - * provided. - * @param {String} [params.jobDescription] - Job description. - * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. - * @param {String} [params.jobTags] - Job tags. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - runInterpreterZetta(data, params) { - return this._post("analysis", null, "clinical/interpreter/zetta", null, "run", data, params); - } - - /** RGA aggregation stats - * @param {String} field - List of fields separated by semicolons, e.g.: clinicalSignificances;type. For nested fields use >>, e.g.: - * type>>clinicalSignificances;knockoutType. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {String} [params.sampleId] - Filter by sample id. - * @param {String} [params.individualId] - Filter by individual id. - * @param {String} [params.sex] - Filter by sex. - * @param {String} [params.phenotypes] - Filter by phenotypes. - * @param {String} [params.disorders] - Filter by disorders. - * @param {String} [params.numParents] - Filter by the number of parents registered. - * @param {String} [params.geneId] - Filter by gene id. - * @param {String} [params.geneName] - Filter by gene name. - * @param {String} [params.chromosome] - Filter by chromosome. - * @param {String} [params.start] - Filter by start position. - * @param {String} [params.end] - Filter by end position. - * @param {String} [params.transcriptId] - Filter by transcript id. - * @param {String} [params.variants] - Filter by variant id. - * @param {String} [params.dbSnps] - Filter by DB_SNP id. - * @param {String} [params.knockoutType] - Filter by knockout type. - * @param {String} [params.filter] - Filter by filter (PASS, NOT_PASS). - * @param {String} [params.type] - Filter by variant type. - * @param {String} [params.clinicalSignificance] - Filter by clinical significance. - * @param {String} [params.populationFrequency] - Filter by population frequency. - * @param {String} [params.consequenceType] - Filter by consequence type. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - aggregationStatsRga(field, params) { - return this._get("analysis", null, "clinical/rga", null, "aggregationStats", {field, ...params}); - } - - /** Query gene RGA - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.count] - Get the total number of results matching the query. Deactivated by default. - * @param {String} [params.includeIndividual] - Include only the comma separated list of individuals to the response. - * @param {Number} [params.skipIndividual] - Number of individuals to skip. - * @param {Number} [params.limitIndividual] - Limit number of individuals returned (default: 1000). - * @param {String} [params.sampleId] - Filter by sample id. - * @param {String} [params.individualId] - Filter by individual id. - * @param {String} [params.sex] - Filter by sex. - * @param {String} [params.phenotypes] - Filter by phenotypes. - * @param {String} [params.disorders] - Filter by disorders. - * @param {String} [params.numParents] - Filter by the number of parents registered. - * @param {String} [params.geneId] - Filter by gene id. - * @param {String} [params.geneName] - Filter by gene name. - * @param {String} [params.chromosome] - Filter by chromosome. - * @param {String} [params.start] - Filter by start position. - * @param {String} [params.end] - Filter by end position. - * @param {String} [params.transcriptId] - Filter by transcript id. - * @param {String} [params.variants] - Filter by variant id. - * @param {String} [params.dbSnps] - Filter by DB_SNP id. - * @param {String} [params.knockoutType] - Filter by knockout type. - * @param {String} [params.filter] - Filter by filter (PASS, NOT_PASS). - * @param {String} [params.type] - Filter by variant type. - * @param {String} [params.clinicalSignificance] - Filter by clinical significance. - * @param {String} [params.populationFrequency] - Filter by population frequency. - * @param {String} [params.consequenceType] - Filter by consequence type. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - queryRgaGene(params) { - return this._get("analysis", null, "clinical/rga/gene", null, "query", params); - } - - /** RGA gene summary stats - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.count] - Get the total number of results matching the query. Deactivated by default. - * @param {String} [params.sampleId] - Filter by sample id. - * @param {String} [params.individualId] - Filter by individual id. - * @param {String} [params.sex] - Filter by sex. - * @param {String} [params.phenotypes] - Filter by phenotypes. - * @param {String} [params.disorders] - Filter by disorders. - * @param {String} [params.numParents] - Filter by the number of parents registered. - * @param {String} [params.geneId] - Filter by gene id. - * @param {String} [params.geneName] - Filter by gene name. - * @param {String} [params.chromosome] - Filter by chromosome. - * @param {String} [params.start] - Filter by start position. - * @param {String} [params.end] - Filter by end position. - * @param {String} [params.transcriptId] - Filter by transcript id. - * @param {String} [params.variants] - Filter by variant id. - * @param {String} [params.dbSnps] - Filter by DB_SNP id. - * @param {String} [params.knockoutType] - Filter by knockout type. - * @param {String} [params.filter] - Filter by filter (PASS, NOT_PASS). - * @param {String} [params.type] - Filter by variant type. - * @param {String} [params.clinicalSignificance] - Filter by clinical significance. - * @param {String} [params.populationFrequency] - Filter by population frequency. - * @param {String} [params.consequenceType] - Filter by consequence type. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - summaryRgaGene(params) { - return this._get("analysis", null, "clinical/rga/gene", null, "summary", params); - } - - /** Generate Recessive Gene Analysis secondary index - * @param {Object} data - Recessive Gene Analysis index params. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.jobId] - Job ID. It must be a unique string within the study. An ID will be autogenerated automatically if not - * provided. - * @param {String} [params.jobDescription] - Job description. - * @param {String} [params.jobDependsOn] - Comma separated list of existing job IDs the job will depend on. - * @param {String} [params.jobTags] - Job tags. - * @param {Boolean} [params.auxiliarIndex = "false"] - Index auxiliar collection to improve performance assuming RGA is completely - * indexed. The default value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - runRgaIndex(data, params) { - return this._post("analysis", null, "clinical/rga/index", null, "run", data, params); - } - - /** Query individual RGA - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.count] - Get the total number of results matching the query. Deactivated by default. - * @param {String} [params.sampleId] - Filter by sample id. - * @param {String} [params.individualId] - Filter by individual id. - * @param {String} [params.sex] - Filter by sex. - * @param {String} [params.phenotypes] - Filter by phenotypes. - * @param {String} [params.disorders] - Filter by disorders. - * @param {String} [params.numParents] - Filter by the number of parents registered. - * @param {String} [params.geneId] - Filter by gene id. - * @param {String} [params.geneName] - Filter by gene name. - * @param {String} [params.chromosome] - Filter by chromosome. - * @param {String} [params.start] - Filter by start position. - * @param {String} [params.end] - Filter by end position. - * @param {String} [params.transcriptId] - Filter by transcript id. - * @param {String} [params.variants] - Filter by variant id. - * @param {String} [params.dbSnps] - Filter by DB_SNP id. - * @param {String} [params.knockoutType] - Filter by knockout type. - * @param {String} [params.filter] - Filter by filter (PASS, NOT_PASS). - * @param {String} [params.type] - Filter by variant type. - * @param {String} [params.clinicalSignificance] - Filter by clinical significance. - * @param {String} [params.populationFrequency] - Filter by population frequency. - * @param {String} [params.consequenceType] - Filter by consequence type. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - queryRgaIndividual(params) { - return this._get("analysis", null, "clinical/rga/individual", null, "query", params); - } - - /** RGA individual summary stats - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.count] - Get the total number of results matching the query. Deactivated by default. - * @param {String} [params.sampleId] - Filter by sample id. - * @param {String} [params.individualId] - Filter by individual id. - * @param {String} [params.sex] - Filter by sex. - * @param {String} [params.phenotypes] - Filter by phenotypes. - * @param {String} [params.disorders] - Filter by disorders. - * @param {String} [params.numParents] - Filter by the number of parents registered. - * @param {String} [params.geneId] - Filter by gene id. - * @param {String} [params.geneName] - Filter by gene name. - * @param {String} [params.chromosome] - Filter by chromosome. - * @param {String} [params.start] - Filter by start position. - * @param {String} [params.end] - Filter by end position. - * @param {String} [params.transcriptId] - Filter by transcript id. - * @param {String} [params.variants] - Filter by variant id. - * @param {String} [params.dbSnps] - Filter by DB_SNP id. - * @param {String} [params.knockoutType] - Filter by knockout type. - * @param {String} [params.filter] - Filter by filter (PASS, NOT_PASS). - * @param {String} [params.type] - Filter by variant type. - * @param {String} [params.clinicalSignificance] - Filter by clinical significance. - * @param {String} [params.populationFrequency] - Filter by population frequency. - * @param {String} [params.consequenceType] - Filter by consequence type. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - summaryRgaIndividual(params) { - return this._get("analysis", null, "clinical/rga/individual", null, "summary", params); - } - - /** Query variant RGA - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.count] - Get the total number of results matching the query. Deactivated by default. - * @param {String} [params.includeIndividual] - Include only the comma separated list of individuals to the response. - * @param {Number} [params.skipIndividual] - Number of individuals to skip. - * @param {Number} [params.limitIndividual] - Limit number of individuals returned (default: 1000). - * @param {String} [params.sampleId] - Filter by sample id. - * @param {String} [params.individualId] - Filter by individual id. - * @param {String} [params.sex] - Filter by sex. - * @param {String} [params.phenotypes] - Filter by phenotypes. - * @param {String} [params.disorders] - Filter by disorders. - * @param {String} [params.numParents] - Filter by the number of parents registered. - * @param {String} [params.geneId] - Filter by gene id. - * @param {String} [params.geneName] - Filter by gene name. - * @param {String} [params.chromosome] - Filter by chromosome. - * @param {String} [params.start] - Filter by start position. - * @param {String} [params.end] - Filter by end position. - * @param {String} [params.transcriptId] - Filter by transcript id. - * @param {String} [params.variants] - Filter by variant id. - * @param {String} [params.dbSnps] - Filter by DB_SNP id. - * @param {String} [params.knockoutType] - Filter by knockout type. - * @param {String} [params.filter] - Filter by filter (PASS, NOT_PASS). - * @param {String} [params.type] - Filter by variant type. - * @param {String} [params.clinicalSignificance] - Filter by clinical significance. - * @param {String} [params.populationFrequency] - Filter by population frequency. - * @param {String} [params.consequenceType] - Filter by consequence type. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - queryRgaVariant(params) { - return this._get("analysis", null, "clinical/rga/variant", null, "query", params); - } - - /** RGA variant summary stats - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.count] - Get the total number of results matching the query. Deactivated by default. - * @param {String} [params.sampleId] - Filter by sample id. - * @param {String} [params.individualId] - Filter by individual id. - * @param {String} [params.sex] - Filter by sex. - * @param {String} [params.phenotypes] - Filter by phenotypes. - * @param {String} [params.disorders] - Filter by disorders. - * @param {String} [params.numParents] - Filter by the number of parents registered. - * @param {String} [params.geneId] - Filter by gene id. - * @param {String} [params.geneName] - Filter by gene name. - * @param {String} [params.chromosome] - Filter by chromosome. - * @param {String} [params.start] - Filter by start position. - * @param {String} [params.end] - Filter by end position. - * @param {String} [params.transcriptId] - Filter by transcript id. - * @param {String} [params.variants] - Filter by variant id. - * @param {String} [params.dbSnps] - Filter by DB_SNP id. - * @param {String} [params.knockoutType] - Filter by knockout type. - * @param {String} [params.filter] - Filter by filter (PASS, NOT_PASS). - * @param {String} [params.type] - Filter by variant type. - * @param {String} [params.clinicalSignificance] - Filter by clinical significance. - * @param {String} [params.populationFrequency] - Filter by population frequency. - * @param {String} [params.consequenceType] - Filter by consequence type. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - summaryRgaVariant(params) { - return this._get("analysis", null, "clinical/rga/variant", null, "summary", params); - } - - /** Clinical analysis search. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.count = "false"] - Get the total number of results matching the query. Deactivated by default. The default - * value is false. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.id] - Comma separated list of Clinical Analysis IDs up to a maximum of 100. - * @param {String} [params.uuid] - Comma separated list of Clinical Analysis UUIDs up to a maximum of 100. - * @param {String} [params.type] - Clinical Analysis type. - * @param {String} [params.disorder] - Clinical Analysis disorder. - * @param {String} [params.files] - Clinical Analysis files. - * @param {String} [params.sample] - Sample associated to the proband or any member of a family. - * @param {String} [params.individual] - Proband or any member of a family. - * @param {String} [params.proband] - Clinical Analysis proband. - * @param {String} [params.probandSamples] - Clinical Analysis proband samples. - * @param {String} [params.family] - Clinical Analysis family. - * @param {String} [params.familyMembers] - Clinical Analysis family members. - * @param {String} [params.familyMemberSamples] - Clinical Analysis family members samples. - * @param {String} [params.panels] - Clinical Analysis panels. - * @param {Boolean} [params.locked] - Locked Clinical Analyses. - * @param {String} [params.analystId] - Clinical Analysis analyst id. - * @param {String} [params.priority] - Clinical Analysis priority. - * @param {String} [params.flags] - Clinical Analysis flags. - * @param {String} [params.creationDate] - Clinical Analysis Creation date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * @param {String} [params.modificationDate] - Clinical Analysis Modification date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, - * <201805. - * @param {String} [params.dueDate] - Clinical Analysis due date. Format: yyyyMMddHHmmss. Examples: >2018, 2017-2018, <201805. - * @param {String} [params.qualityControlSummary] - Clinical Analysis quality control summary. - * @param {String} [params.release] - Release when it was created. - * @param {String} [params.status] - Filter by status. - * @param {String} [params.internalStatus] - Filter by internal status. - * @param {Boolean} [params.deleted] - Boolean to retrieve deleted entries. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - search(params) { - return this._get("analysis", null, "clinical", null, "search", params); - } - - /** Fetch actionable clinical variants - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.sample] - Sample ID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - actionableVariant(params) { - return this._get("analysis", null, "clinical/variant", null, "actionable", params); - } - - /** Fetch clinical variants - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {Number} [params.limit] - Number of results to be returned. - * @param {Number} [params.skip] - Number of results to skip. - * @param {Boolean} [params.count] - Get the total number of results matching the query. Deactivated by default. - * @param {Boolean} [params.approximateCount] - Get an approximate count, instead of an exact total count. Reduces execution time. - * @param {Number} [params.approximateCountSamplingSize] - Sampling size to get the approximate count. Larger values increase accuracy - * but also increase execution time. - * @param {String} [params.savedFilter] - Use a saved filter at User level. - * @param {String} [params.id] - List of IDs, these can be rs IDs (dbSNP) or variants in the format chrom:start:ref:alt, e.g. - * rs116600158,19:7177679:C:T. - * @param {String} [params.region] - List of regions, these can be just a single chromosome name or regions in the format chr:start-end, - * e.g.: 2,3:100000-200000. - * @param {String} [params.type] - List of types, accepted values are SNV, MNV, INDEL, SV, COPY_NUMBER, COPY_NUMBER_LOSS, - * COPY_NUMBER_GAIN, INSERTION, DELETION, DUPLICATION, TANDEM_DUPLICATION, BREAKEND, e.g. SNV,INDEL. - * @param {String} [params.study] - Filter variants from the given studies, these can be either the numeric ID or the alias with the - * format user@project:study. - * @param {String} [params.file] - Filter variants from the files specified. This will set includeFile parameter when not provided. - * @param {String} [params.filter] - Specify the FILTER for any of the files. If 'file' filter is provided, will match the file and the - * filter. e.g.: PASS,LowGQX. - * @param {String} [params.qual] - Specify the QUAL for any of the files. If 'file' filter is provided, will match the file and the qual. - * e.g.: >123.4. - * @param {String} [params.fileData] - Filter by file data (i.e. FILTER, QUAL and INFO columns from VCF file). - * [{file}:]{key}{op}{value}[,;]* . If no file is specified, will use all files from "file" filter. e.g. AN>200 or - * file_1.vcf:AN>200;file_2.vcf:AN<10 . Many fields can be combined. e.g. file_1.vcf:AN>200;DB=true;file_2.vcf:AN<10,FILTER=PASS,LowDP. - * @param {String} [params.sample] - Filter variants by sample genotype. This will automatically set 'includeSample' parameter when not - * provided. This filter accepts multiple 3 forms: 1) List of samples: Samples that contain the main variant. Accepts AND (;) and OR (,) - * operators. e.g. HG0097,HG0098 . 2) List of samples with genotypes: {sample}:{gt1},{gt2}. Accepts AND (;) and OR (,) operators. e.g. - * HG0097:0/0;HG0098:0/1,1/1 . Unphased genotypes (e.g. 0/1, 1/1) will also include phased genotypes (e.g. 0|1, 1|0, 1|1), but not vice - * versa. When filtering by multi-allelic genotypes, any secondary allele will match, regardless of its position e.g. 1/2 will match with - * genotypes 1/2, 1/3, 1/4, .... Genotype aliases accepted: HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT, HET_MISS and MISS e.g. - * HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3) Sample with segregation mode: {sample}:{segregation}. Only one sample accepted.Accepted - * segregation modes: [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, - * mendelianError, compoundHeterozygous ]. Value is case insensitive. e.g. HG0097:DeNovo Sample must have parents defined and indexed. . - * @param {String} [params.sampleData] - Filter by any SampleData field from samples. [{sample}:]{key}{op}{value}[,;]* . If no sample is - * specified, will use all samples from "sample" or "genotype" filter. e.g. DP>200 or HG0097:DP>200,HG0098:DP<10 . Many FORMAT fields can - * be combined. e.g. HG0097:DP>200;GT=1/1,0/1,HG0098:DP<10. - * @param {String} [params.sampleAnnotation] - Selects some samples using metadata information from Catalog. e.g. - * age>20;phenotype=hpo:123,hpo:456;name=smith. - * @param {String} [params.cohort] - Select variants with calculated stats for the selected cohorts. - * @param {String} [params.cohortStatsRef] - Reference Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - * @param {String} [params.cohortStatsAlt] - Alternate Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - * @param {String} [params.cohortStatsMaf] - Minor Allele Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - * @param {String} [params.cohortStatsMgf] - Minor Genotype Frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL<=0.4. - * @param {String} [params.cohortStatsPass] - Filter PASS frequency: [{study:}]{cohort}[<|>|<=|>=]{number}. e.g. ALL>0.8. - * @param {String} [params.missingAlleles] - Number of missing alleles: [{study:}]{cohort}[<|>|<=|>=]{number}. - * @param {String} [params.missingGenotypes] - Number of missing genotypes: [{study:}]{cohort}[<|>|<=|>=]{number}. - * @param {String} [params.score] - Filter by variant score: [{study:}]{score}[<|>|<=|>=]{number}. - * @param {String} [params.family] - Filter variants where any of the samples from the given family contains the variant (HET or - * HOM_ALT). - * @param {String} [params.familyDisorder] - Specify the disorder to use for the family segregation. - * @param {String} [params.familySegregation] - Filter by segregation mode from a given family. Accepted values: [ autosomalDominant, - * autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, compoundHeterozygous ]. - * @param {String} [params.familyMembers] - Sub set of the members of a given family. - * @param {String} [params.familyProband] - Specify the proband child to use for the family segregation. - * @param {String} [params.gene] - List of genes, most gene IDs are accepted (HGNC, Ensembl gene, ...). This is an alias to 'xref' - * parameter. - * @param {String} [params.ct] - List of SO consequence types, e.g. missense_variant,stop_lost or SO:0001583,SO:0001578. Accepts aliases - * 'loss_of_function' and 'protein_altering'. - * @param {String} [params.xref] - List of any external reference, these can be genes, proteins or variants. Accepted IDs include HGNC, - * Ensembl genes, dbSNP, ClinVar, HPO, Cosmic, ... - * @param {String} [params.biotype] - List of biotypes, e.g. protein_coding. - * @param {String} [params.proteinSubstitution] - Protein substitution scores include SIFT and PolyPhen. You can query using the score - * {protein_score}[<|>|<=|>=]{number} or the description {protein_score}[~=|=]{description} e.g. polyphen>0.1,sift=tolerant. - * @param {String} [params.conservation] - Filter by conservation score: {conservation_score}[<|>|<=|>=]{number} e.g. - * phastCons>0.5,phylop<0.1,gerp>0.1. - * @param {String} [params.populationFrequencyAlt] - Alternate Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. - * 1000G:ALL<0.01. - * @param {String} [params.populationFrequencyRef] - Reference Population Frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. - * 1000G:ALL<0.01. - * @param {String} [params.populationFrequencyMaf] - Population minor allele frequency: {study}:{population}[<|>|<=|>=]{number}. e.g. - * 1000G:ALL<0.01. - * @param {String} [params.transcriptFlag] - List of transcript flags. e.g. canonical, CCDS, basic, LRG, MANE Select, MANE Plus Clinical, - * EGLH_HaemOnc, TSO500. - * @param {String} [params.geneTraitId] - List of gene trait association id. e.g. "umls:C0007222" , "OMIM:269600". - * @param {String} [params.go] - List of GO (Gene Ontology) terms. e.g. "GO:0002020". - * @param {String} [params.expression] - List of tissues of interest. e.g. "lung". - * @param {String} [params.proteinKeyword] - List of Uniprot protein variant annotation keywords. - * @param {String} [params.drug] - List of drug names. - * @param {String} [params.functionalScore] - Functional score: {functional_score}[<|>|<=|>=]{number} e.g. cadd_scaled>5.2 , - * cadd_raw<=0.3. - * @param {String} [params.clinical] - Clinical source: clinvar, cosmic. - * @param {String} [params.clinicalSignificance] - Clinical significance: benign, likely_benign, likely_pathogenic, pathogenic. - * @param {Boolean} [params.clinicalConfirmedStatus] - Clinical confirmed status. - * @param {String} [params.customAnnotation] - Custom annotation: {key}[<|>|<=|>=]{number} or {key}[~=|=]{text}. - * @param {String} [params.panel] - Filter by genes from the given disease panel. - * @param {String} [params.panelModeOfInheritance] - Filter genes from specific panels that match certain mode of inheritance. Accepted - * values : [ autosomalDominant, autosomalRecessive, XLinkedDominant, XLinkedRecessive, YLinked, mitochondrial, deNovo, mendelianError, - * compoundHeterozygous ]. - * @param {String} [params.panelConfidence] - Filter genes from specific panels that match certain confidence. Accepted values : [ high, - * medium, low, rejected ]. - * @param {String} [params.panelRoleInCancer] - Filter genes from specific panels that match certain role in cancer. Accepted values : [ - * both, oncogene, tumorSuppressorGene, fusion ]. - * @param {String} [params.panelFeatureType] - Filter elements from specific panels by type. Accepted values : [ gene, region, str, - * variant ]. - * @param {Boolean} [params.panelIntersection] - Intersect panel genes and regions with given genes and regions from que input query. - * This will prevent returning variants from regions out of the panel. - * @param {String} [params.trait] - List of traits, based on ClinVar, HPO, COSMIC, i.e.: IDs, histologies, descriptions,... - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - queryVariant(params) { - return this._get("analysis", null, "clinical/variant", null, "query", params); - } - - /** Returns the acl of the clinical analyses. If member is provided, it will only return the acl for the member. - * @param {String} clinicalAnalyses - Comma separated list of clinical analysis IDs or names up to a maximum of 100. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {String} [params.member] - User or group ID. - * @param {Boolean} [params.silent = "false"] - Boolean to retrieve all possible entries that are queried for, false to raise an - * exception whenever one of the entries looked for cannot be shown for whichever reason. The default value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - acl(clinicalAnalyses, params) { - return this._get("analysis", null, "clinical", clinicalAnalyses, "acl", params); - } - - /** Delete clinical analyses - * @param {String} clinicalAnalyses - Comma separated list of clinical analysis IDs or names up to a maximum of 100. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {Boolean} [params.force = "false"] - Force deletion if the ClinicalAnalysis contains interpretations or is locked. The default - * value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - delete(clinicalAnalyses, params) { - return this._delete("analysis", null, "clinical", clinicalAnalyses, "delete", params); - } - - /** Update clinical analysis attributes - * @param {String} clinicalAnalyses - Comma separated list of clinical analysis IDs. - * @param {Object} data - JSON containing clinical analysis information. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {"ADD"|"REMOVE"|"REPLACE"} [params.commentsAction = "ADD"] - Action to be performed if the array of comments is being updated. - * The default value is ADD. - * @param {"ADD"|"SET"|"REMOVE"} [params.flagsAction = "ADD"] - Action to be performed if the array of flags is being updated. The - * default value is ADD. - * @param {"ADD"|"SET"|"REMOVE"} [params.filesAction = "ADD"] - Action to be performed if the array of files is being updated. The - * default value is ADD. - * @param {"ADD"|"SET"|"REMOVE"} [params.panelsAction = "ADD"] - Action to be performed if the array of panels is being updated. The - * default value is ADD. - * @param {Boolean} [params.includeResult = "false"] - Flag indicating to include the created or updated document result in the response. - * The default value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - update(clinicalAnalyses, data, params) { - return this._post("analysis", null, "clinical", clinicalAnalyses, "update", data, params); - } - - /** Clinical analysis info - * @param {String} clinicalAnalysis - Comma separated list of clinical analysis IDs or names up to a maximum of 100. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {String} [params.study] - Study [[user@]project:]study where study and project can be either the ID or UUID. - * @param {Boolean} [params.deleted = "false"] - Boolean to retrieve deleted entries. The default value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - info(clinicalAnalysis, params) { - return this._get("analysis", null, "clinical", clinicalAnalysis, "info", params); - } - - /** Create a new Interpretation - * @param {String} clinicalAnalysis - Clinical analysis ID. - * @param {Object} data - JSON containing clinical interpretation information. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {String} [params.study] - [[user@]project:]study id. - * @param {"PRIMARY"|"SECONDARY"} [params.setAs = "SECONDARY"] - Set interpretation as. The default value is SECONDARY. - * @param {Boolean} [params.includeResult = "false"] - Flag indicating to include the created or updated document result in the response. - * The default value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - createInterpretation(clinicalAnalysis, data, params) { - return this._post("analysis/clinical", clinicalAnalysis, "interpretation", null, "create", data, params); - } - - /** Clear the fields of the main interpretation of the Clinical Analysis - * @param {String} interpretations - Interpretation IDs of the Clinical Analysis. - * @param {String} clinicalAnalysis - Clinical analysis ID. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - [[user@]project:]study ID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - clearInterpretation(clinicalAnalysis, interpretations, params) { - return this._post("analysis/clinical", clinicalAnalysis, "interpretation", interpretations, "clear", params); - } - - /** Delete interpretation - * @param {String} clinicalAnalysis - Clinical analysis ID. - * @param {String} interpretations - Interpretation IDs of the Clinical Analysis. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - [[user@]project:]study ID. - * @param {String} [params.setAsPrimary] - Interpretation id to set as primary from the list of secondaries in case of deleting the - * actual primary one. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - deleteInterpretation(clinicalAnalysis, interpretations, params) { - return this._delete("analysis/clinical", clinicalAnalysis, "interpretation", interpretations, "delete", params); - } - - /** Revert to a previous interpretation version - * @param {String} clinicalAnalysis - Clinical analysis ID. - * @param {String} interpretation - Interpretation ID. - * @param {Number} version - Version to revert to. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.study] - [[user@]project:]study ID. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - revertInterpretation(clinicalAnalysis, interpretation, version, params) { - return this._post("analysis/clinical", clinicalAnalysis, "interpretation", interpretation, "revert", {version, ...params}); - } - - /** Update interpretation fields - * @param {String} clinicalAnalysis - Clinical analysis ID. - * @param {String} interpretation - Interpretation ID. - * @param {Object} data - JSON containing clinical interpretation information. - * @param {Object} [params] - The Object containing the following optional parameters: - * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. - * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. - * @param {String} [params.study] - [[user@]project:]study ID. - * @param {"ADD"|"SET"|"REMOVE"|"REPLACE"} [params.primaryFindingsAction = "ADD"] - Action to be performed if the array of primary - * findings is being updated. The default value is ADD. - * @param {"ADD"|"SET"|"REMOVE"} [params.methodsAction = "ADD"] - Action to be performed if the array of methods is being updated. The - * default value is ADD. - * @param {"ADD"|"SET"|"REMOVE"|"REPLACE"} [params.secondaryFindingsAction = "ADD"] - Action to be performed if the array of secondary - * findings is being updated. The default value is ADD. - * @param {"ADD"|"REMOVE"|"REPLACE"} [params.commentsAction = "ADD"] - Action to be performed if the array of comments is being updated. - * To REMOVE or REPLACE, the date will need to be provided to identify the comment. The default value is ADD. - * @param {"ADD"|"SET"|"REMOVE"} [params.panelsAction = "ADD"] - Action to be performed if the array of panels is being updated. The - * default value is ADD. - * @param {"PRIMARY"|"SECONDARY"} [params.setAs] - Set interpretation as. - * @param {Boolean} [params.includeResult = "false"] - Flag indicating to include the created or updated document result in the response. - * The default value is false. - * @returns {Promise} Promise object in the form of RestResponse instance. - */ - updateInterpretation(clinicalAnalysis, interpretation, data, params) { - return this._post("analysis/clinical", clinicalAnalysis, "interpretation", interpretation, "update", data, params); - } - -} \ No newline at end of file diff --git a/opencga-client/src/main/javascript/ClinicalAnalysis.js b/opencga-client/src/main/javascript/ClinicalAnalysis.js index 6390431f8da..2d47cced785 100644 --- a/opencga-client/src/main/javascript/ClinicalAnalysis.js +++ b/opencga-client/src/main/javascript/ClinicalAnalysis.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -860,4 +860,25 @@ export default class ClinicalAnalysis extends OpenCGAParentClass { return this._post("analysis/clinical", clinicalAnalysis, "interpretation", interpretation, "update", data, params); } + /** Update clinical analysis report + * @param {String} clinicalAnalysis - Clinical analysis ID. + * @param {Object} data - JSON containing clinical report information. + * @param {Object} [params] - The Object containing the following optional parameters: + * @param {String} [params.include] - Fields included in the response, whole JSON path must be provided. + * @param {String} [params.exclude] - Fields excluded in the response, whole JSON path must be provided. + * @param {String} [params.study] - Study [[organization@]project:]study where study and project can be either the ID or UUID. + * @param {"ADD REMOVE REPLACE"} [params.commentsAction = "ADD"] - Action to be performed if the array of comments is being updated. The + * default value is ADD. + * @param {"ADD SET REMOVE"} [params.supportingEvidencesAction = "ADD"] - Action to be performed if the array of supporting evidences is + * being updated. The default value is ADD. + * @param {"ADD SET REMOVE"} [params.filesAction = "ADD"] - Action to be performed if the array of files is being updated. The default + * value is ADD. + * @param {Boolean} [params.includeResult = "false"] - Flag indicating to include the created or updated document result in the response. + * The default value is false. + * @returns {Promise} Promise object in the form of RestResponse instance. + */ + updateReport(clinicalAnalysis, data, params) { + return this._post("analysis/clinical", clinicalAnalysis, "report", null, "update", data, params); + } + } \ No newline at end of file diff --git a/opencga-client/src/main/javascript/Cohort.js b/opencga-client/src/main/javascript/Cohort.js index 6b8ab16cb1d..237d874af6f 100644 --- a/opencga-client/src/main/javascript/Cohort.js +++ b/opencga-client/src/main/javascript/Cohort.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/DiseasePanel.js b/opencga-client/src/main/javascript/DiseasePanel.js index 1a83bbd6a26..44b47ec7d9f 100644 --- a/opencga-client/src/main/javascript/DiseasePanel.js +++ b/opencga-client/src/main/javascript/DiseasePanel.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Family.js b/opencga-client/src/main/javascript/Family.js index ef938cd64c9..028113d98b3 100644 --- a/opencga-client/src/main/javascript/Family.js +++ b/opencga-client/src/main/javascript/Family.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/File.js b/opencga-client/src/main/javascript/File.js index adac7ffc6fa..4419c507e8e 100644 --- a/opencga-client/src/main/javascript/File.js +++ b/opencga-client/src/main/javascript/File.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/GA4GH.js b/opencga-client/src/main/javascript/GA4GH.js index 67c191b5710..b06055721c4 100644 --- a/opencga-client/src/main/javascript/GA4GH.js +++ b/opencga-client/src/main/javascript/GA4GH.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Individual.js b/opencga-client/src/main/javascript/Individual.js index 1b6366f8ff0..a3307d522da 100644 --- a/opencga-client/src/main/javascript/Individual.js +++ b/opencga-client/src/main/javascript/Individual.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Job.js b/opencga-client/src/main/javascript/Job.js index 065b92a75d8..b83184040e6 100644 --- a/opencga-client/src/main/javascript/Job.js +++ b/opencga-client/src/main/javascript/Job.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Meta.js b/opencga-client/src/main/javascript/Meta.js index 7e42eb048d1..7028dd5ea71 100644 --- a/opencga-client/src/main/javascript/Meta.js +++ b/opencga-client/src/main/javascript/Meta.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. @@ -58,11 +58,12 @@ export default class Meta extends OpenCGAParentClass { } /** Opencga model webservices. - * + * @param {Object} [params] - The Object containing the following optional parameters: + * @param {String} [params.model] - Model description. * @returns {Promise} Promise object in the form of RestResponse instance. */ - model() { - return this._get("meta", null, null, null, "model"); + model(params) { + return this._get("meta", null, null, null, "model", params); } /** Ping Opencga webservices. diff --git a/opencga-client/src/main/javascript/Organization.js b/opencga-client/src/main/javascript/Organization.js index 5102f6b76b5..3884dc598da 100644 --- a/opencga-client/src/main/javascript/Organization.js +++ b/opencga-client/src/main/javascript/Organization.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Project.js b/opencga-client/src/main/javascript/Project.js index b2307a44a8f..3767afc6bca 100644 --- a/opencga-client/src/main/javascript/Project.js +++ b/opencga-client/src/main/javascript/Project.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Sample.js b/opencga-client/src/main/javascript/Sample.js index 04a70eb6d6a..1d4f379fa33 100644 --- a/opencga-client/src/main/javascript/Sample.js +++ b/opencga-client/src/main/javascript/Sample.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Study.js b/opencga-client/src/main/javascript/Study.js index 83caa14961b..b170fbf1c16 100644 --- a/opencga-client/src/main/javascript/Study.js +++ b/opencga-client/src/main/javascript/Study.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/User.js b/opencga-client/src/main/javascript/User.js index dc60a5a9bfa..c5c7544c653 100644 --- a/opencga-client/src/main/javascript/User.js +++ b/opencga-client/src/main/javascript/User.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/Variant.js b/opencga-client/src/main/javascript/Variant.js index 2ee8e9882b5..98d42a16fd2 100644 --- a/opencga-client/src/main/javascript/Variant.js +++ b/opencga-client/src/main/javascript/Variant.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/javascript/VariantOperation.js b/opencga-client/src/main/javascript/VariantOperation.js index 4ae38846bd4..9ceb02dd57d 100644 --- a/opencga-client/src/main/javascript/VariantOperation.js +++ b/opencga-client/src/main/javascript/VariantOperation.js @@ -12,7 +12,7 @@ * WARNING: AUTOGENERATED CODE * * This code was generated by a tool. - * Autogenerated on: 2024-03-04 + * Autogenerated on: 2024-03-06 * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py index fc501c27f87..85bf0da3b3e 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/admin_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py index 713e21ed980..34e898b9f67 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/alignment_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py index 17bd6b2ca38..0cdeeda33d7 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/clinical_analysis_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -1088,3 +1088,30 @@ def update_interpretation(self, clinical_analysis, interpretation, data=None, ** return self._post(category='analysis/clinical', resource='update', query_id=clinical_analysis, subcategory='interpretation', second_query_id=interpretation, data=data, **options) + def update_report(self, clinical_analysis, data=None, **options): + """ + Update clinical analysis report. + PATH: /{apiVersion}/analysis/clinical/{clinicalAnalysis}/report/update + + :param dict data: JSON containing clinical report information. + (REQUIRED) + :param str clinical_analysis: Clinical analysis ID. (REQUIRED) + :param str include: Fields included in the response, whole JSON path + must be provided. + :param str exclude: Fields excluded in the response, whole JSON path + must be provided. + :param str study: Study [[organization@]project:]study where study and + project can be either the ID or UUID. + :param str comments_action: Action to be performed if the array of + comments is being updated. Allowed values: ['ADD REMOVE REPLACE'] + :param str supporting_evidences_action: Action to be performed if the + array of supporting evidences is being updated. Allowed values: + ['ADD SET REMOVE'] + :param str files_action: Action to be performed if the array of files + is being updated. Allowed values: ['ADD SET REMOVE'] + :param bool include_result: Flag indicating to include the created or + updated document result in the response. + """ + + return self._post(category='analysis/clinical', resource='update', query_id=clinical_analysis, subcategory='report', data=data, **options) + diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py index 0146948677b..d0081675985 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/cohort_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py index 46fb2ba4414..ad7fc8a94a5 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/disease_panel_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py index a8c8ca3b884..a2d849ec0b7 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/family_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py index e65ef171cfb..b9b998ba72f 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/file_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py index cc8d7089afc..01f77db3bac 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/ga4gh_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py index 5179f72d86a..7243a4f0865 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/individual_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py index f4d7eb3265b..e37e64878e3 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/job_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py index 6d6f3512234..515d9c60bcd 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/meta_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. @@ -51,6 +51,8 @@ def model(self, **options): """ Opencga model webservices. PATH: /{apiVersion}/meta/model + + :param str model: Model description. """ return self._get(category='meta', resource='model', **options) diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/organization_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/organization_client.py index 7938fd9bed5..cac13370617 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/organization_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/organization_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py index 4007df86afc..5e403ca5027 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/project_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py index 083b2b1827c..e9307f29656 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/sample_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py index 2d4552feb5e..5c2907ee8e4 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/study_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py index 44e283b47d0..12e2c801ea7 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/user_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py index 150d0de143e..99976a5ae1b 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py b/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py index 2e97b915706..9a9a5fca230 100644 --- a/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py +++ b/opencga-client/src/main/python/pyopencga/rest_clients/variant_operation_client.py @@ -2,7 +2,7 @@ WARNING: AUTOGENERATED CODE This code was generated by a tool. - Autogenerated on: 2024-03-04 + Autogenerated on: 2024-03-06 Manual changes to this file may cause unexpected behavior in your application. Manual changes to this file will be overwritten if the code is regenerated. diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/MetaWSServer.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/MetaWSServer.java index 47896b43f5f..6569dd3effe 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/MetaWSServer.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/MetaWSServer.java @@ -110,7 +110,7 @@ public Response status() { @GET @Path("/model") @ApiOperation(value = "Opencga model webservices.", response = String.class) - public Response model(@QueryParam("model") String modelStr) { + public Response model(@ApiParam(value = "Model description") @QueryParam("model") String modelStr) { return run(() -> new OpenCGAResult<>(0, Collections.emptyList(), 1, Collections.singletonList(DataModelsUtils.dataModelToJsonString(modelStr, false)), 1)); diff --git a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java index 1084d90c274..d69c237e421 100644 --- a/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java +++ b/opencga-server/src/main/java/org/opencb/opencga/server/rest/analysis/ClinicalWebService.java @@ -275,6 +275,51 @@ public Response update( } } + @POST + @Path("/{clinicalAnalysis}/report/update") + @Consumes(MediaType.APPLICATION_JSON) + @ApiOperation(value = "Update clinical analysis report", response = ClinicalReport.class) + @ApiImplicitParams({ + @ApiImplicitParam(name = QueryOptions.INCLUDE, value = ParamConstants.INCLUDE_DESCRIPTION, + dataType = "string", paramType = "query"), + @ApiImplicitParam(name = QueryOptions.EXCLUDE, value = ParamConstants.EXCLUDE_DESCRIPTION, + dataType = "string", paramType = "query") + }) + public Response updateReport( + @ApiParam(value = "Clinical analysis ID") @PathParam(value = "clinicalAnalysis") String clinicalAnalysisStr, + @ApiParam(value = ParamConstants.STUDY_DESCRIPTION) @QueryParam(ParamConstants.STUDY_PARAM) String studyStr, + @ApiParam(value = "Action to be performed if the array of comments is being updated.", allowableValues = "ADD,REMOVE,REPLACE", defaultValue = "ADD") + @QueryParam("commentsAction") ParamUtils.AddRemoveReplaceAction commentsAction, + @ApiParam(value = "Action to be performed if the array of supporting evidences is being updated.", allowableValues = "ADD,SET,REMOVE", defaultValue = "ADD") + @QueryParam("supportingEvidencesAction") ParamUtils.BasicUpdateAction supportingEvidencesAction, + @ApiParam(value = "Action to be performed if the array of files is being updated.", allowableValues = "ADD,SET,REMOVE", defaultValue = "ADD") + @QueryParam("filesAction") ParamUtils.BasicUpdateAction filesAction, + @ApiParam(value = ParamConstants.INCLUDE_RESULT_DESCRIPTION, defaultValue = "false") @QueryParam(ParamConstants.INCLUDE_RESULT_PARAM) boolean includeResult, + @ApiParam(name = "body", value = "JSON containing clinical report information", required = true) ClinicalReport params) { + try { + if (commentsAction == null) { + commentsAction = ParamUtils.AddRemoveReplaceAction.ADD; + } + if (supportingEvidencesAction == null) { + supportingEvidencesAction = ParamUtils.BasicUpdateAction.ADD; + } + if (filesAction == null) { + filesAction = ParamUtils.BasicUpdateAction.ADD; + } + + Map actionMap = new HashMap<>(); + actionMap.put(ClinicalAnalysisDBAdaptor.ReportQueryParams.COMMENTS.key(), commentsAction); + actionMap.put(ClinicalAnalysisDBAdaptor.ReportQueryParams.SUPPORTING_EVIDENCES.key(), supportingEvidencesAction); + actionMap.put(ClinicalAnalysisDBAdaptor.ReportQueryParams.FILES.key(), filesAction); + queryOptions.put(Constants.ACTIONS, actionMap); + + return createOkResponse(clinicalManager.updateReport(studyStr, clinicalAnalysisStr, params, queryOptions, token)); + } catch (Exception e) { + return createErrorResponse(e); + } + } + + @POST @Path("/annotationSets/load") @Consumes(MediaType.APPLICATION_JSON) diff --git a/pom.xml b/pom.xml index 4b98a5274f8..7d49e44a0c7 100644 --- a/pom.xml +++ b/pom.xml @@ -885,6 +885,12 @@ com.microsoft.azure adal4j ${adal4j.version} + + + org.slf4j + slf4j-simple + + com.microsoft.graph @@ -910,11 +916,23 @@ com.microsoft.azure azure-client-runtime ${azure-client.version} + + + org.slf4j + slf4j-simple + + com.microsoft.azure azure-client-authentication ${azure-client.version} + + + org.slf4j + slf4j-simple + + org.apache.httpcomponents @@ -935,6 +953,12 @@ com.microsoft.azure azure-batch ${azure-batch.version} + + + org.slf4j + slf4j-simple + + io.fabric8 @@ -1042,6 +1066,12 @@ azure-storage-blob ${azure-storage-blob.version} ${azure.optional} + + + org.slf4j + slf4j-simple + + com.google.code.findbugs