js/clinicaldatamodule.js
// Added after the form has been rendered for performance purposes
Added after the form has been rendered for performance purposes
Added after the form has been rendered for performance purposes
function addDynamicFormLogicPost() {
    validationHelper.process(metadataWrapper.getItemsWithRangeChecks(currentPath.formOID));
    $$("#clinicaldata-content label.radio").forEach(radioItem => {
        radioItem.addEventListener("mouseup", uncheckRadioItem);
    });
    if (currentSubjectKey) $$("#clinicaldata-content .item-field").forEach(itemField => {
        const historyButton = document.createElement("div");
        historyButton.className = "icon is-history-button is-pulled-right is-hidden-survey-view";
        historyButton.innerHTML = "<i class='far fa-clock'></i>";
        historyButton.addEventListener("click", showItemAuditTrail);
        itemField.insertAdjacentElement("afterbegin", historyButton);
    });
    if (ioHelper.isMobile()) return;
    $$("#clinicaldata-content input[type='date'], #clinicaldata-content input[type='time'], #clinicaldata-content input[type='datetime-local']").forEach(dateInput => {
        dateInput.addEventListener("click", showDateTimePicker);
    });
}
function addDynamicFormLogicPost ( ) { validationHelper . process ( metadataWrapper . getItemsWithRangeChecks ( currentPath . formOID ) ) ; $$ ( "#clinicaldata-content label.radio" ) . forEach ( radioItem => { radioItem . addEventListener ( "mouseup" , uncheckRadioItem ) ; } ) ; if ( currentSubjectKey ) $$ ( "#clinicaldata-content .item-field" ) . forEach ( itemField => { const historyButton = document . createElement ( "div" ) ; historyButton . className = "icon is-history-button is-pulled-right is-hidden-survey-view" ; historyButton . innerHTML = "<i class='far fa-clock'></i>" ; historyButton . addEventListener ( "click" , showItemAuditTrail ) ; itemField . insertAdjacentElement ( "afterbegin" , historyButton ) ; } ) ; if ( ioHelper . isMobile ( ) ) return ; $$ ( "#clinicaldata-content input[type='date'], #clinicaldata-content input[type='time'], #clinicaldata-content input[type='datetime-local']" ) . forEach ( dateInput => { dateInput . addEventListener ( "click" , showDateTimePicker ) ; } ) ; }
Added after the form has been rendered for performance purposes
Added after the form has been rendered for performance purposes
// Add real-time logic to validate fields by data type and/or allowed ranges // Allow the user to uncheck an already checked group of radio items // Add a history button to show the audit trail for one specific item // Fourth, add date focus event listeners (currently not used on mobile devices because of a Safari issue)