Skip to content

Utility functions for "querying" graph? #79

Open

Description

@AnalogJ

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.

Activity

  1. dominikbraun commented on Feb 27, 2023

    @dominikbraun
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions