Samson Mutunga 3 жил өмнө
parent
commit
019e2488b4

+ 1 - 1
app/Http/Controllers/StatTreeController.php

@@ -96,7 +96,7 @@ class StatTreeController extends Controller
                 $clause = Clause::where('label', $cell)->where('model', 'ilike', $model)->first();
                 if(!$clause){
                     DB::rollBack();
-                    return $this->fail('No clause record found!');
+                    return $this->fail('No clause record found for ' . $cell);
                 }
                 $nextStatLineClauseId = DB::select("select nextval('stat_tree_line_clause_id_seq')");
                 $statTreeLineClause = new StatTreeLineClause;

+ 14 - 8
spec/stat-tree-report-builder-spec.txt

@@ -11,8 +11,8 @@
 
 				MODEL | QUESTION / LABEL | ANSWER | CLAUSE_TEXT
 
-Client	Active patient?	YES	(is_active IS TRUE)
-Client	Active patient?	NO	(is_active IS FALSE)
+Client	Active?	YES	(is_active IS TRUE)
+Client	Active?	NO	(is_active IS FALSE)
 Client	MCP assigned?	YES	(mcp_pro_id IS NOT NULL)
 Client	MCP assigned?	NO	(mcp_pro_id IS NULL)
 Client	Future MCP appointment?	YES	()
@@ -27,8 +27,10 @@ Client	Active device type?	Weight ONLY	()
 Client	Active device type?	BP ONLY	()
 Client	Active device type?	Weight + BP	()
 Client	Type 2 Diabetic	-	()
-Pro	Active pros?	YES	(is_active IS TRUE)
-Pro	Inactive pros?	NO	(is_active IS FALSE)
+Pro	Active?	YES	(is_active IS TRUE)
+Pro	Active?	NO	(is_active IS FALSE)
+Pro	Is HCP?	YES	(is_hcp IS TRUE)
+Pro	Is HCP?	NO	(is_hcp IS NOT TRUE)
 
 			WORK:::::::::::::::
 
@@ -45,13 +47,13 @@ Pro	Inactive pros?	NO	(is_active IS FALSE)
 
 			EXAMPLE tsv_text_for_lines:
 
-Active patient? YES
+Active? YES
 	MCP assigned? YES
 		MCB Primary? NO
 			Has active RM device? YES
 	MCP assigned? NO
 		MCB Primary? YES
-Active patient? NO
+Active? NO
 	MCB Primary? YES
 		Has active RM device? YES
 		Has active RM device? NO
@@ -61,9 +63,13 @@ Active patient? NO
 	Has active RM device? YES
 	Has active RM device? NO
 
+Active? YES
+	Is HCP? YES
+	Is HCP? NO
+Active? NO
+	Is HCP? YES
+	Is HCP? NO
 
-Active pros? YES
-Inactive pros? NO
 
 	stat_tree_line
 		stat_tree_id