class PostPrescriptionReqModel {
  String vidaAuthTokenID;
  int clinicID;
  int episodeID;
  int appointmentNo;
  int patientMRN;
  List<PrescriptionRequestModel> prescriptionRequestModel;

  PostPrescriptionReqModel(
      {this.vidaAuthTokenID =
          "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiYTYxZjAyZjItNzUwZS00MTZkLWEzOTQtZTRjZmViZGVjMDE5IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUzNTIiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODUzMDAyNywiZXhwIjoxNjA5Mzk0MDI3LCJpYXQiOjE2MDg1MzAwMjd9.M1NTREPgz5vQH_GTZ_KGb0xQW5HEDs47AtNR3jbqnms",
      this.clinicID = 1,
      this.episodeID = 200012117,
      this.appointmentNo = 2016054573,
      this.patientMRN = 3120690,
      this.prescriptionRequestModel});

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

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

class PrescriptionRequestModel {
  int itemId;
  String doseStartDate;
  int duration;
  int dose;
  int doseUnitId;
  int route;
  int frequency;
  int doseTime;
  bool covered;
  bool approvalRequired;
  String remarks;
  String icdcode10Id;

  PrescriptionRequestModel(
      {this.itemId = 4,
      this.doseStartDate = "2020-12-20T13:07:41.769Z",
      this.duration = 2,
      this.dose = 1,
      this.doseUnitId = 1,
      this.route = 1,
      this.frequency = 1,
      this.doseTime = 1,
      this.covered = true,
      this.approvalRequired = true,
      this.remarks = "test1",
      this.icdcode10Id = "test3"});

  PrescriptionRequestModel.fromJson(Map<String, dynamic> json) {
    itemId = json['itemId'];
    doseStartDate = json['doseStartDate'];
    duration = json['duration'];
    dose = json['dose'];
    doseUnitId = json['doseUnitId'];
    route = json['route'];
    frequency = json['frequency'];
    doseTime = json['doseTime'];
    covered = json['covered'];
    approvalRequired = json['approvalRequired'];
    remarks = json['remarks'];
    icdcode10Id = json['icdcode10Id'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['itemId'] = this.itemId;
    data['doseStartDate'] = this.doseStartDate;
    data['duration'] = this.duration;
    data['dose'] = this.dose;
    data['doseUnitId'] = this.doseUnitId;
    data['route'] = this.route;
    data['frequency'] = this.frequency;
    data['doseTime'] = this.doseTime;
    data['covered'] = this.covered;
    data['approvalRequired'] = this.approvalRequired;
    data['remarks'] = this.remarks;
    data['icdcode10Id'] = this.icdcode10Id;
    return data;
  }
}
