import {Component,OnInit, ElementRef, NgZone, ViewChild} from '@angular/core';
import { trigger, transition, animate, style } from '@angular/animations';

@Component({
  selector: 'app-treatmenttrackings',
  templateUrl: './treatmenttrackings.page.html',
  styleUrls: ['./treatmenttrackings.page.scss'],
})
export class TreatmenttrackingsPage implements OnInit {
  shownGroup = null;
  treatment_schedule_open:any;
  treatment_distribution_log:any
  constructor() { 
    this.shownGroup = 0;
    this.get_treattrackings();
  }

  ngOnInit() {
  }
  isGroupShown(group) {
    return this.shownGroup === group;
    }
    toggleGroup(group) {
      if (this.isGroupShown(group)) {
      this.shownGroup = null;
      } else {
      this.shownGroup = group;
      }
      }
      get_treattrackings()
      {
        this.treatment_schedule_open= {
          "treatment_type":"Tube feeding",
          "times_perday":"2",
          "Action":"approve"
          };
          var log = {
            data:[
            {
            "treatment_type":"Inhalation",
            "treatment_description":"test",
            "date_treatment_received":"6/7/2019",
            "time_treatment_received":"6:30:00",
            "notes":"test"
            
            },
            {
            "treatment_type":"Tube feeding",
            "treatment_description":"test",
            "date_treatment_received":"06/14/2019",
            "time_treatment_received":"03.10.00",
            "notes":"test",
            }]
            }
            this.treatment_distribution_log =log.data;
        
          
      }
}
