Skip to content
This repository was archived by the owner on May 10, 2022. It is now read-only.

GSoC2018 report generator #1

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7c71034
Adding migrations and models for report generator tables
Trodrige May 26, 2018
3db8a1b
An attempt to add Factories and seeders for the report generator. Add…
Trodrige May 28, 2018
b62f74a
Added the junction table for report format and draggable component re…
Trodrige Jun 4, 2018
ff73094
display draggable components
Trodrige Jun 6, 2018
eae3984
Getting the option IDs of selected components
Jun 11, 2018
2fc50a5
Sending CSRF header and getting response from controller
Jun 12, 2018
84cb384
corrected previous PR. Added command to create two laravel-ehr databases
Trodrige Jun 14, 2018
2e6ac8d
An attempt to get data from selected columns, and send to views
Trodrige Jun 17, 2018
33fc9c7
Attempt to retrieve data
Trodrige Jun 22, 2018
8536b8a
cleaned showReport function, and sending data to view
Trodrige Jun 23, 2018
8d4896c
attempt to display rendered data in the view
Trodrige Jun 23, 2018
eae851d
Displaying rendered data
Trodrige Jun 25, 2018
877388b
Add new system feature
Trodrige Jul 1, 2018
b1cb778
Adding ability to save report format. Adding entries to join table
Trodrige Jul 2, 2018
780e21a
Updating instruction.txt to show Libre EHR Db configurations
Trodrige Jul 2, 2018
8e281b5
Merging install and instruction files in README file
Trodrige Jul 5, 2018
83de3ee
dumping test data for features and report formats
Trodrige Jul 5, 2018
6b70601
updating and deleting system features
Trodrige Jul 16, 2018
c932ea5
Delete report format
Trodrige Jul 16, 2018
4558a47
Edit report format title and description
Trodrige Jul 20, 2018
29bbb2b
View existing report from selected report format
Trodrige Jul 20, 2018
00a4f22
hiding save report format button when showing existing report
Trodrige Jul 23, 2018
bc024c6
Adding pdf_report.php for PDF generation function
Trodrige Jul 27, 2018
7f33e3f
sending for columns for use in pdf generation
Trodrige Jul 28, 2018
ecc9ebc
keeping all draggable components in drop box and draggable pool.
Trodrige Aug 3, 2018
2320022
--amend
Trodrige Aug 3, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDraggableComponentsTable extends Migration
{
/**
* Run the migrations.
* This file creates draggable_components for the report-generator.
* This is close to the list_options table, but this one if for the report generator module.
*
* TODO Link this table to users table in order to keep track of user adding or editing a component.
*
* @author Tigpezeghe Rodrige K. <[email protected]> (2018)
*
* @return void
*/
public function up()
{
Schema::create('draggable_components', function (Blueprint $table) {
$table->increments('id')->comment = "This will identify each component with a unique integer.";
$table->string('option_id', 255)->comment = "All draggable components have an ID.";
$table->boolean('is_default')->default(1)->comment = "0 -> False, 1 -> True.";
$table->string('user', 255)->default('default')->comment = "The user who created the component. This will be 'default' for components that come with the module.";
$table->string('title', 255)->comment = "This is the text on the component that end users see.";
$table->integer('order', 0)->comment = "The order in which components appear in the list.";
$table->boolean('active')->default(1)->comment = "0 -> False, 1 -> True whether the component should be active or not.";
$table->json('notes', 255)->comment = "This stores the fields that the component relates to in the database.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why notes to be of json type? I can't understand from your comment. Any example will be appreciated.

$table->boolean('toggle_sort')->default(0)->comment = "0 -> False (Descending), 1 -> True (Ascending).";
$table->boolean('toggle_display')->default(0)->comment = "0 -> False, 1 -> True. Display field if checked (1), and no if unchecked (0).";

$table->timestamps();

// $table->foreign('userID')->references('id')->on('users')->onDelete('cascade');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('draggable_components');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateReportFormatsTable extends Migration
{
/**
* Run the migrations.
* This file creates draggable_components for the report-generator.
* This is close to the list_options table, but this one if for the report generator module.
*
* TODO Link this table to users table in order to keep track of user adding or editing a component.
*
* @author Tigpezeghe Rodrige K. <[email protected]> (2018)
*
* @return void
*/
public function up()
{
Schema::create('report_formats', function (Blueprint $table) {
$table->increments('id')->comment = "This will identify each component with a unique integer.";
$table->string('user', 255)->default('default')->comment = "The user who created the report format. This will be 'default' for components that come with the module.";
$table->string('title', 255)->comment = "This is the report name e.g Patient List.";
$table->string('system_feature', 255)->comment = "The system feature under which the report belongs.";
$table->text('description')->comment = "This describes the report format briefly.";
$table->json('draggable_components_id')->comment = "This stores the id of all the components that belong to this report format";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not able to get draggable_components_id field's type.


$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('report_formats');
}
}
26 changes: 26 additions & 0 deletions Modules/ReportGenerator/Entities/DraggableComponent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Modules\ReportGenerator\Entities;

use Illuminate\Database\Eloquent\Model;

class DraggableComponent extends Model
{
protected $fillable = ['is_default', 'user', 'title', 'order', 'active', 'notes', 'toggle_sort', 'toggle_display'];

/**
* Convert notes column from jsona(as specified in migration file) to array.
*
* @var string
*/
protected $casts = [
'notes' => 'array'
];

/**
* The connection name for the model.
* TODO
* @var string
*/
//protected $connection = 'connection-name';
}
26 changes: 26 additions & 0 deletions Modules/ReportGenerator/Entities/ReportFormat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace Modules\ReportGenerator\Entities;

use Illuminate\Database\Eloquent\Model;

class ReportFormat extends Model
{
protected $fillable = ['user', 'title', 'system_feature', 'description', 'draggable_components_id'];

/**
* Convert draggable_components_id column from jsona(as specified in migration file) to array.
*
* @var string
*/
protected $casts = [
'draggable_components_id' => 'array'
];

/**
* The connection name for the model.
* TODO
* @var string
*/
//protected $connection = 'connection-name';
}
20 changes: 10 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateListOptionsTable extends Migration
{
/**
* Run the migrations.
* This will create list_options.
* TODO this migration file isn't complete. It lacks
* the necessary foreign keys.
*
* @author Tigpezeghe Rodrige K. <[email protected]> (2018)
* @return void
*/
public function up()
{
Schema::create('list_options', function (Blueprint $table) {
$table->increments('id')->comment = "Primary Key. Autoincrement.";
$table->string('list_id', 31)->comment = "List Id.";
$table->string('option_id', 31)->comment = "Id for list item.";
$table->string('title', 255)->comment = "The title of the component.";
$table->integer('seq', 0)->comment = "The order in which the components appear in the list.";
$table->boolean('is_default')->default(0)->comment = "0 -> False, 1 -> True.";
$table->float('option_value', 8, 2)->default(0)->comment = "";
$table->string('mapping', 31)->comment = "";
$table->string('notes', 255)->comment = "This stores the meaning or usefulness of the component.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Limiting notes to string is not a good idea. You can use text instead. Notes may exceed 255 char.

$table->string('codes', 255)->comment = "";
$table->boolean('toggle_setting_1')->default(0)->comment = "0 -> False, 1 -> True.";
$table->boolean('toggle_setting_2')->default(0)->comment = "0 -> False, 1 -> True.";
$table->boolean('activity')->default(1)->comment = "0 -> False, 1 -> True whether the component should be active or not.";
$table->string('subtype', 31)->comment = "";

$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('list_options');
}
}