Skip to content

Commit

Permalink
Merge pull request #96 from susom/dev
Browse files Browse the repository at this point in the history
user-defined labs production release
  • Loading branch information
sboosi authored Nov 8, 2024
2 parents 41f0fb2 + 4070c66 commit e315bf3
Show file tree
Hide file tree
Showing 24 changed files with 3,368 additions and 2,021 deletions.
2 changes: 2 additions & 0 deletions pages/editProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
postObj['check_irb_url'] = "<?php echo $module->getUrl("services/checkIRB.php"); ?>";
// store URL for services/callMetadata.php
postObj['metadata_url'] = "<?php echo $module->getUrl("services/callMetadata.php"); ?>";
// store URL for services/getLabResults.php
postObj['get_lab_results_url'] = "<?php echo $module->getUrl("services/getLabResults.php"); ?>";
// store URL for services/getDatasetDesigns.php
postObj['get_dataset_designs_url'] = "<?php echo $module->getUrl("services/getDatasetDesigns.php"); ?>";
// store URL for services/refreshSession.php
Expand Down
2 changes: 1 addition & 1 deletion pages/js/duster/get-data/dist/index.css

Large diffs are not rendered by default.

137 changes: 69 additions & 68 deletions pages/js/duster/get-data/dist/index.js

Large diffs are not rendered by default.

Binary file not shown.
2,027 changes: 2,027 additions & 0 deletions pages/js/duster/new-project/dist/assets/index-1d978ef1.js

Large diffs are not rendered by default.

1,863 changes: 0 additions & 1,863 deletions pages/js/duster/new-project/dist/assets/index-39dccbbb.js

This file was deleted.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pages/js/duster/new-project/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="./assets/favicon-db74ab0b.ico">
<!-- <link rel="icon" href="../shared/src/assets/images/favicon.ico"> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DUSTER</title>
<script type="module" crossorigin src="./assets/index-39dccbbb.js"></script>
<link rel="stylesheet" href="./assets/index-28e3618b.css">
<script type="module" crossorigin src="./assets/index-1d978ef1.js"></script>
<link rel="stylesheet" href="./assets/index-4f7a9f65.css">
</head>
<body>
<div id="app"></div>

</body>
</html>
</html>
4 changes: 2 additions & 2 deletions pages/js/duster/new-project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="../shared/src/assets/images/favicon.ico">
<!-- <link rel="icon" href="../shared/src/assets/images/favicon.ico"> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DUSTER</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
</html>
66 changes: 45 additions & 21 deletions pages/js/duster/new-project/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<nav>
<div class="grid">
<div class="col">
<a class="brand-logo" href="https://med.stanford.edu/">Stanford Medicine</a>
<a class="brand-logo" href="https://med.stanford.edu/" target="_blank">Stanford Medicine</a>
<div style="display:inline;float:left" class="mt-2">
<div class="font-bold text-left" style="font-size:1.25em;">DUSTER</div>
<div class="text-sm font-italic">Research Technology, TDS</div>
Expand Down Expand Up @@ -164,6 +164,7 @@ import ReviewPanel from '@/components/ReviewPanel.vue';
// for testing
import resp from './dusterTestMetadata.json';
import labResultsDev from './lab_results.json'; // TODO delete this line
import {useToast} from "primevue/usetoast";
import Toast from 'primevue/toast';
import {useVuelidate} from "@vuelidate/core";
Expand Down Expand Up @@ -223,6 +224,12 @@ const outcomeOptions = ref<FieldMetadata[]>([]);
const scoreOptions = ref<FieldMetadata[]>([]);
const clinicalDateOptions = ref<FieldMetadata[]>([]);
const labResults = ref();
const labResultsMetadata = computed<any>(() => {
return labResults.value.results;
});
provide('labResults', labResultsMetadata);
const metadataArr = computed<Array<FieldMetadata>>(() => {
let arr:FieldMetadata[] = [];
return arr.concat(demographicsOptions.value)
Expand Down Expand Up @@ -461,6 +468,7 @@ const getDusterMetadata = (metadataUrl:string) => {
outcomeOptions.value = resp.data.outcomes;
scoreOptions.value = resp.data.scores;
clinicalDateOptions.value = resp.data.clinical_dates;
} else {
axios.get(metadataUrl)
.then(function (response) {
Expand All @@ -470,31 +478,47 @@ const getDusterMetadata = (metadataUrl:string) => {
outcomeOptions.value = response.data.outcomes;
scoreOptions.value = response.data.scores;
clinicalDateOptions.value = response.data.clinical_dates;
irbCheckVisible.value = false;
// fetch dataset designs
axios.get(projectConfig.get_dataset_designs_url)
.then(function (response) {
const designs = response.data;
// prompt to restore auto-save
if (projectConfig.edit_mode === false && designs.hasOwnProperty('auto-save') === true) {
autoSaveDesign.value = JSON.parse(designs['auto-save']);
promptRestoreAutoSave.value = true;
} else if (projectConfig.edit_mode === true) {
loadEditMode();
}
})
.catch(function (error) {
// get lab results metadata
axios.get(projectConfig.get_lab_results_url)
.then(function (response) {
labResults.value = response.data;
irbCheckVisible.value = false;
// fetch dataset designs
axios.get(projectConfig.get_dataset_designs_url)
.then(function (response) {
const designs = response.data;
// prompt to restore auto-save
if (projectConfig.edit_mode === false && designs.hasOwnProperty('auto-save') === true) {
autoSaveDesign.value = JSON.parse(designs['auto-save']);
promptRestoreAutoSave.value = true;
} else if (projectConfig.edit_mode === true) {
loadEditMode();
}
})
.catch(function (error) {
});
});
})
.catch(function (error) {
irbCheckMessage.value = "Unable to load DUSTER metadata.";
systemError.value = true;
});
}).catch(function (error) {
irbCheckMessage.value = "Unable to load DUSTER metadata";
systemError.value = true;
irbCheckMessage.value = "Unable to load DUSTER metadata.";
systemError.value = true;
});
}
};
const loadEditMode = () => {
// add an empty array for missing user-defined labs to each data collection window
// retroactive support for user-defined labs feature for older projects
projectConfig.initial_design.collectionWindows.forEach((cw: any) => {
cw.data.ud_labs = cw.data.ud_labs ? cw.data.ud_labs : [];
});
initialDesign.value = projectConfig.initial_design;
// transform and load researcher-provided data
Expand All @@ -515,8 +539,8 @@ const loadEditMode = () => {
}
// load data collection windows
initialDesign.collectionWindows = projectConfig.initial_design.collectionWindows;
collectionWindows.value = initialDesign.value.collectionWindows;
initialDesign.collectionWindows = JSON.parse(JSON.stringify(projectConfig.initial_design.collectionWindows));
collectionWindows.value = JSON.parse(JSON.stringify(initialDesign.value.collectionWindows));
};
const checkForRpDateChanges = () => {
Expand Down
Loading

0 comments on commit e315bf3

Please sign in to comment.