Skip to content

Conversation

@mikix
Copy link
Contributor

@mikix mikix commented Oct 24, 2022

  • Adds some new methods in ctakesclient.text2fhir like nlp_condition or nlp_observation that take a ctakes MatchText and return a fhirclient resource for it.
  • These returned resources include extensions for defining polarity, derivation span, and what source algorithm generated the NLP.

This only includes five new public methods:

  • nlp_concept
  • nlp_condition
  • nlp_observation
  • nlp_medication
  • nlp_procedure

Each will take a MatchText and some other parameters and return a fhirclient resource. The id will be randomly generated.

- Adds some new methods in ctakesclient.text2fhir like
  nlp_condition or nlp_observation that take a ctakes MatchText
  and return a fhirclient resource for it.
- These returned resources include extensions for defining polarity,
  derivation span, and what source algorithm generated the NLP.
self.conceptAttributes = []

# sort list of concepts ensuring same ordering
unsorted = list(UmlsConcept(c) for c in source.get('conceptAttributes'))
Copy link
Contributor

Choose a reason for hiding this comment

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

OK. Curious when is conceptAttributes missing? Is this only when using "Identified" custom dictionary annotations that are from the 3 column BSV? Either way, seems like a good check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah this was an unrelated change I just had sitting on my laptop from earlier testing. I had manually constructed a MatchText I think in a test file and hit an exception because it didn't have a conceptAttributes defined. Easy enough to fix in the test file (I just added the field). But I had also removed the requirement here and am just now committing it.

It should always be defined anyway, but I figured no harm in being a bit graceful when its not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants