Backend Service

This commit is contained in:
2019-03-11 15:39:10 +00:00
parent 7257a86f16
commit 878d34fb36
11 changed files with 152 additions and 20 deletions
+1
View File
@@ -96,6 +96,7 @@ enum {
#define MERMS_PROVIDERS_LOADPROFILE 150035
#define MERMS_PROVIDERS_UPDATEPROFILE 150040
#define MERMS_PROVIDERS_REMINDERS 150045
#define MERMS_PROVIDERS_CREATEMEMBER 150055
// //#define 120001
// // --
#define MERMS_PROVIDERS_END 159999
+1 -1
View File
@@ -298,7 +298,7 @@ long medTrUpdateProfile(CVars in, CVars &out) {
OPTIONAL(in, "street2") REQ_STRING(in, "street2", 1, 49, "(.*)");
REQ_STRING(in, "city", 5, 49, "(.*)");
// OPTIONAL(in, "phone") REQ_STRING(in, "phone", 5, 23, "(.*)");
REQ_STRING(in, "zipcode", 1, 12, "(.*)");
OPTIONAL(in, "zipcode") REQ_STRING(in, "zipcode", 1, 12, "(.*)");
REQ_STRING(in, "state", 1, 59, "(.*)");
REQ_STRING(in, "country", 1, 3, "(.*)");
REQ_STRING(in, "loc", 5, 16, "(.*)");
+16
View File
@@ -18,6 +18,7 @@
long provider_login(CVars in, CVars &out);
long PracticeLogin(CVars in, CVars &out);
long PracticeSessionCheck(long practice_id, long practice_users_id, const char *sessionid, int create);
long provider_createmember(CVars in, CVars &out);
long providers_call(CVars in, CVars &out) {
@@ -33,6 +34,10 @@ long providers_call(CVars in, CVars &out) {
return provider_login(in, out);
break;
case MERMS_PROVIDERS_CREATEMEMBER:
return provider_createmember(in, out);
break;
case EXISTING_CARD:
REQ_LONG(in, "paymentid", 0, -1); // now we have to make sure the payment id is valid for this customer
@@ -57,6 +62,17 @@ long providers_call(CVars in, CVars &out) {
return ret;
}
long provider_createmember(CVars in, CVars &out){
logfmt(logINFO, "ENTER CALL long providers_createmember(CVars in, CVars &out)");
return 0;
}
long provider_login(CVars in, CVars &out) {
long ret = -1;
+1 -1
View File
@@ -59,7 +59,7 @@ $autoload['packages'] = array();
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
//$autoload['libraries'] = array();
$autoload['libraries'] = array('session','form_validation');
$autoload['libraries'] = array('database','session','form_validation');
/*
| -------------------------------------------------------------------
| Auto-load Drivers
@@ -30,6 +30,7 @@ define('MERMS_PROVIDERS_DASHLOAD', 150010);
define('MERMS_PROVIDERS_LOADPROFILE', 150010);
define('MERMS_PROVIDERS_UPDATEPROFILE', 150010);
define('MERMS_PROVIDERS_REMINDERS', 150010);
define('MERMS_PROVIDERS_CREATEMEMBER', 150055);
//define('', 120001);
@@ -70,4 +71,4 @@ define('MERMS_PROVIDERS_REMINDERS', 150010);
#define MERMS_PROVIDERS_END 159999
//
*/
*/
@@ -73,7 +73,40 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$active_group = 'default';
$query_builder = TRUE;
require_once('backend.php');
$show_database_error = true;
$is_live = $mermsemr->cfgReadChar("system.live");
if ($is_live == false) {
$show_database_error = false;
}
$db['default'] = array(
'dsn' => '',
'hostname' => $mermsemr->cfgReadChar("database.host"),
'username' => $mermsemr->cfgReadChar("database.user"),
'password' => $mermsemr->cfgReadChar("database.pass"),
'database' => $mermsemr->cfgReadChar("database.name"),
'dbdriver' => 'postgre',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => $show_database_error,
'db_debug2' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
$db['default_out'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
@@ -11,9 +11,42 @@ class Patient extends Provider_Controller {
public function addnew() {
$data = array();
$data["account_message"] = "";
$data["firstname"] = $data["lastname"] = $data["email"] = $data["password"]= $data["street1"] = $data["street2"]= $data["city"] = $data["zipcode"]="";
if ($_POST){
$data['firstname'] = trim($this->input->post('firstname'));
$data['lastname'] = trim($this->input->post('lastname'));
$data['email'] = trim($this->input->post('email'));
$data['password'] = trim($this->input->post('password'));
$data['street1'] = trim($this->input->post('street1'));
$data['street2'] = trim($this->input->post('street2'));
$data['city'] = trim($this->input->post('city'));
$data['state'] = trim($this->input->post('state'));
$data["action"] = MERMS_PROVIDERS_CREATEMEMBER;
$out = array();
$ret = $this->mermsemr_api($data, $out);
$data["account_message"] = "This is the return ".$ret;
echo "Posted";
}
$out = array();
$out = $this->getPatientList();
$data["patient_list"] = $out["patient_list"];
$this->renderProviderSecurePage('patient/newpatient', $data);
}
private function getPatientList(){
$mysql = "SELECT p.practice_id,p.id AS patient_id,p.member_id,p.long_id,m.firstname,m.lastname,m.phone,p.added "
." FROM patients p LEFT JOIN members m ON m.id=p.member_id ORDER BY p.added DESC";
$query = $this->db->query($mysql);
$num = $query->num_rows();
$data["patient_list"] = $query->result();
return $data;
}
public function report() {
$data = array();
$this->renderProviderSecurePage('patient/patientreport', $data);
@@ -9,4 +9,24 @@ class Provider extends Provider_Controller {
$this->renderProviderSecurePage('dash', $data);
}
public function alerts() {
$data = array();
$this->renderProviderSecurePage('dash', $data);
}
public function todo() {
$data = array();
$this->renderProviderSecurePage('dash', $data);
}
public function tasks() {
$data = array();
$this->renderProviderSecurePage('dash', $data);
}
public function calendar() {
$data = array();
$this->renderProviderSecurePage('dash', $data);
}
}
@@ -0,0 +1,12 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Reports extends Provider_Controller {
public function index() {
$data = array();
$this->renderProviderSecurePage('dash', $data);
}
}
@@ -18,13 +18,29 @@
<tr>
<th>#</th>
<th>Name</th>
<th>Price</th>
<th>In stock</th>
<th>Phone</th>
<th>Chart</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
//print_r($patient_list);
foreach($patient_list as $prow){
?>
<tr>
<td>1</td>
<td><?=$prow->firstname?> <?=$prow->lastname?></td>
<td><?=$prow->phone?></td>
<td><button type="button" class="btn btn-info btn-sm">Chart</button></td>
<td><span class="badge badge-success-inverse">Active</span></td>
<td> <a class="mr-3" href="javascript:void(0);"><i class="fe fe-edit"></i></a><a href="javascript:void(0);"><i class="fe fe-trash-2"></i></a></td>
</tr>
<?
}
?>
<tr>
<td>1</td>
<td>Cold Shoulder Bling Dress</td>
@@ -30,15 +30,15 @@
<div class="card-body">
<form>
<div class="form-row">
<form method="POST" action="/patient/addnew">
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputEmail4">Firstname</label>
<input type="text" class="form-control" id="firstname" placeholder="Firstname">
<input type="text" class="form-control" id="firstname" name="firstname" value="<?=$firstname?>" placeholder="Firstname">
</div>
<div class="form-group col-md-6">
<label for="inputPassword4">Lastname</label>
<input type="text" class="form-control" id="lastname" placeholder="Lastname">
<input type="text" class="form-control" id="lastname" name="lastname" value="<?=$lastname?>" placeholder="Lastname">
</div>
</div>
@@ -49,40 +49,40 @@
</div>
<div class="form-group col-md-6">
<label for="inputPassword4">Password</label>
<input type="password" class="form-control" id="inputPassword4" placeholder="Password">
<input type="password" class="form-control" id="password" value="<?=$password?>" placeholder="Password">
</div>
</div>
<div class="form-group">
<label for="inputAddress">Address</label>
<input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St">
<input type="text" class="form-control" id="street1" name="street1" value="<?=$street1?>" placeholder="1234 Main St">
</div>
<div class="form-group">
<label for="inputAddress2">Address 2</label>
<input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor">
<input type="text" class="form-control" id="street2" name="street2" value=<?=$street2?> placeholder="Apartment, studio, or floor">
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputCity">City</label>
<input type="text" class="form-control" id="inputCity">
<input type="text" class="form-control" id="city" name="city" value="<?=$city?>">
</div>
<div class="form-group col-md-4">
<label for="inputState">State</label>
<select id="inputState" class="form-control">
<select id="inputState" class="form-control" name="state">
<option selected>Select State</option>
<option>Ontario</option>
<option>Toronto</option>
<option value="OGUN">Ogun</option>
<option value="OYO">Oyo</option>
<option value="OSUN" selected>Osun</option>
</select>
</div>
<div class="form-group col-md-2">
<label for="inputZip">Zip</label>
<input type="text" class="form-control" id="inputZip">
<input type="text" class="form-control" id="zipcode" name="zipcode" value="<?=$zipcode?>">
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck">
<label class="form-check-label" for="gridCheck">
Check me out
<label class="form-check-label">
<?=$account_message?>
</label>
</div>
</div>