-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreventSaveUntil.php
More file actions
43 lines (30 loc) · 1.78 KB
/
preventSaveUntil.php
File metadata and controls
43 lines (30 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
if ($hook_event == 'redcap_data_entry_form_top' ) {
if($instrument=="econsent"){
//check that participant has consented before allowing the user to save the page
$econsentCompleteField="pt_e_consent_complete";
//load record data
$loadScreeningRecord=REDCap::GetData('array',$record, $event_id, $econsentCompleteField );
//var_dump($loadScreeningRecord);
//check whether patient has consented by wither electronic or paper means
$patientEConsented='';
$patientEConsented=$loadScreeningRecord[$record][$event_id][$econsentCompleteField];
//echo "PatientEConsented = $patientEConsented <br/><br/>";
if($patientEConsented==''){
//hide and disable all the save buttons, and display a message explaining this to the researcher
echo "<style type='text/css'>#submit-btn-dropdown, #formSaveTip,#submit-btn-savecontinue, #submit-btn-saveexitrecord, #submit-btn-savenextrecord, #submit-btn-savenextform, #submit-btn-saverecord, .dataEntrySaveLeavePageBtn {display:none !important}</style>";
echo "<script type='text/javascript'>
jQuery(document).ready(function() {
$('#submit-btn-saverecord').attr('disabled','disabled');
$('#submit-btn-dropdown').attr('disabled','disabled');
$('#submit-btn-savecontinue').attr('disabled','disabled');
$('#submit-btn-saveexitrecord').attr('disabled','disabled');
$('#submit-btn-savenextrecord').attr('disabled','disabled');
$('#submit-btn-savenextform').attr('disabled','disabled');
$('#submit-btn-saverecord').attr('disabled','disabled');
$('.dataEntrySaveLeavePageBtn').attr('disabled','disabled');
});
</script>";
echo "<div class='green'>The e-consent form will be enabled for researchers to counter-sign once the participant has completed it.</div><br/><br/>";
}
}
}