Skip to content

Commit 8161021

Browse files
refactor
1 parent 9e5842c commit 8161021

File tree

118 files changed

+23605
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+23605
-318
lines changed

README.md

Lines changed: 64 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# OpenAPIClient-php
22

3-
The LORIS API uses standard HTTP error codes. Responses contain either an empty body or a JSON object.
3+
LORIS REST API for clinical data ingestion and management.
4+
Standard HTTP error codes are used. Responses contain either an empty body or a JSON object.
5+
46

57
For more information, please visit [https://github.com/aces/loris](https://github.com/aces/loris).
68

@@ -49,44 +51,89 @@ require_once(__DIR__ . '/vendor/autoload.php');
4951

5052

5153

54+
// Configure Bearer (JWT) authorization: BearerAuth
55+
$config = LORISClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
56+
5257

53-
$apiInstance = new LORISClient\Api\InstrumentDataApi(
58+
$apiInstance = new LORISClient\Api\AuthenticationApi(
5459
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
5560
// This is optional, `GuzzleHttp\Client` will be used as default.
56-
new GuzzleHttp\Client()
61+
new GuzzleHttp\Client(),
62+
$config
5763
);
58-
$action = 'action_example'; // string | Either CREATE_SESSIONS or VALIDATE_SESSIONS. The latter is used when all sessions already exist.
59-
$instrument = 'instrument_example'; // string | Single instrument name
60-
$instruments = 'instruments_example'; // string | Comma-separated list of instruments
64+
$loginRequest = new \LORISClient\LORISClient\Model\LoginRequest(); // \LORISClient\LORISClient\Model\LoginRequest
6165

6266
try {
63-
$result = $apiInstance->instrumentManagerInstrumentDataGet($action, $instrument, $instruments);
67+
$result = $apiInstance->loginPost($loginRequest);
6468
print_r($result);
6569
} catch (Exception $e) {
66-
echo 'Exception when calling InstrumentDataApi->instrumentManagerInstrumentDataGet: ', $e->getMessage(), PHP_EOL;
70+
echo 'Exception when calling AuthenticationApi->loginPost: ', $e->getMessage(), PHP_EOL;
6771
}
6872

6973
```
7074

7175
## API Endpoints
7276

73-
All URIs are relative to *http://localhost*
77+
All URIs are relative to *https://demo.loris.ca/api/v0.0.4-dev*
7478

7579
Class | Method | HTTP request | Description
7680
------------ | ------------- | ------------- | -------------
77-
*InstrumentDataApi* | [**instrumentManagerInstrumentDataGet**](docs/Api/InstrumentDataApi.md#instrumentmanagerinstrumentdataget) | **GET** /instrument_manager/instrument_data | Generate CSV headers for one or more instruments
78-
*InstrumentDataApi* | [**instrumentManagerInstrumentDataPost**](docs/Api/InstrumentDataApi.md#instrumentmanagerinstrumentdatapost) | **POST** /instrument_manager/instrument_data | Upload CSV to insert instrument data
79-
*InstrumentManagerApi* | [**instrumentManagerPost**](docs/Api/InstrumentManagerApi.md#instrumentmanagerpost) | **POST** /instrument_manager | Install an instrument from a LINST file or REDCap data dictionary
81+
*AuthenticationApi* | [**loginPost**](docs/Api/AuthenticationApi.md#loginpost) | **POST** /login | Authenticate and obtain JWT token
82+
*CandidatesApi* | [**createCandidate**](docs/Api/CandidatesApi.md#createcandidate) | **POST** /candidates | Create a new candidate
83+
*CandidatesApi* | [**getCandidate**](docs/Api/CandidatesApi.md#getcandidate) | **GET** /candidates/{candid} | Get candidate details
84+
*CandidatesApi* | [**getCandidates**](docs/Api/CandidatesApi.md#getcandidates) | **GET** /candidates | Get list of candidates
85+
*InstrumentManagerApi* | [**instrumentManagerInstrumentDataGet**](docs/Api/InstrumentManagerApi.md#instrumentmanagerinstrumentdataget) | **GET** /instrument_manager/instrument_data | Generate expected CSV headers for instrument data ingestion
86+
*InstrumentManagerApi* | [**instrumentManagerInstrumentDataPost**](docs/Api/InstrumentManagerApi.md#instrumentmanagerinstrumentdatapost) | **POST** /instrument_manager/instrument_data | Bulk insert instrument data from CSV
87+
*InstrumentManagerApi* | [**instrumentManagerPost**](docs/Api/InstrumentManagerApi.md#instrumentmanagerpost) | **POST** /instrument_manager | Install instrument from LINST file or REDCap CSV
88+
*InstrumentsApi* | [**getInstrumentData**](docs/Api/InstrumentsApi.md#getinstrumentdata) | **GET** /candidates/{candid}/{visit}/instruments/{instrument} | Get instrument data for a candidate/visit
89+
*InstrumentsApi* | [**getVisitInstruments**](docs/Api/InstrumentsApi.md#getvisitinstruments) | **GET** /candidates/{candid}/{visit}/instruments | Get instruments for a visit
90+
*InstrumentsApi* | [**patchInstrumentData**](docs/Api/InstrumentsApi.md#patchinstrumentdata) | **PATCH** /candidates/{candid}/{visit}/instruments/{instrument} | Update instrument data (preserves unspecified fields)
91+
*InstrumentsApi* | [**putInstrumentData**](docs/Api/InstrumentsApi.md#putinstrumentdata) | **PUT** /candidates/{candid}/{visit}/instruments/{instrument} | Replace instrument data (nulls unspecified fields)
92+
*ProjectsApi* | [**getProject**](docs/Api/ProjectsApi.md#getproject) | **GET** /projects/{project} | Get project details including instruments
93+
*ProjectsApi* | [**getProjectInstruments**](docs/Api/ProjectsApi.md#getprojectinstruments) | **GET** /projects/{project}/instruments | Get instruments for a project
94+
*ProjectsApi* | [**getProjects**](docs/Api/ProjectsApi.md#getprojects) | **GET** /projects | Get list of projects
95+
*SitesApi* | [**getSites**](docs/Api/SitesApi.md#getsites) | **GET** /sites | Get list of sites
96+
*VisitsApi* | [**createVisit**](docs/Api/VisitsApi.md#createvisit) | **PUT** /candidates/{candid}/{visit} | Create a new visit/timepoint
97+
*VisitsApi* | [**getVisit**](docs/Api/VisitsApi.md#getvisit) | **GET** /candidates/{candid}/{visit} | Get visit details
8098

8199
## Models
82100

101+
- [CandidateCreateRequest](docs/Model/CandidateCreateRequest.md)
102+
- [CandidateCreateRequestCandidate](docs/Model/CandidateCreateRequestCandidate.md)
103+
- [CandidateObject](docs/Model/CandidateObject.md)
104+
- [CandidatesResponse](docs/Model/CandidatesResponse.md)
105+
- [ErrorResponse](docs/Model/ErrorResponse.md)
83106
- [IdMapping](docs/Model/IdMapping.md)
84-
- [InstrumentManagerInstrumentDataPost200Response](docs/Model/InstrumentManagerInstrumentDataPost200Response.md)
85-
- [InstrumentManagerInstrumentDataPost201Response](docs/Model/InstrumentManagerInstrumentDataPost201Response.md)
86-
- [InstrumentManagerPost201Response](docs/Model/InstrumentManagerPost201Response.md)
107+
- [InstrumentData](docs/Model/InstrumentData.md)
108+
- [InstrumentDataMeta](docs/Model/InstrumentDataMeta.md)
109+
- [InstrumentDataRequest](docs/Model/InstrumentDataRequest.md)
110+
- [InstrumentDataRequestMeta](docs/Model/InstrumentDataRequestMeta.md)
111+
- [InstrumentDataResponse](docs/Model/InstrumentDataResponse.md)
112+
- [InstrumentDataResponseMessage](docs/Model/InstrumentDataResponseMessage.md)
113+
- [InstrumentMeta](docs/Model/InstrumentMeta.md)
114+
- [InstrumentsResponse](docs/Model/InstrumentsResponse.md)
115+
- [LoginRequest](docs/Model/LoginRequest.md)
116+
- [LoginResponse](docs/Model/LoginResponse.md)
117+
- [ProjectResponse](docs/Model/ProjectResponse.md)
118+
- [ProjectResponseMeta](docs/Model/ProjectResponseMeta.md)
119+
- [ProjectsResponse](docs/Model/ProjectsResponse.md)
120+
- [Site](docs/Model/Site.md)
121+
- [SitesResponse](docs/Model/SitesResponse.md)
122+
- [SuccessResponse](docs/Model/SuccessResponse.md)
123+
- [VisitCreateRequest](docs/Model/VisitCreateRequest.md)
124+
- [VisitInstrumentsResponse](docs/Model/VisitInstrumentsResponse.md)
125+
- [VisitInstrumentsResponseMeta](docs/Model/VisitInstrumentsResponseMeta.md)
126+
- [VisitObject](docs/Model/VisitObject.md)
127+
- [VisitObjectMeta](docs/Model/VisitObjectMeta.md)
128+
- [VisitObjectStages](docs/Model/VisitObjectStages.md)
129+
- [VisitObjectStagesVisit](docs/Model/VisitObjectStagesVisit.md)
87130

88131
## Authorization
89-
Endpoints do not require authorization.
132+
133+
Authentication schemes defined for the API:
134+
### BearerAuth
135+
136+
- **Type**: Bearer authentication (JWT)
90137

91138
## Tests
92139

@@ -105,7 +152,7 @@ vendor/bin/phpunit
105152

106153
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
107154

108-
- API version: `0.0.3`
155+
- API version: `0.0.4-dev`
109156
- Package version: `0.0.4-dev`
110157
- Generator version: `7.17.0`
111158
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "aces/loris-php-api-client",
33
"version": "0.0.4-dev",
4-
"description": "The LORIS API uses standard HTTP error codes. Responses contain either an empty body or a JSON object.",
4+
"description": "LORIS REST API for clinical data ingestion and management. Standard HTTP error codes are used. Responses contain either an empty body or a JSON object.",
55
"keywords": [
66
"openapitools",
77
"openapi-generator",

docs/Api/AuthenticationApi.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# LORISClient\AuthenticationApi
2+
3+
4+
5+
All URIs are relative to https://demo.loris.ca/api/v0.0.4-dev, except if the operation defines another base path.
6+
7+
| Method | HTTP request | Description |
8+
| ------------- | ------------- | ------------- |
9+
| [**loginPost()**](AuthenticationApi.md#loginPost) | **POST** /login | Authenticate and obtain JWT token |
10+
11+
12+
## `loginPost()`
13+
14+
```php
15+
loginPost($loginRequest): \LORISClient\LORISClient\Model\LoginResponse
16+
```
17+
18+
Authenticate and obtain JWT token
19+
20+
### Example
21+
22+
```php
23+
<?php
24+
require_once(__DIR__ . '/vendor/autoload.php');
25+
26+
27+
// Configure Bearer (JWT) authorization: BearerAuth
28+
$config = LORISClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
29+
30+
31+
$apiInstance = new LORISClient\Api\AuthenticationApi(
32+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
33+
// This is optional, `GuzzleHttp\Client` will be used as default.
34+
new GuzzleHttp\Client(),
35+
$config
36+
);
37+
$loginRequest = new \LORISClient\LORISClient\Model\LoginRequest(); // \LORISClient\LORISClient\Model\LoginRequest
38+
39+
try {
40+
$result = $apiInstance->loginPost($loginRequest);
41+
print_r($result);
42+
} catch (Exception $e) {
43+
echo 'Exception when calling AuthenticationApi->loginPost: ', $e->getMessage(), PHP_EOL;
44+
}
45+
```
46+
47+
### Parameters
48+
49+
| Name | Type | Description | Notes |
50+
| ------------- | ------------- | ------------- | ------------- |
51+
| **loginRequest** | [**\LORISClient\LORISClient\Model\LoginRequest**](../Model/LoginRequest.md)| | |
52+
53+
### Return type
54+
55+
[**\LORISClient\LORISClient\Model\LoginResponse**](../Model/LoginResponse.md)
56+
57+
### Authorization
58+
59+
[BearerAuth](../../README.md#BearerAuth)
60+
61+
### HTTP request headers
62+
63+
- **Content-Type**: `application/json`
64+
- **Accept**: `application/json`
65+
66+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
67+
[[Back to Model list]](../../README.md#models)
68+
[[Back to README]](../../README.md)

docs/Api/CandidatesApi.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
# LORISClient\CandidatesApi
2+
3+
4+
5+
All URIs are relative to https://demo.loris.ca/api/v0.0.4-dev, except if the operation defines another base path.
6+
7+
| Method | HTTP request | Description |
8+
| ------------- | ------------- | ------------- |
9+
| [**createCandidate()**](CandidatesApi.md#createCandidate) | **POST** /candidates | Create a new candidate |
10+
| [**getCandidate()**](CandidatesApi.md#getCandidate) | **GET** /candidates/{candid} | Get candidate details |
11+
| [**getCandidates()**](CandidatesApi.md#getCandidates) | **GET** /candidates | Get list of candidates |
12+
13+
14+
## `createCandidate()`
15+
16+
```php
17+
createCandidate($candidateCreateRequest): \LORISClient\LORISClient\Model\CandidateObject
18+
```
19+
20+
Create a new candidate
21+
22+
### Example
23+
24+
```php
25+
<?php
26+
require_once(__DIR__ . '/vendor/autoload.php');
27+
28+
29+
// Configure Bearer (JWT) authorization: BearerAuth
30+
$config = LORISClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
31+
32+
33+
$apiInstance = new LORISClient\Api\CandidatesApi(
34+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
35+
// This is optional, `GuzzleHttp\Client` will be used as default.
36+
new GuzzleHttp\Client(),
37+
$config
38+
);
39+
$candidateCreateRequest = new \LORISClient\LORISClient\Model\CandidateCreateRequest(); // \LORISClient\LORISClient\Model\CandidateCreateRequest
40+
41+
try {
42+
$result = $apiInstance->createCandidate($candidateCreateRequest);
43+
print_r($result);
44+
} catch (Exception $e) {
45+
echo 'Exception when calling CandidatesApi->createCandidate: ', $e->getMessage(), PHP_EOL;
46+
}
47+
```
48+
49+
### Parameters
50+
51+
| Name | Type | Description | Notes |
52+
| ------------- | ------------- | ------------- | ------------- |
53+
| **candidateCreateRequest** | [**\LORISClient\LORISClient\Model\CandidateCreateRequest**](../Model/CandidateCreateRequest.md)| | |
54+
55+
### Return type
56+
57+
[**\LORISClient\LORISClient\Model\CandidateObject**](../Model/CandidateObject.md)
58+
59+
### Authorization
60+
61+
[BearerAuth](../../README.md#BearerAuth)
62+
63+
### HTTP request headers
64+
65+
- **Content-Type**: `application/json`
66+
- **Accept**: `application/json`
67+
68+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
69+
[[Back to Model list]](../../README.md#models)
70+
[[Back to README]](../../README.md)
71+
72+
## `getCandidate()`
73+
74+
```php
75+
getCandidate($candid): \LORISClient\LORISClient\Model\CandidateObject
76+
```
77+
78+
Get candidate details
79+
80+
### Example
81+
82+
```php
83+
<?php
84+
require_once(__DIR__ . '/vendor/autoload.php');
85+
86+
87+
// Configure Bearer (JWT) authorization: BearerAuth
88+
$config = LORISClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
89+
90+
91+
$apiInstance = new LORISClient\Api\CandidatesApi(
92+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
93+
// This is optional, `GuzzleHttp\Client` will be used as default.
94+
new GuzzleHttp\Client(),
95+
$config
96+
);
97+
$candid = 'candid_example'; // string
98+
99+
try {
100+
$result = $apiInstance->getCandidate($candid);
101+
print_r($result);
102+
} catch (Exception $e) {
103+
echo 'Exception when calling CandidatesApi->getCandidate: ', $e->getMessage(), PHP_EOL;
104+
}
105+
```
106+
107+
### Parameters
108+
109+
| Name | Type | Description | Notes |
110+
| ------------- | ------------- | ------------- | ------------- |
111+
| **candid** | **string**| | |
112+
113+
### Return type
114+
115+
[**\LORISClient\LORISClient\Model\CandidateObject**](../Model/CandidateObject.md)
116+
117+
### Authorization
118+
119+
[BearerAuth](../../README.md#BearerAuth)
120+
121+
### HTTP request headers
122+
123+
- **Content-Type**: Not defined
124+
- **Accept**: `application/json`
125+
126+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
127+
[[Back to Model list]](../../README.md#models)
128+
[[Back to README]](../../README.md)
129+
130+
## `getCandidates()`
131+
132+
```php
133+
getCandidates(): \LORISClient\LORISClient\Model\CandidatesResponse
134+
```
135+
136+
Get list of candidates
137+
138+
### Example
139+
140+
```php
141+
<?php
142+
require_once(__DIR__ . '/vendor/autoload.php');
143+
144+
145+
// Configure Bearer (JWT) authorization: BearerAuth
146+
$config = LORISClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
147+
148+
149+
$apiInstance = new LORISClient\Api\CandidatesApi(
150+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
151+
// This is optional, `GuzzleHttp\Client` will be used as default.
152+
new GuzzleHttp\Client(),
153+
$config
154+
);
155+
156+
try {
157+
$result = $apiInstance->getCandidates();
158+
print_r($result);
159+
} catch (Exception $e) {
160+
echo 'Exception when calling CandidatesApi->getCandidates: ', $e->getMessage(), PHP_EOL;
161+
}
162+
```
163+
164+
### Parameters
165+
166+
This endpoint does not need any parameter.
167+
168+
### Return type
169+
170+
[**\LORISClient\LORISClient\Model\CandidatesResponse**](../Model/CandidatesResponse.md)
171+
172+
### Authorization
173+
174+
[BearerAuth](../../README.md#BearerAuth)
175+
176+
### HTTP request headers
177+
178+
- **Content-Type**: Not defined
179+
- **Accept**: `application/json`
180+
181+
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
182+
[[Back to Model list]](../../README.md#models)
183+
[[Back to README]](../../README.md)

0 commit comments

Comments
 (0)