This repository was archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
GSoC2018 report generator #1
Open
Trodrige
wants to merge
26
commits into
LibreHealthIO:master
Choose a base branch
from
Trodrige:GSoC2017_Report_Generator
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 3db8a1b
An attempt to add Factories and seeders for the report generator. Add…
Trodrige b62f74a
Added the junction table for report format and draggable component re…
Trodrige ff73094
display draggable components
Trodrige eae3984
Getting the option IDs of selected components
2fc50a5
Sending CSRF header and getting response from controller
84cb384
corrected previous PR. Added command to create two laravel-ehr databases
Trodrige 2e6ac8d
An attempt to get data from selected columns, and send to views
Trodrige 33fc9c7
Attempt to retrieve data
Trodrige 8536b8a
cleaned showReport function, and sending data to view
Trodrige 8d4896c
attempt to display rendered data in the view
Trodrige eae851d
Displaying rendered data
Trodrige 877388b
Add new system feature
Trodrige b1cb778
Adding ability to save report format. Adding entries to join table
Trodrige 780e21a
Updating instruction.txt to show Libre EHR Db configurations
Trodrige 8e281b5
Merging install and instruction files in README file
Trodrige 83de3ee
dumping test data for features and report formats
Trodrige 6b70601
updating and deleting system features
Trodrige c932ea5
Delete report format
Trodrige 4558a47
Edit report format title and description
Trodrige 29bbb2b
View existing report from selected report format
Trodrige 00a4f22
hiding save report format button when showing existing report
Trodrige bc024c6
Adding pdf_report.php for PDF generation function
Trodrige 7f33e3f
sending for columns for use in pdf generation
Trodrige ecc9ebc
keeping all draggable components in drop box and draggable pool.
Trodrige 2320022
--amend
Trodrige File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...portGenerator/Database/Migrations/2018_05_22_153827_create_draggable_components_table.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."; | ||
$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'); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...les/ReportGenerator/Database/Migrations/2018_05_25_203256_create_report_formats_table.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not able to get |
||
|
||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('report_formats'); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
database/migrations/2018_05_18_085927_create_list_options_table.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Limiting notes to string is not a good idea. You can use |
||
$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'); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.