class OrderModel {
  String? orderId;
  String? orderNumber;
  String? patientId;
  String? patientName;
  String? status;
  String? prefix;
  String? suffix;
  String? dob;
  String? NIK;
  String? NIP;
  String? title;
  String? sexID;
  String? hp;
  String? address;
  String? note;
  String? diagnosis;
  String? statusQr;
  String? statusPemeriksaan;
  String? jabatan;
  String? kedudukan;
  String? lokasi;
  String? pekerjaan;
  String? noRM;
  String? isQr;
  List<String>? sample;
  List<String>? testsID;
  List<String>? testDetail;
  List<String>? bahan;
  List<String>? tests;
  List<String>? paket;
  List<String>? paketDetail;

  OrderModel(
      {this.orderId,
      this.orderNumber,
      this.patientId,
      this.patientName,
      this.sample,
      this.tests,
      this.testsID,
      this.status,
      this.NIK,
      this.NIP,
      this.address,
      this.diagnosis,
      this.dob,
      this.hp,
      this.note,
      this.prefix,
      this.noRM,
      this.sexID,
      this.suffix,
      this.title,
      this.testDetail,
      this.paket,
      this.paketDetail,
      this.statusQr,
      this.statusPemeriksaan,
      this.jabatan,
      this.kedudukan,
      this.lokasi,
      this.pekerjaan,
      this.isQr,
      this.bahan});

  OrderModel.fromJson(Map<String, dynamic> json) {
    orderId = json['order_id'];
    orderNumber = json['order_number'];
    patientId = json['patient_id'];
    patientName = json['patient_name'];
    status = json['status'];
    prefix = json['prefix'];
    suffix = json['suffix'];
    dob = json['dob'];
    noRM = json['noRM'];
    NIK = json['NIK'];
    NIP = json['NIP'];
    title = json['title'];
    sexID = json['sexID'];
    hp = json['hp'];
    address = json['address'];
    note = json['note'];
    diagnosis = json['diagnosis'];
    statusQr = json['status_qr'];
    statusPemeriksaan = json['status_pemeriksaan'];
    jabatan = json['jabatan'];
    kedudukan = json['kedudukan'];
    lokasi = json['lokasi'];
    pekerjaan = json['pekerjaan'];
    isQr = json['is_qr'];
    // sample = json['sample'].cast<String>();
    // bahan = json['bahan'].cast<String>();
    // tests = json['tests'].cast<String>();
    // testsID = json['testsID'].cast<String>();
    if (json['sample'] != null) {
      sample = <String>[];

      json['sample'].forEach((v) {
        if (v.isNotEmpty) {
          sample!.add(v.toString());
        }
      });
    }
    if (json['bahan'] != null) {
      bahan = <String>[];
      json['bahan'].forEach((v) {
        if (v.isNotEmpty) {
          bahan!.add(v.toString());
        }
      });
    }
    if (json['tests'] != null) {
      tests = <String>[];
      json['tests'].forEach((v) {
        if (v != "") {
          tests!.add(v.toString());
        }
      });
    }
    if (json['testsID'] != null) {
      testsID = <String>[];
      json['testsID'].forEach((v) {
        if (v.isNotEmpty) {
          testsID!.add(v.toString());
        }
      });
    }
    if (json['testDetail'] != null) {
      testDetail = <String>[];
      json['testDetail'].forEach((v) {
        if (v.isNotEmpty) {
          testDetail!.add(v.toString());
        }
      });
    }
    if (json['packet'] != null) {
      paket = <String>[];
      json['packet'].forEach((v) {
        if (v != "") {
          paket!.add(v.toString());
        }
      });
    }
    if (json['packetDetail'] != null) {
      paketDetail = <String>[];
      json['packetDetail'].forEach((v) {
        if (v.isNotEmpty) {
          paketDetail!.add(v.toString());
        }
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['order_id'] = orderId;
    data['order_number'] = orderNumber;
    data['patient_id'] = patientId;
    data['patient_name'] = patientName;
    data['sample'] = sample;
    data['bahan'] = bahan;
    data['tests'] = tests;
    data['status'] = status;
    data['testsID'] = testsID;
    data['NIK'] = NIK;
    data['nip'] = NIP;
    data['address'] = address;
    data['diagnosis'] = diagnosis;
    data['dob'] = dob;
    data['hp'] = hp;
    data['note'] = note;
    data['prefix'] = prefix;
    data['sexID'] = sexID;
    data['suffix'] = suffix;
    data['title'] = title;
    data['testDetail'] = testDetail;
    data['packet'] = paket;
    data['packetDetail'] = paketDetail;
    data['status_qr'] = statusQr;
    data['status_pemeriksaan'] = statusPemeriksaan;
    data['kedudukan'] = kedudukan;
    data['jabatan'] = jabatan;
    data['lokasi'] = lokasi;
    data['pekerjaan'] = pekerjaan;
    data['noRM'] = noRM;
    data['is_qr'] = isQr;
    return data;
  }
}
