Skip to content

Refactor health center app with REST API migration and enhancements#1906

Open
harshiill wants to merge 12 commits into
FusionIIIT:health-center-v1from
harshiill:health-center-v1
Open

Refactor health center app with REST API migration and enhancements#1906
harshiill wants to merge 12 commits into
FusionIIIT:health-center-v1from
harshiill:health-center-v1

Conversation

@harshiill
Copy link
Copy Markdown

This pull request introduces significant improvements to the testability and maintainability of the FusionIIIT Django project. It adds a dedicated test settings module, refactors URL routing to support test environments, modernizes URL patterns to use re_path, and enhances the health center app with new admin and selector logic. These changes collectively improve the project's structure, make automated testing easier, and update the codebase to follow current Django best practices.

Test environment setup and routing:

  • Added a new test.py settings module in Fusion/settings to provide a dedicated configuration for running tests, including a test database, reduced password hashing, and test-specific installed apps and middleware.
  • Refactored Fusion/urls.py to detect when test settings are active and route to simplified test URLs and minimal apps, isolating the test environment from production logic.
  • Introduced applications/globals/test_urls.py to provide minimal, stubbed endpoints for use in test mode, ensuring tests run quickly and without side effects.

Modernization and code cleanup:

  • Replaced deprecated url() imports and usage with re_path() throughout the codebase, including in applications/globals/urls.py and applications/globals/api/urls.py, to align with modern Django standards and remove reliance on legacy APIs. [1] [2]
  • Cleaned up unnecessary imports and improved import order in applications/globals/views.py. Also made the import of Notification model resilient to errors, preventing test failures if the notifications app is not loaded. [1] [2] [3]

Health center app enhancements:

  • Registered InventoryRequisition and its related inline items in the Django admin, improving admin usability for inventory management.
  • Added a default app config for the health center application, ensuring proper initialization.
  • Introduced a new selectors.py module in the health center app, providing high-level data access functions for dashboards and inventory requisitions, as well as utility functions for user roles and scheduling.## Issue that this pull request solves

govinddwivedi-git and others added 12 commits March 23, 2026 15:55
…ews to REST API endpoints, implement logging for stock retrieval, and create new API services and selectors for improved data handling. Add management commands for importing compounders, doctors, and schedules from Excel files. Update database migrations to normalize day values and introduce tests for service functions.
…ject and remove unused add_prescribed_medicine import
…or dependent fields, and enhance stock management with low-stock alerts and new API endpoints.
…ws, and enhance validation for doctor and pathologist schedules
…ment stock report generation, feedback payload, and relief application handling in compounder API
…ack handling, and improve prescription management with follow-up functionality and data normalization
- Introduced UC test cases covering 18 use cases with 3 tests each, ensuring robust coverage for functionalities like viewing doctor schedules, medical history, downloading records, and managing prescriptions.
- Implemented workflow tests for medical bill reimbursement, inventory procurement requisition, and doctor schedule publication, validating end-to-end processes and negative scenarios.
- Updated URL patterns to use re_path for improved regex handling.
- Added a simple test runner script to facilitate running tests with proper Django setup.
- Created minimal requirements file for project dependencies.
…s and views for feedback handling

- Created HealthCenterFeedback model with fields for complaint, feedback, and date.
- Added migration for the new HealthCenterFeedback model.
- Updated services to handle feedback creation and response, allowing for fallback to a legacy Complaint model.
- Enhanced views to include feedback retrieval and management, ensuring compatibility with existing workflows.
- Introduced utility functions for resolving model paths and handling feedback payloads.
@FusionIIIT-Bot
Copy link
Copy Markdown
Collaborator

Congratulations for making your first Pull Request at Fusion!! 🎉 Someone from our team will review it soon.

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.

3 participants