fix referral screen in out patient

flutter_vervion_2
Elham Rababah 5 years ago
parent 2140f0a229
commit e4fb83826a

@ -200,7 +200,7 @@ class PatientReferralViewModel extends BaseViewModel {
patientID: patient.patientId, patientID: patient.patientId,
roomID: patient.roomId, roomID: patient.roomId,
referralClinic: clinicID, referralClinic: clinicID,
admissionNo: patient.appointmentNo, /// TODO Elham* something in case inpateint since we send send appointmentNo for admissionNo which all time null admissionNo: int.parse(patient.admissionNo!), /// TODO Elham* something in case inpateint since we send send appointmentNo for admissionNo which all time null
referralDoctor: doctorID, referralDoctor: doctorID,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
referringDoctorRemarks: remarks, referringDoctorRemarks: remarks,

@ -1,7 +1,7 @@
// TODO : it have to be changed. // TODO : it have to be changed.
class PatiantInformtion { class PatiantInformtion {
final PatiantInformtion? patientDetails; PatiantInformtion? patientDetails;
int? genderInt; int? genderInt;
dynamic age; dynamic age;
String? appointmentDate; String? appointmentDate;
@ -75,6 +75,7 @@ class PatiantInformtion {
int? vcId; int? vcId;
String? voipToken; String? voipToken;
PatiantInformtion( PatiantInformtion(
{this.patientDetails, {this.patientDetails,
this.projectId, this.projectId,
@ -149,93 +150,111 @@ class PatiantInformtion {
this.status, this.status,
this.vcId, this.vcId,
this.voipToken}); this.voipToken});
PatiantInformtion.fromJson(Map<String, dynamic> json) {
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => PatiantInformtion( try {
patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) : null, patientDetails =
projectId: json["ProjectID"] ?? json["projectID"], json['patientDetails'] != null ? new PatiantInformtion.fromJson(
clinicId: json["ClinicID"] ?? json["clinicID"], json['patientDetails']) : null;
doctorId: json["DoctorID"] ?? json["doctorID"], projectId = json["ProjectID"] ?? json["projectID"];
patientId: json["PatientID"] != null clinicId = json["ClinicID"] ?? json["clinicID"];
doctorId = json["DoctorID"] ?? json["doctorID"];
patientId = json["PatientID"] != null
? json["PatientID"] is String ? json["PatientID"] is String
? int?.parse(json["PatientID"]) ? int?.parse(json["PatientID"])
: json["PatientID"] : json["PatientID"]
: json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'], : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'];
doctorName: json["DoctorName"] ?? json["doctorName"], doctorName = json["DoctorName"] ?? json["doctorName"];
doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], doctorNameN = json["DoctorNameN"] ?? json["doctorNameN"];
firstName: json["FirstName"] ?? json["firstName"], firstName = json["FirstName"] ?? json["firstName"];
middleName: json["MiddleName"] ?? json["middleName"], middleName = json["MiddleName"] ?? json["middleName"];
lastName: json["LastName"] ?? json["lastName"], lastName = json["LastName"] ?? json["lastName"];
firstNameN: json["FirstNameN"] ?? json["firstNameN"], firstNameN = json["FirstNameN"] ?? json["firstNameN"];
middleNameN: json["MiddleNameN"] ?? json["middleNameN"], middleNameN = json["MiddleNameN"] ?? json["middleNameN"];
lastNameN: json["LastNameN"] ?? json["lastNameN"], lastNameN = json["LastNameN"] ?? json["lastNameN"];
gender: json["Gender"] != null gender = json["Gender"] != null
? json["Gender"] is String ? json["Gender"] is String
? int?.parse(json["Gender"]) ? int?.parse(json["Gender"])
: json["Gender"] : json["Gender"]
: json["gender"], : json["gender"];
fullName: json["fullName"] ?? json["fullName"] ?? json["PatientName"], fullName = json["fullName"] ?? json["fullName"] ?? json["PatientName"];
fullNameN: json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], fullNameN =
dateofBirth: json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'], json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"];
nationalityId: json["NationalityID"] ?? json["nationalityID"], dateofBirth = json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'];
mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], nationalityId = json["NationalityID"] ?? json["nationalityID"];
emailAddress: json["EmailAddress"] ?? json["emailAddress"], mobileNumber = json["MobileNumber"] ?? json["mobileNumber"];
patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], emailAddress = json["EmailAddress"] ?? json["emailAddress"];
patientIdentificationNo =
json["PatientIdentificationNo"] ?? json["patientIdentificationNo"];
//TODO make 7 dynamic when the backend retrun it in patient arrival //TODO make 7 dynamic when the backend retrun it in patient arrival
patientType: json["PatientType"] ?? json["patientType"] ?? 1, patientType = json["PatientType"] ?? json["patientType"] ?? 1;
admissionNo: json["AdmissionNo"] ?? json["admissionNo"], admissionNo = json["AdmissionNo"] ?? json["admissionNo"];
admissionDate: json["AdmissionDate"] ?? json["admissionDate"], admissionDate = json["AdmissionDate"] ?? json["admissionDate"];
createdOn: json["CreatedOn"] ?? json["CreatedOn"], createdOn = json["CreatedOn"] ?? json["CreatedOn"];
roomId: json["RoomID"] ?? json["roomID"], roomId = json["RoomID"] ?? json["roomID"];
bedId: json["BedID"] ?? json["bedID"], bedId = json["BedID"] ?? json["bedID"];
nursingStationId: json["NursingStationID"] ?? json["nursingStationID"], nursingStationId = json["NursingStationID"] ?? json["nursingStationID"];
description: json["Description"] ?? json["description"], description = json["Description"] ?? json["description"];
clinicDescription: json["ClinicDescription"] ?? json["clinicDescription"], clinicDescription =
clinicDescriptionN: json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], json["ClinicDescription"] ?? json["clinicDescription"];
nationalityName: json["NationalityName"] ?? json["nationalityName"] ?? json['NationalityName'], clinicDescriptionN =
nationalityNameN: json["NationalityNameN"] ?? json["nationalityNameN"] ?? json['NationalityNameN'], json["ClinicDescriptionN"] ?? json["clinicDescriptionN"];
age: json["Age"] ?? json["age"], nationalityName = json["NationalityName"] ?? json["nationalityName"] ??
genderDescription: json["GenderDescription"], json['NationalityName'];
nursingStationName: json["NursingStationName"], nationalityNameN =
appointmentDate: json["AppointmentDate"] ?? '', json["NationalityNameN"] ?? json["nationalityNameN"] ??
startTime: json["startTime"] ?? json['StartTime'], json['NationalityNameN'];
appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], age = json["Age"] ?? json["age"];
appointmentType: json['appointmentType'], genderDescription = json["GenderDescription"];
appointmentTypeId: json['appointmentTypeId'] ?? json['appointmentTypeid'], nursingStationName = json["NursingStationName"];
arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], appointmentDate = json["AppointmentDate"] ?? '';
clinicGroupId: json['clinicGroupId'], startTime = json["startTime"] ?? json['StartTime'];
companyName: json['companyName'], appointmentNo = json['appointmentNo'] ?? json['AppointmentNo'];
dischargeStatus: json['dischargeStatus'], appointmentType = json['appointmentType'];
doctorDetails: json['doctorDetails'], appointmentTypeId =
endTime: json['endTime'], json['appointmentTypeId'] ?? json['appointmentTypeid'];
episodeNo: json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'], arrivedOn = json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'];
fallRiskScore: json['fallRiskScore'], clinicGroupId = json['clinicGroupId'];
isSigned: json['isSigned'], companyName = json['companyName'];
medicationOrders: json['medicationOrders'], dischargeStatus = json['dischargeStatus'];
nationality: json['nationality'] ?? json['NationalityNameN'], doctorDetails = json['doctorDetails'];
patientMRN: json['patientMRN'] ?? endTime = json['endTime'];
episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'];
fallRiskScore = json['fallRiskScore'];
isSigned = json['isSigned'];
medicationOrders = json['medicationOrders'];
nationality = json['nationality'] ?? json['NationalityNameN'];
patientMRN = json['patientMRN'] ??
json['PatientMRN'] ?? json['PatientMRN'] ??
(json["PatientID"] != null (json["PatientID"] != null
? int?.parse(json["PatientID"].toString()) ? int?.parse(json["PatientID"].toString())
: int?.parse(json["patientID"].toString())), : json["patientID"] != null ? int?.parse(
visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], json["patientID"].toString()) : json["patientId"] != null ? int
nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], ?.parse(json["patientId"].toString()) : '');
patientStatusType: json['patientStatusType'] ?? json['PatientStatusType'], visitType = json['visitType'] ?? json['visitType'] ?? json['visitType'];
visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], nationalityFlagURL =
startTimes: json['StartTime'] ?? json['StartTime'], json['NationalityFlagURL'] ?? json['NationalityFlagURL'];
dischargeDate: json['DischargeDate'], patientStatusType =
status: json['Status'], json['patientStatusType'] ?? json['PatientStatusType'];
vcId: json['VC_ID'], visitTypeId =
json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'];
startTimes = json['StartTime'] ?? json['StartTime'];
dischargeDate = json['DischargeDate'];
status = json['Status'];
vcId = json['VC_ID'];
arrivalTime: json['ArrivalTime'], arrivalTime = json['ArrivalTime'];
arrivalTimeD: json['ArrivalTimeD'], arrivalTimeD = json['ArrivalTimeD'];
callStatus: json['CallStatus'], callStatus = json['CallStatus'];
callStatusDisc: json['CallStatusDisc'], callStatusDisc = json['CallStatusDisc'];
callTypeID: json['CallTypeID'], callTypeID = json['CallTypeID'];
clientRequestID: json['ClientRequestID'], clientRequestID = json['ClientRequestID'];
clinicName: json['ClinicName'], clinicName = json['ClinicName'];
consoltationEnd: json['ConsoltationEnd'], consoltationEnd = json['ConsoltationEnd'];
consultationNotes: json['ConsultationNotes'], consultationNotes = json['ConsultationNotes'];
patientStatus: json['PatientStatus'], patientStatus = json['PatientStatus'];
voipToken: json['VoipToken'], voipToken = json['VoipToken'];
); } catch (e) {
print(e);
}
}
} }

@ -106,9 +106,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
patientGender: patientGender:
model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender, model.patientReferral[model.patientReferral.length - 1].patientDetails!.gender,
referredDate: referredDate:
model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[0], model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[0],
referredTime: referredTime:
model.patientReferral[model.patientReferral.length - 1].referredOn!.split(" ")[1], model.patientReferral[model.patientReferral.length - 1].referredOn?.split(" ")[1],
patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: isSameBranch:
model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch,
@ -136,22 +136,22 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
if (_referTo == null) { if (_referTo == null) {
branchError = TranslationBase.of(context).fieldRequired!; branchError = TranslationBase.of(context).fieldRequired!;
} else { } else {
branchError = null!; branchError = null;
} }
if (_selectedBranch == null) { if (_selectedBranch == null) {
hospitalError = TranslationBase.of(context).fieldRequired!; hospitalError = TranslationBase.of(context).fieldRequired!;
} else { } else {
hospitalError = null!; hospitalError = null;
} }
if (_selectedClinic == null) { if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired!; clinicError = TranslationBase.of(context).fieldRequired!;
} else { } else {
clinicError = null!; clinicError = null;
} }
if (_selectedDoctor == null) { if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired!; doctorError = TranslationBase.of(context).fieldRequired!;
} else { } else {
doctorError = null!; doctorError = null;
} }
}); });
if (appointmentDate == null || if (appointmentDate == null ||

@ -85,7 +85,7 @@ class PatientReferralItemWidget extends StatelessWidget {
: Colors.red[700], : Colors.red[700],
), ),
AppText( AppText(
referredDate!, referredDate??'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 2.0 * SizeConfig.textMultiplier!, fontSize: 2.0 * SizeConfig.textMultiplier!,
@ -98,7 +98,7 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
patientName!, patientName??'',
fontSize: SizeConfig.textMultiplier! * 2.2, fontSize: SizeConfig.textMultiplier! * 2.2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -121,7 +121,7 @@ class PatientReferralItemWidget extends StatelessWidget {
width: 4, width: 4,
), ),
AppText( AppText(
referredTime!, referredTime??'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier!, fontSize: 1.8 * SizeConfig.textMultiplier!,
@ -278,7 +278,7 @@ class PatientReferralItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
referralDoctorName!, referralDoctorName??'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.7 * SizeConfig.textMultiplier!, fontSize: 1.7 * SizeConfig.textMultiplier!,

Loading…
Cancel
Save