From 1f78862acbdb41b42f5fe49b57cb73a0b6adaac2 Mon Sep 17 00:00:00 2001 From: xlecours Date: Tue, 14 Nov 2023 12:10:14 -0500 Subject: [PATCH] Now uses Other as feedback type delegate EDC check to Timepoint class --- tools/fix_timepoint_date_problems.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/tools/fix_timepoint_date_problems.php b/tools/fix_timepoint_date_problems.php index 6286a4a613e..d855d312992 100755 --- a/tools/fix_timepoint_date_problems.php +++ b/tools/fix_timepoint_date_problems.php @@ -539,10 +539,17 @@ function fixDate($candID, $dateType, $newDate, $sessionID, $db) // feedback object $feedback =& NDB_BVL_Feedback::singleton($user->getUsername(), $candID); + //get thread feedback type + $threadFeedbackType = $feedback->getFeedbackTypeIdByName('other'); + if (empty($threadFeedbackType)) { + //create thread feedback type "Other", if it does not exist + $threadFeedbackType = $feedback->createFeedbackType("Other", "Other"); + } + // add the new thread $success = $feedback->createThread( 'profile', - '5', + $threadFeedbackType, "The date of $dateType has been changed to $newDate.", 'N' ); @@ -601,10 +608,17 @@ function fixDate($candID, $dateType, $newDate, $sessionID, $db) $sID ); + //get thread feedback type + $threadFeedbackType = $feedback->getFeedbackTypeIdByName('other'); + if (empty($threadFeedbackType)) { + //create thread feedback type "Other", if it does not exist + $threadFeedbackType = $feedback->createFeedbackType("Other", "Other"); + } + // add the new thread $success = $feedback->createThread( 'visit', - '5', + $threadFeedbackType, "The date of $dateType has been changed to $newDate.", 'N' ); @@ -677,13 +691,7 @@ function diagnose($sessionID, $dateType = null, $newDate = null) $cohortID = $timePoint->getCohortID(); // define the date of birth to use (dob or edc) - if (($dateType=='dob' && $cohortID==1) - || ($dateType=='edc' && $cohortID==2) - ) { - $dateBirth = $newDate; - } else { - $dateBirth = $timePoint->getEffectiveDateOfBirth(); - } + $dateBirth = $timePoint->getEffectiveDateOfBirth(); // check if the timepoint is started before attempting to make changes to it if ($timePoint->getCurrentStage() == 'Not Started'