Skip to content

[redcap] Delete IRedcapRecord #9913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions modules/redcap/php/client/models/records/iredcaprecord.class.inc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace LORIS\redcap\client\models\records;
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
* @link https://www.github.com/aces/Loris/
*/
class RedcapRecord implements IRedcapRecord
class RedcapRecord
{
private string $_form_name;

Expand Down Expand Up @@ -50,11 +50,11 @@ class RedcapRecord implements IRedcapRecord
}

/**
* Get the instrument name
* Get the LORIS instrument name.
*
* @return string
*/
public function getInstrumentName(): string
public function getLorisInstrumentName(): string
{
return $this->_form_name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace LORIS\redcap\client\models\records;
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPLv3
* @link https://www.github.com/aces/Loris/
*/
class RedcapRepeatingRecord extends RedcapRecord implements IRedcapRecord
class RedcapRepeatingRecord extends RedcapRecord
{
private int $_repeat_index;

Expand Down Expand Up @@ -50,11 +50,11 @@ class RedcapRepeatingRecord extends RedcapRecord implements IRedcapRecord
}

/**
* Get the instrument name.
* Get the LORIS instrument name.
*
* @return string
*/
public function getInstrumentName(): string
public function getLorisInstrumentName(): string
{
return $this->getFormName() . '_' . $this->_repeat_index;
}
Expand Down
3 changes: 1 addition & 2 deletions modules/redcap/php/client/redcaphttpclient.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use LORIS\redcap\client\models\RedcapProject;
use LORIS\redcap\client\models\RedcapSurveyParticipant;
use LORIS\redcap\client\models\mappings\RedcapRepeatingInstrumentEvent;
use LORIS\redcap\client\models\mappings\RedcapInstrumentEventMap;
use LORIS\redcap\client\models\records\IRedcapRecord;
use LORIS\redcap\client\models\records\RedcapRecord;
use LORIS\redcap\client\models\records\RedcapRepeatingRecord;

Expand Down Expand Up @@ -653,7 +652,7 @@ class RedcapHttpClient
*
* @throws \LorisException
*
* @return IRedcapRecord[] an array of records
* @return RedcapRecord[] an array of records
*/
public function getInstrumentRecord(
string $instrument_name,
Expand Down
12 changes: 6 additions & 6 deletions modules/redcap/php/redcapnotificationhandler.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use \LORIS\LorisInstance;
use \LORIS\redcap\RedcapQueries;
use \LORIS\redcap\client\RedcapHttpClient;
use \LORIS\redcap\config\RedcapConfig;
use \LORIS\redcap\client\models\records\IRedcapRecord;
use \LORIS\redcap\client\models\RedcapNotification;
use \LORIS\redcap\client\models\records\RedcapRecord;

/**
* This represents a REDCap notification handler.
Expand Down Expand Up @@ -168,7 +168,7 @@ class RedcapNotificationHandler
//
foreach ($records as $record) {
// if repeating instrument, contains the repeat index
$instrument_name = $record->getInstrumentName();
$instrument_name = $record->getLorisInstrumentName();

// get the comment ID for that instrument
$comment_id = $this->_getCommentId(
Expand Down Expand Up @@ -234,15 +234,15 @@ class RedcapNotificationHandler
* Check that the REDCap and LORIS dictionaries of an instrument match.
*
* @param \NDB_BVL_Instrument $instrument a LORIS instrument object
* @param IRedcapRecord $record a REDCap instrument record
* @param RedcapRecord $record a REDCap instrument record
*
* @throws \LorisException if a REDCap field not in LORIS instrument
*
* @return void
*/
private function _assertDictionaryMatches(
\NDB_BVL_Instrument $instrument,
IRedcapRecord $record
RedcapRecord $record
): void {
// var
$instrument_name = $instrument->testName;
Expand Down Expand Up @@ -393,13 +393,13 @@ class RedcapNotificationHandler
* Update a LORIS instrument data with a REDCap record data.
*
* @param \NDB_BVL_Instrument $instrument a LORIS instrument instance
* @param IRedcapRecord $record a REDCap record
* @param RedcapRecord $record a REDCap record
*
* @return void
*/
private function _updateInstrument(
\NDB_BVL_Instrument $instrument,
IRedcapRecord $record
RedcapRecord $record
): void {
// var
$instrument_name = $record->getFormName();
Expand Down
Loading