brapi_post_search_trials: post /search/trials

View source: R/brapi_post_search_trials.R

brapi_post_search_trialsR Documentation

post /search/trials

Description

Submit a search request for Trials

Usage

brapi_post_search_trials(
  con = NULL,
  active = NA,
  commonCropNames = "",
  contactDbIds = "",
  externalReferenceIDs = "",
  externalReferenceSources = "",
  locationDbIds = "",
  locationNames = "",
  programDbIds = "",
  programNames = "",
  searchDateRangeEnd = "",
  searchDateRangeStart = "",
  studyDbIds = "",
  studyNames = "",
  trialDbIds = "",
  trialNames = "",
  trialPUIs = "",
  page = 0,
  pageSize = 1000
)

Arguments

con

list; required: TRUE; BrAPI connection object

active

logical; required: FALSE; Is this trial currently active; default: NA, other possible values: TRUE | FALSE

commonCropNames

vector of type character; required: FALSE; Common crop name(s) for the trials to search for; default: "", when using multiple values supply as c("value1", "value2").

contactDbIds

vector of type character; required: FALSE; Unique contact identifier(s) of trials to search for; default: "", when using multiple values supply as c("value1", "value2").

externalReferenceIDs

vector of type character; required: FALSE; External reference identifier(s) to search for. Could be a simple strings or a URIs (use with externalReferenceSources parameter).; default: "", when using multiple values supply as c("value1", "value2").

externalReferenceSources

vector of type character; required: FALSE; Source system or database identifier(s) of an external reference(s) to search for (use with externalReferenceIDs parameter); default: "", when using multiple values supply as c("value1", "value2").

locationDbIds

vector of type character; required: FALSE; The unique location identifier(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

locationNames

vector of type character; required: FALSE; A human readable location name(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

programDbIds

vector of type character; required: FALSE; Unique program identifier(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

programNames

vector of type character; required: FALSE; Program name(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

searchDateRangeEnd

character; required: FALSE; The start of the overlapping search date range. searchDateRangeStart must be before searchDateRangeEnd.

Return a Trial entity if any of the following cases are true:

  • searchDateRangeStart is before trial.endDate AND searchDateRangeEnd is null

  • searchDateRangeStart is before trial.endDate AND searchDateRangeEnd is after trial.startDate

  • searchDateRangeEnd is after trial.startDate AND searchDateRangeStart is null

  • searchDateRangeEnd is after trial.startDate AND searchDateRangeStart is before trial.endDate

searchDateRangeStart

character; required: FALSE; The start of the overlapping search date range. searchDateRangeStart must be before searchDateRangeEnd.

studyDbIds

vector of type character; required: FALSE; Unique study identifier(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

studyNames

vector of type character; required: FALSE; Study name(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

trialDbIds

vector of type character; required: FALSE; Unique trial identifier(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

trialNames

vector of type character; required: FALSE; The human readable trial name(s)to search for; default: "", when using multiple values supply as c("value1", "value2").

trialPUIs

vector of type character; required: FALSE; A permanent trial identifier(s) to search for. Could be DOI or other URI formatted identifier.; default: "", when using multiple values supply as c("value1", "value2").

page

integer; required: FALSE; Used to request a specific page of data to be returned. The page indexing starts at 0 (the first page is page = 0). Default is 0.

pageSize

integer; required: FALSE; The size of the pages to be returned. Default is 1000.

Details

Advanced searching for the programs resource. Function will return either the search results (Status 200 for an immediate response) or a searchResultsDbId (Status 202 for both a saved and an asynchronous search).

Value

data.frame

Author(s)

Maikel Verouden

References

BrAPI SwaggerHub

See Also

Other brapi-core: brapi_get_commoncropnames(), brapi_get_lists_listDbId(), brapi_get_lists(), brapi_get_locations_locationDbId(), brapi_get_locations(), brapi_get_people_personDbId(), brapi_get_people(), brapi_get_programs_programDbId(), brapi_get_programs(), brapi_get_search_lists_searchResultsDbId(), brapi_get_search_locations_searchResultsDbId(), brapi_get_search_people_searchResultsDbId(), brapi_get_search_programs_searchResultsDbId(), brapi_get_search_studies_searchResultsDbId(), brapi_get_search_trials_searchResultsDbId(), brapi_get_seasons_seasonDbId(), brapi_get_seasons(), brapi_get_serverinfo(), brapi_get_studies_studyDbId(), brapi_get_studies(), brapi_get_studytypes(), brapi_get_trials_trialDbId(), brapi_get_trials(), brapi_post_lists_listDbId_items(), brapi_post_lists(), brapi_post_locations(), brapi_post_people(), brapi_post_programs(), brapi_post_search_lists(), brapi_post_search_locations(), brapi_post_search_people(), brapi_post_search_programs(), brapi_post_search_studies(), brapi_post_seasons(), brapi_post_studies(), brapi_post_trials(), brapi_put_lists_listDbId(), brapi_put_locations_locationDbId(), brapi_put_people_personDbId(), brapi_put_programs_programDbId(), brapi_put_seasons_seasonDbId(), brapi_put_studies_studyDbId(), brapi_put_trials_trialDbId()

Other Trials: brapi_get_search_trials_searchResultsDbId(), brapi_get_trials_trialDbId(), brapi_get_trials(), brapi_post_trials(), brapi_put_trials_trialDbId()

Examples

## Not run: 
con <- brapi_db()$testserver
con[["token"]] <- "YYYY"

# Immediate Response Example
brapi_post_search_trials(con = con,
                         commonCropNames = "Paw Paw")

# Saved or Asynchronous Search Response Example
brapi_post_search_trials(con = con,
                         active = TRUE,
                         commonCropNames = c("Tomatillo", "Paw Paw"),
                         contactDbIds = c("trial_contact_1", "trial_contact_3"),
                         programDbIds = c("program1" , "program3"),
                         trialDbIds = c("trial1", "trial3"))

## End(Not run)


mverouden/brapir-v2 documentation built on April 22, 2022, 9:24 a.m.