Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api): Add "N/A" inside the posible answers of a categorical que… #142

Merged
1 commit merged into from
Oct 28, 2024

Conversation

ghost
Copy link

@ghost ghost commented Oct 25, 2024

This pull request includes significant updates to the survey data transformation process and the filters used in the survey. The key changes involve adding new options to the survey filters and ensuring all survey questions have answers.

Updates to Survey Filters:

  • api/data/filters.sql: Added 'N/A' options to various survey filters to accommodate cases where the provided options do not apply.

Enhancements to Survey Data Transformation:

  • api/data/surveys/transform.ts:
    • Replaced the EXCLUDED_QUESTIONS object with a QUESTIONS set that lists all survey questions to ensure completeness.
    • Introduced a generateSurveyQuestionMap function to map survey questions to their respective survey IDs.
    • Added the ensureAllSurveyQuestionsHaveAnswers function to fill in 'N/A' for any unanswered survey questions.
    • Modified the main transformation function to call ensureAllSurveyQuestionsHaveAnswers and filter out excluded questions using the new set-based approach.

…stion and ensure all survey questions have answers
Copy link

vercel bot commented Oct 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
4-growth ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 0:12am

Copy link
Collaborator

@alexeh alexeh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alepefe-vizz.

I have left some comment regarding how to avoid future potential pains, we might consider them for the future

@ghost ghost merged commit 11d6d37 into dev Oct 28, 2024
4 checks passed
@ghost ghost deleted the feature/SIRH-168 branch October 28, 2024 10:37
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants