import 'ControlsModel.dart';

class PostProcedureReqModel {
  int patientMRN;
  int appointmentNo;
  int episodeID;
  List<Procedures> procedures;
  String vidaAuthTokenID;

  PostProcedureReqModel(
      {this.patientMRN,
      this.appointmentNo,
      this.episodeID,
      this.procedures,
      this.vidaAuthTokenID});

  PostProcedureReqModel.fromJson(Map<String, dynamic> json) {
    patientMRN = json['PatientMRN'];
    appointmentNo = json['AppointmentNo'];
    episodeID = json['EpisodeID'];
    if (json['Procedures'] != null) {
      procedures = new List<Procedures>();
      json['Procedures'].forEach((v) {
        procedures.add(new Procedures.fromJson(v));
      });
    }
    vidaAuthTokenID = json['VidaAuthTokenID'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['PatientMRN'] = this.patientMRN;
    data['AppointmentNo'] = this.appointmentNo;
    data['EpisodeID'] = this.episodeID;
    if (this.procedures != null) {
      data['Procedures'] = this.procedures.map((v) => v.toJson()).toList();
    }
    data['VidaAuthTokenID'] = this.vidaAuthTokenID;
    return data;
  }
}

class Procedures {
  String procedure;
  String category;
  List<Controls> controls;

  Procedures({this.procedure, this.category, this.controls});

  Procedures.fromJson(Map<String, dynamic> json) {
    procedure = json['Procedure'];
    category = json['Category'];
    if (json['Controls'] != null) {
      controls = new List<Controls>();
      json['Controls'].forEach((v) {
        controls.add(new Controls.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['Procedure'] = this.procedure;
    data['Category'] = this.category;
    if (this.controls != null) {
      data['Controls'] = this.controls.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
