import { Component, OnInit } from '@angular/core';
import { Router, NavigationExtras, ActivatedRoute } from '@angular/router'
import {
  NavController,
  AlertController,
  LoadingController,
} from '@ionic/angular'

@Component({
  selector: 'app-merms-selectedpatient',
  templateUrl: './merms-selectedpatient.page.html',
  styleUrls: ['./merms-selectedpatient.page.scss'],
})
export class MermsSelectedpatientPage implements OnInit {

  patient_name: string = "Selected Patient";
  patientData: any;
  reason: string;
  patient_id : number = 0;
  lastname : string ='';
  firstname : string ='';
  appt : string ='';
  gender : string ='';
  age : number =0;

  constructor(public navCtrl: NavController, private router: Router, private route: ActivatedRoute) {
    console.log('-----------------------------xxxx-----------------------------');
    console.log(this.router.getCurrentNavigation().extras.queryParams);
    this.patientData = this.router.getCurrentNavigation().extras.queryParams;

    console.log(this.patientData.special);
    var params = JSON.parse(this.patientData.special);
    this.patient_name = params.firstname + ' ' + params.lastname;
    this.reason = params.reason;

    this.age = params.age;
    this.gender = params.gender;
    this.appt = params.appt;
    this.patient_id = params.id;
    this.firstname = params.firstname;
    


  }

  ngOnInit() {
  }
  goBack(){

  }
}
