Skip to content

Commit e323ff8

Browse files
more changes
1 parent 4feaee4 commit e323ff8

23 files changed

+423
-277
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ Class | Method | HTTP request | Description
7878
*CandidatesApi* | [**createCandidate**](docs/Api/CandidatesApi.md#createcandidate) | **POST** /candidates | Create a new candidate
7979
*CandidatesApi* | [**getCandidate**](docs/Api/CandidatesApi.md#getcandidate) | **GET** /candidates/{candid} | Get candidate details
8080
*CandidatesApi* | [**getCandidates**](docs/Api/CandidatesApi.md#getcandidates) | **GET** /candidates | Get list of candidates
81-
*InstrumentManagerApi* | [**createInstrument**](docs/Api/InstrumentManagerApi.md#createinstrument) | **POST** /instrument_manager | Create instrument from LINST or REDCap data dictionary
82-
*InstrumentManagerApi* | [**getInstrumentDataHeaders**](docs/Api/InstrumentManagerApi.md#getinstrumentdataheaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data
83-
*InstrumentManagerApi* | [**uploadInstrumentData**](docs/Api/InstrumentManagerApi.md#uploadinstrumentdata) | **POST** /instrument_manager/instrument_data | Bulk insert instrument data from CSV
81+
*InstrumentManagerApi* | [**getInstrumentDataHeaders**](docs/Api/InstrumentManagerApi.md#getinstrumentdataheaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data ingestion
82+
*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
8484
*InstrumentsApi* | [**getInstrumentData**](docs/Api/InstrumentsApi.md#getinstrumentdata) | **GET** /candidates/{candid}/{visit}/instruments/{instrument} | Get instrument data for a candidate/visit
8585
*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
87-
*InstrumentsApi* | [**putInstrumentData**](docs/Api/InstrumentsApi.md#putinstrumentdata) | **PUT** /candidates/{candid}/{visit}/instruments/{instrument} | Replace instrument data
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)
8888
*ProjectsApi* | [**getProject**](docs/Api/ProjectsApi.md#getproject) | **GET** /projects/{project} | Get project details including instruments
8989
*ProjectsApi* | [**getProjectInstruments**](docs/Api/ProjectsApi.md#getprojectinstruments) | **GET** /projects/{project}/instruments | Get instruments for a project
9090
*ProjectsApi* | [**getProjects**](docs/Api/ProjectsApi.md#getprojects) | **GET** /projects | Get list of projects
9191
*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
92+
*VisitsApi* | [**createVisit**](docs/Api/VisitsApi.md#createvisit) | **PUT** /candidates/{candid}/{visit} | Create a new visit/timepoint
9393
*VisitsApi* | [**getVisit**](docs/Api/VisitsApi.md#getvisit) | **GET** /candidates/{candid}/{visit} | Get visit details
9494

9595
## Models

docs/Api/InstrumentManagerApi.md

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
# LORISClient\InstrumentManagerApi
22

3-
Bulk CSV upload (used by ClinicalPipeline)
3+
Instrument installation and bulk data operations: - Install instruments from LINST/REDCap files - Bulk upload instrument data via CSV - Get expected CSV headers
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-
| [**createInstrument()**](InstrumentManagerApi.md#createInstrument) | **POST** /instrument_manager | Create instrument from LINST or REDCap data dictionary |
10-
| [**getInstrumentDataHeaders()**](InstrumentManagerApi.md#getInstrumentDataHeaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data |
11-
| [**uploadInstrumentData()**](InstrumentManagerApi.md#uploadInstrumentData) | **POST** /instrument_manager/instrument_data | Bulk insert instrument data from CSV |
9+
| [**getInstrumentDataHeaders()**](InstrumentManagerApi.md#getInstrumentDataHeaders) | **GET** /instrument_manager/instrument_data | Get expected CSV headers for instrument data ingestion |
10+
| [**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 |
1212

1313

14-
## `createInstrument()`
14+
## `getInstrumentDataHeaders()`
1515

1616
```php
17-
createInstrument($installFile): \LORISClient\LORISClient\Model\SuccessResponse
17+
getInstrumentDataHeaders($action, $instrument, $instruments): \SplFileObject
1818
```
1919

20-
Create instrument from LINST or REDCap data dictionary
20+
Get expected CSV headers for instrument data ingestion
21+
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.
2123

2224
### Example
2325

@@ -36,48 +38,52 @@ $apiInstance = new LORISClient\Api\InstrumentManagerApi(
3638
new GuzzleHttp\Client(),
3739
$config
3840
);
39-
$installFile = '/path/to/file.txt'; // \SplFileObject | LINST file or REDCap CSV
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)
4044

4145
try {
42-
$result = $apiInstance->createInstrument($installFile);
46+
$result = $apiInstance->getInstrumentDataHeaders($action, $instrument, $instruments);
4347
print_r($result);
4448
} catch (Exception $e) {
45-
echo 'Exception when calling InstrumentManagerApi->createInstrument: ', $e->getMessage(), PHP_EOL;
49+
echo 'Exception when calling InstrumentManagerApi->getInstrumentDataHeaders: ', $e->getMessage(), PHP_EOL;
4650
}
4751
```
4852

4953
### Parameters
5054

5155
| Name | Type | Description | Notes |
5256
| ------------- | ------------- | ------------- | ------------- |
53-
| **installFile** | **\SplFileObject****\SplFileObject**| LINST file or REDCap CSV | [optional] |
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] |
5460

5561
### Return type
5662

57-
[**\LORISClient\LORISClient\Model\SuccessResponse**](../Model/SuccessResponse.md)
63+
**\SplFileObject**
5864

5965
### Authorization
6066

6167
[BearerAuth](../../README.md#BearerAuth)
6268

6369
### HTTP request headers
6470

65-
- **Content-Type**: `multipart/form-data`
66-
- **Accept**: `application/json`
71+
- **Content-Type**: Not defined
72+
- **Accept**: `application/octet-stream`, `application/json`
6773

6874
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
6975
[[Back to Model list]](../../README.md#models)
7076
[[Back to README]](../../README.md)
7177

72-
## `getInstrumentDataHeaders()`
78+
## `installInstrument()`
7379

7480
```php
75-
getInstrumentDataHeaders($action, $instrument, $instruments): \SplFileObject
81+
installInstrument($installFile): \LORISClient\LORISClient\Model\SuccessResponse
7682
```
7783

78-
Get expected CSV headers for instrument data
84+
Install instrument from LINST file or REDCap data dictionary
7985

80-
Returns CSV with expected headers for the specified instrument(s). Either \"instrument\" OR \"instruments\" must be set, not both.
86+
Creates/installs a new instrument in LORIS from either: - A LINST file (.linst) - A CSV file with one or more REDCap data dictionaries
8187

8288
### Example
8389

@@ -96,38 +102,34 @@ $apiInstance = new LORISClient\Api\InstrumentManagerApi(
96102
new GuzzleHttp\Client(),
97103
$config
98104
);
99-
$action = 'action_example'; // string | CREATE_SESSIONS or VALIDATE_SESSIONS
100-
$instrument = 'instrument_example'; // string | Single instrument name
101-
$instruments = 'instruments_example'; // string | Multiple instrument names (comma-separated)
105+
$installFile = '/path/to/file.txt'; // \SplFileObject | Instrument definition file to install: - LINST file (.linst) - CSV with REDCap data dictionary
102106

103107
try {
104-
$result = $apiInstance->getInstrumentDataHeaders($action, $instrument, $instruments);
108+
$result = $apiInstance->installInstrument($installFile);
105109
print_r($result);
106110
} catch (Exception $e) {
107-
echo 'Exception when calling InstrumentManagerApi->getInstrumentDataHeaders: ', $e->getMessage(), PHP_EOL;
111+
echo 'Exception when calling InstrumentManagerApi->installInstrument: ', $e->getMessage(), PHP_EOL;
108112
}
109113
```
110114

111115
### Parameters
112116

113117
| Name | Type | Description | Notes |
114118
| ------------- | ------------- | ------------- | ------------- |
115-
| **action** | **string**| CREATE_SESSIONS or VALIDATE_SESSIONS | |
116-
| **instrument** | **string**| Single instrument name | [optional] |
117-
| **instruments** | **string**| Multiple instrument names (comma-separated) | [optional] |
119+
| **installFile** | **\SplFileObject****\SplFileObject**| Instrument definition file to install: - LINST file (.linst) - CSV with REDCap data dictionary | |
118120

119121
### Return type
120122

121-
**\SplFileObject**
123+
[**\LORISClient\LORISClient\Model\SuccessResponse**](../Model/SuccessResponse.md)
122124

123125
### Authorization
124126

125127
[BearerAuth](../../README.md#BearerAuth)
126128

127129
### HTTP request headers
128130

129-
- **Content-Type**: Not defined
130-
- **Accept**: `application/octet-stream`
131+
- **Content-Type**: `multipart/form-data`
132+
- **Accept**: `application/json`
131133

132134
[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
133135
[[Back to Model list]](../../README.md#models)
@@ -139,9 +141,9 @@ try {
139141
uploadInstrumentData($action, $dataFile, $instrument, $multiInstrument): \LORISClient\LORISClient\Model\InstrumentDataResponse
140142
```
141143

142-
Bulk insert instrument data from CSV
144+
Bulk insert instrument data from CSV file
143145

144-
Upload CSV file to insert data for one or more instruments. CREATE_SESSIONS mode will create candidates/sessions if they don't exist. VALIDATE_SESSIONS mode requires all sessions to already exist.
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.
145147

146148
### Example
147149

@@ -160,10 +162,10 @@ $apiInstance = new LORISClient\Api\InstrumentManagerApi(
160162
new GuzzleHttp\Client(),
161163
$config
162164
);
163-
$action = 'action_example'; // string | CREATE_SESSIONS creates missing candidates/sessions
164-
$dataFile = '/path/to/file.txt'; // \SplFileObject | CSV with instrument data (headers must match)
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)
165167
$instrument = 'instrument_example'; // string | Single instrument name
166-
$multiInstrument = 'multiInstrument_example'; // string | Multiple instruments flag
168+
$multiInstrument = 'multiInstrument_example'; // string | Set to \\\"true\\\" when uploading multi-instrument CSV
167169

168170
try {
169171
$result = $apiInstance->uploadInstrumentData($action, $dataFile, $instrument, $multiInstrument);
@@ -177,10 +179,10 @@ try {
177179

178180
| Name | Type | Description | Notes |
179181
| ------------- | ------------- | ------------- | ------------- |
180-
| **action** | **string**| CREATE_SESSIONS creates missing candidates/sessions | |
181-
| **dataFile** | **\SplFileObject****\SplFileObject**| CSV with instrument data (headers must match) | |
182+
| **action** | **string**| - CREATE_SESSIONS: Creates candidates/sessions if missing - VALIDATE_SESSIONS: Fails if any candidate/session doesn't exist | |
183+
| **dataFile** | **\SplFileObject****\SplFileObject**| CSV file with instrument data (must include PSCID, Visit_label columns) | |
182184
| **instrument** | **string**| Single instrument name | [optional] |
183-
| **multiInstrument** | **string**| Multiple instruments flag | [optional] |
185+
| **multiInstrument** | **string**| Set to \\\"true\\\" when uploading multi-instrument CSV | [optional] |
184186

185187
### Return type
186188

docs/Api/InstrumentsApi.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# LORISClient\InstrumentsApi
22

3-
Individual instrument data operations
3+
Individual instrument data operations (per candidate/visit)
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
| ------------- | ------------- | ------------- |
99
| [**getInstrumentData()**](InstrumentsApi.md#getInstrumentData) | **GET** /candidates/{candid}/{visit}/instruments/{instrument} | Get instrument data for a candidate/visit |
1010
| [**getVisitInstruments()**](InstrumentsApi.md#getVisitInstruments) | **GET** /candidates/{candid}/{visit}/instruments | Get instruments for a visit |
11-
| [**patchInstrumentData()**](InstrumentsApi.md#patchInstrumentData) | **PATCH** /candidates/{candid}/{visit}/instruments/{instrument} | Update instrument data |
12-
| [**putInstrumentData()**](InstrumentsApi.md#putInstrumentData) | **PUT** /candidates/{candid}/{visit}/instruments/{instrument} | Replace instrument data |
11+
| [**patchInstrumentData()**](InstrumentsApi.md#patchInstrumentData) | **PATCH** /candidates/{candid}/{visit}/instruments/{instrument} | Update instrument data (preserves unspecified fields) |
12+
| [**putInstrumentData()**](InstrumentsApi.md#putInstrumentData) | **PUT** /candidates/{candid}/{visit}/instruments/{instrument} | Replace instrument data (nulls unspecified fields) |
1313

1414

1515
## `getInstrumentData()`
@@ -140,7 +140,7 @@ try {
140140
patchInstrumentData($candid, $visit, $instrument, $instrumentDataRequest): \LORISClient\LORISClient\Model\InstrumentData
141141
```
142142

143-
Update instrument data
143+
Update instrument data (preserves unspecified fields)
144144

145145
### Example
146146

@@ -204,7 +204,7 @@ try {
204204
putInstrumentData($candid, $visit, $instrument, $instrumentDataRequest): \LORISClient\LORISClient\Model\InstrumentData
205205
```
206206

207-
Replace instrument data
207+
Replace instrument data (nulls unspecified fields)
208208

209209
### Example
210210

docs/Api/VisitsApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ All URIs are relative to https://demo.loris.ca/api/v0.0.4-dev, except if the ope
66

77
| Method | HTTP request | Description |
88
| ------------- | ------------- | ------------- |
9-
| [**createVisit()**](VisitsApi.md#createVisit) | **PUT** /candidates/{candid}/{visit} | Create a new visit |
9+
| [**createVisit()**](VisitsApi.md#createVisit) | **PUT** /candidates/{candid}/{visit} | Create a new visit/timepoint |
1010
| [**getVisit()**](VisitsApi.md#getVisit) | **GET** /candidates/{candid}/{visit} | Get visit details |
1111

1212

@@ -16,7 +16,7 @@ All URIs are relative to https://demo.loris.ca/api/v0.0.4-dev, except if the ope
1616
createVisit($candid, $visit, $visitCreateRequest): \LORISClient\LORISClient\Model\VisitObject
1717
```
1818

19-
Create a new visit
19+
Create a new visit/timepoint
2020

2121
### Example
2222

docs/Model/CandidateCreateRequestCandidate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**project** | **string** | |
8-
**pSCID** | **string** | | [optional]
8+
**pSCID** | **string** | Required if PSCID generation is set to \"prompt\" | [optional]
99
**doB** | **\DateTime** | |
1010
**sex** | **string** | |
1111
**site** | **string** | |

docs/Model/InstrumentData.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**meta** | [**\LORISClient\LORISClient\Model\InstrumentDataMeta**](InstrumentDataMeta.md) | | [optional]
8-
**data** | **array<string,mixed>** | | [optional]
8+
**data** | **array<string,mixed>** | Instrument field values | [optional]
99

1010
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/InstrumentDataRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**meta** | [**\LORISClient\LORISClient\Model\InstrumentDataRequestMeta**](InstrumentDataRequestMeta.md) | | [optional]
8-
**data** | **array<string,mixed>** | | [optional]
8+
**data** | **array<string,mixed>** | Instrument field values to update | [optional]
99

1010
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

docs/Model/InstrumentDataResponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**success** | **bool** | Whether insertion was successful | [optional]
88
**message** | [**\LORISClient\LORISClient\Model\InstrumentDataResponseMessage**](InstrumentDataResponseMessage.md) | | [optional]
9-
**idMapping** | [**\LORISClient\LORISClient\Model\IdMapping[]**](IdMapping.md) | Mapping of external to internal IDs | [optional]
9+
**idMapping** | [**\LORISClient\LORISClient\Model\IdMapping[]**](IdMapping.md) | Mapping of external PSCID to internal CandID (for CREATE_SESSIONS) | [optional]
1010

1111
[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

0 commit comments

Comments
 (0)