toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['enrollment'] = this.enrollment;
data['incidentDate'] = this.incidentDate;
data['enrollmentDate'] = this.enrollmentDate;
data['trackedEntityType'] = this.trackedEntityType;
data['orgUnit'] = this.orgUnit;
data['program'] = this.program;
data['status'] = this.status;
data['synced'] = this.synced;
data['syncFailed'] = this.syncFailed;
data['lastSyncSummary'] = this.lastSyncSummary != null
? jsonEncode(
(this.lastSyncSummary as EnrollmentImportSummary).responseSummary)
: null;
;
data['geometry'] =
this.geometry != null ? jsonEncode(this.geometry?.geometryData) : null;
data['lastSyncDate'] = this.lastSyncDate;
data['events'] = this.events ?? [];
data['trackedEntityInstance'] = this.trackedEntityInstance;
data['dirty'] = this.dirty;
data['created'] = this.created;
data['lastUpdated'] = this.lastUpdated;
return data;
}