class RRTRequestModel { num patientId; int patientOutSa; bool isOutPatient; int nearestProjectId; num longitude; num latitude; String additionalDetails; String nationality; num paymentAmount; List procedures; RRTRequestModel( {this.patientId, this.patientOutSa, this.isOutPatient, this.nearestProjectId, this.longitude, this.latitude, this.additionalDetails, this.nationality, this.paymentAmount, this.procedures}); RRTRequestModel.fromJson(Map json) { patientId = json['patientId']; patientOutSa = json['patientOutSa']; isOutPatient = json['isOutPatient']; nearestProjectId = json['nearestProjectId']; longitude = json['longitude']; latitude = json['latitude']; additionalDetails = json['additionalDetails']; nationality = json['nationality']; paymentAmount = json['paymentAmount']; if (json['procedures'] != null) { procedures = []; json['procedures'].forEach((v) { procedures.add(new Procedures.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['patientId'] = this.patientId; data['patientOutSa'] = this.patientOutSa; data['isOutPatient'] = this.isOutPatient; data['nearestProjectId'] = this.nearestProjectId; data['longitude'] = this.longitude; data['latitude'] = this.latitude; data['additionalDetails'] = this.additionalDetails; data['nationality'] = this.nationality; data['paymentAmount'] = this.paymentAmount; if (this.procedures != null) { data['procedures'] = this.procedures.map((v) => v.toJson()).toList(); } return data; } } class Procedures { String serviceID; Procedures({this.serviceID}); Procedures.fromJson(Map json) { serviceID = json['ServiceID']; } Map toJson() { final Map data = new Map(); data['ServiceID'] = this.serviceID; return data; } }