-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes made to the read me to cater for windows users and also for an automated batch file #18
Open
francisguchie
wants to merge
22
commits into
IMS94:master
Choose a base branch
from
francisguchie:master
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 all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
f9f40be
Update readme.md
francisguchie 2927524
Update readme.md
francisguchie 8c17f86
Update readme.md
francisguchie 286829d
Update readme.md
francisguchie 3727bf6
Update readme.md
francisguchie deec819
Create AutoStart.bat
francisguchie f665dbc
Added server side processing for patients data table.
IMS94 634dcc0
Fix search patient not accurate issue
d121774
Fix of inability to handle large data
c48d681
Update .gitignore to not to include composer.phar
babd44b
Updated patient record seeder and added a todo to patients page.
IMS94 250d7ab
Minor update to batch wise loading of stats for dashboard
IMS94 9490197
Merge branch 'pull/19'
IMS94 2814f6c
Added jmeter and postman tests under docs/ folder
IMS94 4c2fd67
Added mysql service to travis.yml
IMS94 8ecd5f5
Update readme.md
francisguchie 4086056
Update readme.md
francisguchie b27e2da
Update readme.md
francisguchie 0f419a4
Update readme.md
francisguchie 338723a
Update readme.md
francisguchie 1e434d1
Create AutoStart.bat
francisguchie 23f8a28
Merge branch 'master' of https://github.com/francisguchie/chr247.com
francisguchie 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 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 |
---|---|---|
|
@@ -8,3 +8,4 @@ Homestead.json | |
/.idea | ||
/_ide_helper.php | ||
/storage/ | ||
composer.phar |
This file contains 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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
language: php | ||
|
||
services: | ||
- mysql | ||
|
||
php: | ||
- 5.6 | ||
- 7.0 | ||
|
This file contains 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,14 @@ | ||
@echo off | ||
rem this is for windows users only | ||
rem change the drive path to what suits your server | ||
re | ||
|
||
|
||
cd C:\path to folder\ | ||
|
||
start php artisan serve --host xx.xx.xx.xx --port 8000 | ||
|
||
rem auto display of the web browser | ||
rem this will automatically open the application using your default set web browser | ||
|
||
start http://xx.xx.xx.xx:8000 |
This file contains 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 contains 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 |
---|---|---|
|
@@ -13,17 +13,97 @@ | |
use Illuminate\Support\Facades\Validator; | ||
|
||
class PatientController extends Controller { | ||
|
||
/** | ||
* Get the patients list | ||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | ||
*/ | ||
public function getPatientList() { | ||
$clinic = Clinic::getCurrentClinic(); | ||
$patients = $clinic->patients; | ||
return view('patients.patients', ['patients' => $patients]); | ||
return view('patients.patients', ['patients' => []]); | ||
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. We are returning an empty list here? |
||
} | ||
|
||
|
||
/** | ||
* Get the patients list for data tables, server side processing | ||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View | ||
*/ | ||
public function listPatients(Request $request) | ||
{ | ||
$clinic = Clinic::getCurrentClinic(); | ||
|
||
$draw = $request->query('draw'); | ||
$start = $request->query('start'); | ||
$length = $request->query('length'); | ||
$search = $request->query('search'); | ||
$order = $request->query('order'); | ||
$query = $search['value']; | ||
$orderByColIdx = $order[0]["column"]; | ||
$orderByDirection = $order[0]["dir"]; | ||
|
||
$orderByCol = 'first_name'; | ||
if ($orderByColIdx == 2) { | ||
$orderByCol = 'phone'; | ||
} else if ($orderByColIdx == 3) { | ||
$orderByCol = 'address'; | ||
} else if ($orderByColIdx == 4) { | ||
$orderByCol = 'dob'; | ||
$orderByDirection = $orderByDirection == 'asc' ? 'desc' : 'asc'; | ||
} | ||
|
||
Log::debug("Draw -> $draw, Start-> $start, Length-> $length, OrderByColumn-> $orderByColIdx, Query-> $query"); | ||
|
||
$totalRecords = $clinic->patients()->count(); | ||
$filteredRecords = $totalRecords; | ||
|
||
$patients = $clinic->patients(); | ||
|
||
if (!empty($query)) { | ||
$patients = $patients->where(DB::raw('concat(first_name, " ", last_name)'), 'like', "%$query%"); | ||
$filteredRecords = $patients->count(); | ||
} | ||
|
||
$patients = $patients->orderBy($orderByCol, $orderByDirection) | ||
->skip($start)->take($length)->get(); | ||
|
||
$data = []; | ||
foreach ($patients as $patient) { | ||
$buttons = ''; | ||
if (\Gate::allows('delete', $patient)) { | ||
$buttons = " | ||
<button class=\"btn btn-sm btn-danger\" data-toggle=\"modal\" | ||
data-target=\"#confirmDeletePatientModal\" | ||
onclick=\"showConfirmDelete($patient->id,'$patient->first_name $patient->last_name')\"> | ||
<i class=\"fa fa-recycle fa-lg\" data-toggle=\"tooltip\" | ||
data-placement=\"bottom\" title=\"\" | ||
data-original-title=\"Delete this patient? | ||
You won't be able to delete this patient if the patient has any records | ||
associated to him/her in the system.\"></i> | ||
</button>"; | ||
} | ||
|
||
$row = [ | ||
$patient->id, | ||
$patient->first_name . ' ' . $patient->last_name, | ||
$patient->phone, | ||
$patient->address, | ||
\Utils::getAge($patient->dob), | ||
$buttons | ||
]; | ||
|
||
$data[] = $row; | ||
} | ||
|
||
$result = [ | ||
'draw' => $draw, | ||
'recordsTotal' => $totalRecords, | ||
'recordsFiltered' => $filteredRecords, | ||
'data' => $data | ||
]; | ||
|
||
return response()->json($result); | ||
} | ||
|
||
/** | ||
* Adds a patient to the system | ||
* | ||
|
This file contains 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 contains 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 contains 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 contains 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,177 @@ | ||
{ | ||
"info": { | ||
"_postman_id": "183abd2f-a810-4516-8714-9dc61610368e", | ||
"name": "chr247", | ||
"description": "chr247 APIs and pages", | ||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
}, | ||
"item": [ | ||
{ | ||
"name": "Login", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "7c782fb2-28cd-430d-85f6-080c38d79121", | ||
"exec": [ | ||
"pm.test(\"Status code is 200\", function () {", | ||
" pm.response.to.have.status(200);", | ||
" pm.response.to.be.withBody;", | ||
"});", | ||
"", | ||
"pm.test(\"Check cookies\", function() {", | ||
" pm.expect(pm.cookies.has(\"XSRF-TOKEN\")).to.be.true;", | ||
" pm.expect(pm.cookies.has(\"chr247_session\")).to.be.true;", | ||
"});", | ||
"", | ||
"pm.environment.set(\"xsrf_token\", pm.cookies.get(\"XSRF-TOKEN\"));", | ||
"pm.environment.set(\"session\", pm.cookies.get(\"chr247_session\"));", | ||
"" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "{{chr247_url}}/login", | ||
"host": [ | ||
"{{chr247_url}}" | ||
], | ||
"path": [ | ||
"login" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "Login", | ||
"event": [ | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "fee7c243-2c36-4ea3-adba-b832fd446f70", | ||
"exec": [ | ||
"pm.test(\"Status code is 200\", function () {", | ||
" pm.response.to.have.status(200);", | ||
" pm.response.to.be.withBody;", | ||
"});", | ||
"", | ||
"" | ||
], | ||
"type": "text/javascript" | ||
} | ||
} | ||
], | ||
"request": { | ||
"method": "POST", | ||
"header": [], | ||
"body": { | ||
"mode": "formdata", | ||
"formdata": [ | ||
{ | ||
"key": "password", | ||
"value": "{{password}}", | ||
"type": "text" | ||
}, | ||
{ | ||
"key": "username", | ||
"value": "{{username}}", | ||
"type": "text" | ||
} | ||
] | ||
}, | ||
"url": { | ||
"raw": "{{chr247_url}}/login", | ||
"host": [ | ||
"{{chr247_url}}" | ||
], | ||
"path": [ | ||
"login" | ||
] | ||
} | ||
}, | ||
"response": [] | ||
}, | ||
{ | ||
"name": "List Patients", | ||
"request": { | ||
"method": "GET", | ||
"header": [], | ||
"url": { | ||
"raw": "{{chr247_url}}/patients/list?order[0][column]=1&order[0][dir]=asc&start=0&length=10&search[value]=a&search[regex]=false&draw=1", | ||
"host": [ | ||
"{{chr247_url}}" | ||
], | ||
"path": [ | ||
"patients", | ||
"list" | ||
], | ||
"query": [ | ||
{ | ||
"key": "order[0][column]", | ||
"value": "1" | ||
}, | ||
{ | ||
"key": "order[0][dir]", | ||
"value": "asc" | ||
}, | ||
{ | ||
"key": "start", | ||
"value": "0" | ||
}, | ||
{ | ||
"key": "length", | ||
"value": "10" | ||
}, | ||
{ | ||
"key": "search[value]", | ||
"value": "a" | ||
}, | ||
{ | ||
"key": "search[regex]", | ||
"value": "false" | ||
}, | ||
{ | ||
"key": "draw", | ||
"value": "1" | ||
} | ||
] | ||
}, | ||
"description": "API used by data tables to paginate and load patients" | ||
}, | ||
"response": [] | ||
} | ||
], | ||
"event": [ | ||
{ | ||
"listen": "prerequest", | ||
"script": { | ||
"id": "96ee9cc0-96a5-4fcd-b677-b47f58005cf0", | ||
"type": "text/javascript", | ||
"exec": [ | ||
"if(pm.environment.has(\"xsrf_token\")) {", | ||
" pm.request.headers.add({", | ||
" key: \"X-XSRF-TOKEN\",", | ||
" value: \"{{xsrf_token}}\"", | ||
" });", | ||
"}" | ||
] | ||
} | ||
}, | ||
{ | ||
"listen": "test", | ||
"script": { | ||
"id": "3a1eba76-6c9a-4497-8931-ab05d5115ff3", | ||
"type": "text/javascript", | ||
"exec": [ | ||
"" | ||
] | ||
} | ||
} | ||
], | ||
"protocolProfileBehavior": {} | ||
} |
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.
I think this line is incorrect?