import 'package:ftc_mobile_app/models/profileData/user_data.dart'; import '../body_points_category.dart'; class CarePlan { CarePlan({ this.id, this.eventDateTime, this.userId, this.addedby, this.noteDetails, this.active, this.noteType, this.title, this.flag, this.isHTML, this.createdAt, this.updatedAt, this.healthIssueId, this.keycontacts, this.riskAssesments, }); CarePlan.fromJson(dynamic json) { id = json['_id']; eventDateTime = json['eventDateTime']; userId = json['userId'] is Map ? UserData.fromJson(json['userId']) : null; addedby = json['addedby'] is Map ? UserData.fromJson(json['addedby']) : null; noteDetails = json['noteDetails']; active = json['active']; noteType = json['noteType']; title = json['title']; flag = json['flag']; isHTML = json['isHTML']; createdAt = json['createdAt']; updatedAt = json['updatedAt']; healthIssueId = json['healthIssueId'] != null ? HealthIssueId.fromJson(json['healthIssueId']) : null; keycontacts = json['keycontacts'] != null ? List.from(json['keycontacts']) : null; riskAssesments = json['riskAssesments'] != null ? List.from(json['riskAssesments']) : null; } String? id; int? eventDateTime; UserData? userId; UserData? addedby; String? noteDetails; bool? active; String? noteType; String? title; bool? flag; bool? isHTML; String? createdAt; String? updatedAt; HealthIssueId? healthIssueId; List? keycontacts; List? riskAssesments; Map toJson() { final map = {}; map['_id'] = id; map['eventDateTime'] = eventDateTime; if (userId != null) { map['userId'] = userId?.toJson(); } if (addedby != null) { map['addedby'] = addedby?.toJson(); } map['noteDetails'] = noteDetails; map['active'] = active; map['noteType'] = noteType; map['title'] = title; map['flag'] = flag; map['isHTML'] = isHTML; map['createdAt'] = createdAt; map['updatedAt'] = updatedAt; if (healthIssueId != null) { map['healthIssueId'] = healthIssueId?.toJson(); } if (keycontacts != null) { map['keycontacts'] = keycontacts; } if (riskAssesments != null) { map['riskAssesments'] = riskAssesments; } return map; } } class HealthIssueId { HealthIssueId.fromJson(dynamic json) { id = json['_id']; category = json['category'] != null ? SubCat.fromJson(json['category']) : null; status = json['status']; healthNote = json['healthNote']; complaint = json['complaint']; userId = json['userId']; isCarePlanData = json['isCarePlanData']; isPhysicalIntervention = json['isPhysicalIntervention']; createdAt = json['createdAt']; updatedAt = json['updatedAt']; } String? id; SubCat? category; bool? status; String? healthNote; String? complaint; String? userId; bool? isCarePlanData; bool? isPhysicalIntervention; String? createdAt; String? updatedAt; Map toJson() { final map = {}; map['_id'] = id; if (category != null) { map['category'] = category?.toJson(); } map['status'] = status; map['healthNote'] = healthNote; map['complaint'] = complaint; map['userId'] = userId; map['isCarePlanData'] = isCarePlanData; map['isPhysicalIntervention'] = isPhysicalIntervention; map['createdAt'] = createdAt; map['updatedAt'] = updatedAt; return map; } } // class Category { // Category.fromJson(dynamic json) { // id = json['_id']; // name = json['name']; // enumValue = json['enum']; // parentCategory = json['parentCategory'] != null ? ParentCategory.fromJson(json['parentCategory']) : null; // createdAt = json['createdAt']; // updatedAt = json['updatedAt']; // v = json['__v']; // } // // String? id; // String? name; // String? enumValue; // ParentCategory? parentCategory; // String? createdAt; // String? updatedAt; // int? v; // // Map toJson() { // final map = {}; // map['_id'] = id; // map['name'] = name; // map['enum'] = enumValue; // if (parentCategory != null) { // map['parentCategory'] = parentCategory?.toJson(); // } // map['createdAt'] = createdAt; // map['updatedAt'] = updatedAt; // map['__v'] = v; // return map; // } // } // // class ParentCategory { // ParentCategory.fromJson(dynamic json) { // id = json['_id']; // name = json['name']; // enumValue = json['enum']; // createdAt = json['createdAt']; // updatedAt = json['updatedAt']; // v = json['__v']; // } // // String? id; // String? name; // String? enumValue; // String? createdAt; // String? updatedAt; // int? v; // // Map toJson() { // final map = {}; // map['_id'] = id; // map['name'] = name; // map['enum'] = enumValue; // map['createdAt'] = createdAt; // map['updatedAt'] = updatedAt; // map['__v'] = v; // return map; // } // }