Skip to content

Commit 262d79f

Browse files
changes
1 parent e517b5c commit 262d79f

File tree

97 files changed

+941
-2281
lines changed

Some content is hidden

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

97 files changed

+941
-2281
lines changed

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
# OpenAPIClient-php
22

3-
LORIS REST API for clinical data ingestion pipelines.
4-
Authentication via JWT - POST /login to get token, use as \"Bearer <token>\".
3+
LORIS REST API and Module endpoints.
54

5+
## Server Configuration
66

7-
For more information, please visit [https://github.com/aces/loris](https://github.com/aces/loris).
7+
This schema has TWO types of endpoints with different base URLs:
8+
9+
| Type | Base URL | Endpoints |
10+
|------|----------|-----------|
11+
| REST API (versioned) | `{baseUrl}/api/{version}` | /login, /candidates, /projects, /sites |
12+
| Module (non-versioned) | `{baseUrl}` (root) | /instrument_manager, /instrument_manager/instrument_data |
13+
14+
**InstrumentManager endpoints use path-level server overrides** to specify the non-versioned base URL.
15+
When using `InstrumentManagerApi`, configure with base URL only (no `/api/{version}`).
16+
17+
18+
For more information, please visit [https://github.com/aces/Loris](https://github.com/aces/Loris).
819

920
## Installation & Usage
1021

@@ -77,19 +88,19 @@ Class | Method | HTTP request | Description
7788
*AuthenticationApi* | [**login**](docs/Api/AuthenticationApi.md#login) | **POST** /login | Authenticate and obtain JWT token
7889
*CandidatesApi* | [**createCandidate**](docs/Api/CandidatesApi.md#createcandidate) | **POST** /candidates | Create a new candidate
7990
*CandidatesApi* | [**getCandidate**](docs/Api/CandidatesApi.md#getcandidate) | **GET** /candidates/{candid} | Get candidate details
80-
*CandidatesApi* | [**getCandidates**](docs/Api/CandidatesApi.md#getcandidates) | **GET** /candidates | Get list of candidates
81-
*InstrumentManagerApi* | [**getInstrumentDataHeaders**](docs/Api/InstrumentManagerApi.md#getinstrumentdataheaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data ingestion
91+
*CandidatesApi* | [**getCandidates**](docs/Api/CandidatesApi.md#getcandidates) | **GET** /candidates | List all candidates
92+
*InstrumentManagerApi* | [**getInstrumentDataHeaders**](docs/Api/InstrumentManagerApi.md#getinstrumentdataheaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data upload
8293
*InstrumentManagerApi* | [**installInstrument**](docs/Api/InstrumentManagerApi.md#installinstrument) | **POST** /instrument_manager | Install instrument from LINST file or REDCap data dictionary
83-
*InstrumentManagerApi* | [**uploadInstrumentData**](docs/Api/InstrumentManagerApi.md#uploadinstrumentdata) | **POST** /instrument_manager/instrument_data | Bulk insert instrument data from CSV file
84-
*InstrumentsApi* | [**getInstrumentData**](docs/Api/InstrumentsApi.md#getinstrumentdata) | **GET** /candidates/{candid}/{visit}/instruments/{instrument} | Get instrument data for a candidate/visit
85-
*InstrumentsApi* | [**getVisitInstruments**](docs/Api/InstrumentsApi.md#getvisitinstruments) | **GET** /candidates/{candid}/{visit}/instruments | Get instruments for a visit
86-
*InstrumentsApi* | [**patchInstrumentData**](docs/Api/InstrumentsApi.md#patchinstrumentdata) | **PATCH** /candidates/{candid}/{visit}/instruments/{instrument} | Update instrument data (preserves unspecified fields)
87-
*InstrumentsApi* | [**putInstrumentData**](docs/Api/InstrumentsApi.md#putinstrumentdata) | **PUT** /candidates/{candid}/{visit}/instruments/{instrument} | Replace instrument data (nulls unspecified fields)
88-
*ProjectsApi* | [**getProject**](docs/Api/ProjectsApi.md#getproject) | **GET** /projects/{project} | Get project details including instruments
89-
*ProjectsApi* | [**getProjectInstruments**](docs/Api/ProjectsApi.md#getprojectinstruments) | **GET** /projects/{project}/instruments | Get instruments for a project
90-
*ProjectsApi* | [**getProjects**](docs/Api/ProjectsApi.md#getprojects) | **GET** /projects | Get list of projects
91-
*SitesApi* | [**getSites**](docs/Api/SitesApi.md#getsites) | **GET** /sites | Get list of sites
92-
*VisitsApi* | [**createVisit**](docs/Api/VisitsApi.md#createvisit) | **PUT** /candidates/{candid}/{visit} | Create a new visit/timepoint
94+
*InstrumentManagerApi* | [**uploadInstrumentData**](docs/Api/InstrumentManagerApi.md#uploadinstrumentdata) | **POST** /instrument_manager/instrument_data | Bulk upload instrument data from CSV
95+
*InstrumentsApi* | [**getInstrumentData**](docs/Api/InstrumentsApi.md#getinstrumentdata) | **GET** /candidates/{candid}/{visit}/instruments/{instrument} | Get instrument data
96+
*InstrumentsApi* | [**getVisitInstruments**](docs/Api/InstrumentsApi.md#getvisitinstruments) | **GET** /candidates/{candid}/{visit}/instruments | List instruments for a visit
97+
*InstrumentsApi* | [**patchInstrumentData**](docs/Api/InstrumentsApi.md#patchinstrumentdata) | **PATCH** /candidates/{candid}/{visit}/instruments/{instrument} | Update instrument data
98+
*InstrumentsApi* | [**putInstrumentData**](docs/Api/InstrumentsApi.md#putinstrumentdata) | **PUT** /candidates/{candid}/{visit}/instruments/{instrument} | Replace instrument data
99+
*ProjectsApi* | [**getProject**](docs/Api/ProjectsApi.md#getproject) | **GET** /projects/{project} | Get project details
100+
*ProjectsApi* | [**getProjectInstruments**](docs/Api/ProjectsApi.md#getprojectinstruments) | **GET** /projects/{project}/instruments | List project instruments
101+
*ProjectsApi* | [**getProjects**](docs/Api/ProjectsApi.md#getprojects) | **GET** /projects | List projects
102+
*SitesApi* | [**getSites**](docs/Api/SitesApi.md#getsites) | **GET** /sites | List sites
103+
*VisitsApi* | [**createVisit**](docs/Api/VisitsApi.md#createvisit) | **PUT** /candidates/{candid}/{visit} | Create a new visit
93104
*VisitsApi* | [**getVisit**](docs/Api/VisitsApi.md#getvisit) | **GET** /candidates/{candid}/{visit} | Get visit details
94105

95106
## Models
@@ -111,18 +122,14 @@ Class | Method | HTTP request | Description
111122
- [LoginRequest](docs/Model/LoginRequest.md)
112123
- [LoginResponse](docs/Model/LoginResponse.md)
113124
- [ProjectResponse](docs/Model/ProjectResponse.md)
114-
- [ProjectResponseMeta](docs/Model/ProjectResponseMeta.md)
115125
- [ProjectsResponse](docs/Model/ProjectsResponse.md)
116126
- [Site](docs/Model/Site.md)
117127
- [SitesResponse](docs/Model/SitesResponse.md)
118-
- [StageObject](docs/Model/StageObject.md)
119128
- [SuccessResponse](docs/Model/SuccessResponse.md)
120129
- [VisitCreateRequest](docs/Model/VisitCreateRequest.md)
121130
- [VisitInstrumentsResponse](docs/Model/VisitInstrumentsResponse.md)
122-
- [VisitInstrumentsResponseMeta](docs/Model/VisitInstrumentsResponseMeta.md)
123131
- [VisitObject](docs/Model/VisitObject.md)
124132
- [VisitObjectMeta](docs/Model/VisitObjectMeta.md)
125-
- [VisitObjectStages](docs/Model/VisitObjectStages.md)
126133

127134
## Authorization
128135

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": "LORIS REST API for clinical data ingestion pipelines. Authentication via JWT - POST /login to get token, use as \"Bearer <token>\".",
4+
"description": "LORIS REST API and Module endpoints. ## Server Configuration This schema has TWO types of endpoints with different base URLs: | Type | Base URL | Endpoints | |------|----------|-----------| | REST API (versioned) | `{baseUrl}/api/{version}` | /login, /candidates, /projects, /sites | | Module (non-versioned) | `{baseUrl}` (root) | /instrument_manager, /instrument_manager/instrument_data | **InstrumentManager endpoints use path-level server overrides** to specify the non-versioned base URL. When using `InstrumentManagerApi`, configure with base URL only (no `/api/{version}`).",
55
"keywords": [
66
"openapitools",
77
"openapi-generator",

docs/Api/AuthenticationApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LORISClient\AuthenticationApi
22

3-
Login and JWT token
3+
JWT authentication
44

55
All URIs are relative to https://demo.loris.ca/api/v0.0.4-dev, except if the operation defines another base path.
66

docs/Api/CandidatesApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ All URIs are relative to https://demo.loris.ca/api/v0.0.4-dev, except if the ope
88
| ------------- | ------------- | ------------- |
99
| [**createCandidate()**](CandidatesApi.md#createCandidate) | **POST** /candidates | Create a new candidate |
1010
| [**getCandidate()**](CandidatesApi.md#getCandidate) | **GET** /candidates/{candid} | Get candidate details |
11-
| [**getCandidates()**](CandidatesApi.md#getCandidates) | **GET** /candidates | Get list of candidates |
11+
| [**getCandidates()**](CandidatesApi.md#getCandidates) | **GET** /candidates | List all candidates |
1212

1313

1414
## `createCandidate()`
@@ -133,7 +133,7 @@ try {
133133
getCandidates(): \LORISClient\LORISClient\Model\CandidatesResponse
134134
```
135135

136-
Get list of candidates
136+
List all candidates
137137

138138
### Example
139139

docs/Api/InstrumentManagerApi.md

Lines changed: 87 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11
# LORISClient\InstrumentManagerApi
22

3-
Instrument installation and bulk data operations: - Install instruments from LINST/REDCap files - Bulk upload instrument data via CSV - Get expected CSV headers
3+
**Module endpoints (non-versioned)** These endpoints do NOT use the &#x60;/api/{version}&#x60; prefix. Configure client with base URL only. &#x60;&#x60;&#x60;php // For InstrumentManager, use base URL without /api/{version} $moduleConfig-&gt;setHost(&#39;https://your-loris.ca&#39;); &#x60;&#x60;&#x60;
44

55
All URIs are relative to https://demo.loris.ca/api/v0.0.4-dev, except if the operation defines another base path.
66

77
| Method | HTTP request | Description |
88
| ------------- | ------------- | ------------- |
9-
| [**getInstrumentDataHeaders()**](InstrumentManagerApi.md#getInstrumentDataHeaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data ingestion |
9+
| [**getInstrumentDataHeaders()**](InstrumentManagerApi.md#getInstrumentDataHeaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data upload |
1010
| [**installInstrument()**](InstrumentManagerApi.md#installInstrument) | **POST** /instrument_manager | Install instrument from LINST file or REDCap data dictionary |
11-
| [**uploadInstrumentData()**](InstrumentManagerApi.md#uploadInstrumentData) | **POST** /instrument_manager/instrument_data | Bulk insert instrument data from CSV file |
11+
| [**uploadInstrumentData()**](InstrumentManagerApi.md#uploadInstrumentData) | **POST** /instrument_manager/instrument_data | Bulk upload instrument data from CSV |
1212

1313

1414
## `getInstrumentDataHeaders()`
1515

1616
```php
17-
getInstrumentDataHeaders($action, $instrument, $instruments): \SplFileObject
17+
getInstrumentDataHeaders($action, $instrument, $instruments): string
1818
```
19+
### URI(s):
20+
- {protocol}://{host} Module endpoint (non-versioned)
21+
- Variables:
22+
- protocol: No description provided
23+
- Allowed values:
24+
- http
25+
- https
26+
- Default value: https
1927

20-
Get expected CSV headers for instrument data ingestion
28+
- host: No description provided
29+
- Default value: demo.loris.ca
2130

22-
Generates and returns a CSV file with the expected headers for the specified instrument(s). Either \"instrument\" OR \"instruments\" must be set, not both.
31+
Get expected CSV headers for instrument data upload
32+
33+
Returns a CSV template with expected headers for the specified instrument(s). Use either `instrument` (single) or `instruments` (comma-separated), not both. **Note**: This is a module endpoint. Configure client with base URL only.
2334

2435
### Example
2536

@@ -38,12 +49,18 @@ $apiInstance = new LORISClient\Api\InstrumentManagerApi(
3849
new GuzzleHttp\Client(),
3950
$config
4051
);
41-
$action = 'action_example'; // string | - CREATE_SESSIONS: For when sessions may need to be created - VALIDATE_SESSIONS: For when all sessions must already exist
42-
$instrument = 'instrument_example'; // string | Single instrument name (mutually exclusive with instruments)
43-
$instruments = 'instruments_example'; // string | Multiple instrument names, comma-separated (mutually exclusive with instrument)
52+
$action = 'action_example'; // string | - CREATE_SESSIONS: Headers for creating new candidates/sessions - VALIDATE_SESSIONS: Headers for existing candidates/sessions only
53+
$instrument = 'instrument_example'; // string | Single instrument name
54+
$instruments = 'instruments_example'; // string | Multiple instrument names (comma-separated)
55+
56+
$hostIndex = 0;
57+
$variables = [
58+
'protocol' => 'YOUR_VALUE',
59+
'host' => 'YOUR_VALUE',
60+
];
4461

4562
try {
46-
$result = $apiInstance->getInstrumentDataHeaders($action, $instrument, $instruments);
63+
$result = $apiInstance->getInstrumentDataHeaders($action, $instrument, $instruments, $hostIndex, $variables);
4764
print_r($result);
4865
} catch (Exception $e) {
4966
echo 'Exception when calling InstrumentManagerApi->getInstrumentDataHeaders: ', $e->getMessage(), PHP_EOL;
@@ -54,13 +71,15 @@ try {
5471

5572
| Name | Type | Description | Notes |
5673
| ------------- | ------------- | ------------- | ------------- |
57-
| **action** | **string**| - CREATE_SESSIONS: For when sessions may need to be created - VALIDATE_SESSIONS: For when all sessions must already exist | |
58-
| **instrument** | **string**| Single instrument name (mutually exclusive with instruments) | [optional] |
59-
| **instruments** | **string**| Multiple instrument names, comma-separated (mutually exclusive with instrument) | [optional] |
74+
| **action** | **string**| - CREATE_SESSIONS: Headers for creating new candidates/sessions - VALIDATE_SESSIONS: Headers for existing candidates/sessions only | |
75+
| **instrument** | **string**| Single instrument name | [optional] |
76+
| **instruments** | **string**| Multiple instrument names (comma-separated) | [optional] |
77+
| hostIndex | null|int | Host index. Defaults to null. If null, then the library will use $this->hostIndex instead | [optional] |
78+
| variables | array | Associative array of variables to pass to the host. Defaults to empty array. | [optional] |
6079

6180
### Return type
6281

63-
**\SplFileObject**
82+
**string**
6483

6584
### Authorization
6685

@@ -69,7 +88,7 @@ try {
6988
### HTTP request headers
7089

7190
- **Content-Type**: Not defined
72-
- **Accept**: `application/octet-stream`, `application/json`
91+
- **Accept**: `text/csv`, `application/json`
7392

7493
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
7594
[[Back to Model list]](../../README.md#models)
@@ -80,10 +99,21 @@ try {
8099
```php
81100
installInstrument($installFile): \LORISClient\LORISClient\Model\SuccessResponse
82101
```
102+
### URI(s):
103+
- {protocol}://{host} Module endpoint (non-versioned)
104+
- Variables:
105+
- protocol: No description provided
106+
- Allowed values:
107+
- http
108+
- https
109+
- Default value: https
110+
111+
- host: No description provided
112+
- Default value: demo.loris.ca
83113

84114
Install instrument from LINST file or REDCap data dictionary
85115

86-
Creates/installs a new instrument in LORIS from either: - A LINST file (.linst) - A CSV file with one or more REDCap data dictionaries
116+
Installs a new instrument in LORIS from either: - A LINST file (.linst) - A CSV file with REDCap data dictionary format **Note**: This is a module endpoint. Configure client with base URL only, not `/api/{version}`.
87117

88118
### Example
89119

@@ -102,10 +132,16 @@ $apiInstance = new LORISClient\Api\InstrumentManagerApi(
102132
new GuzzleHttp\Client(),
103133
$config
104134
);
105-
$installFile = '/path/to/file.txt'; // \SplFileObject | Instrument definition file to install: - LINST file (.linst) - CSV with REDCap data dictionary
135+
$installFile = '/path/to/file.txt'; // \SplFileObject | LINST file or REDCap CSV to install
136+
137+
$hostIndex = 0;
138+
$variables = [
139+
'protocol' => 'YOUR_VALUE',
140+
'host' => 'YOUR_VALUE',
141+
];
106142

107143
try {
108-
$result = $apiInstance->installInstrument($installFile);
144+
$result = $apiInstance->installInstrument($installFile, $hostIndex, $variables);
109145
print_r($result);
110146
} catch (Exception $e) {
111147
echo 'Exception when calling InstrumentManagerApi->installInstrument: ', $e->getMessage(), PHP_EOL;
@@ -116,7 +152,9 @@ try {
116152

117153
| Name | Type | Description | Notes |
118154
| ------------- | ------------- | ------------- | ------------- |
119-
| **installFile** | **\SplFileObject****\SplFileObject**| Instrument definition file to install: - LINST file (.linst) - CSV with REDCap data dictionary | |
155+
| **installFile** | **\SplFileObject****\SplFileObject**| LINST file or REDCap CSV to install | |
156+
| hostIndex | null|int | Host index. Defaults to null. If null, then the library will use $this->hostIndex instead | [optional] |
157+
| variables | array | Associative array of variables to pass to the host. Defaults to empty array. | [optional] |
120158

121159
### Return type
122160

@@ -140,10 +178,21 @@ try {
140178
```php
141179
uploadInstrumentData($action, $dataFile, $instrument, $multiInstrument): \LORISClient\LORISClient\Model\InstrumentDataResponse
142180
```
181+
### URI(s):
182+
- {protocol}://{host} Module endpoint (non-versioned)
183+
- Variables:
184+
- protocol: No description provided
185+
- Allowed values:
186+
- http
187+
- https
188+
- Default value: https
143189

144-
Bulk insert instrument data from CSV file
190+
- host: No description provided
191+
- Default value: demo.loris.ca
145192

146-
Uploads a CSV file to insert data for one or more instruments. Actions: - CREATE_SESSIONS: Creates candidates and sessions if they don't exist - VALIDATE_SESSIONS: Requires all candidates/sessions to already exist CSV must have columns: PSCID, Visit_label, plus instrument fields.
193+
Bulk upload instrument data from CSV
194+
195+
Uploads CSV data for one or more instruments. **Actions**: - `CREATE_SESSIONS`: Creates candidates/sessions if they don't exist - `VALIDATE_SESSIONS`: Fails if any candidate/session is missing **CSV Requirements**: - Must include `PSCID` and `Visit_label` columns - For single instrument: include instrument field columns - For multi-instrument: set `multi-instrument=true` and include `Instrument` column **Note**: This is a module endpoint. Configure client with base URL only.
147196

148197
### Example
149198

@@ -162,13 +211,19 @@ $apiInstance = new LORISClient\Api\InstrumentManagerApi(
162211
new GuzzleHttp\Client(),
163212
$config
164213
);
165-
$action = 'action_example'; // string | - CREATE_SESSIONS: Creates candidates/sessions if missing - VALIDATE_SESSIONS: Fails if any candidate/session doesn't exist
166-
$dataFile = '/path/to/file.txt'; // \SplFileObject | CSV file with instrument data (must include PSCID, Visit_label columns)
167-
$instrument = 'instrument_example'; // string | Single instrument name
168-
$multiInstrument = 'multiInstrument_example'; // string | Set to \\\"true\\\" when uploading multi-instrument CSV
214+
$action = 'action_example'; // string
215+
$dataFile = '/path/to/file.txt'; // \SplFileObject | CSV file with instrument data
216+
$instrument = 'instrument_example'; // string | Single instrument name (omit for multi-instrument)
217+
$multiInstrument = 'multiInstrument_example'; // string | Set to \\\"true\\\" for multi-instrument CSV
218+
219+
$hostIndex = 0;
220+
$variables = [
221+
'protocol' => 'YOUR_VALUE',
222+
'host' => 'YOUR_VALUE',
223+
];
169224

170225
try {
171-
$result = $apiInstance->uploadInstrumentData($action, $dataFile, $instrument, $multiInstrument);
226+
$result = $apiInstance->uploadInstrumentData($action, $dataFile, $instrument, $multiInstrument, $hostIndex, $variables);
172227
print_r($result);
173228
} catch (Exception $e) {
174229
echo 'Exception when calling InstrumentManagerApi->uploadInstrumentData: ', $e->getMessage(), PHP_EOL;
@@ -179,10 +234,12 @@ try {
179234

180235
| Name | Type | Description | Notes |
181236
| ------------- | ------------- | ------------- | ------------- |
182-
| **action** | **string**| - CREATE_SESSIONS: Creates candidates/sessions if missing - VALIDATE_SESSIONS: Fails if any candidate/session doesn&#39;t exist | |
183-
| **dataFile** | **\SplFileObject****\SplFileObject**| CSV file with instrument data (must include PSCID, Visit_label columns) | |
184-
| **instrument** | **string**| Single instrument name | [optional] |
185-
| **multiInstrument** | **string**| Set to \\\&quot;true\\\&quot; when uploading multi-instrument CSV | [optional] |
237+
| **action** | **string**| | |
238+
| **dataFile** | **\SplFileObject****\SplFileObject**| CSV file with instrument data | |
239+
| **instrument** | **string**| Single instrument name (omit for multi-instrument) | [optional] |
240+
| **multiInstrument** | **string**| Set to \\\&quot;true\\\&quot; for multi-instrument CSV | [optional] |
241+
| hostIndex | null|int | Host index. Defaults to null. If null, then the library will use $this->hostIndex instead | [optional] |
242+
| variables | array | Associative array of variables to pass to the host. Defaults to empty array. | [optional] |
186243

187244
### Return type
188245

0 commit comments

Comments
 (0)