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

Add Medication and Allergy CDA fields #51

Merged
merged 47 commits into from
Aug 5, 2024

Conversation

adamkells
Copy link
Contributor

@adamkells adamkells commented Jul 22, 2024

What does this do?

This PR adds the CDA fields of Medication and Allergy which were omitted from the original Clinical Documentation PR #47 .
In particular it makes the following concrete changes:

  • Renames get_concept_from_cda_value to get_medication_concept_from_cda_value.
  • Adds equivalent functions for medication and allergies.
  • Refactors the existing _extract_problems function to be more concise and less nested.
  • Adds functions for _extract_medications and _extract_allergies.
  • Adds an allergy code to the test_cda.xml file

jennferjiangkells and others added 30 commits June 18, 2024 17:33
…with leading underscore name change to internal funcs
@adamkells adamkells self-assigned this Jul 22, 2024
@adamkells adamkells changed the title Add missing CDA fields Add Medication and Allergy CDA fields Jul 23, 2024
@adamkells adamkells marked this pull request as ready for review July 25, 2024 07:53
@adamkells adamkells added the Issue: Feature Request ✨ New feature or improvement to existing feature label Jul 25, 2024
Copy link
Member

@jenniferjiangkells jenniferjiangkells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added pydantic validation to the medications extract method, and methods for adding new medication entries. Painful short-term but I think it's better for future scaling and maintenance. Passing the torch back to you to do the same for allergies 🤡

@jenniferjiangkells
Copy link
Member

jenniferjiangkells commented Aug 5, 2024

Made some bug fixes and added tests. Of note:

  • EntryRelationship can be list in allergy extraction
  • overwrite wasn't working quite right when there are existing entries - fixed this and added tests
  • Added a default allergy_type to AllergyConcept
  • Some typos in add allergy entry function template

Let's merge it before I lose the will to live

@jenniferjiangkells jenniferjiangkells merged commit 3d661a3 into main Aug 5, 2024
5 checks passed
@jenniferjiangkells jenniferjiangkells deleted the improvement/cda_fields branch September 5, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Feature Request ✨ New feature or improvement to existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants