فهرست منبع

Merge branch 'master' of https://rav.triplestart.com/tigerphp/lemon-admin

Peter Muturi 6 ماه پیش
والد
کامیت
832770ceb1

+ 62 - 0
app/Helpers.php

@@ -289,4 +289,66 @@ if (!function_exists('selected_lab_html_address')) {
     </div>';
     }
 }
+
+function getTestInfo($key){
+    $lbsTests = (array) config('constants.lbs_tests');
+    $test = @$lbsTests[$key];
+    if($test) return $test;
+    return null;
+}
+function getTestDisplayName($key){
+    $test = (array) getTestInfo($key);
+    
+    if(isset($test['label'])) return $test['label'];
+
+    return toHumanReadable($key);
+}
+
+function getAllTests(){
+    return (array) config('constants.lbs_tests');
+}
+
+function getTest($testKey) {
+    return @getAllTests()[$testKey];
+}
+
+function getTestLabelByKey( $testKey ) {
+    $label = getTestLabel(getTest($testKey));
+    if($label) return $label;
+    return toHumanReadable($testKey);
+}
+
+function getTestLabel( $test ) {
+    return @$test[ 'label' ];
+}
+
+function getTestPrice( $testKey ) {
+    return floatval( config( 'app.'.$testKey ) );
+}
+
+if ( !function_exists( 'get_lab_station_summary2' ) ) {
+    function get_lab_station_summary2( $lab ) {
+        $states = config( 'constants.states' );
+
+        $data  = json_decode( $lab->data );
+
+        return [
+            'id' => @$data->id,
+            'city' => @$data->city,
+            'distance' => '', //todo use zips table to get distance between zips
+            'fax_number' => @$data->fax_number,
+            'lab_title' => @$data->title,
+            'latitude' => @$data->latitude,
+            'longitude' => @$data->longitude,
+            'phone_number' => @$data->phone_number,
+            'postcode' => @$data->zip_code,
+            'state' => @$data->state,
+            'street' => @$data->address,
+            // 'services' => json_decode( $lab->services ),
+            'hrs_of_operation' => @$data->opening_hours,
+            'show_hrs_of_operation' => false,
+            'augmented' => @$data->augmented
+        ];
+    }
+}
 ?>

+ 19 - 5
app/Http/Controllers/AdminController.php

@@ -20,6 +20,7 @@ use OpenTok\OpenTok;
 use Illuminate\Support\Facades\Storage;
 use Exception;
 use Ramsey\Uuid\Uuid;
+use App\Models\Lab2;
 
 class AdminController extends Controller
 {
@@ -368,26 +369,39 @@ class AdminController extends Controller
 
     public function orderCreate(Request $request){
         $userUid = $request->get('userUid');
-        $allTests = config('constants.tests');
         $selectedTests = $request->get('tests', []);
         if(!count($selectedTests)){
             return $this->fail('Please select a test!');
         }
         $tests = [];
-        foreach($allTests as $key=>$title){
-            $tests[$key] = in_array($key, $selectedTests) ? 1 : 0;
+        $total = 0;
+        foreach($selectedTests as $index=>$key){
+            $tests[$key] = getTestPrice($key);
+            $total = $total + floatval($tests[$key]);
         }
         $data = [
             'tests' => $tests,
-            'tests_total' => $request->get('total'),
+            'tests_total' => $total,
             'tests_lab_id' => $request->get('tests_lab_id')
         ];
 
+        $selectedLabId = $data['tests_lab_id'];
+
+        $labDetails = null;
+        if ($selectedLabId) {
+            $lab = Lab2::whereRaw("data->>'id' = '" . $selectedLabId . "'")->first();
+            if ($lab) {
+                $labDetails = get_lab_station_summary2($lab);
+            }
+        }
+
+        $data['lab'] = $labDetails;
+
         $detailJson = [
             'selected_options' => json_encode($data)
         ];
 
-        $javaResponse = $this->callJava('/api/customerStore/submitOrderAsAdmin', ['userUid' => $userUid, 'detailJson' => json_encode($detailJson)], $this->sessionKey);
+        $javaResponse = $this->callJava('/api/customerStore/submitOrderAsAdmin', ['userUid' => $userUid, 'detailJson' => json_encode($detailJson), 'orderTotal' => $total], $this->sessionKey);
         if (!@$javaResponse['success']) {
             return $this->fail($javaResponse['message']);
         }

+ 45 - 0
app/Models/Lab2.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use App\Models\BaseModel;
+
+class Lab2 extends BaseModel
+{
+    use HasFactory;
+
+    protected $table = 'labs2';
+
+    public function address($short = false){
+        $data = json_decode($this->data);
+       
+        $labAddress = [];
+        $labAddressShort = [];
+
+        if($data->address2) {
+            $labAddress[] = $data->address2;
+        }
+
+        if($data->city) {
+            $labAddress[] = '<br>' . $data->city;
+            $labAddressShort[] = $data->city;
+        }
+        if($data->state) {
+            $labAddress[] = ' ' . $data->state . ', ';
+            $labAddressShort[] = $data->state;
+        }
+        if($data->zip_code) {
+            $labAddress[] = ' ' . $data->zip_code;
+            $labAddressShort[] = $data->zip_code;
+        }
+        $labAddress = implode('', $labAddress);
+        $labAddressShort = implode(' ', $labAddressShort);
+        if($short) return $labAddressShort;
+        return $labAddress;
+    }
+    public function labData(){
+        return json_decode($this->data);
+    }
+}

+ 13 - 4
app/Models/StoreOrder.php

@@ -86,8 +86,9 @@ class StoreOrder extends BaseModel
     public function testsRequestedInHumanReadable(){
         $data = [];
         $tests = $this->testsRequested();
+        $allTests = getAllTests();
         foreach($tests as $test){
-            $testName = config('constants.tests.'.$test);
+            $testName = @$allTests[$test]['label'];
             $testPrice = displayAmount('$', config('app.'.$test));
             $string = $testName . ' - '.$testPrice;
             array_push($data, $string);
@@ -99,8 +100,9 @@ class StoreOrder extends BaseModel
         $data = [];
         $tests = $this->partnerTestsRequested();
         $discount = $this->getPartnerTestDiscount();
+        $allTests = getAllTests();
         foreach($tests as $test){
-            $testName = config('constants.tests.'.$test);
+            $testName = $allTests[$test]['label'];
             $testPrice = floatval(config('app.'.$test));
             $testCost = $testPrice - $discount;
             $string = $testName . ' - '. displayAmount('$', $testCost);
@@ -171,7 +173,14 @@ class StoreOrder extends BaseModel
 
     public function getOrderTestsSummary(){
         $orderSelectedOptions = $this->selectedOptions();
-        return @$orderSelectedOptions['selectedOptionsSummary'] ?? [];
+        $tests = @$orderSelectedOptions['tests'] ?? [];
+        $data = [];
+        foreach($tests as $k=>$v){
+            if($v){
+                $data[$k] = $v;
+            }
+        }
+        return $data;
     }
 
     public function getOrderAllTestsRequested(){
@@ -187,7 +196,7 @@ class StoreOrder extends BaseModel
             $hasPartner = @$orderSelectedOptions['partner'] ? true:false;
             $partnerDiscount = floatval(@$orderSelectedOptions['partner_test_discount_amount']);            
             $allTests = array_merge($allTests, (array) $order->getOrderTestsSummary());
-            $partnerTotal = $partnerTotal + floatval($orderSelectedOptions['partner_test_total']);
+            $partnerTotal = $partnerTotal + floatval(@$orderSelectedOptions['partner_test_total']);
             $orderTotal = $orderTotal + floatval($order->order_total);
         }
         $summary['all_tests'] = $allTests;

+ 22 - 16
config/app.php

@@ -66,22 +66,28 @@ return [
       'MYCO_GEN'=> env('MYCO_GEN'),
 
 
-    'check_10_test_panel_with_early_rna' => env('check_10_test_panel_with_early_rna'),
-    'check_10_test_panel' => env('check_10_test_panel'),
-    'check_hsv_1' => env('check_hsv_1'),
-    'check_hsv_2' => env('check_hsv_2'),
-    'check_chlamydia' => env('check_chlamydia'),
-    'check_gonorrhea' => env('check_gonorrhea'),
-    'check_chlamydia_gonorrhea' => env('check_chlamydia_gonorrhea'),
-    'check_syphillis' => env('check_syphillis'),
-    'check_hepatitis_a' => env('check_hepatitis_a'),
-    'check_hepatitis_b' => env('check_hepatitis_b'),
-    'check_hepatitis_c' => env('check_hepatitis_c'),
-    'check_hiv_antibody' => env('check_hiv_antibody'),
-    'check_hiv_rna' => env('check_hiv_rna'),
-    'check_trichomoniasis' => env('check_trichomoniasis'),
-    'check_doxy_pep' => env('check_doxy_pep'),
-    'check_trichomoniasis_test_and_comprehensive_wellness_with_urinalysis' => env('check_trichomoniasis_test_and_comprehensive_wellness_with_urinalysis'),
+    'HSV_1'=> env('HSV_1'),
+    'HSV_2'=> env('HSV_2'),
+    'HSV_1_2_PANEL'=> env('HSV_1_2_PANEL'),
+    'HIV_1_2'=> env('HIV_1_2'),
+    'HEP_A'=> env('HEP_A'),
+    'HEP_B'=> env('HEP_B'),
+    'HEP_C'=> env('HEP_C'),
+    'GEN_CHL'=> env('GEN_CHL'),
+    'GEN_GON'=> env('GEN_GON'),
+    'GEN_CHL_GON'=> env('GEN_CHL_GON'),
+    'ORAL_CHL_GON'=> env('ORAL_CHL_GON'),
+    'CHL_GON_PANEL'=> env('CHL_GON_PANEL'),
+    'SYPH'=> env('SYPH'),
+    'HIV_RNA'=> env('HIV_RNA'),
+    '12TP'=> env('12TP'),
+    '12TP_WITH_HIV_RNA'=> env('12TP_WITH_HIV_RNA'),
+    'UA'=> env('UA'),
+    'TRICH_MALE'=> env('TRICH_MALE'),
+    'TRICH_MALE_WITH_URINALYSIS'=> env('TRICH_MALE_WITH_URINALYSIS'),
+    'TRICH_FEMALE'=> env('TRICH_FEMALE'),
+    'TRICH_FEMALE_WITH_URINALYSIS'=> env('TRICH_FEMALE_WITH_URINALYSIS'),
+    'MYCO_GEN'=> env('MYCO_GEN'),
 
     /*
     |--------------------------------------------------------------------------

+ 419 - 297
config/constants.php

@@ -1,307 +1,429 @@
 <?php
 return [
 
-  'lbs' => [
-      'name' => "LetsBeSafe",
-      'productName' => "LetsBeSafe",
-      'supportEmail' => config('app.supportEmail'),
-      'supportPhone' => config('app.phoneNumber'),
-      'standardUnitPrice' => '49.50',
-      'standardShipping' => '0',
-      'expeditedShipping' => '18.00',
-      'favicon' => '/lbs/img/icon.png',
-      // 'logo' => '/lbs/img/lbs-logo.png',
-      'logo' => 'https://primarywellness.com/img/lbs/lbs-logo.png',
-      'phoneIcon' => 'https://primarywellness.com/img/lbs/phone.png',
-      'emailIcon' => 'https://primarywellness.com/img/lbs/email.png',
-      'primaryColor' => '#24315E',
-      'productUrl' => config('app.orderAppUrl')
+    'lbs' => [
+        'name' => 'LetsBeSafe',
+        'productName' => 'LetsBeSafe',
+        'supportEmail' => config( 'app.supportEmail' ),
+        'supportPhone' => config( 'app.phoneNumber' ),
+        'standardUnitPrice' => '49.50',
+        'standardShipping' => '0',
+        'expeditedShipping' => '18.00',
+        'favicon' => '/lbs/img/icon.png',
+        // 'logo' => '/lbs/img/lbs-logo.png',
+        'logo' => 'https://primarywellness.com/img/lbs/lbs-logo.png',
+        'phoneIcon' => 'https://primarywellness.com/img/lbs/phone.png',
+        'emailIcon' => 'https://primarywellness.com/img/lbs/email.png',
+        'primaryColor' => '#24315E',
+        'productUrl' => config( 'app.orderAppUrl' )
     ],
 
-    'tests' => [
-      'check_10_test_panel_with_early_rna' => '11-Test Panel With Early RNA',
-    'check_10_test_panel' => '11-Test Panel',
-    'check_hsv_1' => 'Herpes 1',
-    'check_hsv_2' => 'Herpes 2',
-    'check_hsv_1_2' => 'Herpes I & II',
-    'check_chlamydia' => 'Chlamydia',
-    'check_gonorrhea' => 'Gonorrhea',
-    'check_chlamydia_gonorrhea' => 'Chlamydia + Gonorrhea',
-    'check_syphillis' => 'Syphilis',
-    'check_hepatitis_a' => 'Hepatitis A',
-    'check_hepatitis_b' => 'Hepatitis B',
-    'check_hepatitis_c' => 'Hepatitis C',
-    'check_hiv_antibody' => 'HIV-1 + HIV-2 Antibody (4th Gen)',
-    'check_hiv_rna' => 'HIV RNA Early Detection',
-    'check_trichomoniasis' => 'Trichomoniasis',
-    'check_trichomoniasis_test_and_comprehensive_wellness_with_urinalysis' => 'Trichomoniasis + Comprehensive Wellness Panel With a Urinalysis',
-    'check_doxy_pep' => 'DoxyPEP'
+    'lbs_tests' => [
+        'HSV_1' => [
+            'label' => 'Herpes 1',
+            'page_title' => 'Oral Herpes (HSV-1) Test',
+            'quest_name_for_pdf' => 'HSV 1 IGG',
+            'quest_code_for_pdf' => '3636'
+        ],
+        'HSV_2' => [
+            'label' => 'Herpes 2',
+            'page_title' => 'Genital Herpes (HSV-2) Test',
+            'quest_name_for_pdf' => 'HSV 2 IGG',
+            'quest_code_for_pdf' => '3640',
+        ],
+        'HSV_1_2_PANEL' => [
+            'label' => 'Herpes 1 & 2',
+            'page_title' => 'Herpes Type 1 and Type 2 Panel',
+            'quest_name_for_pdf' => 'HSV 1/2 IGG TYPE SP',
+            'quest_code_for_pdf' => '6447'
+        ],
+        'HIV_1_2' => [
+            'label' => 'HIV 1 & 2 Antibody (4th Gen)',
+            'page_title' => 'HIV 1 & 2 Antibody (4th Gen) Test',
+            'quest_name_for_pdf' => 'HIV1/2 AG/AB,4 W/RFL',
+            'quest_code_for_pdf' => '91431'
+        ],
+        'HEP_A' => [
+            'label' => 'Hepatitis A',
+            'page_title' => 'Hepatitis A Test',
+            'quest_name_for_pdf' => 'HEP A IGM AB',
+            'quest_code_for_pdf' => '512'
+        ],
+        'HEP_B' => [
+            'label' => 'Hepatitis B',
+            'page_title' => 'Hepatitis B Test',
+            'quest_name_for_pdf' => 'HEP B SURF AG W/CONF',
+            'quest_code_for_pdf' => '498'
+        ],
+        'HEP_C' => [
+            'label' => 'Hepatitis C',
+            'page_title' => 'Hepatitis C Test',
+            'quest_name_for_pdf' => 'HEP C AB W/REFL HCV',
+            'quest_code_for_pdf' => '8472'
+        ],
+        'GEN_CHL' => [
+            'label' => 'Chlamydia (Urogenital)',
+            'page_title' => 'Genital Chlamydia Test',
+            'quest_name_for_pdf' => 'Chlamydia trachomatis RNA, TMA, Urogenital',
+            'quest_code_for_pdf' => '11361'
+        ],
+        'GEN_GON' => [
+            'label' => 'Gonorrhea (Urogenital)',
+            'page_title' => 'Genital Gonorrhea Test',
+            'quest_name_for_pdf' => 'Neisseria gonorrhoeae RNA, TMA, Urogenital',
+            'quest_code_for_pdf' => '11362'
+        ],
+        'GEN_CHL_GON' => [
+            'label' => 'Chlamydia + Gonorrhea (Urogenital)',
+            'page_title' => '--',
+            'quest_name_for_pdf' => 'CT/GC RNA,TMA,UROGEN',
+            'quest_code_for_pdf' => '11363'
+        ],
+        'ORAL_CHL_GON' => [
+            'label' => 'Chlamydia + Gonorrhea (Oral)',
+            'page_title' => '--',
+            'quest_name_for_pdf' => 'Chlamydia/Neisseria gonorrhoeae RNA, TMA, Throat',
+            'quest_code_for_pdf' => '70051'
+        ],
+        'CHL_GON_PANEL' => [
+            'page_title' => 'Chlamydia & Gonorrhea (Oral + Genital) Panel',
+            'quest_components' => [ 'GEN_CHL_GON', 'ORAL_CHL_GON' ]
+        ],
+        'SYPH' => [
+            'label' => 'Syphilis',
+            'page_title' => 'Syphilis Test',
+            'quest_name_for_pdf' => 'RPR (Diagnosis) with Reflex to Titer and Treponema pallidum Antibody, IA',
+            'quest_code_for_pdf' => '36126'
+        ],
+        'HIV_RNA' => [
+            'label' => 'HIV RNA Test for Early Detection',
+            'page_title' => 'HIV RNA Test for Early Detection',
+            'quest_name_for_pdf' => 'HIV 1 RNA, QL RT PCR',
+            'quest_code_for_pdf' => '16185'
+        ],
+        '12TP' => [
+            'label' => '12-Test',
+            'page_title' => 'Full 12-Panel STD Test',
+            'quest_components' => [ 'HSV_1', 'HSV_2', 'GEN_CHL_GON', 'ORAL_CHL_GON', 'HEP_A', 'HEP_B', 'HEP_C', 'SYPH', 'HIV_1_2', 'CBC', 'CMP' ]
+        ],
+        '12TP_WITH_HIV_RNA' => [
+            'label' => '12-Test Panel with HIV RNA Early Detection',
+            'page_title' => 'Full 12-Panel STD Test with HIV Early RNA Detection',
+            'quest_components' => [ 'HSV_1', 'HSV_2', 'GEN_CHL_GON', 'ORAL_CHL_GON', 'HEP_A', 'HEP_B', 'HEP_C', 'SYPH', 'HIV_RNA', 'CBC', 'CMP' ]
+        ],
+        'UA' => [
+            'page_title' => 'Urinalysis - Complete',
+            'quest_name_for_pdf' => 'UA, COMPLETE',
+            'quest_code_for_pdf' => '5463'
+        ],
+        'TRICH_MALE' => [
+            'label' => 'Trichomoniasis',
+            'page_title' => 'Trichomoniasis Test',
+            'sex' => 'M',
+            'quest_name_for_pdf' => 'T.VAGINALIS RNA,MALE',
+            'quest_code_for_pdf' => '90801'
+        ],
+        'TRICH_MALE_WITH_URINALYSIS' => [
+            'label' => 'Trichomoniasis with urinalysis',
+            'page_title' => 'Trichomoniasis Test',
+            'sex' => 'M',
+            'quest_components' => [ 'TRICH_MALE', 'UA' ]
+        ],
+        'TRICH_FEMALE' => [
+            'label' => 'Trichomoniasis',
+            'page_title' => 'Trichomoniasis Test',
+            'sex' => 'F',
+            'quest_name_for_pdf' => 'TRICHOMONAS VAG RNA, QL',
+            'quest_code_for_pdf' => '19550'
+        ],
+        'TRICH_FEMALE_WITH_URINALYSIS' => [
+            'label' => 'Trichomoniasis with urinalysis',
+            'page_title' => 'Trichomoniasis Test',
+            'sex' => 'F',
+            'quest_components' => [ 'TRICH_FEMALE', 'UA' ]
+        ],
+        'MYCO_GEN' => [
+            'label' => 'Mycoplasma genitalium',
+            'page_title' => 'Mycoplasma Genitalium',
+            'quest_name_for_pdf' => 'M.GENITALIUM, TMA',
+            'quest_code_for_pdf' => '91475'
+        ],
+        'CBC' => [
+            'page_title' => 'CBC (includes Differential and Platelets)',
+            'quest_name_for_pdf' => 'CBC (includes Differential and Platelets)',
+            'quest_code_for_pdf' => '6399'
+        ],
+        'CMP' => [
+            'page_title' => 'Comprehensive Metabolic Panel',
+            'quest_name_for_pdf' => 'Comprehensive Metabolic Panel',
+            'quest_code_for_pdf' => '10231'
+        ],
     ],
 
     'countries' => [
-        "AF" => "Afghanistan",
-        "AL" => "Albania",
-        "DZ" => "Algeria",
-        "AS" => "American Samoa",
-        "AD" => "Andorra",
-        "AO" => "Angola",
-        "AI" => "Anguilla",
-        "AQ" => "Antarctica",
-        "AG" => "Antigua and Barbuda",
-        "AR" => "Argentina",
-        "AM" => "Armenia",
-        "AW" => "Aruba",
-        "AU" => "Australia",
-        "AT" => "Austria",
-        "AZ" => "Azerbaijan",
-        "BS" => "Bahamas",
-        "BH" => "Bahrain",
-        "BD" => "Bangladesh",
-        "BB" => "Barbados",
-        "BY" => "Belarus",
-        "BE" => "Belgium",
-        "BZ" => "Belize",
-        "BJ" => "Benin",
-        "BM" => "Bermuda",
-        "BT" => "Bhutan",
-        "BO" => "Bolivia",
-        "BA" => "Bosnia and Herzegovina",
-        "BW" => "Botswana",
-        "BV" => "Bouvet Island",
-        "BR" => "Brazil",
-        "BQ" => "British Antarctic Territory",
-        "IO" => "British Indian Ocean Territory",
-        "VG" => "British Virgin Islands",
-        "BN" => "Brunei",
-        "BG" => "Bulgaria",
-        "BF" => "Burkina Faso",
-        "BI" => "Burundi",
-        "KH" => "Cambodia",
-        "CM" => "Cameroon",
-        "CA" => "Canada",
-        "CT" => "Canton and Enderbury Islands",
-        "CV" => "Cape Verde",
-        "KY" => "Cayman Islands",
-        "CF" => "Central African Republic",
-        "TD" => "Chad",
-        "CL" => "Chile",
-        "CN" => "China",
-        "CX" => "Christmas Island",
-        "CC" => "Cocos [Keeling] Islands",
-        "CO" => "Colombia",
-        "KM" => "Comoros",
-        "CG" => "Congo - Brazzaville",
-        "CD" => "Congo - Kinshasa",
-        "CK" => "Cook Islands",
-        "CR" => "Costa Rica",
-        "HR" => "Croatia",
-        "CU" => "Cuba",
-        "CY" => "Cyprus",
-        "CZ" => "Czech Republic",
-        "CI" => "Côte d’Ivoire",
-        "DK" => "Denmark",
-        "DJ" => "Djibouti",
-        "DM" => "Dominica",
-        "DO" => "Dominican Republic",
-        "NQ" => "Dronning Maud Land",
-        "DD" => "East Germany",
-        "EC" => "Ecuador",
-        "EG" => "Egypt",
-        "SV" => "El Salvador",
-        "GQ" => "Equatorial Guinea",
-        "ER" => "Eritrea",
-        "EE" => "Estonia",
-        "ET" => "Ethiopia",
-        "FK" => "Falkland Islands",
-        "FO" => "Faroe Islands",
-        "FJ" => "Fiji",
-        "FI" => "Finland",
-        "FR" => "France",
-        "GF" => "French Guiana",
-        "PF" => "French Polynesia",
-        "TF" => "French Southern Territories",
-        "FQ" => "French Southern and Antarctic Territories",
-        "GA" => "Gabon",
-        "GM" => "Gambia",
-        "GE" => "Georgia",
-        "DE" => "Germany",
-        "GH" => "Ghana",
-        "GI" => "Gibraltar",
-        "GR" => "Greece",
-        "GL" => "Greenland",
-        "GD" => "Grenada",
-        "GP" => "Guadeloupe",
-        "GU" => "Guam",
-        "GT" => "Guatemala",
-        "GG" => "Guernsey",
-        "GN" => "Guinea",
-        "GW" => "Guinea-Bissau",
-        "GY" => "Guyana",
-        "HT" => "Haiti",
-        "HM" => "Heard Island and McDonald Islands",
-        "HN" => "Honduras",
-        "HK" => "Hong Kong SAR China",
-        "HU" => "Hungary",
-        "IS" => "Iceland",
-        "IN" => "India",
-        "ID" => "Indonesia",
-        "IR" => "Iran",
-        "IQ" => "Iraq",
-        "IE" => "Ireland",
-        "IM" => "Isle of Man",
-        "IL" => "Israel",
-        "IT" => "Italy",
-        "JM" => "Jamaica",
-        "JP" => "Japan",
-        "JE" => "Jersey",
-        "JT" => "Johnston Island",
-        "JO" => "Jordan",
-        "KZ" => "Kazakhstan",
-        "KE" => "Kenya",
-        "KI" => "Kiribati",
-        "KW" => "Kuwait",
-        "KG" => "Kyrgyzstan",
-        "LA" => "Laos",
-        "LV" => "Latvia",
-        "LB" => "Lebanon",
-        "LS" => "Lesotho",
-        "LR" => "Liberia",
-        "LY" => "Libya",
-        "LI" => "Liechtenstein",
-        "LT" => "Lithuania",
-        "LU" => "Luxembourg",
-        "MO" => "Macau SAR China",
-        "MK" => "Macedonia",
-        "MG" => "Madagascar",
-        "MW" => "Malawi",
-        "MY" => "Malaysia",
-        "MV" => "Maldives",
-        "ML" => "Mali",
-        "MT" => "Malta",
-        "MH" => "Marshall Islands",
-        "MQ" => "Martinique",
-        "MR" => "Mauritania",
-        "MU" => "Mauritius",
-        "YT" => "Mayotte",
-        "FX" => "Metropolitan France",
-        "MX" => "Mexico",
-        "FM" => "Micronesia",
-        "MI" => "Midway Islands",
-        "MD" => "Moldova",
-        "MC" => "Monaco",
-        "MN" => "Mongolia",
-        "ME" => "Montenegro",
-        "MS" => "Montserrat",
-        "MA" => "Morocco",
-        "MZ" => "Mozambique",
-        "MM" => "Myanmar [Burma]",
-        "NA" => "Namibia",
-        "NR" => "Nauru",
-        "NP" => "Nepal",
-        "NL" => "Netherlands",
-        "AN" => "Netherlands Antilles",
-        "NT" => "Neutral Zone",
-        "NC" => "New Caledonia",
-        "NZ" => "New Zealand",
-        "NI" => "Nicaragua",
-        "NE" => "Niger",
-        "NG" => "Nigeria",
-        "NU" => "Niue",
-        "NF" => "Norfolk Island",
-        "KP" => "North Korea",
-        "VD" => "North Vietnam",
-        "MP" => "Northern Mariana Islands",
-        "NO" => "Norway",
-        "OM" => "Oman",
-        "PC" => "Pacific Islands Trust Territory",
-        "PK" => "Pakistan",
-        "PW" => "Palau",
-        "PS" => "Palestinian Territories",
-        "PA" => "Panama",
-        "PZ" => "Panama Canal Zone",
-        "PG" => "Papua New Guinea",
-        "PY" => "Paraguay",
-        "YD" => "People's Democratic Republic of Yemen",
-        "PE" => "Peru",
-        "PH" => "Philippines",
-        "PN" => "Pitcairn Islands",
-        "PL" => "Poland",
-        "PT" => "Portugal",
-        "PR" => "Puerto Rico",
-        "QA" => "Qatar",
-        "RO" => "Romania",
-        "RU" => "Russia",
-        "RW" => "Rwanda",
-        "RE" => "Réunion",
-        "BL" => "Saint Barthélemy",
-        "SH" => "Saint Helena",
-        "KN" => "Saint Kitts and Nevis",
-        "LC" => "Saint Lucia",
-        "MF" => "Saint Martin",
-        "PM" => "Saint Pierre and Miquelon",
-        "VC" => "Saint Vincent and the Grenadines",
-        "WS" => "Samoa",
-        "SM" => "San Marino",
-        "SA" => "Saudi Arabia",
-        "SN" => "Senegal",
-        "RS" => "Serbia",
-        "CS" => "Serbia and Montenegro",
-        "SC" => "Seychelles",
-        "SL" => "Sierra Leone",
-        "SG" => "Singapore",
-        "SK" => "Slovakia",
-        "SI" => "Slovenia",
-        "SB" => "Solomon Islands",
-        "SO" => "Somalia",
-        "ZA" => "South Africa",
-        "GS" => "South Georgia and the South Sandwich Islands",
-        "KR" => "South Korea",
-        "ES" => "Spain",
-        "LK" => "Sri Lanka",
-        "SD" => "Sudan",
-        "SR" => "Suriname",
-        "SJ" => "Svalbard and Jan Mayen",
-        "SZ" => "Swaziland",
-        "SE" => "Sweden",
-        "CH" => "Switzerland",
-        "SY" => "Syria",
-        "ST" => "São Tomé and Príncipe",
-        "TW" => "Taiwan",
-        "TJ" => "Tajikistan",
-        "TZ" => "Tanzania",
-        "TH" => "Thailand",
-        "TL" => "Timor-Leste",
-        "TG" => "Togo",
-        "TK" => "Tokelau",
-        "TO" => "Tonga",
-        "TT" => "Trinidad and Tobago",
-        "TN" => "Tunisia",
-        "TR" => "Turkey",
-        "TM" => "Turkmenistan",
-        "TC" => "Turks and Caicos Islands",
-        "TV" => "Tuvalu",
-        "UM" => "U.S. Minor Outlying Islands",
-        "PU" => "U.S. Miscellaneous Pacific Islands",
-        "VI" => "U.S. Virgin Islands",
-        "UG" => "Uganda",
-        "UA" => "Ukraine",
-        "SU" => "Union of Soviet Socialist Republics",
-        "AE" => "United Arab Emirates",
-        "GB" => "United Kingdom",
-        "US" => "United States",
-        "ZZ" => "Unknown or Invalid Region",
-        "UY" => "Uruguay",
-        "UZ" => "Uzbekistan",
-        "VU" => "Vanuatu",
-        "VA" => "Vatican City",
-        "VE" => "Venezuela",
-        "VN" => "Vietnam",
-        "WK" => "Wake Island",
-        "WF" => "Wallis and Futuna",
-        "EH" => "Western Sahara",
-        "YE" => "Yemen",
-        "ZM" => "Zambia",
-        "ZW" => "Zimbabwe",
-        "AX" => "Åland Islands",
+        'AF' => 'Afghanistan',
+        'AL' => 'Albania',
+        'DZ' => 'Algeria',
+        'AS' => 'American Samoa',
+        'AD' => 'Andorra',
+        'AO' => 'Angola',
+        'AI' => 'Anguilla',
+        'AQ' => 'Antarctica',
+        'AG' => 'Antigua and Barbuda',
+        'AR' => 'Argentina',
+        'AM' => 'Armenia',
+        'AW' => 'Aruba',
+        'AU' => 'Australia',
+        'AT' => 'Austria',
+        'AZ' => 'Azerbaijan',
+        'BS' => 'Bahamas',
+        'BH' => 'Bahrain',
+        'BD' => 'Bangladesh',
+        'BB' => 'Barbados',
+        'BY' => 'Belarus',
+        'BE' => 'Belgium',
+        'BZ' => 'Belize',
+        'BJ' => 'Benin',
+        'BM' => 'Bermuda',
+        'BT' => 'Bhutan',
+        'BO' => 'Bolivia',
+        'BA' => 'Bosnia and Herzegovina',
+        'BW' => 'Botswana',
+        'BV' => 'Bouvet Island',
+        'BR' => 'Brazil',
+        'BQ' => 'British Antarctic Territory',
+        'IO' => 'British Indian Ocean Territory',
+        'VG' => 'British Virgin Islands',
+        'BN' => 'Brunei',
+        'BG' => 'Bulgaria',
+        'BF' => 'Burkina Faso',
+        'BI' => 'Burundi',
+        'KH' => 'Cambodia',
+        'CM' => 'Cameroon',
+        'CA' => 'Canada',
+        'CT' => 'Canton and Enderbury Islands',
+        'CV' => 'Cape Verde',
+        'KY' => 'Cayman Islands',
+        'CF' => 'Central African Republic',
+        'TD' => 'Chad',
+        'CL' => 'Chile',
+        'CN' => 'China',
+        'CX' => 'Christmas Island',
+        'CC' => 'Cocos [Keeling] Islands',
+        'CO' => 'Colombia',
+        'KM' => 'Comoros',
+        'CG' => 'Congo - Brazzaville',
+        'CD' => 'Congo - Kinshasa',
+        'CK' => 'Cook Islands',
+        'CR' => 'Costa Rica',
+        'HR' => 'Croatia',
+        'CU' => 'Cuba',
+        'CY' => 'Cyprus',
+        'CZ' => 'Czech Republic',
+        'CI' => 'Côte d’Ivoire',
+        'DK' => 'Denmark',
+        'DJ' => 'Djibouti',
+        'DM' => 'Dominica',
+        'DO' => 'Dominican Republic',
+        'NQ' => 'Dronning Maud Land',
+        'DD' => 'East Germany',
+        'EC' => 'Ecuador',
+        'EG' => 'Egypt',
+        'SV' => 'El Salvador',
+        'GQ' => 'Equatorial Guinea',
+        'ER' => 'Eritrea',
+        'EE' => 'Estonia',
+        'ET' => 'Ethiopia',
+        'FK' => 'Falkland Islands',
+        'FO' => 'Faroe Islands',
+        'FJ' => 'Fiji',
+        'FI' => 'Finland',
+        'FR' => 'France',
+        'GF' => 'French Guiana',
+        'PF' => 'French Polynesia',
+        'TF' => 'French Southern Territories',
+        'FQ' => 'French Southern and Antarctic Territories',
+        'GA' => 'Gabon',
+        'GM' => 'Gambia',
+        'GE' => 'Georgia',
+        'DE' => 'Germany',
+        'GH' => 'Ghana',
+        'GI' => 'Gibraltar',
+        'GR' => 'Greece',
+        'GL' => 'Greenland',
+        'GD' => 'Grenada',
+        'GP' => 'Guadeloupe',
+        'GU' => 'Guam',
+        'GT' => 'Guatemala',
+        'GG' => 'Guernsey',
+        'GN' => 'Guinea',
+        'GW' => 'Guinea-Bissau',
+        'GY' => 'Guyana',
+        'HT' => 'Haiti',
+        'HM' => 'Heard Island and McDonald Islands',
+        'HN' => 'Honduras',
+        'HK' => 'Hong Kong SAR China',
+        'HU' => 'Hungary',
+        'IS' => 'Iceland',
+        'IN' => 'India',
+        'ID' => 'Indonesia',
+        'IR' => 'Iran',
+        'IQ' => 'Iraq',
+        'IE' => 'Ireland',
+        'IM' => 'Isle of Man',
+        'IL' => 'Israel',
+        'IT' => 'Italy',
+        'JM' => 'Jamaica',
+        'JP' => 'Japan',
+        'JE' => 'Jersey',
+        'JT' => 'Johnston Island',
+        'JO' => 'Jordan',
+        'KZ' => 'Kazakhstan',
+        'KE' => 'Kenya',
+        'KI' => 'Kiribati',
+        'KW' => 'Kuwait',
+        'KG' => 'Kyrgyzstan',
+        'LA' => 'Laos',
+        'LV' => 'Latvia',
+        'LB' => 'Lebanon',
+        'LS' => 'Lesotho',
+        'LR' => 'Liberia',
+        'LY' => 'Libya',
+        'LI' => 'Liechtenstein',
+        'LT' => 'Lithuania',
+        'LU' => 'Luxembourg',
+        'MO' => 'Macau SAR China',
+        'MK' => 'Macedonia',
+        'MG' => 'Madagascar',
+        'MW' => 'Malawi',
+        'MY' => 'Malaysia',
+        'MV' => 'Maldives',
+        'ML' => 'Mali',
+        'MT' => 'Malta',
+        'MH' => 'Marshall Islands',
+        'MQ' => 'Martinique',
+        'MR' => 'Mauritania',
+        'MU' => 'Mauritius',
+        'YT' => 'Mayotte',
+        'FX' => 'Metropolitan France',
+        'MX' => 'Mexico',
+        'FM' => 'Micronesia',
+        'MI' => 'Midway Islands',
+        'MD' => 'Moldova',
+        'MC' => 'Monaco',
+        'MN' => 'Mongolia',
+        'ME' => 'Montenegro',
+        'MS' => 'Montserrat',
+        'MA' => 'Morocco',
+        'MZ' => 'Mozambique',
+        'MM' => 'Myanmar [Burma]',
+        'NA' => 'Namibia',
+        'NR' => 'Nauru',
+        'NP' => 'Nepal',
+        'NL' => 'Netherlands',
+        'AN' => 'Netherlands Antilles',
+        'NT' => 'Neutral Zone',
+        'NC' => 'New Caledonia',
+        'NZ' => 'New Zealand',
+        'NI' => 'Nicaragua',
+        'NE' => 'Niger',
+        'NG' => 'Nigeria',
+        'NU' => 'Niue',
+        'NF' => 'Norfolk Island',
+        'KP' => 'North Korea',
+        'VD' => 'North Vietnam',
+        'MP' => 'Northern Mariana Islands',
+        'NO' => 'Norway',
+        'OM' => 'Oman',
+        'PC' => 'Pacific Islands Trust Territory',
+        'PK' => 'Pakistan',
+        'PW' => 'Palau',
+        'PS' => 'Palestinian Territories',
+        'PA' => 'Panama',
+        'PZ' => 'Panama Canal Zone',
+        'PG' => 'Papua New Guinea',
+        'PY' => 'Paraguay',
+        'YD' => "People's Democratic Republic of Yemen",
+        'PE' => 'Peru',
+        'PH' => 'Philippines',
+        'PN' => 'Pitcairn Islands',
+        'PL' => 'Poland',
+        'PT' => 'Portugal',
+        'PR' => 'Puerto Rico',
+        'QA' => 'Qatar',
+        'RO' => 'Romania',
+        'RU' => 'Russia',
+        'RW' => 'Rwanda',
+        'RE' => 'Réunion',
+        'BL' => 'Saint Barthélemy',
+        'SH' => 'Saint Helena',
+        'KN' => 'Saint Kitts and Nevis',
+        'LC' => 'Saint Lucia',
+        'MF' => 'Saint Martin',
+        'PM' => 'Saint Pierre and Miquelon',
+        'VC' => 'Saint Vincent and the Grenadines',
+        'WS' => 'Samoa',
+        'SM' => 'San Marino',
+        'SA' => 'Saudi Arabia',
+        'SN' => 'Senegal',
+        'RS' => 'Serbia',
+        'CS' => 'Serbia and Montenegro',
+        'SC' => 'Seychelles',
+        'SL' => 'Sierra Leone',
+        'SG' => 'Singapore',
+        'SK' => 'Slovakia',
+        'SI' => 'Slovenia',
+        'SB' => 'Solomon Islands',
+        'SO' => 'Somalia',
+        'ZA' => 'South Africa',
+        'GS' => 'South Georgia and the South Sandwich Islands',
+        'KR' => 'South Korea',
+        'ES' => 'Spain',
+        'LK' => 'Sri Lanka',
+        'SD' => 'Sudan',
+        'SR' => 'Suriname',
+        'SJ' => 'Svalbard and Jan Mayen',
+        'SZ' => 'Swaziland',
+        'SE' => 'Sweden',
+        'CH' => 'Switzerland',
+        'SY' => 'Syria',
+        'ST' => 'São Tomé and Príncipe',
+        'TW' => 'Taiwan',
+        'TJ' => 'Tajikistan',
+        'TZ' => 'Tanzania',
+        'TH' => 'Thailand',
+        'TL' => 'Timor-Leste',
+        'TG' => 'Togo',
+        'TK' => 'Tokelau',
+        'TO' => 'Tonga',
+        'TT' => 'Trinidad and Tobago',
+        'TN' => 'Tunisia',
+        'TR' => 'Turkey',
+        'TM' => 'Turkmenistan',
+        'TC' => 'Turks and Caicos Islands',
+        'TV' => 'Tuvalu',
+        'UM' => 'U.S. Minor Outlying Islands',
+        'PU' => 'U.S. Miscellaneous Pacific Islands',
+        'VI' => 'U.S. Virgin Islands',
+        'UG' => 'Uganda',
+        'UA' => 'Ukraine',
+        'SU' => 'Union of Soviet Socialist Republics',
+        'AE' => 'United Arab Emirates',
+        'GB' => 'United Kingdom',
+        'US' => 'United States',
+        'ZZ' => 'Unknown or Invalid Region',
+        'UY' => 'Uruguay',
+        'UZ' => 'Uzbekistan',
+        'VU' => 'Vanuatu',
+        'VA' => 'Vatican City',
+        'VE' => 'Venezuela',
+        'VN' => 'Vietnam',
+        'WK' => 'Wake Island',
+        'WF' => 'Wallis and Futuna',
+        'EH' => 'Western Sahara',
+        'YE' => 'Yemen',
+        'ZM' => 'Zambia',
+        'ZW' => 'Zimbabwe',
+        'AX' => 'Åland Islands',
     ]
 ];

+ 5 - 22
resources/views/app/my-account/admin/orders/forms/create-order.blade.php

@@ -1,12 +1,5 @@
 <?php
-    $tests = config('constants.tests');
-    $packages = array_filter(
-        $tests,
-        function ($value){
-            return(strpos($value,'Test Panel') !== false);
-        }
-    );
-    $individualTests = array_diff($tests, $packages);
+    $tests = getAllTests();
 ?>
 <div moe normal>
     <a start show href="#" class="text-primary">+ Create Order</a>
@@ -17,21 +10,11 @@
             <div id="createOrder" v-cloak>
                 <input type="hidden" name="total" v-model="form.total" />
                 <input type="hidden" name="userUid" value="{{$user->uid}}" />
-                <div class="form-group mb-3">
-                    <label class="me-3"><input type="radio" name="testType" value="11PanelTest" v-model="form.testType" required /> Comprehensive 11-Panel Test</label>
-                    <label><input type="radio" name="testType" value="individualTests" v-model="form.testType" required /> Individual Tests</label>
-                </div>
-                <div v-if="form.testType === '11PanelTest'" class="px-3">
-                    <div class="d-flex flex-column">
-                        @foreach($packages as $key=>$title)
-                            <label><input type="radio" name="tests[]" value="{{ $key }}" data-amount="{{ config('app.'.$key) }}" required /> {{ $title }} - {{ displayAmount('$', config('app.'.$key)) }}</label>
-                        @endforeach
-                    </div>
-                </div>
-                <div v-if="form.testType === 'individualTests'" class="px-3">
+
+                <div class="px-3">
                     <div class="d-flex flex-column">
-                        @foreach($individualTests as $k=>$t)
-                            <label><input type="checkbox" name="tests[]" value="{{ $k }}" data-amount="{{  config('app.'.$k) }}" /> {{ $t }} - {{ displayAmount('$', config('app.'.$k)) }}</label>
+                        @foreach($tests as $k=>$t)
+                            <label><input type="checkbox" name="tests[]" value="{{ $k }}" data-amount="{{  config('app.'.$k) }}" /> {{ @$t['label'] ?? @$t['page_title'] }} - {{ displayAmount('$', floatval(config('app.'.$k))) }}</label>
                         @endforeach
                     </div>
                 </div>

+ 1 - 19
resources/views/app/my-account/admin/orders/partials/table.blade.php

@@ -26,7 +26,6 @@
                 <th>Name</th>
                 <th class="text-nowrap">Created At</th>
                 <th class="text-nowrap">Total Amount</th>
-                <th>Orders</th>
                 <th>Lab</th>
                 <th>Lab Request</th>
                 <th>Trx</th>
@@ -53,24 +52,7 @@
                     <td class="text-nowrap" style="width:1px">{{ $order->user->full_name }}</td>
                     <td class="text-nowrap" style="width:1px">{{ friendly_date_time($order->created_at) }}</td>
                     <td style="width:1px">{{ displayAmount('$', $order->total()) }}</td>
-                    <td style="width:550px">
-                      @foreach($order->testsRequested() as  $tkey => $test)
-                       <small>{{ config('constants.tests.'.$test) }}</small>@if(count($order->associatedOrders($order->id)) || count($order->testsRequested()) -1 !== $tkey),@endif
-                       @endforeach
-                       {{-- Associated Orders --}}
-                       @foreach($order->associatedOrders($order->id) as $tOrder => $assocOrder)
-                         <?php $orderTotal = $orderTotal + $assocOrder->order_total; ?>
-                         @foreach($assocOrder->testsRequested() as  $tkey => $test)
-                         <small>{{ config('constants.tests.'.$test) }}<small>@if(count($order->associatedOrders($order->id)) -1 !== $tOrder),@endif
-                         @endforeach
-                       @endforeach
-                       @if(@$storeOrderSelectedOptions->partner == 1)
-                       <p class="mt-2 mb-0"><b style="font-family:sans-serif">Partner: {{@$storeOrderSelectedOptions->partner_email}}</b></p>
-                       @endif
-                        @if(@$results_attachment)
-                        <p class="mt-2 p-1 bg-light border text-sm"><b>Lab Report: <a class="ms-2 text-success" href="{{ $results_attachment['attachmentAccessTokenUrl'] }}" target="_blank"><i class="fal fa-file-pdf"></i> Download PDF</a></b></p>
-                        @endif
-                    </td>
+                    
                     <td>
                         @if($selectedLab)
                             <?= selected_lab_html_address($selectedLab); ?>

+ 1 - 1
resources/views/app/my-account/admin/orders/sub/dashboard.blade.php

@@ -73,7 +73,7 @@
                         <tbody>
                             @foreach ($tests as $key=>$test)
                                 <tr>
-                                    <td class="w-50 w-lg-75 px-2">{{ $test['name'] }}</td>
+                                    <td class="w-50 w-lg-75 px-2">{{ getTestDisplayName($key) }}</td>
                                 </tr>
                             @endforeach
                         </tbody>

+ 10 - 10
resources/views/app/my-account/admin/orders/sub/template/invoice-order-detail.blade.php

@@ -22,11 +22,10 @@
                 </tr>
                 <tr>
                     <td colspan="3" style="width:200px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">Date:
-                        <?= date('F d, Y', strtotime($order->created_at)) ?>
+                        <?= date('m/d/Y', strtotime($order->created_at)) ?>
                     </td>
                     <td colspan="2" align="right" valign="top"
-                        style="width:430px;padding:0 6px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">Order:
-                        #{{ $order->orderNumber() }}</td>
+                        style="width:430px;padding:0 6px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif">Order #: {{ $order->orderNumber() }}</td>
                 </tr>
                 <tr height="15">
                     <td colspan="5"></td>
@@ -39,30 +38,31 @@
                 <tr height="15">
                     <td colspan="5"></td>
                 </tr>
-                @foreach ($orderSummary['all_tests'] as $tkey => $test)
+                @foreach ($orderSummary['all_tests'] as $test => $price)
                     <tr>
                         <td colspan="3" style="padding:0 0 0 0;vertical-align:top;">
                             <span
-                                style="font-weight:400;">{{ $test['name'] }}</span>
+                                style="font-weight:400;">{{ getTestDisplayName($test) }}</span>
                         </td>
                         <td align="right" valign="top" style="padding:0 0px;">
-                            <span
-                                style="font-weight:400;white-space:nowrap;display:block;">${{ number_format($test['price'], 2) }}</span>
+                            @if($price > 1)
+                                <span style="font-weight:400;white-space:nowrap;display:block;">${{ number_format($price, 2) }}</span>
+                            @endif
                         </td>
                     </tr>
                 @endforeach
 
                 @if (@$orderSelectedOptions->partner == 1)
 
-                @foreach ($orderSummary['all_tests'] as $pTestKey => $pTest)
+                @foreach ($orderSummary['all_tests'] as $pTestKey => $pTestPrice)
                     <tr>
                         <td colspan="3" style="padding:0 0 0 0;vertical-align:top;">
                             <span
-                                style="font-weight:400;">{{ $pTest['name'] }} (Partner Test)</span>
+                                style="font-weight:400;">{{ getTestLabelByKey($pTestKey) }} (Partner Test)</span>
                         </td>
                         <td align="right" valign="top" style="padding:0 0px;">
                             <span
-                                style="font-weight:400;white-space:nowrap;display:block;">${{ number_format($pTest['price'], 2) }}</span>
+                                style="font-weight:400;white-space:nowrap;display:block;">${{ number_format($pTestPrice, 2) }}</span>
                         </td>
                     </tr>
                 @endforeach