From 446e5f2e8957eb2c506ebae2d58c8958fbe8eeac Mon Sep 17 00:00:00 2001 From: James Curtis Date: Fri, 20 Nov 2020 13:58:12 +0000 Subject: [PATCH] [FIX] Transferred patient has placement task stuck as scheduled When a A02 HL7 message is sent (to transfer a patient between wards), the existing placement task is cancelled (from state of scheduled) and a new one is created with a state of scheduled. When a A03 HL7 message is sent (to discharge a patient), the scheduled placement task remains in a state of scheduled and causes an error if the same patient is admitted again. As bed assignment is no longer used, the placement task should be processed as completed as soon as it is created and the placement task use the ward as the location. Fixes #16865 --- nh_clinical/operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nh_clinical/operations.py b/nh_clinical/operations.py index a4ab0eb1..5785cde2 100644 --- a/nh_clinical/operations.py +++ b/nh_clinical/operations.py @@ -354,7 +354,7 @@ def submit(self, cr, uid, activity_id, vals, context=None): if vals.get('location_id'): location_pool = self.pool['nh.clinical.location'] available_ids = location_pool.get_available_location_ids( - cr, uid, ['bed'], context=context) + cr, uid, ['ward', 'bed'], context=context) if vals['location_id'] not in available_ids: raise osv.except_osv( "Patient Placement Error!",