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); }
public function toArray() { $params = array(); $params['maternalheight'] = $this->getMaternalheight(); $params['maternalweight'] = $this->getMaternalweight(); $params['ethnicity'] = $this->getEthnicity(); $params['parity'] = $this->getParity(); $params['edd'] = $this->getEdd(); $params['growversion'] = $this->getGrowchartversion(); $params['growchartid'] = $this->getGrowchartid(); $params['requestdate'] = $this->getRequestdate(); $growchartid = $this->getGrowchartid(); if ($this->birth) { $this->birth->setGrowchartid($growchartid); $params['birth'] = $this->birth->toArray(); } if ($this->babies) { foreach ($this->babies as $baby) { $baby->setGrowchartid($growchartid); $params['babies'][] = $baby->toArray(); } } if ($this->measurements) { foreach ($this->measurements as $m) { $m->setGrowchartid($growchartid); $params['measurements'][] = $m->toArray(); } } if ($this->chart) { $this->chart->setGrowchartid($growchartid); $params['chart'] = $this->chart->toArray(); } return $params; }
protected function execute(InputInterface $input, OutputInterface $output) { parent::execute($input, $output); $growchartid = $input->getArgument('growchartid'); $dialog = $this->getHelperSet()->get('dialog'); $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>'); $antenataliugrdetection = $dialog->select($output, '<info>Whether the baby is antenatal iugr detection?(N):</info>', array('Y' => 'Yes', 'N' => 'No'), 'N'); $birth = new Birth(); $birth->setAntenataliugrdetection($antenataliugrdetection); $birth->setBabydob($babydob); $birth->setBabygender($babygender); $birth->setBirthweight($birthweight); $birth->setGrowchartid($growchartid); try { $res = $this->client->registerBirth($birth); } catch (Exception $ex) { $output->writeln('<error>' . $ex->getMessage() . '</error>'); } $output->writeln($res); }
public function registerBirth(Birth $birth) { return $this->call('registerBirth', $birth->getSoapParams()); }
public function registerBirth(Birth $birth) { $res = $this->doRequest($this->buildQuery('/xml/registerbirth/'), $birth->getXmlPayload()); return $res; }
public function registerBirth(Birth $birth) { $url = $this->buildQuery(sprintf('/json/pregnancy/%s/birth', $birth->getGrowchartid())); $res = $this->doRequest($url, $birth->toJson()); return $res; }