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

snomed refset processing update #294

Merged
merged 7 commits into from
Feb 1, 2023
Merged

snomed refset processing update #294

merged 7 commits into from
Feb 1, 2023

Conversation

antsh3k
Copy link
Collaborator

@antsh3k antsh3k commented Jan 16, 2023

Main change has been to the processing of snomed refsets to the required medcat models formats.

while len(stack) != 0:
# remove the last element from the stack
current_snomed = stack.pop()
current_snomed_parent = pt2ch.get(current_snomed, [])
Copy link
Member

Choose a reason for hiding this comment

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

Should the LHS be named as *_children rather than *_parent?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks will change.

Retrieves all the children of a given SNOMED CT ID (SCTID) from a given parent-to-child mapping (pt2ch) via the "IS A" relationship.
pt2ch can be found in a MedCAT model in the additional info via the call: cat.cdb.addl_info['pt2ch']

Parameters:
Copy link
Member

Choose a reason for hiding this comment

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

This is different from Google-style docstrings used at other places so pls check if the existing doc-gen will honour this.


def map_snomed2opcs4(self) -> pd.DataFrame:
"""Map SNOMED to OPSC4.
def map_snomed2opcs4(self):
Copy link
Member

Choose a reason for hiding this comment

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

Missing return type hint.

snomed2opcs4df = self._map_snomed2refset()[1]
return self._refset_df2dict(snomed2opcs4df)

def _check_path_and_release(self):
Copy link
Member

Choose a reason for hiding this comment

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

Missing return type hint.

This function takes a SNOMED refset DataFrame as an input and converts it into a dictionary.
The DataFrame should contain the columns 'referencedComponentId','mapTarget','mapGroup','mapPriority','mapRule','mapAdvice'.

Parameters:
Copy link
Member

Choose a reason for hiding this comment

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

Again, pls check if the existing doc-gen will honour this.

'mapAdvice': row['mapAdvice']} for _, row in group.iterrows()]).to_dict()
return refset_dict

def _map_snomed2refset(self):
Copy link
Member

Choose a reason for hiding this comment

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

Missing return type hint.

Copy link
Member

@baixiac baixiac left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@antsh3k
Copy link
Collaborator Author

antsh3k commented Feb 1, 2023

Ready for merge if everyone is okay with it

@antsh3k antsh3k merged commit d1af700 into master Feb 1, 2023
@antsh3k antsh3k deleted the icd10update branch February 1, 2023 16:36
mart-r pushed a commit to mart-r/MedCAT that referenced this pull request Jun 14, 2023
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.

2 participants