Merge branch 'development' into fridayf-fix-bug
commit
6eb12b011f
@ -0,0 +1,258 @@
|
|||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
|
||||||
|
class MyReferralPatientModel {
|
||||||
|
dynamic rowID;
|
||||||
|
int projectID;
|
||||||
|
int lineItemNo;
|
||||||
|
int doctorID;
|
||||||
|
int patientID;
|
||||||
|
String doctorName;
|
||||||
|
dynamic doctorNameN;
|
||||||
|
String firstName;
|
||||||
|
String middleName;
|
||||||
|
String lastName;
|
||||||
|
dynamic firstNameN;
|
||||||
|
dynamic middleNameN;
|
||||||
|
dynamic lastNameN;
|
||||||
|
int gender;
|
||||||
|
String dateofBirth;
|
||||||
|
String mobileNumber;
|
||||||
|
String emailAddress;
|
||||||
|
String patientIdentificationNo;
|
||||||
|
int patientType;
|
||||||
|
String admissionNo;
|
||||||
|
String admissionDate;
|
||||||
|
String roomID;
|
||||||
|
String bedID;
|
||||||
|
dynamic nursingStationID;
|
||||||
|
dynamic description;
|
||||||
|
String nationalityName;
|
||||||
|
dynamic nationalityNameN;
|
||||||
|
String clinicDescription;
|
||||||
|
String clinicDescriptionN;
|
||||||
|
int referralDoctor;
|
||||||
|
int referringDoctor;
|
||||||
|
int referralClinic;
|
||||||
|
int referringClinic;
|
||||||
|
int referralStatus;
|
||||||
|
DateTime referralDate;
|
||||||
|
String referringDoctorRemarks;
|
||||||
|
String referredDoctorRemarks;
|
||||||
|
String referralResponseOn;
|
||||||
|
int priority;
|
||||||
|
int frequency;
|
||||||
|
String mAXResponseTime;
|
||||||
|
int episodeID;
|
||||||
|
int appointmentNo;
|
||||||
|
String appointmentDate;
|
||||||
|
int appointmentType;
|
||||||
|
int patientMRN;
|
||||||
|
String createdOn;
|
||||||
|
int clinicID;
|
||||||
|
String nationalityID;
|
||||||
|
String age;
|
||||||
|
String doctorImageURL;
|
||||||
|
String frequencyDescription;
|
||||||
|
String genderDescription;
|
||||||
|
bool isDoctorLate;
|
||||||
|
bool isDoctorResponse;
|
||||||
|
String nationalityFlagURL;
|
||||||
|
String nursingStationName;
|
||||||
|
String priorityDescription;
|
||||||
|
String referringClinicDescription;
|
||||||
|
String referringDoctorName;
|
||||||
|
|
||||||
|
MyReferralPatientModel(
|
||||||
|
{this.rowID,
|
||||||
|
this.projectID,
|
||||||
|
this.lineItemNo,
|
||||||
|
this.doctorID,
|
||||||
|
this.patientID,
|
||||||
|
this.doctorName,
|
||||||
|
this.doctorNameN,
|
||||||
|
this.firstName,
|
||||||
|
this.middleName,
|
||||||
|
this.lastName,
|
||||||
|
this.firstNameN,
|
||||||
|
this.middleNameN,
|
||||||
|
this.lastNameN,
|
||||||
|
this.gender,
|
||||||
|
this.dateofBirth,
|
||||||
|
this.mobileNumber,
|
||||||
|
this.emailAddress,
|
||||||
|
this.patientIdentificationNo,
|
||||||
|
this.patientType,
|
||||||
|
this.admissionNo,
|
||||||
|
this.admissionDate,
|
||||||
|
this.roomID,
|
||||||
|
this.bedID,
|
||||||
|
this.nursingStationID,
|
||||||
|
this.description,
|
||||||
|
this.nationalityName,
|
||||||
|
this.nationalityNameN,
|
||||||
|
this.clinicDescription,
|
||||||
|
this.clinicDescriptionN,
|
||||||
|
this.referralDoctor,
|
||||||
|
this.referringDoctor,
|
||||||
|
this.referralClinic,
|
||||||
|
this.referringClinic,
|
||||||
|
this.referralStatus,
|
||||||
|
this.referralDate,
|
||||||
|
this.referringDoctorRemarks,
|
||||||
|
this.referredDoctorRemarks,
|
||||||
|
this.referralResponseOn,
|
||||||
|
this.priority,
|
||||||
|
this.frequency,
|
||||||
|
this.mAXResponseTime,
|
||||||
|
this.episodeID,
|
||||||
|
this.appointmentNo,
|
||||||
|
this.appointmentDate,
|
||||||
|
this.appointmentType,
|
||||||
|
this.patientMRN,
|
||||||
|
this.createdOn,
|
||||||
|
this.clinicID,
|
||||||
|
this.nationalityID,
|
||||||
|
this.age,
|
||||||
|
this.doctorImageURL,
|
||||||
|
this.frequencyDescription,
|
||||||
|
this.genderDescription,
|
||||||
|
this.isDoctorLate,
|
||||||
|
this.isDoctorResponse,
|
||||||
|
this.nationalityFlagURL,
|
||||||
|
this.nursingStationName,
|
||||||
|
this.priorityDescription,
|
||||||
|
this.referringClinicDescription,
|
||||||
|
this.referringDoctorName});
|
||||||
|
|
||||||
|
MyReferralPatientModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
rowID = json['RowID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
lineItemNo = json['LineItemNo'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
doctorNameN = json['DoctorNameN'];
|
||||||
|
firstName = json['FirstName'];
|
||||||
|
middleName = json['MiddleName'];
|
||||||
|
lastName = json['LastName'];
|
||||||
|
firstNameN = json['FirstNameN'];
|
||||||
|
middleNameN = json['MiddleNameN'];
|
||||||
|
lastNameN = json['LastNameN'];
|
||||||
|
gender = json['Gender'];
|
||||||
|
dateofBirth = json['DateofBirth'];
|
||||||
|
mobileNumber = json['MobileNumber'];
|
||||||
|
emailAddress = json['EmailAddress'];
|
||||||
|
patientIdentificationNo = json['PatientIdentificationNo'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
admissionNo = json['AdmissionNo'];
|
||||||
|
admissionDate = json['AdmissionDate'];
|
||||||
|
roomID = json['RoomID'];
|
||||||
|
bedID = json['BedID'];
|
||||||
|
nursingStationID = json['NursingStationID'];
|
||||||
|
description = json['Description'];
|
||||||
|
nationalityName = json['NationalityName'];
|
||||||
|
nationalityNameN = json['NationalityNameN'];
|
||||||
|
clinicDescription = json['ClinicDescription'];
|
||||||
|
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||||
|
referralDoctor = json['ReferralDoctor'];
|
||||||
|
referringDoctor = json['ReferringDoctor'];
|
||||||
|
referralClinic = json['ReferralClinic'];
|
||||||
|
referringClinic = json['ReferringClinic'];
|
||||||
|
referralStatus = json['ReferralStatus'];
|
||||||
|
referralDate = DateUtils.convertStringToDate(json['ReferralDate']);
|
||||||
|
referringDoctorRemarks = json['ReferringDoctorRemarks'];
|
||||||
|
referredDoctorRemarks = json['ReferredDoctorRemarks'];
|
||||||
|
referralResponseOn = json['ReferralResponseOn'];
|
||||||
|
priority = json['Priority'];
|
||||||
|
frequency = json['Frequency'];
|
||||||
|
mAXResponseTime = json['MAXResponseTime'];
|
||||||
|
episodeID = json['EpisodeID'];
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
|
appointmentDate = json['AppointmentDate'];
|
||||||
|
appointmentType = json['AppointmentType'];
|
||||||
|
patientMRN = json['PatientMRN'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
nationalityID = json['NationalityID'];
|
||||||
|
age = json['Age'];
|
||||||
|
doctorImageURL = json['DoctorImageURL'];
|
||||||
|
frequencyDescription = json['FrequencyDescription'];
|
||||||
|
genderDescription = json['GenderDescription'];
|
||||||
|
isDoctorLate = json['IsDoctorLate'];
|
||||||
|
isDoctorResponse = json['IsDoctorResponse'];
|
||||||
|
nationalityFlagURL = json['NationalityFlagURL'];
|
||||||
|
nursingStationName = json['NursingStationName'];
|
||||||
|
priorityDescription = json['PriorityDescription'];
|
||||||
|
referringClinicDescription = json['ReferringClinicDescription'];
|
||||||
|
referringDoctorName = json['ReferringDoctorName'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['RowID'] = this.rowID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['LineItemNo'] = this.lineItemNo;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['DoctorName'] = this.doctorName;
|
||||||
|
data['DoctorNameN'] = this.doctorNameN;
|
||||||
|
data['FirstName'] = this.firstName;
|
||||||
|
data['MiddleName'] = this.middleName;
|
||||||
|
data['LastName'] = this.lastName;
|
||||||
|
data['FirstNameN'] = this.firstNameN;
|
||||||
|
data['MiddleNameN'] = this.middleNameN;
|
||||||
|
data['LastNameN'] = this.lastNameN;
|
||||||
|
data['Gender'] = this.gender;
|
||||||
|
data['DateofBirth'] = this.dateofBirth;
|
||||||
|
data['MobileNumber'] = this.mobileNumber;
|
||||||
|
data['EmailAddress'] = this.emailAddress;
|
||||||
|
data['PatientIdentificationNo'] = this.patientIdentificationNo;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['AdmissionNo'] = this.admissionNo;
|
||||||
|
data['AdmissionDate'] = this.admissionDate;
|
||||||
|
data['RoomID'] = this.roomID;
|
||||||
|
data['BedID'] = this.bedID;
|
||||||
|
data['NursingStationID'] = this.nursingStationID;
|
||||||
|
data['Description'] = this.description;
|
||||||
|
data['NationalityName'] = this.nationalityName;
|
||||||
|
data['NationalityNameN'] = this.nationalityNameN;
|
||||||
|
data['ClinicDescription'] = this.clinicDescription;
|
||||||
|
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||||
|
data['ReferralDoctor'] = this.referralDoctor;
|
||||||
|
data['ReferringDoctor'] = this.referringDoctor;
|
||||||
|
data['ReferralClinic'] = this.referralClinic;
|
||||||
|
data['ReferringClinic'] = this.referringClinic;
|
||||||
|
data['ReferralStatus'] = this.referralStatus;
|
||||||
|
data['ReferralDate'] = this.referralDate;
|
||||||
|
data['ReferringDoctorRemarks'] = this.referringDoctorRemarks;
|
||||||
|
data['ReferredDoctorRemarks'] = this.referredDoctorRemarks;
|
||||||
|
data['ReferralResponseOn'] = this.referralResponseOn;
|
||||||
|
data['Priority'] = this.priority;
|
||||||
|
data['Frequency'] = this.frequency;
|
||||||
|
data['MAXResponseTime'] = this.mAXResponseTime;
|
||||||
|
data['EpisodeID'] = this.episodeID;
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
data['AppointmentDate'] = this.appointmentDate;
|
||||||
|
data['AppointmentType'] = this.appointmentType;
|
||||||
|
data['PatientMRN'] = this.patientMRN;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['NationalityID'] = this.nationalityID;
|
||||||
|
data['Age'] = this.age;
|
||||||
|
data['DoctorImageURL'] = this.doctorImageURL;
|
||||||
|
data['FrequencyDescription'] = this.frequencyDescription;
|
||||||
|
data['GenderDescription'] = this.genderDescription;
|
||||||
|
data['IsDoctorLate'] = this.isDoctorLate;
|
||||||
|
data['IsDoctorResponse'] = this.isDoctorResponse;
|
||||||
|
data['NationalityFlagURL'] = this.nationalityFlagURL;
|
||||||
|
data['NursingStationName'] = this.nursingStationName;
|
||||||
|
data['PriorityDescription'] = this.priorityDescription;
|
||||||
|
data['ReferringClinicDescription'] = this.referringClinicDescription;
|
||||||
|
data['ReferringDoctorName'] = this.referringDoctorName;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
get patientName {
|
||||||
|
return this.firstName+" "+this.lastName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/MyReferralPatientModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
|
||||||
|
|
||||||
|
class MyReferralInPatientService extends BaseService {
|
||||||
|
List<MyReferralPatientModel> myReferralPatients = List();
|
||||||
|
|
||||||
|
Future getMyReferralPatientService() async {
|
||||||
|
hasError = false;
|
||||||
|
Map<String, dynamic> body = Map();
|
||||||
|
await getDoctorProfile();
|
||||||
|
body['DoctorID'] = doctorProfile.doctorID;
|
||||||
|
body['FirstName'] = "0";
|
||||||
|
body['MiddleName'] = "0";
|
||||||
|
body['LastName'] = "0";
|
||||||
|
body['PatientMobileNumber'] = "0";
|
||||||
|
body['PatientIdentificationID'] = "0";
|
||||||
|
body['PatientID'] = 0;
|
||||||
|
body['From'] = "0";
|
||||||
|
body['To'] = "0";
|
||||||
|
body['stamp'] = "2021-04-23T15:03:34.189Z";//DateTime.now().toIso8601String();
|
||||||
|
body['IsLoginForDoctorApp'] = true;
|
||||||
|
body['IPAdress'] = "11.11.11.11";
|
||||||
|
body['PatientOutSA'] = false;
|
||||||
|
body['PatientTypeID'] = 1;
|
||||||
|
myReferralPatients.clear();
|
||||||
|
await baseAppClient.post(
|
||||||
|
GET_MY_REFERRAL_INPATIENT,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
if (response['List_MyReferralPatient'] != null) {
|
||||||
|
response['List_MyReferralPatient'].forEach((v) {
|
||||||
|
myReferralPatients.add(MyReferralPatientModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
body: body,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
|
||||||
|
await getDoctorProfile();
|
||||||
|
|
||||||
|
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
|
||||||
|
|
||||||
|
_requestAddReferredDoctorRemarks.projectID = referral.projectID;
|
||||||
|
_requestAddReferredDoctorRemarks.admissionNo = referral.admissionNo.toString();
|
||||||
|
_requestAddReferredDoctorRemarks.lineItemNo = referral.lineItemNo;
|
||||||
|
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
|
||||||
|
_requestAddReferredDoctorRemarks.editedBy = doctorProfile.doctorID;
|
||||||
|
_requestAddReferredDoctorRemarks.patientID = referral.patientID;
|
||||||
|
_requestAddReferredDoctorRemarks.referringDoctor = referral.referringDoctor;
|
||||||
|
await baseAppClient.post(
|
||||||
|
ADD_REFERRED_DOCTOR_REMARKS,
|
||||||
|
body: _requestAddReferredDoctorRemarks.toJson(),
|
||||||
|
onSuccess: (dynamic body, int statusCode) {
|
||||||
|
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '../../../../routes.dart';
|
||||||
|
|
||||||
|
class MyReferralInPatientScreen extends StatelessWidget {
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<PatientReferralViewModel>(
|
||||||
|
onModelReady: (model) => model.getMyReferralPatientService(),
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: false,
|
||||||
|
appBarTitle: TranslationBase.of(context).referPatient,
|
||||||
|
body: model.myReferralPatients.isEmpty
|
||||||
|
? Center(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 100,
|
||||||
|
),
|
||||||
|
Image.asset('assets/images/no-data.png'),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).referralEmptyMsg,
|
||||||
|
color: Theme.of(context).errorColor,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 70),
|
||||||
|
// color: Colors.white,
|
||||||
|
// height: MediaQuery.of(context).size.height,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// SizedBox(height: 50),
|
||||||
|
...List.generate(
|
||||||
|
model.myReferralPatients.length,
|
||||||
|
(index) => InkWell(
|
||||||
|
onTap: () {
|
||||||
|
//TODO build the nwe page
|
||||||
|
|
||||||
|
},
|
||||||
|
child: PatientReferralItemWidget(
|
||||||
|
referralStatus: model.getReferralStatusNameByCode(model.myReferralPatients[index].referralStatus,context),
|
||||||
|
referralStatusCode: model.myReferralPatients[index].referralStatus,
|
||||||
|
patientName: model.myReferralPatients[index].patientName,
|
||||||
|
patientGender: model.myReferralPatients[index].gender,
|
||||||
|
referredDate: DateUtils.getDayMonthYearDateFormatted(model.myReferralPatients[index].referralDate),
|
||||||
|
referredTime: DateUtils.getTimeHHMMA(model.myReferralPatients[index].referralDate),
|
||||||
|
patientID: "${model.myReferralPatients[index].patientID}",
|
||||||
|
isSameBranch: false,
|
||||||
|
isReferral: true,
|
||||||
|
isReferralClinic: true,
|
||||||
|
referralClinic:"${model.myReferralPatients[index].referringClinicDescription}",
|
||||||
|
remark: model.myReferralPatients[index].referringDoctorRemarks,
|
||||||
|
nationality: model.myReferralPatients[index].nationalityName,
|
||||||
|
nationalityFlag: model.myReferralPatients[index].nationalityFlagURL,
|
||||||
|
doctorAvatar: model.myReferralPatients[index].doctorImageURL,
|
||||||
|
referralDoctorName: model.myReferralPatients[index].referringDoctorName,
|
||||||
|
clinicDescription: model.myReferralPatients[index].referringClinicDescription,
|
||||||
|
infoIcon: Icon(FontAwesomeIcons.arrowRight,
|
||||||
|
size: 25, color: Colors.black),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue