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

Utility functions for "querying" graph? #79

Open
AnalogJ opened this issue Feb 17, 2023 · 1 comment
Open

Utility functions for "querying" graph? #79

AnalogJ opened this issue Feb 17, 2023 · 1 comment
Labels
question Further information is requested

Comments

@AnalogJ
Copy link

AnalogJ commented Feb 17, 2023

Hi,
I'm the developer of Fasten Health (which is an open-source personal health record aggregator), that uses Graph under the hood to help "answer" patient questions using their medical records.

FHIR medical records have complicated relationships. I've stored these relationships in an acyclic directed graph using your library, but it's been a long time since I've use Graph theory professionally, and I'm running into some use-cases where native query functionality would make my life much easier.

Right now, our medical record graph easily answers the question: "Give me a list of all patient Conditions, and all related resources (encounters, practitioners, organizations, devices, locations, ect)"

I'd also like to use the graph to answer other questions like:

  • generate a Phonebook/list of contacts - "create a list of all Locations, Organizations and Practitioners and then find the related Conditions and/or Encounters where the patient interacted with that entity"

Since Locations, Organizations and Practitioners may not have a direct relationship with Conditions and Encounters, I have to walk the graph. Is there a utility function I can use to "query" data within the Graph?


Totally understand if none of this makes sense and it's completely out-of-scope for this library. I might just need to do more reading on Graph theory.

@dominikbraun dominikbraun added the question Further information is requested label Feb 27, 2023
@dominikbraun
Copy link
Owner

Hi! That's an interesting use case.

If there is a "standard algorithm" that would solve your problem, we can implement that of course - but otherwise, you might need to add edges so that Locations have a direct relationship with Conditions and mark those edges as edges intended for queries only, or create a second graph that represents these relations, or use vertex and edge attributes to store related data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants