EReferral fixes
parent
abcb71e86e
commit
062ca5c11c
@ -1,60 +1,131 @@
|
||||
class SearchEReferralResponseModel {
|
||||
String patientMobileNumber;
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
Null sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
dynamic acceptedBrachCode;
|
||||
dynamic acceptedBranchName;
|
||||
dynamic acceptedBranchNameAr;
|
||||
dynamic channel;
|
||||
dynamic identityCardAttachment;
|
||||
String identityNumber;
|
||||
dynamic insuranceCardAttachment;
|
||||
bool isInsuredPatient;
|
||||
List<dynamic> medicalReportAttachment;
|
||||
String otherRelationship;
|
||||
String patientContactNo;
|
||||
int patientId;
|
||||
String patientName;
|
||||
int preferredBranchCode;
|
||||
String preferredBranchName;
|
||||
String referralDate;
|
||||
int referralNumber;
|
||||
String identificationNo;
|
||||
RelationshipType relationshipType;
|
||||
String requesterContactNo;
|
||||
String requesterName;
|
||||
String status;
|
||||
String statusAr;
|
||||
|
||||
SearchEReferralResponseModel(
|
||||
{this.patientMobileNumber,
|
||||
this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.referralNumber,
|
||||
this.identificationNo});
|
||||
{this.acceptedBrachCode,
|
||||
this.acceptedBranchName,
|
||||
this.acceptedBranchNameAr,
|
||||
this.channel,
|
||||
this.identityCardAttachment,
|
||||
this.identityNumber,
|
||||
this.insuranceCardAttachment,
|
||||
this.isInsuredPatient,
|
||||
this.medicalReportAttachment,
|
||||
this.otherRelationship,
|
||||
this.patientContactNo,
|
||||
this.patientId,
|
||||
this.patientName,
|
||||
this.preferredBranchCode,
|
||||
this.preferredBranchName,
|
||||
this.referralDate,
|
||||
this.referralNumber,
|
||||
this.relationshipType,
|
||||
this.requesterContactNo,
|
||||
this.requesterName,
|
||||
this.status,
|
||||
this.statusAr});
|
||||
|
||||
SearchEReferralResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
patientMobileNumber = json['PatientMobileNumber'];
|
||||
versionID = json['VersionID'];
|
||||
acceptedBrachCode = json['AcceptedBrachCode'];
|
||||
acceptedBranchName = json['AcceptedBranchName'];
|
||||
acceptedBranchNameAr = json['AcceptedBranchNameAr'];
|
||||
channel = json['Channel'];
|
||||
languageID = json['LanguageID'];
|
||||
iPAdress = json['IPAdress'];
|
||||
generalid = json['generalid'];
|
||||
patientOutSA = json['PatientOutSA'];
|
||||
sessionID = json['SessionID'];
|
||||
isDentalAllowedBackend = json['isDentalAllowedBackend'];
|
||||
deviceTypeID = json['DeviceTypeID'];
|
||||
identityCardAttachment = json['IdentityCardAttachment'];
|
||||
identityNumber = json['IdentityNumber'];
|
||||
insuranceCardAttachment = json['InsuranceCardAttachment'];
|
||||
isInsuredPatient = json['IsInsuredPatient'];
|
||||
otherRelationship = json['OtherRelationship'];
|
||||
patientContactNo = json['PatientContactNo'];
|
||||
patientId = json['PatientId'];
|
||||
patientName = json['PatientName'];
|
||||
preferredBranchCode = json['PreferredBranchCode'];
|
||||
preferredBranchName = json['PreferredBranchName'];
|
||||
referralDate = json['ReferralDate'];
|
||||
referralNumber = json['ReferralNumber'];
|
||||
identificationNo = json['IdentificationNo'];
|
||||
relationshipType = json['RelationshipType'] != null
|
||||
? new RelationshipType.fromJson(json['RelationshipType'])
|
||||
: null;
|
||||
requesterContactNo = json['RequesterContactNo'];
|
||||
requesterName = json['RequesterName'];
|
||||
status = json['Status'];
|
||||
statusAr = json['StatusAr'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['PatientMobileNumber'] = this.patientMobileNumber;
|
||||
data['VersionID'] = this.versionID;
|
||||
data['AcceptedBrachCode'] = this.acceptedBrachCode;
|
||||
data['AcceptedBranchName'] = this.acceptedBranchName;
|
||||
data['AcceptedBranchNameAr'] = this.acceptedBranchNameAr;
|
||||
data['Channel'] = this.channel;
|
||||
data['LanguageID'] = this.languageID;
|
||||
data['IPAdress'] = this.iPAdress;
|
||||
data['generalid'] = this.generalid;
|
||||
data['PatientOutSA'] = this.patientOutSA;
|
||||
data['SessionID'] = this.sessionID;
|
||||
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
|
||||
data['DeviceTypeID'] = this.deviceTypeID;
|
||||
data['IdentityCardAttachment'] = this.identityCardAttachment;
|
||||
data['IdentityNumber'] = this.identityNumber;
|
||||
data['InsuranceCardAttachment'] = this.insuranceCardAttachment;
|
||||
data['IsInsuredPatient'] = this.isInsuredPatient;
|
||||
if (this.medicalReportAttachment != null) {
|
||||
data['MedicalReportAttachment'] =
|
||||
this.medicalReportAttachment.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['OtherRelationship'] = this.otherRelationship;
|
||||
data['PatientContactNo'] = this.patientContactNo;
|
||||
data['PatientId'] = this.patientId;
|
||||
data['PatientName'] = this.patientName;
|
||||
data['PreferredBranchCode'] = this.preferredBranchCode;
|
||||
data['PreferredBranchName'] = this.preferredBranchName;
|
||||
data['ReferralDate'] = this.referralDate;
|
||||
data['ReferralNumber'] = this.referralNumber;
|
||||
data['IdentificationNo'] = this.identificationNo;
|
||||
if (this.relationshipType != dynamic) {
|
||||
data['RelationshipType'] = this.relationshipType.toJson();
|
||||
}
|
||||
data['RequesterContactNo'] = this.requesterContactNo;
|
||||
data['RequesterName'] = this.requesterName;
|
||||
data['Status'] = this.status;
|
||||
data['StatusAr'] = this.statusAr;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class RelationshipType {
|
||||
int iD;
|
||||
String text;
|
||||
String textAr;
|
||||
String textEn;
|
||||
|
||||
RelationshipType({this.iD, this.text, this.textAr, this.textEn});
|
||||
|
||||
RelationshipType.fromJson(Map<String, dynamic> json) {
|
||||
iD = json['ID'];
|
||||
text = json['Text'];
|
||||
textAr = json['Text_Ar'];
|
||||
textEn = json['Text_En'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['ID'] = this.iD;
|
||||
data['Text'] = this.text;
|
||||
data['Text_Ar'] = this.textAr;
|
||||
data['Text_En'] = this.textEn;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,164 @@
|
||||
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ReferralDetails extends StatefulWidget {
|
||||
final SearchEReferralResponseModel referral;
|
||||
|
||||
const ReferralDetails({Key key, @required this.referral}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ReferralDetailsState createState() => _ReferralDetailsState();
|
||||
}
|
||||
|
||||
class _ReferralDetailsState extends State<ReferralDetails> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
isShowAppBar: true,
|
||||
showNewAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
appBarTitle: TranslationBase.of(context).ereferral,
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
elevation: 3.0,
|
||||
shape: cardRadius(12),
|
||||
margin:
|
||||
EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 10.0),
|
||||
child: Text(
|
||||
TranslationBase.of(context).referralDetails,
|
||||
style: TextStyle(
|
||||
letterSpacing: -0.64,
|
||||
color: Colors.black,
|
||||
fontSize: 18.0,
|
||||
fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(top: 10, bottom: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
TranslationBase.of(context).referralStatus),
|
||||
),
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
projectViewModel.isArabic
|
||||
? widget.referral.statusAr
|
||||
: widget.referral.status,
|
||||
isBold: true),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
mDivider(Colors.grey[600]),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(top: 10, bottom: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
TranslationBase.of(context).patientName),
|
||||
),
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
widget.referral.patientName,
|
||||
isBold: true),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
mDivider(Colors.grey[600]),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(top: 10, bottom: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
TranslationBase.of(context).referralNumber),
|
||||
),
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
widget.referral.referralNumber.toString(),
|
||||
isBold: true),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
mDivider(Colors.grey[600]),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(top: 10, bottom: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
TranslationBase.of(context).referralDate),
|
||||
),
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
DateUtil.getMonthDayYearDateFormatted(
|
||||
DateUtil.convertStringToDateNoTimeZone(
|
||||
widget.referral.referralDate)),
|
||||
isBold: true),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
mDivider(Colors.grey[600]),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(top: 10, bottom: 5),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
TranslationBase.of(context).hospital),
|
||||
),
|
||||
Expanded(
|
||||
child: _getNormalText(
|
||||
widget.referral.preferredBranchName,
|
||||
isBold: true),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
_getNormalText(text, {bool isBold = false}) {
|
||||
return Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: isBold ? 14 : 12,
|
||||
letterSpacing: -0.5,
|
||||
color: isBold ? Colors.black : Colors.grey[700],
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue