@@ -89,25 +89,22 @@ class RedcapMapper
8989 * session creation is enabled for that visit in the REDCap module
9090 * configuration, or throws an error if it is not.
9191 *
92- * @param RedcapRecord $redcap_record The REDCap record.
93- * @param string $unique_event_name The unique event name associated with
94- * that REDCap record.
95- * @param \Candidate $candidate The LORIS candidate associated with
96- * that REDCap record.
92+ * @param RedcapRecord $redcap_record The REDCap record.
93+ * @param \Candidate $candidate The LORIS candidate associated with
94+ * that REDCap record.
9795 *
9896 * @return string The visit label of the relevant session.
9997 */
10098 public function getVisitLabel (
10199 RedcapRecord $ redcap_record ,
102- string $ unique_event_name ,
103100 \Candidate $ candidate ,
104101 ): string {
105- $ visit_config = $ this ->getVisitConfig ($ unique_event_name );
102+ $ visit_config = $ this ->getVisitConfig ($ redcap_record -> unique_event_name );
106103
107104 // If no visit mappings are defined in the configuration, use the REDCap
108105 // unique event name as the visit label directly.
109106 if ($ visit_config === null ) {
110- return $ unique_event_name ;
107+ return $ redcap_record -> unique_event_name ;
111108 }
112109
113110 $ session = $ this ->checkOrCreateSession ($ candidate , $ visit_config );
@@ -140,7 +137,7 @@ class RedcapMapper
140137 // Find the REDCap event that matches the REDCap notification event.
141138 $ redcap_event = array_find (
142139 $ redcap_events ,
143- fn ($ redcap_event ) => $ unique_event_name === $ redcap_event -> unique_name ,
140+ fn ($ redcap_event ) => $ redcap_event -> unique_name === $ unique_event_name ,
144141 );
145142
146143 // There should always be a REDCap event that matches the REDCap
0 commit comments