Skip to content

Commit

Permalink
Removed duplicate Clinical History/HPO terms loop
Browse files Browse the repository at this point in the history
  • Loading branch information
fatimarabab committed Jul 6, 2023
1 parent 91ac2fa commit 40a12b7
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions etc/fixtures/migrations/migrate-new-sections-phenotips-importer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ try {
let briefToModelGoalsFields = [];
let clinicalToGeneToPhenotype = [];
let namesOfFieldsToMove = ['Model of Interest', 'Goals', 'Proposed Model/Project']
let HPOTermsValues = {};
let HPOTermsValues = [];
element.sections.forEach(section => {
// print('---------')
// print(section)
Expand All @@ -74,17 +74,6 @@ try {
section.content = section.content.filter((contentItem) => {
return !namesOfFieldsToMove.includes(contentItem.field);
});
} else if (section.header === 'Clinical History') {
section.content.forEach(contentItem => {
contentItem['type'] = 'section-text';
if(contentItem.field === 'HPO Terms') {
clinicalToGeneToPhenotype.push(contentItem);
}
})

section.content = section.content.filter((contentItem) => {
return !contentItem.field === 'HPO Terms';
});
} else if (section.header === 'Pedigree') {
section['attachment_field'] = 'Pedigree';
if(section.content.length == 0) {
Expand All @@ -99,9 +88,13 @@ try {
}
} else if (section.header === 'Clinical History') {
section.content.forEach(contentItem => {
print("REached clinical history")
contentItem['type'] = 'section-text';
if(contentItem.field == 'HPO Terms') {
if(contentItem.field === 'HPO Terms') {
HPOTermsValues = contentItem.value;
print(HPOTermsValues)
print(contentItem.value)
print("SOMETHING IS HAPPENING HERE??????????")
}
});
} else {
Expand Down

0 comments on commit 40a12b7

Please sign in to comment.