protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $preg = new Pregnancy();
     $preg->setEdd('20140809');
     $preg->setEthnicity(1);
     $preg->setParity(0);
     $preg->setMaternalheight(166);
     $preg->setMaternalweight(60);
     $preg->setGrowchartversion('NL2013');
     $measurement = new Measurement();
     $measurement->setDate('20140809');
     $measurement->setType('efw');
     $measurement->setValue(3000);
     $preg->setMeasurements(array($measurement, $measurement));
     $birth = new Birth();
     $birth->setAntenataliugrdetection(false);
     $birth->setBabydob('20140809');
     $preg->setBirth($birth);
     $chart = new Chart();
     $chart->setFirstname('Test');
     $chart->setHeight('750');
     $chart->setLanguage('en_US');
     $preg->setChart($chart);
     $baby = new Baby();
     $baby->setBabygender('M');
     $baby->setBabynr(1);
     $baby->setBabyName('Test baby');
     $babies = array($baby, $baby);
     $preg->setBabies($babies);
     $pregnancies = array($preg, $preg);
     $res = $this->client->registerPregnancies($pregnancies);
     print_r($res);
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $growchartid = $input->getArgument('growchartid');
     $dialog = $this->getHelperSet()->get('dialog');
     $previousgrowchartid = $dialog->ask($output, '<info>Please entry the previous growchartid</info>');
     $babydob = $dialog->ask($output, '<info>Please entry the baby birth (YYYYMMDD):</info>');
     $babygender = $dialog->select($output, '<info>Please entry the baby gender(M):</info>', array('M' => 'Male', 'F' => 'Female'), 'M');
     $birthweight = $dialog->ask($output, '<info>Please entry baby weight(g):</info>');
     $birthgestation = $dialog->ask($output, '<info>Please entry birth gestation:</info>');
     $baby = new Baby();
     $baby->setBabydob($babydob);
     $baby->setBabygender($babygender);
     $baby->setBirthgestation($birthgestation);
     $baby->setBirthweight($birthweight);
     $baby->setGrowchartid($growchartid);
     $baby->setPreviousGrowchartid($previousgrowchartid);
     try {
         $res = $this->client->registerBaby($baby);
     } catch (Exception $ex) {
         $output->writeln('<error>' . $ex->getMessage() . '</error>');
     }
     $output->writeln($res);
 }