Skip to content

Commit

Permalink
[instrument] Fix data type of getCandID function (#9228)
Browse files Browse the repository at this point in the history
getCandID in the instrument class was incorrectly returning a string
instead of a CandID object. (Since the function was recently added,
we still have time to fix it before the release with little chance of
it having been used elsewhere.)
  • Loading branch information
driusan committed May 2, 2024
1 parent 5994d74 commit 8e9a61d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions php/libraries/NDB_BVL_Instrument.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2380,7 +2380,7 @@ abstract class NDB_BVL_Instrument extends NDB_Page
$confirmed = $timepoint->getVisitStatus() === 'Pass' ? 'Y' : 'N';

$set = [
'CandID' => $this->getCandID(),
'CandID' => $this->getCandID()->__toString(),
'DxEvolutionID' => $dxEvolutionID,
'Diagnosis' => json_encode($diagnosis),
'Confirmed' => $confirmed
Expand Down Expand Up @@ -2491,9 +2491,9 @@ abstract class NDB_BVL_Instrument extends NDB_Page
/**
* Get the candidate's CandID
*
* @return string|null The candidate's CandID
* @return ?CandID The candidate's CandID
*/
function getCandID() : ?string
function getCandID() : ?CandID
{
$db = $this->loris->getDatabaseConnection();
$CommentID = $this->getCommentID();
Expand All @@ -2505,7 +2505,10 @@ abstract class NDB_BVL_Instrument extends NDB_Page
WHERE f.CommentID=:CID",
['CID' => $CommentID]
);
return $candID;
if ($candID === null) {
return null;
}
return new CandID($candID);

}

Expand Down

0 comments on commit 8e9a61d

Please sign in to comment.