Manual Reference Source Test
import ImportService from 'clinical6/src/services/ImportService.js'
public class | source

ImportService

Extends:

AbstractServiceJsonApiService → ImportService

Service handling Import calls with specific endpoints.

Constructor Summary

Public Constructor
public

Update type to be dynamic_content__contents

Method Summary

Public Methods
public

async getExampleFiles(options: Object): Promise<any[]>

Gets example files for the bulk import

Inherited Summary

From class AbstractService
public get
public set
public
private
From class JsonApiService
public

options: *

public

async delete(obj: Object, options: String): Promise

Call a DELETE request on the main obj.type expecting JSON API information.

public

async get(params: Object, options: String): Promise

Call a GET request expecting JSON API information.

public

async getChildren(parent: Object, child: Object, options: String): Promise

Call a GET request expecting JSON API information for children given a parent.

public

async insert(obj: Object, options: String): Promise

Call a POST request on the main obj.type expecting JSON API information.

public

async update(obj: Object, options: String): Promise

Call a PATCH request on the main obj.type expecting JSON API information.

Public Constructors

public constructor() source

Update type to be dynamic_content__contents

Override:

JsonApiService#constructor

Public Methods

public async getExampleFiles(options: Object): Promise<any[]> source

Gets example files for the bulk import

Params:

NameTypeAttributeDescription
options Object
  • optional

Options to modify the network call and storage options

options.cacheMode String
  • optional

Override the caching method for this call

Return:

Promise<any[]>

Promise object that returns a list of files

Throw:

Clinical6Error

If missing token or missing required parameters

Example:

import { importService } from 'clinical6';

// You will be able to access the example files using the `getExampleFiles` method.
importService.getExampleFiles().then(files => console.log(files));

Test: