Refactor health center app with REST API migration and enhancements#1906
Open
harshiill wants to merge 12 commits into
Open
Refactor health center app with REST API migration and enhancements#1906harshiill wants to merge 12 commits into
harshiill wants to merge 12 commits into
Conversation
…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.
…ompatibility for POST requests
…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
…d create migration for changes
…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.
Collaborator
|
Congratulations for making your first Pull Request at Fusion!! 🎉 Someone from our team will review it soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
test.pysettings module inFusion/settingsto provide a dedicated configuration for running tests, including a test database, reduced password hashing, and test-specific installed apps and middleware.Fusion/urls.pyto detect when test settings are active and route to simplified test URLs and minimal apps, isolating the test environment from production logic.applications/globals/test_urls.pyto provide minimal, stubbed endpoints for use in test mode, ensuring tests run quickly and without side effects.Modernization and code cleanup:
url()imports and usage withre_path()throughout the codebase, including inapplications/globals/urls.pyandapplications/globals/api/urls.py, to align with modern Django standards and remove reliance on legacy APIs. [1] [2]applications/globals/views.py. Also made the import ofNotificationmodel resilient to errors, preventing test failures if the notifications app is not loaded. [1] [2] [3]Health center app enhancements:
InventoryRequisitionand its related inline items in the Django admin, improving admin usability for inventory management.selectors.pymodule 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