Skip to content

Commit

Permalink
[FIX] address metadata bug and remove message when all metadata present
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Levitas committed Jun 3, 2024
1 parent 134e454 commit dc65e8d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ui/src/components/modalityForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,39 @@ export default defineComponent({
}
//match the pos of type and series.idx inside the ezbids.objects[]
this.loadInitFormValues();
/*
With perf/asl data, when ArterialSpinLabelingType is CASL or PCASL, you can't have the following:
- PASLType
- LabelingSlabThickness
- BolusCutOffFlag
- BolusCutOffTimingSequence
- BolusCutOffDelayTime
- BolusCutOffTechnique
*/
if (type_str === 'perf/asl' && ['CASL', 'PCASL'].includes(this.formData['ArterialSpinLabelingType'])) {
let bad_keys = [
'PASLType',
'LabelingSlabThickness',
'BolusCutOffFlag',
'BolusCutOffTimingSequence',
'BolusCutOffDelayTime',
'BolusCutOffTechnique',
];
function removeEntryByFieldValue(arr, bad_key) {
return arr.filter(obj => obj.field !== bad_key);
}
for (let bad_key of bad_keys) {
for (let i in this.fields) {
this.fields[i] = removeEntryByFieldValue(this.fields[i], bad_key);
}
if (this.formData.hasOwnProperty(bad_key)) {
delete this.formData[bad_key];
}
}
}
//Task validate form on load
this.showDialog = true;
this.$nextTick(() => {
Expand Down Expand Up @@ -767,6 +800,7 @@ export default defineComponent({
if (type === 'perf/m0scan' && field !== 'RepetitionTimePreparation') {
continue;
}
// Deal with different metadata standards for pet/pet and pet/blood
if (type === 'pet/blood' && !section.includes('Blood')) {
continue;
Expand Down
8 changes: 8 additions & 0 deletions ui/src/libUnsafe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,14 @@ export function metadataAlerts(
}
}

for (let i = requiredFields.length - 1; i >= 0; i--) {
let requiredField = requiredFields[i];

if (sidecarMetadata.hasOwnProperty(requiredField)) {
requiredFields.splice(i, 1);
}
}

let metadataAlertFields = requiredFields.concat(typoFields);
// console.log('required', requiredFields);
// console.log('typo', typoFields);
Expand Down

0 comments on commit dc65e8d

Please sign in to comment.