fix referral patient services

merge-requests/726/head
Elham Rababah 5 years ago
parent 663c8d1104
commit 72966c3269

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
@ -56,7 +56,7 @@ const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddRefe
const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient';
const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient'; const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient';
const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals';
@ -181,7 +181,7 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient";
const GET_MY_REFERRAL_OUTPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferredOutPatient"; const GET_MY_REFERRAL_OUTPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient";
const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient";
const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient";

@ -158,8 +158,8 @@ class MyReferralPatientModel {
referringDoctor = json['ReferringDoctor']; referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic']; referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic']; referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus']; referralStatus = json["ReferralStatus"] is String ?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0: json["ReferralStatus"];
referralDate = AppDateUtils.convertStringToDate(json['ReferralDate']); referralDate = AppDateUtils.getDateTimeFromString(json['ReferralDate']);
referringDoctorRemarks = json['ReferringDoctorRemarks']; referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn']; referralResponseOn = json['ReferralResponseOn'];

@ -0,0 +1,104 @@
class MyReferralPatientRequestModel {
int channel;
int clinicID;
int doctorID;
int editedBy;
String firstName;
String from;
String iPAdress;
bool isLoginForDoctorApp;
int languageID;
String lastName;
String middleName;
int patientID;
String patientIdentificationID;
String patientMobileNumber;
bool patientOutSA;
int patientTypeID;
int projectID;
String sessionID;
String stamp;
String to;
String tokenID;
double versionID;
String vidaAuthTokenID;
MyReferralPatientRequestModel(
{this.channel,
this.clinicID,
this.doctorID,
this.editedBy,
this.firstName,
this.from,
this.iPAdress,
this.isLoginForDoctorApp,
this.languageID,
this.lastName,
this.middleName,
this.patientID,
this.patientIdentificationID,
this.patientMobileNumber,
this.patientOutSA,
this.patientTypeID,
this.projectID,
this.sessionID,
this.stamp,
this.to,
this.tokenID,
this.versionID,
this.vidaAuthTokenID});
MyReferralPatientRequestModel.fromJson(Map<String, dynamic> json) {
channel = json['Channel'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
firstName = json['FirstName'];
from = json['From'];
iPAdress = json['IPAdress'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
languageID = json['LanguageID'];
lastName = json['LastName'];
middleName = json['MiddleName'];
patientID = json['PatientID'];
patientIdentificationID = json['PatientIdentificationID'];
patientMobileNumber = json['PatientMobileNumber'];
patientOutSA = json['PatientOutSA'];
patientTypeID = json['PatientTypeID'];
projectID = json['ProjectID'];
sessionID = json['SessionID'];
stamp = json['stamp'];
to = json['To'];
tokenID = json['TokenID'];
versionID = json['VersionID'];
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Channel'] = this.channel;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
data['FirstName'] = this.firstName;
data['From'] = this.from;
data['IPAdress'] = this.iPAdress;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['LanguageID'] = this.languageID;
data['LastName'] = this.lastName;
data['MiddleName'] = this.middleName;
data['PatientID'] = this.patientID;
data['PatientIdentificationID'] = this.patientIdentificationID;
data['PatientMobileNumber'] = this.patientMobileNumber;
data['PatientOutSA'] = this.patientOutSA;
data['PatientTypeID'] = this.patientTypeID;
data['ProjectID'] = this.projectID;
data['SessionID'] = this.sessionID;
data['stamp'] = this.stamp;
data['To'] = this.to;
data['TokenID'] = this.tokenID;
data['VersionID'] = this.versionID;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.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'; import 'package:doctor_app_flutter/models/doctor/request_add_referred_doctor_remarks.dart';
@ -8,22 +9,22 @@ class MyReferralInPatientService extends BaseService {
Future getMyReferralPatientService() async { Future getMyReferralPatientService() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map();
await getDoctorProfile(); await getDoctorProfile();
body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0"; MyReferralPatientRequestModel myReferralPatientRequestModel =
body['MiddleName'] = "0"; MyReferralPatientRequestModel(
body['LastName'] = "0"; doctorID: doctorProfile.doctorID,
body['PatientMobileNumber'] = "0"; firstName: "0",
body['PatientIdentificationID'] = "0"; middleName: "0",
body['PatientID'] = 0; lastName: "0",
body['From'] = "0"; patientMobileNumber: "0",
body['To'] = "0"; patientIdentificationID: "0",
body['stamp'] = DateTime.now().toIso8601String(); patientID: 0,
body['IsLoginForDoctorApp'] = true; from: "0",
body['IPAdress'] = "11.11.11.11"; to: "0",
body['PatientOutSA'] = false; stamp: DateTime.now().toIso8601String(),
body['PatientTypeID'] = 1; isLoginForDoctorApp: true,
patientTypeID: 1);
myReferralPatients.clear(); myReferralPatients.clear();
await baseAppClient.post( await baseAppClient.post(
GET_MY_REFERRAL_INPATIENT, GET_MY_REFERRAL_INPATIENT,
@ -38,34 +39,34 @@ class MyReferralInPatientService extends BaseService {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },
body: body, body: myReferralPatientRequestModel.toJson(),
); );
} }
Future getMyReferralOutPatientService() async { Future getMyReferralOutPatientService() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map();
await getDoctorProfile(); await getDoctorProfile();
body['DoctorID'] = doctorProfile.doctorID;
body['FirstName'] = "0"; MyReferralPatientRequestModel myReferralPatientRequestModel =
body['MiddleName'] = "0"; MyReferralPatientRequestModel(
body['LastName'] = "0"; doctorID: doctorProfile.doctorID,
body['PatientMobileNumber'] = "0"; firstName: "0",
body['PatientIdentificationID'] = "0"; middleName: "0",
body['PatientID'] = 0; lastName: "0",
body['From'] = "0"; patientMobileNumber: "0",
body['To'] = "0"; patientIdentificationID: "0",
body['stamp'] = DateTime.now().toIso8601String(); patientID: 0,
body['IsLoginForDoctorApp'] = true; from: "0",
body['IPAdress'] = "11.11.11.11"; to: "0",
body['PatientOutSA'] = false; stamp: DateTime.now().toIso8601String(),
body['PatientTypeID'] = 1; isLoginForDoctorApp: true,
patientTypeID: 1);
myReferralPatients.clear(); myReferralPatients.clear();
await baseAppClient.post( await baseAppClient.post(
GET_MY_REFERRAL_OUTPATIENT, GET_MY_REFERRAL_OUTPATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
if (response['List_MyReferredOutPatient'] != null) { if (response['List_MyOutPatientReferral'] != null) {
response['List_MyReferredOutPatient'].forEach((v) { response['List_MyOutPatientReferral'].forEach((v) {
myReferralPatients.add(MyReferralPatientModel.fromJson(v)); myReferralPatients.add(MyReferralPatientModel.fromJson(v));
}); });
} }
@ -74,7 +75,7 @@ class MyReferralInPatientService extends BaseService {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },
body: body, body: myReferralPatientRequestModel.toJson(),
); );
} }

@ -161,7 +161,6 @@ class PatientReferralService extends LookupService {
hasError = false; hasError = false;
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel _requestMyReferralPatient =
RequestMyReferralPatientModel(); RequestMyReferralPatientModel();
// _requestMyReferralPatient.doctorID = 1002;
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
await baseAppClient.post( await baseAppClient.post(
@ -169,7 +168,7 @@ class PatientReferralService extends LookupService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
listMyReferredPatientModel.clear(); listMyReferredPatientModel.clear();
response['List_MyOutPatientReferral'].forEach((v) { response['List_MyReferredOutPatient'].forEach((v) {
MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); MyReferredPatientModel item = MyReferredPatientModel.fromJson(v);
if (doctorProfile != null) { if (doctorProfile != null) {
item.isReferralDoctorSameBranch = item.isReferralDoctorSameBranch =

@ -174,22 +174,22 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMyReferralPatientService() async { Future getMyReferralPatientService({bool localBusy = false}) async {
setState(ViewState.Busy); if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy);
await _myReferralService.getMyReferralPatientService(); await _myReferralService.getMyReferralPatientService();
if (_myReferralService.hasError) { if (_myReferralService.hasError) {
error = _myReferralService.error; error = _myReferralService.error;
setState(ViewState.Error); if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getMyReferralOutPatientService() async { Future getMyReferralOutPatientService({bool localBusy = false}) async {
setState(ViewState.Busy); if(localBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy);
await _myReferralService.getMyReferralOutPatientService(); await _myReferralService.getMyReferralOutPatientService();
if (_myReferralService.hasError) { if (_myReferralService.hasError) {
error = _myReferralService.error; error = _myReferralService.error;
setState(ViewState.Error); if(localBusy) setState(ViewState.ErrorLocal); else setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -166,7 +166,7 @@ class MyReferredPatientModel {
referringDoctor = json['ReferringDoctor']; referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic']; referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic']; referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus']; referralStatus = json["ReferralStatus"] is String?json['ReferralStatus']== "Accepted"?46:json['ReferralStatus']=="Pending"?1:0 : json['ReferralStatus'];// TODO Elham json['ReferralStatus'];
referralDate = json['ReferralDate']; referralDate = json['ReferralDate'];
referringDoctorRemarks = json['ReferringDoctorRemarks']; referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks']; referredDoctorRemarks = json['ReferredDoctorRemarks'];

@ -1,16 +1,21 @@
import 'package:doctor_app_flutter/core/enum/PatientType.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/referral_patient_detail_in-paint.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart';
import 'package:doctor_app_flutter/util/date-utils.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/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class MyReferralInPatientScreen extends StatelessWidget { class MyReferralInPatientScreen extends StatelessWidget {
PatientType patientType = PatientType.IN_PATIENT;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -20,7 +25,25 @@ class MyReferralInPatientScreen extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
body: model.myReferralPatients.isEmpty body: Column(
children: [
Container(
margin: EdgeInsets.only(top: 70),
child: PatientTypeRadioWidget(
(patientType) async {
this.patientType = patientType;
GifLoaderDialogUtils.showMyDialog(context);
if (patientType == PatientType.IN_PATIENT) {
await model.getMyReferralPatientService(localBusy: true);
} else {
await model.getMyReferralOutPatientService(localBusy: true);
}
GifLoaderDialogUtils.hideDialog(context);
},
),
),
model.myReferralPatients.isEmpty
? Center( ? Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -84,6 +107,8 @@ class MyReferralInPatientScreen extends StatelessWidget {
), ),
), ),
), ),
],
),
), ),
); );
} }

@ -237,6 +237,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if(referredPatient.frequency != null)
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
@ -256,7 +257,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient referredPatient
.frequencyDescription, .frequencyDescription??'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 1.8 * fontSize: 1.8 *
@ -303,6 +304,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
) )
], ],
), ),
if(referredPatient.priorityDescription != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -317,7 +319,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
referredPatient.priorityDescription, referredPatient.priorityDescription??'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize:
@ -327,6 +329,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if(referredPatient.mAXResponseTime != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -342,9 +345,9 @@ class ReferralPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime != null? AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime, referredPatient.mAXResponseTime,
"dd MMM,yyyy"), "dd MMM,yyyy"):'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize:
@ -469,7 +472,7 @@ class ReferralPatientDetailScreen extends StatelessWidget {
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
referredPatient.referringDoctorRemarks, referredPatient.referringDoctorRemarks??'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.8 * SizeConfig.textMultiplier, fontSize: 1.8 * SizeConfig.textMultiplier,

@ -236,6 +236,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if(referredPatient
.frequencyDescription != null)
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.start, MainAxisAlignment.start,
@ -301,6 +303,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
) )
], ],
), ),
if(referredPatient.priorityDescription != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -322,6 +325,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if(referredPatient.mAXResponseTime != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -337,9 +341,9 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
Expanded( Expanded(
child: AppText( child: AppText(
AppDateUtils.convertDateFromServerFormat( referredPatient.mAXResponseTime != null?AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime, referredPatient.mAXResponseTime,
"dd MMM,yyyy"), "dd MMM,yyyy"):'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize:
@ -515,6 +519,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
AppText( AppText(
referredPatient referredPatient
.referredDoctorRemarks == null ?'':referredPatient
.referredDoctorRemarks.isNotEmpty .referredDoctorRemarks.isNotEmpty
? referredPatient.referredDoctorRemarks ? referredPatient.referredDoctorRemarks
: TranslationBase.of(context).notRepliedYet, : TranslationBase.of(context).notRepliedYet,
@ -543,7 +548,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontSize: 1.8, fontSize: 1.8,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
disabled: referredPatient.referredDoctorRemarks.isNotEmpty disabled: referredPatient.referredDoctorRemarks == null? true: referredPatient.referredDoctorRemarks.isNotEmpty
? false ? false
: true, : true,
onPressed: () async { onPressed: () async {

@ -371,4 +371,22 @@ class AppDateUtils {
else else
return ""; return "";
} }
// handel date like "09/05/2021 17:00"
static DateTime getDateTimeFromString(String str) {
List<String> array = str.split('/');
int day = int.parse(array[0]);
int month = int.parse(array[1]);
List<String> array2 = array[2].split(' ');
int year = int.parse(array2[0]);
String hour = array2[1];
List<String> hourList = hour.split(":");
DateTime date = DateTime(year, month, day, int.parse(hourList[0]), int.parse(hourList[1]));
return date;
}
} }

Loading…
Cancel
Save