本文整理汇总了PHP中Control::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::create方法的具体用法?PHP Control::create怎么用?PHP Control::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
/* Users table */
$usersData = array(array("username" => "administrator", "password" => Hash::make("password"), "email" => "admin@kblis.org", "name" => "kBLIS Administrator", "designation" => "Programmer"), array("username" => "external", "password" => Hash::make("password"), "email" => "admin@kblis.org", "name" => "External System User", "designation" => "Administrator", "image" => "/i/users/user-2.jpg"), array("username" => "lmorena", "password" => Hash::make("password"), "email" => "lmorena@kblis.org", "name" => "L. Morena", "designation" => "Lab Technologist", "image" => "/i/users/user-3.png"), array("username" => "abumeyang", "password" => Hash::make("password"), "email" => "abumeyang@kblis.org", "name" => "A. Abumeyang", "designation" => "Doctor"));
foreach ($usersData as $user) {
$users[] = User::create($user);
}
$this->command->info('users seeded');
/* Specimen Types table */
$specTypesData = array(array("name" => "Ascitic Tap"), array("name" => "Aspirate"), array("name" => "CSF"), array("name" => "Dried Blood Spot"), array("name" => "High Vaginal Swab"), array("name" => "Nasal Swab"), array("name" => "Plasma"), array("name" => "Plasma EDTA"), array("name" => "Pleural Tap"), array("name" => "Pus Swab"), array("name" => "Rectal Swab"), array("name" => "Semen"), array("name" => "Serum"), array("name" => "Skin"), array("name" => "Sputum"), array("name" => "Stool"), array("name" => "Synovial Fluid"), array("name" => "Throat Swab"), array("name" => "Urethral Smear"), array("name" => "Urine"), array("name" => "Vaginal Smear"), array("name" => "Water"), array("name" => "Whole Blood"));
foreach ($specTypesData as $specimenType) {
$specTypes[] = SpecimenType::create($specimenType);
}
$this->command->info('specimen_types seeded');
/* Test Categories table - These map on to the lab sections */
$test_categories = TestCategory::create(array("name" => "PARASITOLOGY", "description" => ""));
$lab_section_microbiology = TestCategory::create(array("name" => "MICROBIOLOGY", "description" => ""));
$this->command->info('test_categories seeded');
/* Measure Types */
$measureTypes = array(array("id" => "1", "name" => "Numeric Range"), array("id" => "2", "name" => "Alphanumeric Values"), array("id" => "3", "name" => "Autocomplete"), array("id" => "4", "name" => "Free Text"));
foreach ($measureTypes as $measureType) {
MeasureType::create($measureType);
}
$this->command->info('measure_types seeded');
/* Measures table */
$measureBSforMPS = Measure::create(array("measure_type_id" => "2", "name" => "BS for mps", "unit" => ""));
$measure1 = Measure::create(array("measure_type_id" => "2", "name" => "Grams stain", "unit" => ""));
$measure2 = Measure::create(array("measure_type_id" => "2", "name" => "SERUM AMYLASE", "unit" => ""));
$measure3 = Measure::create(array("measure_type_id" => "2", "name" => "calcium", "unit" => ""));
$measure4 = Measure::create(array("measure_type_id" => "2", "name" => "SGOT", "unit" => ""));
$measure5 = Measure::create(array("measure_type_id" => "2", "name" => "Indirect COOMBS test", "unit" => ""));
$measure6 = Measure::create(array("measure_type_id" => "2", "name" => "Direct COOMBS test", "unit" => ""));
$measure7 = Measure::create(array("measure_type_id" => "2", "name" => "Du test", "unit" => ""));
MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "No mps seen", "interpretation" => "Negative"));
MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "+", "interpretation" => "Positive"));
MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "++", "interpretation" => "Positive"));
MeasureRange::create(array("measure_id" => $measureBSforMPS->id, "alphanumeric" => "+++", "interpretation" => "Positive"));
MeasureRange::create(array("measure_id" => $measure1->id, "alphanumeric" => "Negative"));
MeasureRange::create(array("measure_id" => $measure1->id, "alphanumeric" => "Positive"));
MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "Low"));
MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "High"));
MeasureRange::create(array("measure_id" => $measure2->id, "alphanumeric" => "Normal"));
MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "High"));
MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "Low"));
MeasureRange::create(array("measure_id" => $measure3->id, "alphanumeric" => "Normal"));
MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "High"));
MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "Low"));
MeasureRange::create(array("measure_id" => $measure4->id, "alphanumeric" => "Normal"));
MeasureRange::create(array("measure_id" => $measure5->id, "alphanumeric" => "Positive"));
MeasureRange::create(array("measure_id" => $measure5->id, "alphanumeric" => "Negative"));
MeasureRange::create(array("measure_id" => $measure6->id, "alphanumeric" => "Positive"));
MeasureRange::create(array("measure_id" => $measure6->id, "alphanumeric" => "Negative"));
MeasureRange::create(array("measure_id" => $measure7->id, "alphanumeric" => "Positive"));
MeasureRange::create(array("measure_id" => $measure7->id, "alphanumeric" => "Negative"));
$measures = array(array("measure_type_id" => "1", "name" => "URIC ACID", "unit" => "mg/dl"), array("measure_type_id" => "4", "name" => "CSF for biochemistry", "unit" => ""), array("measure_type_id" => "4", "name" => "PSA", "unit" => ""), array("measure_type_id" => "1", "name" => "Total", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Alkaline Phosphate", "unit" => "u/l"), array("measure_type_id" => "1", "name" => "Direct", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Total Proteins", "unit" => ""), array("measure_type_id" => "4", "name" => "LFTS", "unit" => "NULL"), array("measure_type_id" => "1", "name" => "Chloride", "unit" => "mmol/l"), array("measure_type_id" => "1", "name" => "Potassium", "unit" => "mmol/l"), array("measure_type_id" => "1", "name" => "Sodium", "unit" => "mmol/l"), array("measure_type_id" => "4", "name" => "Electrolytes", "unit" => ""), array("measure_type_id" => "1", "name" => "Creatinine", "unit" => "mg/dl"), array("measure_type_id" => "1", "name" => "Urea", "unit" => "mg/dl"), array("measure_type_id" => "4", "name" => "RFTS", "unit" => ""), array("measure_type_id" => "4", "name" => "TFT", "unit" => ""));
foreach ($measures as $measure) {
Measure::create($measure);
}
$measureGXM = Measure::create(array("measure_type_id" => "4", "name" => "GXM", "unit" => ""));
$measureBG = Measure::create(array("measure_type_id" => "2", "name" => "Blood Grouping", "unit" => ""));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "O-"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "O+"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "A-"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "A+"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "B-"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "B+"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "AB-"));
MeasureRange::create(array("measure_id" => $measureBG->id, "alphanumeric" => "AB+"));
$measureHB = Measure::create(array("measure_type_id" => Measure::NUMERIC, "name" => "HB", "unit" => "g/dL"));
$measuresUrinalysisData = array(array("measure_type_id" => "4", "name" => "Urine microscopy", "unit" => ""), array("measure_type_id" => "4", "name" => "Pus cells", "unit" => ""), array("measure_type_id" => "4", "name" => "S. haematobium", "unit" => ""), array("measure_type_id" => "4", "name" => "T. vaginalis", "unit" => ""), array("measure_type_id" => "4", "name" => "Yeast cells", "unit" => ""), array("measure_type_id" => "4", "name" => "Red blood cells", "unit" => ""), array("measure_type_id" => "4", "name" => "Bacteria", "unit" => ""), array("measure_type_id" => "4", "name" => "Spermatozoa", "unit" => ""), array("measure_type_id" => "4", "name" => "Epithelial cells", "unit" => ""), array("measure_type_id" => "4", "name" => "ph", "unit" => ""), array("measure_type_id" => "4", "name" => "Urine chemistry", "unit" => ""), array("measure_type_id" => "4", "name" => "Glucose", "unit" => ""), array("measure_type_id" => "4", "name" => "Ketones", "unit" => ""), array("measure_type_id" => "4", "name" => "Proteins", "unit" => ""), array("measure_type_id" => "4", "name" => "Blood", "unit" => ""), array("measure_type_id" => "4", "name" => "Bilirubin", "unit" => ""), array("measure_type_id" => "4", "name" => "Urobilinogen Phenlpyruvic acid", "unit" => ""), array("measure_type_id" => "4", "name" => "pH", "unit" => ""));
foreach ($measuresUrinalysisData as $measureU) {
$measuresUrinalysis[] = Measure::create($measureU);
}
$measuresWBCData = array(array("measure_type_id" => Measure::NUMERIC, "name" => "WBC", "unit" => "x10³/µL"), array("measure_type_id" => Measure::NUMERIC, "name" => "Lym", "unit" => "L"), array("measure_type_id" => Measure::NUMERIC, "name" => "Mon", "unit" => "*"), array("measure_type_id" => Measure::NUMERIC, "name" => "Neu", "unit" => "*"), array("measure_type_id" => Measure::NUMERIC, "name" => "Eos", "unit" => ""), array("measure_type_id" => Measure::NUMERIC, "name" => "Baso", "unit" => ""));
foreach ($measuresWBCData as $value) {
$measuresWBC[] = Measure::create($value);
}
$measureRangesWBC = array(array("measure_id" => $measuresWBC[0]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 4, "range_upper" => 11), array("measure_id" => $measuresWBC[1]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 1.5, "range_upper" => 4), array("measure_id" => $measuresWBC[2]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0.1, "range_upper" => 9), array("measure_id" => $measuresWBC[3]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 2.5, "range_upper" => 7), array("measure_id" => $measuresWBC[4]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0, "range_upper" => 6), array("measure_id" => $measuresWBC[5]->id, "age_min" => 0, "age_max" => 100, "gender" => MeasureRange::BOTH, "range_lower" => 0, "range_upper" => 2));
foreach ($measureRangesWBC as $value) {
MeasureRange::create($value);
}
$this->command->info('measures seeded');
/* Test Types table */
$testTypeBS = TestType::create(array("name" => "BS for mps", "test_category_id" => $test_categories->id, "orderable_test" => 1));
$testTypeStoolCS = TestType::create(array("name" => "Stool for C/S", "test_category_id" => $lab_section_microbiology->id));
$testTypeGXM = TestType::create(array("name" => "GXM", "test_category_id" => $test_categories->id));
$testTypeHB = TestType::create(array("name" => "HB", "test_category_id" => $test_categories->id, "orderable_test" => 1));
$testTypeUrinalysis = TestType::create(array("name" => "Urinalysis", "test_category_id" => $test_categories->id));
$testTypeWBC = TestType::create(array("name" => "WBC", "test_category_id" => $test_categories->id));
$this->command->info('test_types seeded');
/* TestType Measure table */
TestTypeMeasure::create(array("test_type_id" => $testTypeBS->id, "measure_id" => $measureBSforMPS->id));
TestTypeMeasure::create(array("test_type_id" => $testTypeGXM->id, "measure_id" => $measureGXM->id));
TestTypeMeasure::create(array("test_type_id" => $testTypeGXM->id, "measure_id" => $measureBG->id));
TestTypeMeasure::create(array("test_type_id" => $testTypeHB->id, "measure_id" => $measureHB->id));
foreach ($measuresUrinalysis as $value) {
TestTypeMeasure::create(array("test_type_id" => $testTypeUrinalysis->id, "measure_id" => $value->id));
}
foreach ($measuresWBC as $value) {
TestTypeMeasure::create(array("test_type_id" => $testTypeWBC->id, "measure_id" => $value->id));
//.........这里部分代码省略.........