Ejemplo n.º 1
0
 /**
  * @dataProvider cases
  */
 public function testConvert( $numeral, $text )
 {
   $ntt = new NumberToText( $numeral );
   $this->assertEquals( $text, $ntt->convert(), "'$numeral' converts to '$text'" );
 }
Ejemplo n.º 2
0
 function get_prescription_florida_display()
 {
     $db = get_db();
     $ntt = new NumberToText($this->quantity);
     $ntt2 = new NumberToText($this->per_refill);
     $ntt3 = new NumberToText($this->refills);
     $string = "";
     $gnd = $this->provider->get_name_display();
     while (strlen($gnd) < 31) {
         $gnd .= " ";
     }
     $string .= $gnd . $this->provider->federal_drug_id . "\n";
     $sql = "SELECT * FROM users JOIN facility AS f ON f.name = users.facility where users.id ='" . add_escape_custom($this->provider->id) . "'";
     $results = $db->Execute($sql);
     if (!$results->EOF) {
         $rfn = $results->fields['name'];
         while (strlen($rfn) < 31) {
             $rfn .= " ";
         }
         $string .= $rfn . $this->provider->get_provider_number_default() . "\n" . $results->fields['street'] . "\n" . $results->fields['city'] . ", " . $results->fields['state'] . " " . $results->fields['postal_code'] . "\n" . $results->fields['phone'] . "\n";
     }
     $string .= "\n";
     $string .= strtoupper($this->patient->lname) . ", " . ucfirst($this->patient->fname) . " " . $this->patient->mname . "\n";
     $string .= "DOB " . $this->patient->date_of_birth . "\n";
     $string .= "\n";
     $string .= date("F j, Y", strtotime($this->start_date)) . "\n";
     $string .= "\n";
     $string .= strtoupper($this->drug) . " " . $this->size . " " . $this->unit_array[$this->unit] . "\n";
     if (strlen($this->note) > 0) {
         $string .= "Notes: \n" . $this->note . "\n";
     }
     if (!empty($this->dosage)) {
         $string .= $this->dosage;
         if (!empty($this->form)) {
             $string .= " " . $this->form_array[$this->form];
         }
         if (!empty($this->interval)) {
             $string .= " " . $this->interval_array[$this->interval];
         }
         if (!empty($this->route)) {
             $string .= " " . $this->route_array[$this->route] . "\n";
         }
     }
     if (!empty($this->quantity)) {
         $string .= "Disp: " . $this->quantity . " (" . trim(strtoupper($ntt->convert())) . ")" . "\n";
     }
     $string .= "\n";
     $string .= "Refills: " . $this->refills . " (" . trim(strtoupper($ntt3->convert())) . "), Per Refill Disp: " . $this->per_refill . " (" . trim(strtoupper($ntt2->convert())) . ")" . "\n";
     $string .= $this->substitute_array[$this->substitute] . "\n";
     $string .= "\n";
     return $string;
 }