Skip to content

Commit

Permalink
fix null error in diagnosis query
Browse files Browse the repository at this point in the history
  • Loading branch information
nr23730 committed Feb 1, 2024
1 parent 18aec07 commit fdc3ef6
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src/pages/patientView/clinicalInformation/PatientViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2782,27 +2782,29 @@ export class PatientViewPageStore {
console.log('update');
mtbs.forEach(mtb =>
mtb.therapyRecommendations.forEach(tr => {
var diagnosis = [
{
sampleId: this.getDiagnosisFromSamples.result[0]
.sampleId,
attributeId: this.getDiagnosisFromSamples.result[0]
.clinicalAttribute.clinicalAttributeId,
attributeName: this.getDiagnosisFromSamples.result[0]
.clinicalAttribute.displayName,
value: this.getDiagnosisFromSamples.result[0].value,
},
] as IClinicalData[];
if (
!tr.reasoning.clinicalData?.find(
diag => diag.value == diagnosis[0].value
)
) {
tr.reasoning.clinicalData = diagnosis.concat(
tr.reasoning.clinicalData
? tr.reasoning.clinicalData
: []
);
if (this.getDiagnosisFromSamples.result.length > 0) {
var diagnosis = [
{
sampleId: this.getDiagnosisFromSamples.result[0]
.sampleId,
attributeId: this.getDiagnosisFromSamples.result[0]
.clinicalAttribute.clinicalAttributeId,
attributeName: this.getDiagnosisFromSamples
.result[0].clinicalAttribute.displayName,
value: this.getDiagnosisFromSamples.result[0].value,
},
] as IClinicalData[];
if (
!tr.reasoning.clinicalData?.find(
diag => diag.value == diagnosis[0].value
)
) {
tr.reasoning.clinicalData = diagnosis.concat(
tr.reasoning.clinicalData
? tr.reasoning.clinicalData
: []
);
}
}
})
);
Expand Down

0 comments on commit fdc3ef6

Please sign in to comment.