Skip to content

Commit

Permalink
Add comment for interval object acceptance & DOB/DOD logic
Browse files Browse the repository at this point in the history
Signed-off-by: Courtney Gosselin <[email protected]>
  • Loading branch information
CourtneyGosselin committed Feb 28, 2024
1 parent 2995124 commit 6a3a40d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/views/clinicalGenomic/useClinicalPatientData.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function useClinicalPatientData(patientId, programId) {
value === '' ||
key === ''
) &&
(!(typeof obj[key] === 'object') || (typeof obj[key] === 'object' && 'month_interval' in obj[key]))
(!(typeof obj[key] === 'object') || (typeof obj[key] === 'object' && 'month_interval' in obj[key])) // Accept interval date objects remove all other objects
)
);
}
Expand Down
2 changes: 2 additions & 0 deletions src/views/clinicalGenomic/widgets/clinicalData.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ function ClinicalView() {
const ageInMonths = patient.date_of_death.month_interval - patient.date_of_birth.month_interval;
patient.date_of_death = Math.floor(ageInMonths / 12);
patient.date_of_birth = Math.floor(-patient.date_of_birth.month_interval / 12);
} else if (patient.date_of_birth && patient.deceased) {
patient.date_of_birth = Math.floor(-patient.date_of_birth.month_interval / 12);
} else {
delete patient.date_of_birth;
delete patient.date_of_death;
Expand Down

0 comments on commit 6a3a40d

Please sign in to comment.