VT Experimental First Conflict Check

From PikaDocs

Table of contents

Introduction

In looking at our workflow, we are hoping to accomplish a couple of things:

1) Find out if a prospective client on the phone is or has been an OP in the database. This may require stopping the intake.
If they are not an OP in the database, move forward.

2) Once the client information in the address book has been taken care of, the first thing we do in the case should be to add the opposing party, before getting any eligibility information. We want to determine whether we have a conflict of interest before getting the eligibility numbers, etc.

So we have 2 conflict checks actually...

To deal with #2 see Control_First_Case_Tab_On_Intake

A good alternative approach for #2 which is in actual use is Iowa's Intake_Workflow_Additions

This page deals with #1


Warning

This page is posted so I can discuss with Aaron and other interested parties what I did and lobby for inclusion into default Pika. ;) Don't do this unless you know what you are doing!


Changes to /subtemplates/intake_contact_list.html

2 modifications to this file: Roughly line 73, just after this:

<th>SSN</th>

add this:

  <!-- Andrew Cameron 2006/2/28 adding OP -->
        <th>Opposing Party</th>

And, at

Roughly line 106, just after this:

<td>
        	%%[ssn]%%
        </td>

add this:

        <!-- Andrew Cameron 2006/2/28 adding OP -->
         <td>
             %%[opposing_party]%%
         </td>

Changes to /app/config/PikaMisc.php

Add a new function, roughly at line 905. After getMotdEntries and before htmlContactList

static function checkForOP($contactid)
	{
        /* new function - Andrew Cameron 2006/2/28
        has the contact indicated by $contactid ever been an Opposing Party in any case in the conflict table?
		*/
        
        // Query the conflict table WHERE conflict.contact_id = that person
		$sql2 = "SELECT *
		FROM   conflict
		WHERE  conflict.contact_id = $contactid";
		$result2 = mysql_query($sql2) or trigger_error(mysql_error());
		if (!$result2) 
		{
			die('Invalid query2: ' . mysql_error());
		}
				
		$foundOP = FALSE;
		// loop through the results of the query of the conflict table
		while ($row2 = mysql_fetch_assoc($result2))
		{
			// if relation_code indicates conflict (2) this person is an OP
            // this hard coding of role 2 is stupid -- how to fix this?
           	     	if (strval($row2['relation_code']) == "2")
			{ 
				// flag this contact as an opposing party.
				//  don't look up details in case table for now to keep this simple
				$foundOP = TRUE;
				// if the person was found as an OP in the conflict table once, no need to keep looping thru
				break;
			}                  	  
		} // end of while loop dealing with conflict table

		return $foundOP;
	}

Make 2 sets of modifications to the htmlContactList function.

Mod #1: Roughly line 1140. Immediately after

$row['relation_code'] = $relation_code;
and before
$phonetic_table->addRow($row);

add this:

// Andrew Cameron 2006/2/28 call the new function checkForOP to see if this contact has been an OP
		                $conid = strval($row['contact_id']); 
				if (  (pikaMisc::checkForOP($conid)) == TRUE)
 				{
					$row['opposing_party'] = "YES!";
				}
				// end of new function call - Andrew

Mod #2: Add this same block of code again around line 1252. Immediately after

$row['relation_code'] = $relation_code;

and just before this:

$contacts_table->addRow($row);

Changes to /ssn_dup.php

Matt F. at Pika software programmed for us the capability to catch SSN duplicates before they are inserted. This involves changes a few files. One file is a new file called /ssn_dup.php. The file /intake2.php calls a function called htmlContactList which constructs the list of possible person matches during intake. Normally that function is run in /app/lib/pikaMisc.php, hence the changes above to that file. However, /ssn_dup.php also contains that function. So now intake2.php calls the version of the function in ssn_dup.php. So we need to change that file to incorporate our additional conflict check code.

Around the following lines of /ssn_dup.php: 107, 217, 278, 333.
The code immediately before the change to make is:

$row['relation_code'] = $relation_code;

The code immediately after is either:

$phonetic_table->addRow($row);

or

$contacts_table->addRow($row);

And the code you insert between those 2 lines is:

// Andrew Cameron 2006/2/28 call the new function checkForOP to see if this contact has been an OP
$conid = strval($row['contact_id']); 
if (  (pikaMisc::checkForOP($conid)) == TRUE)
{
$row['opposing_party'] = "YES!";
}
// end of new function call - Andrew

Of course, you probably want to substitute your own name and the date you make the change on your system.