Exemplo n.º 1
0
 public function getPDF(ChartPdf $chartpdf, $filename = null)
 {
     $res = $this->doRequest($this->buildQuery('/xml/getpdf/'), $chartpdf->getXmlPayload());
     $pdfurl = (string) $res->url;
     if ($filename) {
         $content = $this->httpRequest($pdfurl);
         file_put_contents($filename, $content);
     }
     return $pdfurl;
 }
Exemplo n.º 2
0
 public function getPDF(ChartPdf $chartpdf, $filename = null)
 {
     $url = $this->buildQuery(sprintf('/json/pregnancy/%s/chartpdf', $chartpdf->getGrowchartid()));
     $res = $this->doRequest($url, $chartpdf->toJson());
     $pdfurl = (string) $res->url;
     if ($filename) {
         $content = $this->httpRequest($pdfurl);
         file_put_contents($filename, $content);
     }
     return $pdfurl;
 }
Exemplo n.º 3
0
 public function getPDF(ChartPdf $chartpdf, $filename = null)
 {
     $obj = $this->call('getPdf', $chartpdf->getSoapParams());
     return $obj->url;
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $growchartid = $input->getArgument('growchartid');
     $dialog = $this->getHelperSet()->get('dialog');
     $firstname = $dialog->ask($output, '<info>Please entry the firstname:</info>');
     $lastname = $dialog->ask($output, '<info>Please entry the lastname:</info>');
     $maternaldob = $dialog->ask($output, '<info>Please entry maternal dob:</info>');
     $maternalreference = $dialog->ask($output, '<info>Please entry maternal reference:</info>');
     $babyname = $dialog->ask($output, '<info>Please entry the baby name:</info>');
     $babygestation = $dialog->ask($output, '<info>Please entry the baby gestation:</info>');
     $babygender = $dialog->select($output, '<info>Please entry the baby gender(M):</info>', array('M' => 'Male', 'F' => 'Female'), 'M');
     $babybirthweight = $dialog->ask($output, '<info>Pleae entry the baby weight when birth (g)</info>');
     $language = $dialog->select($output, '<info>Please entry the text language (en_UK):</info>', Chart::getSupportedLanguage(), '0');
     $pdf = new ChartPdf();
     $pdf->setBabybirthweight($babybirthweight);
     $pdf->setBabygender($babygender);
     $pdf->setBabygestation($babygestation);
     $pdf->setBabyname($babyname);
     $pdf->setFirstname($firstname);
     $pdf->setGrowchartid($growchartid);
     $pdf->setLanguage($language);
     $pdf->setLastname($lastname);
     $pdf->setMaternaldob($maternaldob);
     $pdf->setReference($maternalreference);
     try {
         $url = $this->client->getPDF($pdf);
     } catch (Exception $ex) {
         $output->writeln('<error>' . $ex->getMessage() . '</error>');
     }
     $output->writeln($url);
 }