@nuralogix.ai/dfx-api-client
Version:
DeepAffex API JavaScript Client Library
230 lines (142 loc) • 5.85 kB
Markdown
[@nuralogix.ai/dfx-api-client](../../index.md) / [HTTP](../../http/index.md) / Studies
# Studies
Studies end points
Studies are organized segments of analyses that guide the measurement process.
Studies consist of Types, Templates and Assets. A study type is a general,
high-level grouping for studies. A template is a pre-built study standard
created and made available by the Nuralogix team. Templates are version
controlled and named for use with a study.
### Sample code
```js
const apiClient = client();
const response = await apiClient.http.studies.retrieve('your-study-id');
const { status, body } = response;
if (status !== '200') {
/**
* TypeScript knows that once we are inside this block, the only response
* shape that matches a non "200" response is the ErrorResponse
*/
throw body;
}
/** Otherwise the shape of the response is StudyRetrieve200Response */
console.log(body.Name);
```
### Methods
- [create](index.md#create)
- [deleteStudyMeasurement](index.md#deletestudymeasurement)
- [list](index.md#list)
- [remove](index.md#remove)
- [retrieve](index.md#retrieve)
- [retrieveSdkConfigData](index.md#retrievesdkconfigdata)
- [templates](index.md#templates)
- [types](index.md#types)
- [update](index.md#update)
### create
▸ **create**(`data`)
Creates a new study within an organization. Studies must be based on a specific StudyTemplateID.
Passing in config will override values available in the StudyType definition template.
Endpoint Action ID = 80x
#### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`StudyCreateRequest`](interfaces/StudyCreateRequest.md) |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudyCreate200Response`](interfaces/StudyCreate200Response.md)\>
___
### deleteStudyMeasurement
▸ **deleteStudyMeasurement**(`studyId`)
Only DFX_ORG_ADMIN has permission to delete all measuremenet of specific study
for its own organization.
Endpoint Action ID = 811
#### Parameters
| Name | Type |
| :------ | :------ |
| `studyId` | `string` |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudyDeleteMeasurements200Response`](interfaces/StudyDeleteMeasurements200Response.md)\>
___
### list
▸ **list**(`statusId`)
Lists all the studies created in an organization.
Endpoint Action ID = 805
#### Parameters
| Name | Type |
| :------ | :------ |
| `statusId` | ``null`` \| `string` |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudyList200Response`](interfaces/StudyList200Response.md)\>
___
### remove
▸ **remove**(`studyId`)
Deletes a study. However, if there are any measurements taken under that Study
already, it cannot be deleted.
Endpoint Action ID = 808
#### Parameters
| Name | Type |
| :------ | :------ |
| `studyId` | `string` |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudyDelete200Response`](interfaces/StudyDelete200Response.md)\>
___
### retrieve
▸ **retrieve**(`studyId`)
Retrieves a study record with it's definitions and values.
It also displays the amount of measurements captured in it to date.
Endpoint Action ID = 804
#### Parameters
| Name | Type |
| :------ | :------ |
| `studyId` | `string` |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudyRetrieve200Response`](interfaces/StudyRetrieve200Response.md)\>
___
### retrieveSdkConfigData
▸ **retrieveSdkConfigData**(`data`)
Retrieves a study's binary config data that has to be used to initialize the DFX SDK Factory object.
Get the SDKID parameter by calling GetSDKId on the DFX SDK Factory object. A response of 304 means
that existing file in hand is up to date.
Endpoint Action ID = 806
#### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`StudyRetrieveSdkConfigDataRequest`](interfaces/StudyRetrieveSdkConfigDataRequest.md) |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudySdkConfigData200Response`](interfaces/StudySdkConfigData200Response.md)\>
___
### templates
▸ **templates**(`data`)
Retrieves a list of study templates that exist in a particular organization.
Endpoint Action ID = 801
#### Parameters
| Name | Type |
| :------ | :------ |
| `data` | [`StudyTemplateRequest`](interfaces/StudyTemplateRequest.md) |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudyTemplates200Response`](interfaces/StudyTemplates200Response.md)\>
___
### types
▸ **types**(`statusId`)
Retrieves a list of studies that act as templates or base types.
Types can be filtered by the Status querystring value. This is useful
for looking up all studies and current.
Endpoint Action ID = 800
#### Parameters
| Name | Type |
| :------ | :------ |
| `statusId` | ``null`` \| `string` |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudyTypes200Response`](interfaces/StudyTypes200Response.md)\>
___
### update
▸ **update**(`studyId`, `data`)
Updates a particular study record with new information. Organizations can set the status of a
particular study as well to record their general activity and visibility. Study templates
cannot be revised after a study is created.
Endpoint Action ID = 807
#### Parameters
| Name | Type |
| :------ | :------ |
| `studyId` | `string` |
| `data` | [`StudyUpdateRequest`](interfaces/StudyUpdateRequest.md) |
#### Returns
`Promise`<[`ErrorResponse`](../../interfaces/ErrorResponse.md) \| [`StudyUpdate200Response`](interfaces/StudyUpdate200Response.md)\>