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 24 commits
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,94 @@ | ||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; | ||
SET time_zone = "+00:00"; | ||
|
||
-- | ||
-- Database: `librereportgenerator` | ||
-- | ||
|
||
-- -------------------------------------------------------- | ||
|
||
-- | ||
-- Dumping data for table `draggable_components` | ||
-- | ||
|
||
INSERT INTO `draggable_components` (`id`, `option_id`, `is_default`, `user`, `title`, `order`, `active`, `note`, `toggle_sort`, `toggle_display`, `created_at`, `updated_at`) VALUES | ||
(1, 'pfullname', 1, 'default', 'Patient Fullname', 5, 1, 'patient_data:fname:mname:lname', 0, 0, NULL, NULL), | ||
(2, 'plfname', 1, 'default', 'Patient Last Firstname', 10, 1, 'patient_data:lname:fname', 0, 0, NULL, NULL), | ||
(3, 'pflname', 1, 'default', 'Patient First Lastname', 15, 1, 'patient_data:fname:lname', 0, 0, NULL, NULL), | ||
(4, 'preversedname', 1, 'default', 'Patient Full reversed name', 20, 1, 'patient_data:lname:mname:fname', 0, 0, NULL, NULL), | ||
(5, 'pfmname', 1, 'default', 'Patient First Middlename', 25, 1, 'patient_data:fname:mname', 0, 0, NULL, NULL), | ||
(6, 'pid', 1, 'default', 'Patient Id', 30, 1, 'patient_data:id', 0, 0, NULL, NULL), | ||
(7, 'pstreet', 1, 'default', 'Patient Street', 35, 1, 'patient_data:street', 0, 0, NULL, NULL), | ||
(8, 'pcity', 1, 'default', 'Patient First Lastname', 40, 1, 'patient_data:city', 0, 0, NULL, NULL), | ||
(9, 'pstate', 1, 'default', 'Patient Full reversed name', 45, 1, 'patient_data:lname:mname:fname', 0, 0, NULL, NULL), | ||
(10, 'pstreetcity', 1, 'default', 'Patient Street City', 50, 1, 'patient_data:street:city', 0, 0, NULL, NULL), | ||
(11, 'pcitystate', 1, 'default', 'Patient City State', 55, 1, 'patient_data:city:state', 0, 0, NULL, NULL), | ||
(12, 'pstreetcitystate', 1, 'default', 'Patient Street City State', 60, 1, 'patient_data:street:city:state', 0, 0, NULL, NULL), | ||
(13, 'ppcode', 1, 'default', 'Patient Postal Code', 65, 1, 'patient_data:postal_code', 0, 0, NULL, NULL), | ||
(14, 'poccupation', 1, 'default', 'Patient Occupation', 70, 1, 'patient_data:occupation', 0, 0, NULL, NULL), | ||
(15, 'pemail', 1, 'default', 'Patient Email', 75, 1, 'patient_data:email', 0, 0, NULL, NULL), | ||
(16, 'pphone', 1, 'default', 'Patient Phone Contact', 80, 1, 'patient_data:phone_contact', 0, 0, NULL, NULL), | ||
(17, 'planguage', 1, 'default', 'Patient Language', 85, 1, 'patient_data:language', 0, 0, NULL, NULL), | ||
(18, 'pregdate', 1, 'default', 'Patient Register date', 90, 1, 'patient_data:regdate', 0, 0, NULL, NULL), | ||
(19, 'psex', 1, 'default', 'Patient Sex', 95, 1, 'patient_data:sex', 0, 0, NULL, NULL), | ||
(20, 'pemailphone', 1, 'default', 'Patient Email Phone', 100, 1, 'patient_data:email:phone_contact', 0, 0, NULL, NULL), | ||
(21, 'pidfullname', 1, 'default', 'Patient PID Fullname', 105, 1, 'patient_data:id:fname:mname:lname', 0, 0, NULL, NULL), | ||
(22, 'pdob', 1, 'default', 'Patient Date of birth', 110, 1, 'patient_data:DOB', 0, 0, NULL, NULL), | ||
(23, 'pss', 1, 'default', 'Patient SS', 115, 1, 'patient_data:ss', 0, 0, NULL, NULL), | ||
(24, 'pstatus', 1, 'default', 'Patient Status', 120, 1, 'patient_data:status', 0, 0, NULL, NULL), | ||
(25, 'preferrer', 1, 'default', 'Patient Referrer', 125, 1, 'patient_data:referrer', 0, 0, NULL, NULL), | ||
(26, 'pstatussex', 1, 'default', 'Patient Status Sex', 130, 1, 'patient_data:status:sex', 0, 0, NULL, NULL), | ||
(27, 'pidnamecontact', 1, 'default', 'Patient ID Name Contact', 135, 1, 'patient_data:id:fname:mname:phone_contact:email', 0, 0, NULL, NULL), | ||
(28, 'pidnameAddress', 1, 'default', 'Patient ID Name Address', 140, 1, 'patient_data:id:fname:mname:street:city:state:postal_code', 0, 0, NULL, NULL), | ||
(29, 'poccupationmonthlyincome', 1, 'default', 'Patient Occupation Monthly Income', 145, 1, 'patient_data:occupation:monthly_income', 0, 0, NULL, NULL), | ||
(30, 'psexstatusfamilysize', 1, 'default', 'Patient Sex Status Family Size', 150, 1, 'patient_data:sex:status:family_size', 0, 0, NULL, NULL); | ||
|
||
-- -------------------------------------------------------- | ||
|
||
-- | ||
-- Dumping data for table `draggable_component_report_format` | ||
-- | ||
|
||
INSERT INTO `draggable_component_report_format` (`id`, `draggable_component_id`, `report_format_id`, `created_at`, `updated_at`) VALUES | ||
(1, 21, 1, '2018-07-05 09:16:37', '2018-07-05 09:16:37'), | ||
(2, 12, 1, '2018-07-05 09:16:37', '2018-07-05 09:16:37'), | ||
(3, 19, 1, '2018-07-05 09:16:37', '2018-07-05 09:16:37'), | ||
(4, 5, 2, '2018-07-05 09:21:59', '2018-07-05 09:21:59'), | ||
(5, 20, 2, '2018-07-05 09:21:59', '2018-07-05 09:21:59'), | ||
(6, 12, 2, '2018-07-05 09:21:59', '2018-07-05 09:21:59'), | ||
(7, 21, 3, '2018-07-05 09:36:19', '2018-07-05 09:36:19'), | ||
(8, 30, 3, '2018-07-05 09:36:19', '2018-07-05 09:36:19'), | ||
(9, 21, 4, '2018-07-05 09:37:39', '2018-07-05 09:37:39'), | ||
(10, 25, 4, '2018-07-05 09:37:39', '2018-07-05 09:37:39'), | ||
(11, 18, 4, '2018-07-05 09:37:39', '2018-07-05 09:37:39'), | ||
(12, 21, 5, '2018-07-05 09:40:59', '2018-07-05 09:40:59'), | ||
(13, 23, 5, '2018-07-05 09:40:59', '2018-07-05 09:40:59'), | ||
(14, 13, 5, '2018-07-05 09:40:59', '2018-07-05 09:40:59'), | ||
(15, 15, 5, '2018-07-05 09:40:59', '2018-07-05 09:40:59'); | ||
|
||
-- -------------------------------------------------------- | ||
|
||
-- | ||
-- Dumping data for table `report_formats` | ||
-- | ||
|
||
INSERT INTO `report_formats` (`id`, `user`, `title`, `description`, `system_feature_id`, `created_at`, `updated_at`) VALUES | ||
(1, 'default', 'Patient List', 'List of all patients with basic demographics.', 1, '2018-07-05 09:16:37', '2018-07-05 09:16:37'), | ||
(2, 'default', 'Patients Contacts and Address', 'List of all patient\'s email, phone, street, city and state.', 1, '2018-07-05 09:21:59', '2018-07-05 09:21:59'), | ||
(3, 'default', 'Patient Family Size', 'Information on patient\'s family size', 1, '2018-07-05 09:36:19', '2018-07-05 09:36:19'), | ||
(4, 'default', 'Patient Registration', 'Information on patient\'s registrars, and date.', 1, '2018-07-05 09:37:39', '2018-07-05 09:37:39'), | ||
(5, 'default', 'Patient SS', 'Patients\' SS and postal codes', 1, '2018-07-05 09:40:59', '2018-07-05 09:40:59'); | ||
|
||
-- -------------------------------------------------------- | ||
|
||
-- | ||
-- Dumping data for table `system_features` | ||
-- | ||
|
||
INSERT INTO `system_features` (`id`, `name`, `description`, `user`, `created_at`, `updated_at`) VALUES | ||
(1, 'Clients', 'Reports related to clients', 'default', '2018-07-02 04:43:04', '2018-07-02 04:43:04'), | ||
(2, 'Financial', 'Reports related to finance and payments.', 'default', '2018-07-02 08:20:40', '2018-07-02 08:20:40'), | ||
(3, 'Visits', 'Reports concerning patients and other visits.', 'default', '2018-07-04 23:00:00', '2018-07-04 23:00:00'), | ||
(4, 'Procedures', 'Procedure statistics, and other pending orders', 'default', '2018-07-04 23:00:00', '2018-07-04 23:00:00'), | ||
(5, 'Insurance', 'Reports related to patients\' insurance, and other related issues.', 'default', '2018-07-04 23:00:00', '2018-07-04 23:00:00'), | ||
(6, 'Inventory', 'Reports related to inventory at various level in the system.', 'default', '2018-07-04 23:00:00', '2018-07-04 23:00:00'); |
44 changes: 44 additions & 0 deletions
44
...es/ReportGenerator/Database/Migrations/2018_04_30_182051_create_system_features_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,44 @@ | ||
<?php | ||
/** | ||
* This file creates a table for system features, e.g Clients, Financial, Insurance. | ||
* This table is used to handle the many-to-many relationship between both tables. | ||
* | ||
* @author Tigpezeghe Rodrige K. <[email protected]> | ||
* Copyright 2018 Tigpezeghe Rodrige K. <[email protected]> | ||
*/ | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateSystemFeaturesTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @author Tigpezeghe Rodrige K. <[email protected]> (2018) | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::connection('mysql_report_generator')->create('system_features', function (Blueprint $table) { | ||
$table->increments('id')->comment = "This will identify each system feature with a unique integer."; | ||
$table->string('name')->comment = "The name of the system feature."; | ||
$table->text('description')->comment = "This describes the system feature briefly."; | ||
$table->string('user', 255)->default('default')->comment = "The user who created the feature. This will be 'default' for features that come with the module."; | ||
|
||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('system_features'); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...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,53 @@ | ||
<?php | ||
/** | ||
* 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]> | ||
* Copyright 2018 Tigpezeghe Rodrige K. <[email protected]> | ||
*/ | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateDraggableComponentsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @author Tigpezeghe Rodrige K. <[email protected]> (2018) | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::connection('mysql_report_generator')->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->string('note', 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'); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...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,49 @@ | ||
<?php | ||
/** | ||
* This file creates report formats for the report-generator. | ||
* These report formats are close to system static reports, 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]> | ||
* Copyright 2018 Tigpezeghe Rodrige K. <[email protected]> | ||
*/ | ||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateReportFormatsTable extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @author Tigpezeghe Rodrige K. <[email protected]> (2018) | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::connection('mysql_report_generator')->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->text('description')->comment = "This describes the report format briefly."; | ||
//$table->string('option_ids')->comment = "This stores the option ids of components that constitute this report format"; | ||
$table->integer('system_feature_id')->unsigned()->comment = "The system feature under which the report belongs."; | ||
$table->foreign('system_feature_id')->references('id')->on('system_features')->onDelete('cascade'); | ||
//$table->string('draggable_components_id', 1000)->comment = "This stores the id of all the components that belong to this report format"; | ||
|
||
|
||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::dropIfExists('report_formats'); | ||
} | ||
} |
Oops, something went wrong.
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.
Take dump of whole database. What if user do not run migrations or somehow migration fails? He/she do not know your table structure.
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.
I took these when I had no entries for report_formats, and system features in the database. I'll populate those tables with some entries and dump again!
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.
I meant that you are taking dump of one table
draggable_components
. Instead take dump of whole databaselibrereportgenerator
. I think now I'm clear.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.
I get you!
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.
If I export the entire database, then it'll have CREATE TABLE xyz, and migration command takes care of creating tables.
We need only the INSERT sql statements in this file.