You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
3.9 KiB
Dart
140 lines
3.9 KiB
Dart
class PatientInfoModel {
|
|
int? age;
|
|
String? dateOfBirth;
|
|
String? firstNameAr;
|
|
String? firstNameEn;
|
|
String? secondNameAr;
|
|
String? secondNameEn;
|
|
String? thirdNameAr;
|
|
String? thirdNameEn;
|
|
String? lastNameAr;
|
|
String? lastNameEn;
|
|
String? gender;
|
|
String? healthId;
|
|
String? idNumber;
|
|
String? idType;
|
|
bool? isHijri;
|
|
String? maritalStatus;
|
|
String? maritalStatusCode;
|
|
String? nationalDateOfBirth;
|
|
String? nationality;
|
|
String? nationalityCode;
|
|
String? occupation;
|
|
String? patientStatus;
|
|
String? placeOfBirth;
|
|
int? messageStatus;
|
|
String? errorEndUserMessage;
|
|
String? errorMessage;
|
|
|
|
PatientInfoModel({
|
|
this.age,
|
|
this.dateOfBirth,
|
|
this.firstNameAr,
|
|
this.firstNameEn,
|
|
this.secondNameAr,
|
|
this.secondNameEn,
|
|
this.thirdNameAr,
|
|
this.thirdNameEn,
|
|
this.lastNameAr,
|
|
this.lastNameEn,
|
|
this.gender,
|
|
this.healthId,
|
|
this.idNumber,
|
|
this.idType,
|
|
this.isHijri,
|
|
this.maritalStatus,
|
|
this.maritalStatusCode,
|
|
this.nationalDateOfBirth,
|
|
this.nationality,
|
|
this.nationalityCode,
|
|
this.occupation,
|
|
this.patientStatus,
|
|
this.placeOfBirth,
|
|
this.messageStatus,
|
|
this.errorEndUserMessage,
|
|
this.errorMessage,
|
|
});
|
|
|
|
factory PatientInfoModel.fromJson(Map<String, dynamic> json) {
|
|
return PatientInfoModel(
|
|
age: json['Age'],
|
|
dateOfBirth: json['DateOfBirth'],
|
|
firstNameAr: json['FirstNameAr'],
|
|
firstNameEn: json['FirstNameEn'],
|
|
secondNameAr: json['SecondNameAr'],
|
|
secondNameEn: json['SecondNameEn'],
|
|
thirdNameAr: json['ThirdNameAr'],
|
|
thirdNameEn: json['ThirdNameEn'],
|
|
lastNameAr: json['LastNameAr'],
|
|
lastNameEn: json['LastNameEn'],
|
|
gender: json['Gender'],
|
|
healthId: json['HealthId'],
|
|
idNumber: json['IdNumber'],
|
|
idType: json['IdType'],
|
|
isHijri: json['IsHijri'],
|
|
maritalStatus: json['MaritalStatus'],
|
|
maritalStatusCode: json['MaritalStatusCode'],
|
|
nationalDateOfBirth: json['NationalDateOfBirth'],
|
|
nationality: json['Nationality'],
|
|
nationalityCode: json['NationalityCode'],
|
|
occupation: json['Occupation'],
|
|
patientStatus: json['PatientStatus']?.toString(),
|
|
placeOfBirth: json['PlaceofBirth'],
|
|
messageStatus: json['MessageStatus'],
|
|
errorEndUserMessage: json['ErrorEndUserMessage'],
|
|
errorMessage: json['ErrorMessage'],
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'Age': age,
|
|
'DateOfBirth': dateOfBirth,
|
|
'FirstNameAr': firstNameAr,
|
|
'FirstNameEn': firstNameEn,
|
|
'SecondNameAr': secondNameAr,
|
|
'SecondNameEn': secondNameEn,
|
|
'ThirdNameAr': thirdNameAr,
|
|
'ThirdNameEn': thirdNameEn,
|
|
'LastNameAr': lastNameAr,
|
|
'LastNameEn': lastNameEn,
|
|
'Gender': gender,
|
|
'HealthId': healthId,
|
|
'IdNumber': idNumber,
|
|
'IdType': idType,
|
|
'IsHijri': isHijri,
|
|
'MaritalStatus': maritalStatus,
|
|
'MaritalStatusCode': maritalStatusCode,
|
|
'NationalDateOfBirth': nationalDateOfBirth,
|
|
'Nationality': nationality,
|
|
'NationalityCode': nationalityCode,
|
|
'Occupation': occupation,
|
|
'PatientStatus': patientStatus,
|
|
'PlaceofBirth': placeOfBirth,
|
|
'MessageStatus': messageStatus,
|
|
'ErrorEndUserMessage': errorEndUserMessage,
|
|
'ErrorMessage': errorMessage,
|
|
};
|
|
}
|
|
|
|
String get fullNameAr {
|
|
List<String> parts = [
|
|
firstNameAr ?? '',
|
|
secondNameAr ?? '',
|
|
(thirdNameAr != null && thirdNameAr != '-') ? thirdNameAr! : '',
|
|
lastNameAr ?? '',
|
|
].where((s) => s.trim().isNotEmpty && s != '-').toList();
|
|
return parts.join(' ').trim();
|
|
}
|
|
|
|
String get fullNameEn {
|
|
List<String> parts = [
|
|
firstNameEn ?? '',
|
|
secondNameEn ?? '',
|
|
(thirdNameEn != null && thirdNameEn != '-') ? thirdNameEn! : '',
|
|
lastNameEn ?? '',
|
|
].where((s) => s.trim().isNotEmpty && s != '-').toList();
|
|
return parts.join(' ').trim();
|
|
}
|
|
}
|