Skip to content
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

bug: CCDA import creates extra entries in list_options for drug_units list_id #7319

Closed
adunsulag opened this issue Apr 5, 2024 · 2 comments · Fixed by #7321
Closed

bug: CCDA import creates extra entries in list_options for drug_units list_id #7319

adunsulag opened this issue Apr 5, 2024 · 2 comments · Fixed by #7321
Assignees
Labels
Bug developers This issue targets an issue that is for developers/collaborators/module writers/technical users
Milestone

Comments

@adunsulag
Copy link
Sponsor Member

When running the CCDA import process with a CCDA for a patient the CdaTemplateImportDispose->InsertImmunization() function is creating empty list_option entries for the drug_units list_id.

You can reproduce this easily by running the openemr-cmd irp 20 utility command or by passing a CCDA directly with the following command (run in the easy-dev docker environment)

php console openemr:ccda-newpatient-import --document=/root/synthea/output/ccda/Alysia661_Kristan816_Turcotte120_0f3907cd-027f-2ccf-cea2-6e81989c2704.xml 

This was discovered in the latest OpenEMR master release and likely exists in OpenEMR 7.0.2.

@adunsulag adunsulag added the Bug label Apr 5, 2024
@adunsulag adunsulag added this to the 7.0.2.1 milestone Apr 5, 2024
@adunsulag adunsulag self-assigned this Apr 5, 2024
@adunsulag
Copy link
Sponsor Member Author

Note this bug slows down the patient summary screen immensely once you have a number of patients due to how large the drug_units table becomes. This causes the immunization / prescription queries on the patient summary screen to get extremely slow.

To fix this we need to look at only inserting the entries in the InsertImmunization screen function if there are actual data values to insert.

@adunsulag
Copy link
Sponsor Member Author

Looks like the same bug happens in CdaTemplateImportDispose->InsertPrescriptions

adunsulag added a commit to DiscoverAndChange/openemr that referenced this issue Apr 5, 2024
This fixes the error in the ccda that was creating tons of entries in
the drug_entry list options list.  The CCDA was not checking against
empty values and would continue to create new list_options for each
immunization / prescription drug_unit when the unit was an empty string

I also added some debugging instruments on the prescription and
immunization process which makes it easy to compare for a ccda what is
being parsed and what is being stored in the database.

Added a debug flag to all of the ccda commands so that these options are
available for people needing to do any debugging of the process.
adunsulag added a commit that referenced this issue Apr 7, 2024
* Fixes #7319 ccda extra drug_unit list options

This fixes the error in the ccda that was creating tons of entries in
the drug_entry list options list.  The CCDA was not checking against
empty values and would continue to create new list_options for each
immunization / prescription drug_unit when the unit was an empty string

I also added some debugging instruments on the prescription and
immunization process which makes it easy to compare for a ccda what is
being parsed and what is being stored in the database.

Added a debug flag to all of the ccda commands so that these options are
available for people needing to do any debugging of the process.

* Exclude 0 values from amount administered checks.

We decided that we wanted to exclude recording 0 values so updated the
conditions on the immunization and prescription to account for that.
stephenwaite pushed a commit to stephenwaite/openemr that referenced this issue Apr 7, 2024
* Fixes openemr#7319 ccda extra drug_unit list options

This fixes the error in the ccda that was creating tons of entries in
the drug_entry list options list.  The CCDA was not checking against
empty values and would continue to create new list_options for each
immunization / prescription drug_unit when the unit was an empty string

I also added some debugging instruments on the prescription and
immunization process which makes it easy to compare for a ccda what is
being parsed and what is being stored in the database.

Added a debug flag to all of the ccda commands so that these options are
available for people needing to do any debugging of the process.

* Exclude 0 values from amount administered checks.

We decided that we wanted to exclude recording 0 values so updated the
conditions on the immunization and prescription to account for that.
sjpadgett pushed a commit to sjpadgett/openemr that referenced this issue Apr 16, 2024
* Fixes openemr#7319 ccda extra drug_unit list options

This fixes the error in the ccda that was creating tons of entries in
the drug_entry list options list.  The CCDA was not checking against
empty values and would continue to create new list_options for each
immunization / prescription drug_unit when the unit was an empty string

I also added some debugging instruments on the prescription and
immunization process which makes it easy to compare for a ccda what is
being parsed and what is being stored in the database.

Added a debug flag to all of the ccda commands so that these options are
available for people needing to do any debugging of the process.

* Exclude 0 values from amount administered checks.

We decided that we wanted to exclude recording 0 values so updated the
conditions on the immunization and prescription to account for that.

(cherry picked from commit 0b1be28)
@adunsulag adunsulag added the developers This issue targets an issue that is for developers/collaborators/module writers/technical users label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug developers This issue targets an issue that is for developers/collaborators/module writers/technical users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant