/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // List all the active specimentypes
     $specimentypes = SpecimenType::orderBy('name', 'ASC')->get();
     // Load the view and pass the specimentypes
     return View::make('specimentype.index')->with('specimentypes', $specimentypes);
 }
 public function specimenCountPerStatus()
 {
     Input::replace($this->specimenData);
     $specimenType = new SpecimenTypeController();
     $specimenType->store();
     $specimenTypeStored = SpecimenType::orderBy('id', 'desc')->take(1)->get()->toArray();
     $specimenTypeSaved = SpecimenType::find($specimenTypeStored[0]['id']);
     $count = $specimenTypeSaved->countPerStatus([Specimen::ACCEPTED, Specimen::REJECTED, Specimen::NOT_COLLECTED]);
     $this->assertEquals($specimenTypeSaved->specimen->count(), $count);
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //Get the testtype
     $testtype = TestType::find($id);
     $measures = Measure::all();
     $measuretype = MeasureType::all()->sortBy('id');
     $specimentypes = SpecimenType::orderBy('name')->get();
     $testcategory = TestCategory::all();
     $organisms = Organism::orderBy('name')->get();
     //Open the Edit View and pass to it the $testtype
     return View::make('testtype.edit')->with('testtype', $testtype)->with('testcategory', $testcategory)->with('measures', $measures)->with('measuretype', $measuretype)->with('specimentypes', $specimentypes)->with('organisms', $organisms);
 }