New York
Join 1000+ graph enthusiasts & innovators October 23–24  •  Use code WEB10 for 10% off!

GraphGist: Behavioral Health Treatment Planning

by Greg Ricker

Use Case(s)

Using the Wiley Treatment Plan

I am using the "Wiley treatment plan" data set as the basis of our domain model since it is one standard that is used in behavioral health. A key aspect of treatment in the field of behavioral health involves creating a four-part treatment plan, packaged as libraries, consisting of a Problem, Goal, Objective, and Intervention.

The Problem

The Problem states, in general terms, what the patient is suffering with. For example, this might be Depression, Low self-Esteem, Substance Abuse, or something else.

The Goal

The Goal is the end result. For example, a patient might have the goal of "Demonstrate respect and regard for self and others".

The Objectives

Objectives are milestones along the way from the Problem to the Goal: ways in which the patient is going to improve.

The Intervention

Interventions are tasks or activities performed as part of the plan. These may be actions taken by the patient and others involved in the treatment plan.

Additional Complications

In practice, there are several snarls in the model described above that make the implementation of the Wiley plan difficult for relational databases.

The first is the existence of links from problem to goal to intervention restricting interventions to those related only to a specfic problem and/or goal. Setting this up in an SQL database required a separate table to maintain "linkages" for each plan. Generating an appropriate plan requires traversing the linkage table a number of times, resulting in queries that can run from two to ten seconds depending on how many libraries are loaded.

The second change is that not everyone uses the plan in the defined order of problem → goal → objective → intervention. Any practical implementation of the treatment plan system has to let the user start from any point in the plan and work from there. For example, the user can start with goal then jump to intervention and then on to problem.

Thirdly, the information (goals, objectives, interventions) is reused. For example, GoalA may be used for ProblemA in LibraryA but it maybe used again with other problems within the same library or span libraries.

Figure 1. The Wiley Treatment Plan Domain Model

Implementing The Wiley Plan using Neo4j

Implementing the model in Neo4j resulted in 300 nodes and 120k relationships. A typical query runs in about 500 ms and `RETURN`s 500-700 values. In addition, adding custom plans that deviate from the Wiley plan was easy and didn’t affect performance.

Figure 2. Modified Wiley Treatment Plan Domain Model

Nodes

(:Library)
(:Problem)
(:Goal)

Relationships

(:Library)-[:HAS_PROBLEM]->(:Problem)-[:HAS_GOAL]->(:Goal)
(:Problem)-[:HAS_OBJECTIVE]->(:Objective)
(:Problem)-[:HAS_INTERVENTION]->(:Intervenion)

Sample Dataset

The sample data set uses a one library, one problem, and four objectives, goals, and interventions.

CREATE (lib:Library {GroupID:'230', Description:'School Counseling and Social Work'})
CREATE (prob1:Problem {name:'17', Description:'Parenting Skills/Discipline',GroupID:'230'})
CREATE (obj1:Objective {name:'9', Description:'Parents use natural and logical consequences to redirect the students behavior.',GroupID:'230',ProblemNumber:'17'})
CREATE (obj2:Objective {name:'8', Description:'Parents allow the student to learn from his/her mistakes.',GroupID:'230',ProblemNumber:'17'})
CREATE (obj3:Objective {name:'6', Description:'Parents set limits using positive discipline strategies.',GroupID:'230',ProblemNumber:'17'})
CREATE (obj4:Objective {name:'20', Description:'Parents work to maintain a strong, couple-centered family environment',GroupID:'230',ProblemNumber:'17'})
CREATE (goal1:Goal {name:'4', Description:'Acquire positive and moral character traits',GroupID:'230',ProblemNumber:'17'})
CREATE (goal2:Goal {name:'3', Description:'Demonstrate respect and regard for self and others.',GroupID:'230',ProblemNumber:'17'})
CREATE (goal3:Goal {name:'5', Description:'Parents acquire positive discipline strategies that set limits and encourage independence.,',GroupID:'230',ProblemNumber:'17'})
CREATE (goal4:Goal {name:'6', Description:'Family atmosphere is peaceful, loving, and harmonious.',GroupID:'230',ProblemNumber:'17'})
CREATE (intervention1:Intervention {name:'7', Description:'Suggest that the parents and the student meet weekly at a designated time to review progress, give encouragement, note continuing concerns, and keep a written progress report to share with a counselor or private therapist.',GroupID:'230',ProblemNumber:'17'})
CREATE (intervention2:Intervention {name:'38', Description:'Encourage the parents and teachers to allow the student to seek his/her own solutions with guidance even if it requires some struggle and learning from mistakes. Recommend that the parents and teachers listen to the students problems with empathy and give guidance or assistance only when requested; discuss the results of this approach in a subsequent counseling session.',GroupID:'230',ProblemNumber:'17'})
CREATE (intervention3:Intervention {name:'1', Description:'Meet with the parents to obtain information about discipline, family harmony, and the students developmental history.',GroupID:'230',ProblemNumber:'17'})
CREATE (intervention4:Intervention {name:'8', Description:'Have the student complete the (Personal Profile) informational sheet from the School Counseling and School Social Homework Planner (Knapp), which details pertinent personal data, or gather personal information in an informal interview with the student."',GroupID:'230',ProblemNumber:'17'})
CREATE (lib)-[:HAS_PROBLEM]->(prob1)
CREATE (prob1)-[:HAS_GOAL]->(goal1)
CREATE (prob1)-[:HAS_GOAL]->(goal2)
CREATE (prob1)-[:HAS_GOAL]->(goal3)
CREATE (prob1)-[:HAS_GOAL]->(goal4)
CREATE (prob1)-[:HAS_OBJECTIVE]->(obj1)
CREATE (prob1)-[:HAS_OBJECTIVE]->(obj2)
CREATE (prob1)-[:HAS_OBJECTIVE]->(obj3)
CREATE (prob1)-[:HAS_OBJECTIVE]->(obj4)
CREATE (prob1)-[:HAS_INTERVENTION]->(intervention1)
CREATE (prob1)-[:HAS_INTERVENTION]->(intervention2)
CREATE (prob1)-[:HAS_INTERVENTION]->(intervention3)
CREATE (prob1)-[:HAS_INTERVENTION]->(intervention4)
Loading graph...

Use Cases

Display All Objectives

MATCH (c:Objective)
RETURN c.Description AS Objective
Loading table...

Display All Problems

MATCH (c:Problem)
RETURN c.Description AS Problem
Loading table...

Display All Goals

MATCH (c:Goal)
RETURN c.Description AS Goal
Loading table...

Find nterventions for all libraries and problem number 17

MATCH (lib:Library)-[:HAS_PROBLEM]->(st:Problem{name:'17'})-[:HAS_INTERVENTION]-(i:Intervention)
RETURN lib.Description AS Library, st.Description AS Problem, i.Description AS Intervention;
Loading table...

Display All Problems, Interventions, and Objectives for one library

MATCH (lib:Library{GroupID:'230'})-[:HAS_PROBLEM]->(st:Problem{name:'17'})-[:HAS_INTERVENTION]-(i:Intervention) with i,st MATCH (st)-[:HAS_OBJECTIVE]->(m:Objective)
RETURN st.Description AS Problem, m.Description AS Objective, i.Description AS Intervention;
Loading table...

Conclusion

Developing the treatment planner in SQL took months to get correct and the performance to the point where it was useable. I used py2neo to populate import the data in to the graph. In all, it took less than a week from start to finish(it took longer to create this gist).

Running queries, preparing the console!

Run
Table
Graph
Table!
Graph!
Error!
Loading