openemr / openemr

The most popular open source electronic health records and medical practice management solution.
https://open-emr.org/
GNU General Public License v3.0
3.17k stars 2.15k forks source link

Query Error while saving Encounter #6435

Open learnhl7-arun opened 1 year ago

learnhl7-arun commented 1 year ago

Describe the bug

System shows the error _ERROR: query failed: INSERT INTO issue_encounter ( pid, list_id, encounter ) VALUES (?,?,?) _Error: Duplicate entry '57-0-105' for key 'PRIMARY'__

when adding an encounter with Problem, Allergies and Medications

To Reproduce

Steps to reproduce the behavior:

  1. Add a 'Patient'
  2. Create Encounter. Add a problem with ICD Code, Allergies with Reaction and Medications.
  3. Click on Save Button.
  4. System shows error image

Expected behavior

System should save the record

Client configuration

Issue reproduced in Demo.

juggernautsei commented 1 year ago

@learnhl7-arun Can you go into your database and look at the record that the error message is referring to? You should be able to find 57-0-105. Which column is that data is in?

image

stephenwaite commented 1 year ago

there's a bug in the communication between the encounter form and the add edit issue script that results in not sending the id from the issue table back to the encounter common form and save script after saving the new issue

by default you would expect this issue to be added to the encounter as well

also looks to be an error when trying to deselect all issues that were linked to the encounter

Screenshot from 2023-05-06 16-35-15