class InterventionHistoryList{
  List<InterventionHistory>? history = [];
  InterventionHistoryList.fromJson(Map<String, dynamic> json){
    var entryList =  json['entityList'] ?? {};
    List<InterventionHistory> tempList = [];
    for(var item in entryList){
      var medication = InterventionHistory.fromJson(item);
      tempList.add(medication);
    }
    history?.addAll(tempList);
  }
}

class InterventionHistory {
  String? authizationFormText;
  int? authorizedAction;
  int? commentedBy;
  String? commentedByName;
  String? interventionDesc;
  int? interventionId;
  String? remark;

  InterventionHistory({
    this.authizationFormText,
    this.authorizedAction,
    this.commentedBy,
    this.commentedByName,
    this.interventionDesc,
    this.interventionId,
    this.remark,
  });

  factory InterventionHistory.fromJson(Map<String, dynamic> json) {
    print('the remark is ${json['remark']}');
    return InterventionHistory(
      authizationFormText: json['authizationFormText'] ?? '',
      authorizedAction: json['authorizedAction'] ?? '',
      commentedBy: json['commentedBy'] ?? '',
      commentedByName: json['commentedByName'] ?? '',
      interventionDesc: json['interventionDesc'] ?? '',
      interventionId: json['interventionId'] ?? '',
      remark: json['remark'] ?? '',
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'authizationFormText': authizationFormText,
      'authorizedAction': authorizedAction,
      'commentedBy': commentedBy,
      'commentedByName': commentedByName,
      'interventionDesc': interventionDesc,
      'interventionId': interventionId,
      'remark': remark,
    };
  }
}