-
Notifications
You must be signed in to change notification settings - Fork 43
Update the code to save and retrieve the data for Chief Complaint QC #127
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
Conversation
…Chief Complaint module
WalkthroughThe update adds logging to the service and enhances the nurse quick consultation workflow to handle chief complaints. When inserting nurse data, chief complaints are now linked to the visit ID and saved. Additionally, chief complaints are included in the data returned for the nurse-to-doctor visit details screen, integrating this information into both data persistence and retrieval processes. Changes
Sequence Diagram(s)sequenceDiagram
participant Nurse as Nurse
participant Service as QuickConsultationServiceImpl
participant DB as Database
Nurse->>Service: quickConsultNurseDataInsert(inputJson)
Service->>DB: Save anthropometry and vital details
Service->>Service: For each chiefComplaint in inputJson
Service->>Service: Add benVisitID to chiefComplaint
Service->>DB: saveBeneficiaryChiefComplaint(updatedChiefComplaints)
Service-->>Nurse: Return result
sequenceDiagram
participant Doctor as Doctor
participant Service as QuickConsultationServiceImpl
participant DB as Database
Doctor->>Service: getBenDataFrmNurseToDocVisitDetailsScreen(benRegID, visitCode)
Service->>DB: Fetch data for nurse-to-doctor visit
Service->>DB: getBenChiefComplaints(benRegID, visitCode)
Service->>Doctor: Return data including chief complaints
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java (2)
31-32: Good addition of logging capabilities.Adding logger support is a good practice, however, I noticed that while you've added the logger instance, there are no actual logging statements implemented in the code, particularly around the new chief complaints processing logic.
Consider adding appropriate logging statements around critical operations such as the chief complaints processing to help with troubleshooting and monitoring. For example:
+ logger.info("Processing chief complaints for benVisitID: {}", benVisitID); JsonArray chiefComplaintsArray = jsnOBJ.getAsJsonArray("chiefComplaints"); if (chiefComplaintsArray != null && chiefComplaintsArray.size() > 0) { + logger.debug("Found {} chief complaints to process", chiefComplaintsArray.size()); for (JsonElement elem : chiefComplaintsArray) { JsonObject complaintObj = elem.getAsJsonObject(); complaintObj.addProperty("benVisitID", benVisitID); } + logger.debug("Successfully added benVisitID to all chief complaints"); }Also applies to: 69-69, 107-108
248-259: Implementation for Chief Complaint QC data saving looks good.The code correctly processes the chief complaints array by adding the visit ID to each complaint object and then saving the updated data. This ensures that chief complaints are properly associated with the current visit.
For better error handling, consider adding a try-catch block and logging any exceptions that might occur during the processing of chief complaints:
//Chief Complaint QC update + try { JsonArray chiefComplaintsArray = jsnOBJ.getAsJsonArray("chiefComplaints"); if (chiefComplaintsArray != null && chiefComplaintsArray.size() > 0) { for (JsonElement elem : chiefComplaintsArray) { JsonObject complaintObj = elem.getAsJsonObject(); complaintObj.addProperty("benVisitID", benVisitID); } } jsnOBJ.add("chiefComplaints", chiefComplaintsArray); Long benChiefComplaintID = saveBeneficiaryChiefComplaint(jsnOBJ); + } catch (Exception e) { + logger.error("Error processing chief complaints: {}", e.getMessage(), e); + throw e; + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java(5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (java)
🔇 Additional comments (1)
src/main/java/com/iemr/hwc/service/quickConsultation/QuickConsultationServiceImpl.java (1)
501-502: Properly implemented Chief Complaint data retrieval.The response map is correctly updated to include the beneficiary chief complaints fetched via
commonNurseServiceImpl.getBenChiefComplaints(). This enables the retrieval of chief complaint data in the nurse-to-doctor visit details screen.



Description
Update the code to save and retrieve the chief complaint QC data.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
Checklist:
Summary by CodeRabbit
New Features
Other