diff --git a/www-api/app/Config/Routes.php b/www-api/app/Config/Routes.php index 38fb5787..5ae0e1ed 100644 --- a/www-api/app/Config/Routes.php +++ b/www-api/app/Config/Routes.php @@ -250,6 +250,8 @@ $routes->get('/en/wrench/api/v1/bko/generics', 'Bko::apigate'); $routes->post('/en/wrench/api/v1/bko/generics', 'Bko::apigate'); +$routes->post('/emrapi/v1/identity/login', 'Agents::apigate'); + /* * -------------------------------------------------------------------- * Additional Routing diff --git a/www-api/app/Controllers/Agents.php b/www-api/app/Controllers/Agents.php new file mode 100644 index 00000000..7b82955b --- /dev/null +++ b/www-api/app/Controllers/Agents.php @@ -0,0 +1,64 @@ +getSiteConfigurations("system.live"); + $primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever"); + $server_tag = $this->getSiteConfigurations("system.server_tag"); + + $final_out =[]; + $final_out["environment"] = $current_env + 0; + $final_out["session_image_server"] = $primary_image_sever; // + $final_out["server_tag"] = $server_tag; + $final_out["language"] = "en"; + $final_out["ip_loc"] = $ip_loc; + $final_out["family_types"] = $this->familyTypes(); + $final_out["history_types"] = $this->historyTypes(); + //return json_encode( ( new \App\Models\ResultFormatter() )->processOutJson($in, $out)); + return json_encode( $final_out ); + + } + private function familyTypes(){ + return [ + array("ty"=>"Parent", "id"=>"PARENT", "tag"=>"fam_type_parent"), + array("ty"=>"Relatives", "id"=>"RELATIVES", "tag"=>"fam_type_relatives"), + array("ty"=>"Others", "id"=>"Others", "tag"=>"fam_type_others") + ]; + } + private function historyTypes(){ + return [ + array("ty"=>"Completed Jobs", "id"=>"COMPLETED_JOBS", "tag"=>"hist_type_completed_jobs"), + ]; + } +}