
import {Component,OnInit, ElementRef, NgZone, ViewChild} from '@angular/core';
import { trigger, transition, animate, style } from '@angular/animations';
@Component({
  selector: 'app-medicationtracking',
  templateUrl: './medicationtracking.page.html',
  styleUrls: ['./medicationtracking.page.scss'],
})
export class MedicationtrackingPage implements OnInit {
  medicalschedule_open:any
  shownGroup = null;
  medicalschedule_log:any;
  constructor() { 
    this.shownGroup = 0;
    this.get_medicalSchedule();
  }

  ngOnInit() {
  }
  isGroupShown(group) {
    return this.shownGroup === group;
    }
    toggleGroup(group) {
      if (this.isGroupShown(group)) {
      this.shownGroup = null;
      } else {
      this.shownGroup = group;
      }
      }
      get_medicalSchedule() {
       var mediocalschedule = {
          "data" :[
         {
              "name_medicine":"Hydrochlorothiazide",
         "dosage_unit":"5",
         "time_per_day":"3",
         
         },
         {
           "name_medicine":"Hydrochlorothiazide",
         "dosage_unit":"5",
         "time_per_day":"3",
       
         },
         {
           "name_medicine":"Hydrochlorothiazide",
         "dosage_unit":"5",
         "time_per_day":"3",
        
         },
         {
           "name_medicine":"Potassium Chloride",
         "dosage_unit":"5",
         "time_per_day":"2",
        
         },
           ]
         };
         this.medicalschedule_open = mediocalschedule.data;
         console.log(this.medicalschedule_open);
         var medication_transaction_log = {
          
            data :[
            {
            "name_medicine":"Potassium Chloride",
            "dossage_units":"5",
            "units_provided":"22",
            "date_medication_received":"06/14/2019",
            "time_medication":"03:01 PM",
            "notes":"test",
            "given_by":"Admin Nuvento",
            "missed_medication":"no"
            },
            {
            "name_medicine":"Amoxicillin",
            "dossage_units":"1",
            "units_provided":"3",
            "date_medication_received":"12/6/2019 ",
            "time_medication":"13:04:00",
            "notes":"test",
            "given_by":"Admin Nuvento",
            "missed_medication":"no"
            },
            {
            "name_medicine":"Amlodipine",
            "dossage_units":"10",
            "units_provided":"15",
            "date_medication_received":"12/6/2019 ",
            "time_medication":"12:02:00",
            "notes":"test",
            "given_by":"Admin Nuvento",
            "missed_medication":"no"
            }
            ]
            };
            this.medicalschedule_log = medication_transaction_log.data;
            
         
      }

}
