@datafire/opentrials_local v3.0.0
@datafire/opentrials_local
Client library for OpenTrials API
Installation and Usage
npm install --save @datafire/opentrials_local
let opentrials_local = require('@datafire/opentrials_local').create();
.then(data => {
console.log(data);
});
Description
Actions
getCondition
Returns condition details
opentrials_local.getCondition({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the condition
- id required
Output
- output Condition
listDocumentCategories
Returns document categories
opentrials_local.listDocumentCategories(null, context)
Input
This action has no parameters
Output
- output DocumentCategoryList
listDocuments
Returns documents
opentrials_local.listDocuments({}, context)
Input
- input
object
- page
integer
: The page number - per_page
integer
: Number of items per page
- page
Output
- output DocumentList
getDocument
Returns details of a document
opentrials_local.getDocument({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the document
- id required
Output
- output Document
listFDAApplications
Returns FDA applications
opentrials_local.listFDAApplications({}, context)
Input
- input
object
- page
integer
: The page number - per_page
integer
: Number of items per page
- page
Output
- output FDAApplicationList
getFDAApplication
Returns an FDA application details
opentrials_local.getFDAApplication({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the FDA application
- id required
Output
- output FDAApplication
getIntervention
Returns intervention details
opentrials_local.getIntervention({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the intervention
- id required
Output
- output Intervention
getOrganisation
Returns organisation details
opentrials_local.getOrganisation({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the organisation
- id required
Output
- output Organisation
getPerson
Returns person details
opentrials_local.getPerson({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the person
- id required
Output
- output Person
getPublication
Returns publication details
opentrials_local.getPublication({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the publication
- id required
Output
- output Publication
searchTrials
Returns trials based on a search query. By default, it'll search in all of a trial's attributes.
q
is a ElasticSearch query string (e.g.public_title:(depressive OR depression)
)page
can take a value between1
and100
per_page
can take a value between10
and100
opentrials_local.searchTrials({}, context)
Input
- input
object
- q
string
: The search query (follows the ElasticSearch Query String syntax) - page
integer
: The page number - per_page
integer
: Number of items per page
- q
Output
- output TrialSearchResults
autocomplete
Autocomplete search feature for supported database entities (location
). It has the same options as a regular search
operation, with an extra required in
parameter indicating the entity type to search.
opentrials_local.autocomplete({
"in": ""
}, context)
Input
- input
object
- in required
string
(values: location): The entity to search for - q
string
: The search query - page
integer
: The page number - per_page
integer
: Number of items per page
- in required
Output
- output AutocompleteResults
searchFDADocuments
Search the FDA documents
opentrials_local.searchFDADocuments({}, context)
Input
- input
object
- q
string
: The search query (follows the ElasticSearch Query String syntax) - text
string
: Search query on the documents file's text (follows the ElasticSearch Simple Query String syntax) - page
integer
: The page number - per_page
integer
: Number of items per page
- q
Output
- output FDADocumentSearchResults
list
Returns list of sources
opentrials_local.list(null, context)
Input
This action has no parameters
Output
- output SourceList
getTrial
Returns a trial's details and related entities (e.g. conditions
).
opentrials_local.getTrial({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the trial
- id required
Output
- output Trial
getRecords
Returns a trial's raw records from its sources
opentrials_local.getRecords({
"id": ""
}, context)
Input
- input
object
- id required
string
: ID of the trial
- id required
Output
- output RecordList
getRecord
Returns a trial's raw record from its sources
opentrials_local.getRecord({
"trialId": "",
"id": ""
}, context)
Input
- input
object
- trialId required
string
: ID of the trial - id required
string
: ID of the trial's record
- trialId required
Output
- output Record
Definitions
AutocompleteResult
- AutocompleteResult
object
- id required
string
- name required
string
- id required
AutocompleteResults
- AutocompleteResults
object
- items required
array
- items AutocompleteResult
- total_count required
integer
- items required
Condition
- Condition
object
- id required
string
: ID of the condition - name required
string
: Name of the condition - url required
string
: OpenTrials API URL of the condition
- id required
Discrepancies
- Discrepancies
object
: Object listing the Trial's discrepant fields- gender
array
- items DiscrepantFieldString
- has_published_results
array
- items DiscrepantFieldBoolean
- recruitment_status
array
- items DiscrepantFieldString
- status
array
- items DiscrepantFieldString
- target_sample_size
array
- items DiscrepantFieldInteger
- gender
DiscrepancyFieldBase
- DiscrepancyFieldBase
object
- record_id required
string
- source_name required
string
- record_id required
DiscrepantFieldBoolean
- DiscrepantFieldBoolean
object
- record_id required
string
- source_name required
string
- value
boolean
- record_id required
DiscrepantFieldInteger
- DiscrepantFieldInteger
object
- record_id required
string
- source_name required
string
- value
integer
- record_id required
DiscrepantFieldString
- DiscrepantFieldString
object
- record_id required
string
- source_name required
string
- value
string
- record_id required
Document
- Document
object
- document_category required DocumentCategory
- fda_application FDAApplication
- file File
- id required
string
: ID of the document - name required
string
- source Source
- source_url
string
: URL of origin for this document - trials
array
- items TrialSummary
- url required
string
: OpenTrials API URL of the document
DocumentCategory
- DocumentCategory
object
- group
string
: Name of document category - id required
integer
- name required
string
: Name of document sub-category
- group
DocumentCategoryList
- DocumentCategoryList
object
- items required
array
- items DocumentCategory
- total_count required
integer
- items required
DocumentList
- DocumentList
object
- items required
array
- items DocumentSummary
- total_count required
integer
- items required
DocumentSummary
- DocumentSummary
object
- document_category required DocumentCategory
- fda_application FDAApplication
- file FileSummary
- id required
string
- name required
string
- source_id
string
: ID of the document's source - source_url
string
: URL of origin for this document - trials
array
- items TrialSummary
- url required
string
: OpenTrials API URL of the document
ErrorResponse
- ErrorResponse
object
- message required
string
- message required
FDAApplication
- FDAApplication
object
- active_ingredients
string
: Active ingredients contained in the drug - drug_name
string
: Name of the drug - fda_approvals
array
: Associated FDA approvals- items FDAApproval
- id required
string
: FDA application ID - organisation Organisation
- type
string
: The FDA application type (e.g. "NDA", "ANDA", etc.) - url required
string
: OpenTrials API URL for this FDA application
- active_ingredients
FDAApplicationList
- FDAApplicationList
object
- items required
array
- items FDAApplication
- total_count required
integer
- items required
FDAApproval
- FDAApproval
object
- action_date required
string
- fda_application FDAApplication
- id required
string
: FDA approval ID - notes
string
: Additional information about the FDA approval - supplement_number required
integer
- type required
string
: Type of FDA approval
- action_date required
FDADocumentSearchResult
- FDADocumentSearchResult
- document_category required DocumentCategory
- fda_application FDAApplication
- file FileSummary
- id required
string
- name required
string
- source_id
string
: ID of the document's source - source_url
string
: URL of origin for this document - trials
array
- items TrialSummary
- url required
string
: OpenTrials API URL of the document - file File
FDADocumentSearchResults
- FDADocumentSearchResults
object
- items required
array
- items FDADocumentSearchResult
- total_count required
integer
- items required
File
- File
object
- documentcloud_id
string
- id
string
: ID of the file - sha1
string
- source_url
string
: URL of origin for this file - pages
array
: Array with text of each of the file's pages- items
object
- num required
integer
: Page number - text required
string
- num required
- items
- documentcloud_id
FileSummary
- FileSummary
object
- documentcloud_id
string
- id
string
: ID of the file - sha1
string
- source_url
string
: URL of origin for this file
- documentcloud_id
Intervention
- Intervention
object
- id required
string
: ID of the intervention - name required
string
: Name of the intervention - type
string
(values: drug, procedure, other): Type of the intervention (drug / other) - url required
string
: OpenTrials API URL of the intervention
- id required
Location
- Location
object
- id required
string
: ID of the location - name required
string
: Name of the location - type
string
(values: country, city, other): Type of the location (country / city / other)
- id required
Organisation
- Organisation
object
- id required
string
: ID of the organisation - name required
string
: Name of the organisation - url required
string
: OpenTrials API URL of the organisation
- id required
Person
- Person
object
- id required
string
: ID of the person - name required
string
: Name of the person - url required
string
: OpenTrials API URL of the person
- id required
Publication
- Publication
object
- abstract required
string
- authors
array
- items
string
- items
- created_at
string
- date
string
- id required
string
: ID of the publication - journal
string
- slug
string
- source required Source
- source_url required
string
- title required
string
- updated_at
string
- url required
string
- abstract required
PublicationSummary
- PublicationSummary
object
- id required
string
- source_id required
string
- source_url required
string
- title required
string
- url required
string
- id required
Record
- Record
object
- created_at required
string
: Date when the record was created - id required
string
: ID of the record - identifiers
object
: Object that maps the trial's sources ids with its identifiers. - is_primary
boolean
: Is this record the primary source of data for its trial - last_verification_date
string
: Date when the record's data was last verified by provider - public_title required
string
: Title of the record - recruitment_status
string
(values: recruiting, not_recruiting, unknown, other): Trial's recruitment status (e.g. recruiting, unknown etc.) - source required Source
- source_id
string
: ID of the record's source - source_url required
string
: URL of the record's source (where it was collected from) - status
string
(values: ongoing, withdrawn, suspended, terminated, complete, unknown, other): Trial's status (e.g. ongoing, withdrawn, complete etc.) - trial_id required
string
: ID of the trial referenced in the record - trial_url required
string
: OpenTrials API URL of the trial referenced in the record - updated_at required
string
: Date when the record was updated - url required
string
: OpenTrials API URL of the record
- created_at required
RecordList
- RecordList
array
- items Record
RecordSummary
- RecordSummary
object
- id required
string
- is_primary
boolean
- last_verification_date
string
- source_id required
string
- url required
string
- id required
RiskOfBias
- RiskOfBias
object
- id required
string
- risk_of_bias_criteria
array
- items RiskOfBiasCriteria
- source_id required
string
- source_url required
string
- study_id required
string
- id required
RiskOfBiasCriteria
- RiskOfBiasCriteria
object
- id required
string
- name required
string
- value required
string
(values: yes, no, unknown)
- id required
Source
- Source
object
- id required
string
- name required
string
- source_url
string
: URL to source's website - terms_and_conditions_url
string
- type
string
(values: register, journal, other)
- id required
SourceList
- SourceList
array
- items Source
Trial
- Trial
object
- age_range
object
- max_age
string
: Maximum participant age (e.g. "12 Years", "1 Month", "15 Days"). If unknown, it'sundefined
. If no limit, it's "any". If not applicable, it's "N/A". - min_age
string
: Minimum participant age (e.g. "12 Years", "1 Month", "15 Days"). If unknown, it'sundefined
. If no limit, it's "any". If not applicable, it's "N/A".
- max_age
- brief_summary
string
: Summary of the trial - completion_date
string
: Date the trial was completed - conditions
array
: Conditions the trial refers to- items Condition
- discrepancies
object
: Discrepancies in trial's details between different sources- items Discrepancies
- documents
array
: Documents related to the trial- items DocumentSummary
- gender
string
(values: both, male, female): Gender of the subjects of the trial - has_published_results
boolean
: Trial has its results published (true/false) - id required
string
: ID of the trial - identifiers
object
: Object that maps the trial's sources ids with its identifiers. - interventions required
array
: Interventions related to the trial- items Intervention
- locations required
array
: Locations related to the trial- items TrialLocation
- organisations required
array
: Organisations related to the trial- items TrialOrganisation
- persons required
array
: People related to the trial- items TrialPerson
- public_title required
string
: Title of the trial - publications required
array
: Publications referring the trial- items PublicationSummary
- records required
array
: (published) records of the trial- items RecordSummary
- recruitment_status
string
(values: recruiting, not_recruiting, unknown, other): Recruitment status of the trial - registration_date
string
: Date the trial was registered - results_exemption_date
string
: Date when a certification of exemption has been filed for the trial - risks_of_bias required
array
- items RiskOfBias
- source_id
string
: ID of the trial's source - sources required
object
- items Source
- status
string
(values: ongoing, withdrawn, suspended, terminated, complete, unknown, other): Completion status of the trial - study_phase
array
: Phases of the study (e.g.["Phase 2"]
or["Phase 1", "Phase 2"]
)- items
string
- items
- target_sample_size
integer
: Target sample size for the trial - url required
string
: Source URL (where the trial was collected from)
- age_range
TrialLocation
- TrialLocation
object
: Location of a trial- id required
string
: ID of the location - name required
string
: Name of the location - type
string
(values: country, city, other): Type of the location (country / city / other) - role
string
(values: recruitment_countries, other)
- id required
TrialOrganisation
- TrialOrganisation
object
- id required
string
: ID of the organisation - name required
string
: Name of the organisation - url required
string
: OpenTrials API URL of the organisation - role
string
(values: primary_sponsor, sponsor, funder, other)
- id required
TrialPerson
- TrialPerson
object
: People related to a trial- id required
string
: ID of the person - name required
string
: Name of the person - url required
string
: OpenTrials API URL of the person - role
string
(values: principal_investigator, public_queries, scientific_queries, other)
- id required
TrialSearchResults
- TrialSearchResults
object
- items required
array
- items Trial
- total_count required
integer
- items required
TrialSummary
- TrialSummary
object
- id required
string
: ID of the trial - public_title required
string
: Title of the record - url required
string
: OpenTrials API URL for this trial
- id required
5 years ago