本文整理汇总了PHP中Patient::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Patient::create方法的具体用法?PHP Patient::create怎么用?PHP Patient::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patient
的用法示例。
在下文中一共展示了Patient::create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
Patient::create([]);
}
}
示例2: store
/**
* Store a newly created patient in storage.
*
* @return Response
*/
public function store()
{
$validator = Validator::make($data = Input::all(), Patient::$rules);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
$patient = Patient::create($data);
return Redirect::route('patient-chart-get', $patient->id)->with('global', 'New patient created.');
}
示例3: store
/**
* Store a newly created patient in storage.
*
* @return Response
*/
public function store()
{
$validator = Validator::make($data = Input::all(), Patient::$rules);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
Patient::create($data);
return Redirect::route('backend.patients.index');
}
示例4: run
public function run()
{
DB::table('patient')->truncate();
/**
* Tipos de examen
*/
$patientList = [["identificationTypeId" => '2', "maritalStatusId" => '5', "name" => 'Juana', "lastname" => 'Lopera', "identificationNumber" => '1094999887', "placebirth" => 'Montenegro, Quindío, Colombia', "birthdate" => '1990-01-23', "gender" => 'f', "occupation" => 'Psicologa', "residenceCity" => 'Armenia, Quindío, Colombia', "address" => 'Cra 12 Nro 23-41'], ["identificationTypeId" => '1', "maritalStatusId" => '2', "name" => 'Adriana', "lastname" => 'Martinez', "identificationNumber" => '745841', "placebirth" => 'Calarca, Quindío, Colombia', "birthdate" => '1990-01-23', "gender" => 'f', "occupation" => 'Estudiante', "residenceCity" => 'NY, NY, USA', "address" => '123 main street']];
foreach ($patientList as $patient) {
Patient::create($patient);
}
}
示例5: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
// dd(Input::all());
//adding patient basic info
$patient = Patient::create(array("first_name" => Input::get("firstname"), "middle_name" => Input::get("middlename"), "last_name" => Input::get("lastname"), "birth_date" => Input::get("dob"), "hospital_id" => Input::get("hosp_no"), "phone" => Input::get("phone"), "facility_id" => Input::get("facility"), "server_status" => "not", "uid" => uniqid()));
//adding patient visit info
$visit = Visit::create(array("patient_id" => $patient->id, "visit_date" => date('Y-m-d'), "server_status" => 'not', "user" => Auth::user()->firstname . " " . Auth::user()->middlename . " " . Auth::user()->lastname));
//adding address information
PatientInfo::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "hospital_id" => Input::get("hosp_no"), "region" => Input::get("region"), "district" => Input::get("district"), "ward" => Input::get("ward"), "ten_cell_leader" => Input::get("t_cell_leadr")));
//adding gynecological history inforamtion for a visit
GynecologicalHistory::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "parity" => Input::get("parity"), "number_of_pregnancy" => Input::get("number_of_preg"), "menarche" => Input::get("menarche"), "age_at_sexual_debut" => Input::get("start_sex_age"), "marital_status" => Input::get("marital"), "age_at_first_marriage" => Input::get("first_marriage"), "sexual_partner" => Input::get("sexual_partner"), "partner_sexual_partner" => Input::get("partner_sexual_partner")));
//adding contraceptive history
ContraceptiveHistory::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "previous_status" => Input::get("ever_used_contra"), "current_status" => Input::get("current_on_contra"), "previous_contraceptive_id" => Input::has("ever_contra") ? Input::get("ever_contra") : "", "current_contraceptive_id" => Input::has("current_contra") ? Input::get("current_contra") : ""));
//adding HIV status
HivStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::has("hiv_status") ? Input::get("hiv_status") : "", "test_status" => Input::has("hiv_test_status") ? Input::get("hiv_test_status") : "", "unknown_reason" => Input::has("unknown_reason") ? Input::get("unknown_reason") : "", "years_since_first_diagnosis" => Input::has("year_since_diagnosis") ? Input::get("year_since_diagnosis") : "", "year_of_last_test" => Input::has("last_test") ? Input::get("last_test") : "", "art_status" => Input::has("art_status") ? Input::get("art_status") : "", "current_art_status" => Input::has("current_art_status") ? Input::get("current_art_status") : "", "pitc_offered" => Input::get("test_again") == "yes" ? "yes" : "no", "pitc_agreed" => Input::has("test_again") ? Input::get("test_again") : "", "pitc_result" => Input::has("current_test_result") ? Input::get("current_test_result") : "", "pitc_cd4_count" => Input::has("current_cd4") ? Input::get("current_cd4") : "", "prev_cd4_count" => Input::has("prev_cd4") ? Input::get("prev_cd4") : ""));
//adding VIA Status
ViaStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "via_counselling_status" => Input::get("via_counceling"), "via_test_status" => Input::get("via_test"), "reject_reason" => Input::has("via_reason") ? Input::get("via_reason") : "", "via_result" => Input::has("via_results") ? Input::get("via_results") : ""));
//adding colposcopy
ColposcopyStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::get("colposcopy_status"), "result_id" => Input::has("colpo_result") ? Input::get("colpo_result") : ""));
//adding cervical screening
CervicalScreening::create(array("patient_id" => $patient->id, "status" => Input::get("screening_status"), "last_test" => Input::has("last_screen") ? Input::get("last_screen") : ""));
//adding Pap smear result
PapsmearStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::get("pap_status"), "result_id" => Input::has("pap_result") ? Input::get("pap_result") : ""));
//adding intervetion status
Intervention::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "type_id" => Input::has("intervention") ? Input::get("intervention") : "", "indicator_id" => Input::has("indicator") ? Input::get("indicator") : "", "histology_id" => Input::has("histology") ? Input::get("histology") : "", "cancer_id" => Input::has("cancer") ? Input::get("cancer") : "", "grade" => Input::has("hist_grade") ? Input::get("hist_grade") : "", "stages" => Input::has("stages") ? Input::get("stages") : "", "differentiation" => Input::has("differentiation") ? Input::get("differentiation") : ""));
$report = PatientReport::create(array("patient_id" => $patient->id, "bitrh_date" => Input::get("dob"), "region" => Input::get("region"), "district" => Input::get("district"), "parity" => Input::get("parity"), "number_of_pregnancy" => Input::get("number_of_preg"), "menarche" => Input::get("menarche"), "age_at_sexual_debut" => Input::get("start_sex_age"), "marital_status" => Input::get("marital"), "first_marriage" => Input::get("first_marriage"), "partners" => Input::get("sexual_partner"), "partners_partner" => Input::get("partner_sexual_partner"), "contraceptive_status" => Input::get("current_on_contra"), "contraceptive_type" => Input::has("current_contra") ? Input::get("current_contra") : "", "HIV_status" => Input::has("hiv_status") ? Input::get("hiv_status") : "", "facility_id" => Input::get("facility")));
if (Input::has("current_cd4")) {
$report->cd4_count = Input::get("current_cd4");
} elseif (Input::has("prev_cd4")) {
$report->cd4_count = Input::has("prev_cd4");
}
$report->save();
if (Input::get("next_visit") != "") {
Notification::create(array("patient_id" => $patient->id, "message" => "Kumbuka Kwenda katika kituo ulichopimwa mara ya mwisho saratani ya shingo ya kizazi. Tafadhali fika bila kukosa tarehe " . Input::get('next_visit'), "status" => "pending", "phone_number" => $patient->phone, "next_visit" => Input::get('next_visit')));
}
Logs::create(array("user_id" => Auth::user()->id, "action" => "Patient followup for " . $patient->first_name . " " . $patient->last_name));
$msg = "Patient Added Successfull";
return View::make("patient.index", compact("msg"));
}
示例6: 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));
//.........这里部分代码省略.........
示例7: run
public function run()
{
Patient::where('patient_id', 'P01')->delete();
Patient::create(['name' => 'Ahmed Raza', 'dob' => date('Y-m-d', strtotime('-25 years')), 'gender' => 'Male', 'age' => 25, 'email' => 'bc110201815@vu.edu.pk', 'city' => 'Lahore', 'country' => 'Pakistan', 'address' => 'DHA', 'phone' => '(0092) 334-4050495', 'cnic' => '12345-1234567-8', 'note' => 'Care the patient well.', 'patient_id' => 'P01']);
}