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

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

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

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

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

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

Loading…
Cancel
Save