js/clinicaldatamodule.js
// TODO: Loads entire tree if according elements are passed, implement this analogously for metadatamodule
Loads entire tree if according elements are passed, implement this analogously for metadatamodule
Loads entire tree if according elements are passed implement this analogously for metadatamodule
async function loadTree(studyEventOID, formOID) {
    if (safeCloseClinicaldata(() => loadTree(studyEventOID, formOID))) return;
    currentPath.studyEventOID = studyEventOID;
    currentPath.formOID = formOID;
    $$("#clinicaldata-study-event-panel-blocks a").removeElements();
    $$("#clinicaldata-form-panel-blocks a").removeElements();
    for (let studyEventDef of metadataWrapper.getStudyEvents()) {
        const studyEventOID = studyEventDef.getOID();
        const translatedDescription = studyEventDef.getTranslatedDescription(languageHelper.getCurrentLocale());
        const dataStatus = currentSubjectKey ? clinicaldataWrapper.getDataStatusForStudyEvent(studyEventOID) : clinicaldataWrapper.dataStatusTypes.EMPTY;
        let panelBlock = htmlElements.getClinicaldataPanelBlock(studyEventOID, translatedDescription, studyEventDef.getName(), null, dataStatus);
        panelBlock.onclick = () => loadTree(studyEventOID, null);
        $("#clinicaldata-study-event-panel-blocks").appendChild(panelBlock);
    }
    adjustMobileUI();
    if (!currentPath.studyEventOID && !currentPath.formOID && metadataWrapper.getStudyEvents().length == 1) backOnMobile();
    if (currentPath.studyEventOID) await loadFormsByStudyEvent();
}
async function loadTree ( studyEventOID , formOID ) { if ( safeCloseClinicaldata ( ( ) => loadTree ( studyEventOID , formOID ) ) ) return ; currentPath . studyEventOID = studyEventOID ; currentPath . formOID = formOID ; $$ ( "#clinicaldata-study-event-panel-blocks a" ) . removeElements ( ) ; $$ ( "#clinicaldata-form-panel-blocks a" ) . removeElements ( ) ; for ( let studyEventDef of metadataWrapper . getStudyEvents ( ) ) { const studyEventOID = studyEventDef . getOID ( ) ; const translatedDescription = studyEventDef . getTranslatedDescription ( languageHelper . getCurrentLocale ( ) ) ; const dataStatus = currentSubjectKey ? clinicaldataWrapper . getDataStatusForStudyEvent ( studyEventOID ) : clinicaldataWrapper . dataStatusTypes . EMPTY ; let panelBlock = htmlElements . getClinicaldataPanelBlock ( studyEventOID , translatedDescription , studyEventDef . getName ( ) , null , dataStatus ) ; panelBlock . onclick = ( ) => loadTree ( studyEventOID , null ) ; $ ( "#clinicaldata-study-event-panel-blocks" ) . appendChild ( panelBlock ) ; } adjustMobileUI ( ) ; if ( ! currentPath . studyEventOID && ! currentPath . formOID && metadataWrapper . getStudyEvents ( ) . length == 1 ) backOnMobile ( ) ; if ( currentPath . studyEventOID ) await loadFormsByStudyEvent ( ) ; }
TODO: Loads entire tree if according elements are passed, implement this analogously for metadatamodule
TODO : Loads entire tree if according elements are passed implement this analogously for metadatamodule
// Check if the data has changed / new data has been entered and show a prompt first