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

@ -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