fix(patient-appointment): missing Patient Encounter series when created from Patient Appointment#1050
fix(patient-appointment): missing Patient Encounter series when created from Patient Appointment#1050md-umair-21 wants to merge 1 commit into
Conversation
…ed from Patient Appointment
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Issue:
When Patient Encounter was created from the Create Patient Encounter button on Patient Appointment, the form opened through open_mapped_doc. That path mapped field values from the appointment, but it skipped the normal new_doc default initialization, so naming_series stayed blank. A blank series can cause incorrect naming/sequence behavior when the encounter is saved. The normal or independent patient encounter were properly setting series field correctly, issue is with encounter created from appointment.
Before fix:

Fix:
Changed the Patient Encounter create action in Patient Appointment set frappe.route_options with the appointment-derived values and open the form with frappe.new_doc("Patient Encounter"). This keeps the encounter fields prefilled and allows Frappe to apply the default naming_series correctly.
After fix:

Note:-
Also required for version-16 branch, the above issue also exists there.