referral -re design

merge-requests/556/head
mosazaid 5 years ago
parent 976da1e935
commit 9d00440789

@ -37,8 +37,8 @@ class VitalSignsViewModel extends BaseViewModel {
}
}
Future getPatientVitalSignHistory(
PatiantInformtion patient, String from, String to, bool isInPatient) async {
Future getPatientVitalSignHistory(PatiantInformtion patient, String from,
String to, bool isInPatient) async {
setState(ViewState.Busy);
if (from == null || from == "0") {
from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
@ -47,11 +47,11 @@ class VitalSignsViewModel extends BaseViewModel {
to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd');
}
// if(isInPatient){
if (isInPatient) {
await _vitalSignService.getInPatientVitalSignHistory(patient);
// }else {
// await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
// }
} else {
await _vitalSignService.getPatientVitalSignsHistory(patient, from, to);
}
if (_vitalSignService.hasError) {
error = _vitalSignService.error;

@ -62,6 +62,8 @@ class MyReferredPatientModel {
String nursingStationName;
String priorityDescription;
String referringClinicDescription;
String referralDoctorName;
String referralClinicDescription;
String referringDoctorName;
bool isReferralDoctorSameBranch;
@ -127,6 +129,8 @@ class MyReferredPatientModel {
this.referringClinicDescription,
this.referringDoctorName,
this.isReferralDoctorSameBranch,
this.referralDoctorName,
this.referralClinicDescription,
});
MyReferredPatientModel.fromJson(Map<String, dynamic> json) {
@ -190,6 +194,8 @@ class MyReferredPatientModel {
priorityDescription = json['PriorityDescription'];
referringClinicDescription = json['ReferringClinicDescription'];
referringDoctorName = json['ReferringDoctorName'];
referralDoctorName = json['ReferralDoctorName'];
referralClinicDescription = json['ReferralClinicDescription'];
}
Map<String, dynamic> toJson() {
@ -254,6 +260,8 @@ class MyReferredPatientModel {
data['PriorityDescription'] = this.priorityDescription;
data['ReferringClinicDescription'] = this.referringClinicDescription;
data['ReferringDoctorName'] = this.referringDoctorName;
data['ReferralDoctorName'] = this.referralDoctorName;
data['ReferralClinicDescription'] = this.referralClinicDescription;
return data;
}
}

@ -58,7 +58,7 @@ class PatientProfileScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
!isFromSearch && patientType == "1"
!isFromSearch && isInpatient/*patientType == "1"*/
? PatientProfileHeaderNewDesignInPatient(
patient, patientType, arrivalType)
: PatientProfileHeaderNewDesign(

@ -23,7 +23,7 @@ class ReferredPatientScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
Container(
height: 100,
),
Image.asset('assets/images/no-data.png'),
@ -37,22 +37,24 @@ class ReferredPatientScreen extends StatelessWidget {
],
),
)
: SingleChildScrollView(
: SingleChildScrollView(// DoctorApplication.svc/REST/GtMyReferredPatient
child: Container(
margin: EdgeInsets.only(top: 70),
child: Column(
children: [
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
// const Divider(
// color: Color(0xffCCCCCC),
// height: 1,
// thickness: 2,
// indent: 0,
// endIndent: 0,
// ),
...List.generate(
model.listMyReferredPatientModel.length,
(index) =>
PatientReferralItemWidget(
referralStatus: "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}",
referralStatusCode: model.getReferredPatientItem(index).referralStatus,
patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}",
patientGender: model.getReferredPatientItem(index).gender,
referredDate: DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy"),
@ -70,8 +72,8 @@ class ReferredPatientScreen extends StatelessWidget {
model.getReferredPatientItem(index).nationalityFlagURL,
doctorAvatar:
model.getReferredPatientItem(index).doctorImageURL,
referralDoctorName: "${model.getReferredPatientItem(index).referringDoctorName}(${model.getReferredPatientItem(index).referringClinicDescription})",
clinicDescription: null,
referralDoctorName: "Dr. ${model.getReferredPatientItem(index).referralDoctorName}",
clinicDescription: model.getReferredPatientItem(index).referralClinicDescription,
),
),
],

@ -12,6 +12,7 @@ import 'package:provider/provider.dart';
class PatientReferralItemWidget extends StatelessWidget {
final String referralStatus;
final int referralStatusCode;
final String patientName;
final int patientGender;
final String referredDate;
@ -29,6 +30,7 @@ class PatientReferralItemWidget extends StatelessWidget {
PatientReferralItemWidget(
{this.referralStatus,
this.referralStatusCode,
this.patientName,
this.patientGender,
this.referredDate,
@ -54,11 +56,11 @@ class PatientReferralItemWidget extends StatelessWidget {
children: [
Container(
child: CardWithBgWidget(
bgColor: referralStatus != null
? referralStatus == 'Pending'
? Color(0xffc4aa54)
: Colors.red[800]
: Colors.grey[500],
bgColor: referralStatusCode == 1
? Color(0xffc4aa54)
: referralStatusCode == 46
? Colors.green[700]
: Colors.red[700],
hasBorder: false,
widget: Container(
// padding: EdgeInsets.only(left: 20, right: 0, bottom: 0),
@ -74,13 +76,11 @@ class PatientReferralItemWidget extends StatelessWidget {
fontFamily: 'Poppins',
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700,
color: referralStatus != null
? referralStatus == 'Pending'
? Color(0xffc4aa54)
: referralStatus == 'Accepted'
? Colors.green[700]
: Colors.red[700]
: Colors.grey[500],
color: referralStatusCode == 1
? Color(0xffc4aa54)
: referralStatusCode == 46
? Colors.green[700]
: Colors.red[700],
),
AppText(
referredDate,
@ -222,6 +222,7 @@ class PatientReferralItemWidget extends StatelessWidget {
fontWeight: FontWeight.w700,
fontSize: 1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
maxLines: 1,
),
),
],
@ -246,18 +247,27 @@ class PatientReferralItemWidget extends StatelessWidget {
child: Container(
width: 40,
height: 40,
child: doctorAvatar !=null?ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
doctorAvatar,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
)):Container(),
child: doctorAvatar != null
? ClipRRect(
borderRadius: BorderRadius.circular(20.0),
child: Image.network(
doctorAvatar,
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace stackTrace) {
return Text('No Image');
},
))
: Container(
child: Image.asset(
patientGender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
),
),
),
),
Expanded(
@ -266,14 +276,23 @@ class PatientReferralItemWidget extends StatelessWidget {
margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
referralDoctorName,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontWeight: FontWeight.w800,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
color: Colors.black,
),
if (clinicDescription != null)
AppText(
clinicDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 1.4 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
],
),
),

@ -185,7 +185,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
fontSize: 1.2 * SizeConfig.textMultiplier,
),
AppText(
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.createdOn)).inDays + 1}",
"${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays}",
fontSize: 1.4 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w700),
],

Loading…
Cancel
Save