Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into episode_inpatient_changes

 Conflicts:
	lib/screens/patients/In_patient/in_patient_list_page.dart
merge-requests/829/head
Elham Rababh 4 years ago
commit cdc3b36174

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -30,6 +30,11 @@ class GetMedicationForInPatientModel {
dynamic strength;
String pHRItemDescription;
String pHRItemDescriptionN;
String doctorName;
String uomDescription;
String routeDescription;
String directionDescription;
String refillDescription;
GetMedicationForInPatientModel(
{this.setupID,
@ -62,11 +67,22 @@ class GetMedicationForInPatientModel {
this.editedOn,
this.strength,
this.pHRItemDescription,
this.pHRItemDescriptionN});
this.pHRItemDescriptionN,
this.doctorName,
this.uomDescription,
this.routeDescription,
this.directionDescription,
this.refillDescription});
GetMedicationForInPatientModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
doctorName = json['DoctorName'];
refillDescription = json['RefillDescription'];
directionDescription = json['DirectionDescription'];
routeDescription = json['RouteDescription'];
uomDescription = json['UOMDescription'];
admissionNo = json['AdmissionNo'];
patientID = json['PatientID'];
orderNo = json['OrderNo'];
@ -101,6 +117,11 @@ class GetMedicationForInPatientModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['DoctorName'] = this.doctorName;
data['RefillDescription'] = this.refillDescription;
data['RouteDescription'] = this.routeDescription;
data['DirectionDescription'] = this.directionDescription;
data['UOMDescription'] = this.uomDescription;
data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo;
data['PatientID'] = this.patientID;

@ -1,18 +1,22 @@
class GetOrderedProcedureRequestModel {
String vidaAuthTokenID;
int patientMRN;
int appointmentNo;
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN});
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN, this.appointmentNo});
GetOrderedProcedureRequestModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appointmentNo;
return data;
}
}

@ -28,16 +28,12 @@ class ProcedureService extends BaseService {
List<ProcedureTempleteDetailsModel> templateList = List();
List<ProcedureTempleteDetailsModel> _templateDetailsList = List();
List<ProcedureTempleteDetailsModel> get templateDetailsList =>
_templateDetailsList;
List<ProcedureTempleteDetailsModel> get templateDetailsList => _templateDetailsList;
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel =
GetOrderedProcedureRequestModel();
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel();
ProcedureTempleteRequestModel _procedureTempleteRequestModel =
ProcedureTempleteRequestModel();
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel();
ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel();
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
// clinicId: 17,
@ -63,8 +59,7 @@ class ProcedureService extends BaseService {
//search: ["DENTAL"],
);
Future getProcedureTemplate(
{int doctorId, int projectId, int clinicId, String categoryID}) async {
Future getProcedureTemplate({int doctorId, int projectId, int clinicId, String categoryID}) async {
_procedureTempleteRequestModel = ProcedureTempleteRequestModel(
// tokenID: "@dm!n",
patientID: 0,
@ -72,19 +67,18 @@ class ProcedureService extends BaseService {
);
hasError = false;
await baseAppClient.post(GET_TEMPLETE_LIST/*GET_PROCEDURE_TEMPLETE*/,
await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/,
onSuccess: (dynamic response, int statusCode) {
templateList.clear();
templateList.clear();
response['DAPP_TemplateGetList'].forEach((template) {
ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template);
if(categoryID != null){
if(categoryID == templateElement.categoryID){
if (categoryID != null) {
if (categoryID == templateElement.categoryID) {
templateList.add(templateElement);
}
} else {
templateList.add(templateElement);
}
});
// response['HIS_ProcedureTemplateList'].forEach((template) {
// _templateList.add(ProcedureTempleteModel.fromJson(template));
@ -95,21 +89,17 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteRequestModel.toJson());
}
Future getProcedureTemplateDetails(
{int doctorId, int projectId, int clinicId, int templateId}) async {
Future getProcedureTemplateDetails({int doctorId, int projectId, int clinicId, int templateId}) async {
_procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel(
templateID: templateId, searchType: 1, patientID: 0);
ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0);
hasError = false;
//insuranceApprovalInPatient.clear();
_templateDetailsList.clear();
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, onSuccess: (dynamic response, int statusCode) {
//prescriptionsList.clear();
response['HIS_ProcedureTemplateDetailsList'].forEach((template) {
_templateDetailsList
.add(ProcedureTempleteDetailsModel.fromJson(template));
_templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -117,15 +107,14 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteDetailsRequestModel.toJson());
}
Future getProcedure({int mrn}) async {
_getOrderedProcedureRequestModel =
GetOrderedProcedureRequestModel(patientMRN: mrn);
Future getProcedure({int mrn, int appointmentNo}) async {
_getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(
patientMRN: mrn,
);
hasError = false;
_procedureList.clear();
await baseAppClient.post(GET_PROCEDURE_LIST,
onSuccess: (dynamic response, int statusCode) {
_procedureList.add(
GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
_procedureList.add(GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -135,8 +124,7 @@ class ProcedureService extends BaseService {
Future getCategory() async {
hasError = false;
await baseAppClient.post(GET_LIST_CATEGORISE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_LIST_CATEGORISE, onSuccess: (dynamic response, int statusCode) {
categoryList = [];
categoryList = response['listProcedureCategories']['entityList'];
}, onFailure: (String error, int statusCode) {
@ -145,7 +133,7 @@ class ProcedureService extends BaseService {
}, body: Map());
}
Future getProcedureCategory({String categoryName, String categoryID,patientId}) async {
Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel(
search: ["$categoryName"],
patientMRN: patientId,
@ -156,10 +144,8 @@ class ProcedureService extends BaseService {
);
hasError = false;
_categoriesList.clear();
await baseAppClient.post(GET_CATEGORISE_PROCEDURE,
onSuccess: (dynamic response, int statusCode) {
_categoriesList
.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
await baseAppClient.post(GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
_categoriesList.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -169,8 +155,7 @@ class ProcedureService extends BaseService {
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false;
_procedureList.clear();
await baseAppClient.post(POST_PROCEDURE_LIST,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -178,12 +163,10 @@ class ProcedureService extends BaseService {
}, body: postProcedureReqModel.toJson());
}
Future updateProcedure(
UpdateProcedureRequestModel updateProcedureRequestModel) async {
Future updateProcedure(UpdateProcedureRequestModel updateProcedureRequestModel) async {
hasError = false;
_procedureList.clear();
await baseAppClient.post(UPDATE_PROCEDURE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(UPDATE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
print("ACCEPTED");
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -191,14 +174,11 @@ class ProcedureService extends BaseService {
}, body: updateProcedureRequestModel.toJson());
}
Future valadteProcedure(
ProcedureValadteRequestModel procedureValadteRequestModel) async {
Future valadteProcedure(ProcedureValadteRequestModel procedureValadteRequestModel) async {
hasError = false;
_valadteProcedureList.clear();
await baseAppClient.post(GET_PROCEDURE_VALIDATION,
onSuccess: (dynamic response, int statusCode) {
_valadteProcedureList.add(
ProcedureValadteModel.fromJson(response['ValidateProcedureList']));
await baseAppClient.post(GET_PROCEDURE_VALIDATION, onSuccess: (dynamic response, int statusCode) {
_valadteProcedureList.add(ProcedureValadteModel.fromJson(response['ValidateProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -23,8 +23,7 @@ import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'
as cpe;
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it
@ -61,13 +60,13 @@ class ProcedureViewModel extends BaseViewModel {
List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
Future getProcedure({int mrn, String patientType}) async {
Future getProcedure({int mrn, String patientType, int appointmentNo}) async {
hasError = false;
await getDoctorProfile();
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn);
await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo);
if (_procedureService.hasError) {
error = _procedureService.error;
if (patientType == "7")
@ -78,15 +77,12 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProcedureCategory(
{String categoryName, String categoryID, patientId}) async {
Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
if (categoryName == null) return;
hasError = false;
setState(ViewState.Busy);
await _procedureService.getProcedureCategory(
categoryName: categoryName,
categoryID: categoryID,
patientId: patientId);
categoryName: categoryName, categoryID: categoryID, patientId: patientId);
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
@ -321,8 +317,7 @@ class ProcedureViewModel extends BaseViewModel {
List<cpe.EntityList> entityList,
ProcedureType procedureType}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
@ -337,21 +332,13 @@ class ProcedureViewModel extends BaseViewModel {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(
code: "ordertype",
controlValue: procedureType == ProcedureType.PROCEDURE
? element.type ?? "1"
: "0"),
Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
controlsProcedure
.add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
@ -371,8 +358,7 @@ class ProcedureViewModel extends BaseViewModel {
Helpers.showErrorToast(error);
getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) {
Helpers.showErrorToast(
valadteProcedureList[0].entityList[0].warringMessages);
Helpers.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {

@ -30,13 +30,21 @@ class _InPatientListPageState extends State<InPatientListPage> {
bool hasQuery = false;
bool showBottomSheet = false;
String selectedClinicName;
ScrollController _scrollController;
@override
void dispose() {
_searchController.dispose();
_scrollController.dispose();
super.dispose();
}
@override
void initState() {
_scrollController = new ScrollController();
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(

@ -91,7 +91,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).direction,
color: Colors.grey,
),
Expanded(child: AppText(" " + prescriptions.directionID.toString() ?? '')),
Expanded(
child: AppText(" " + prescriptions.directionDescription.toString() ?? '')),
],
),
Row(
@ -100,7 +101,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).route,
color: Colors.grey,
),
AppText(" " + prescriptions.routeId.toString() ?? ''),
AppText(" " + prescriptions.routeDescription.toString() ?? ''),
],
),
Row(
@ -109,7 +110,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).refill,
color: Colors.grey,
),
Expanded(child: AppText(" " + prescriptions.refillID.toString() ?? '')),
Expanded(child: AppText(" " + prescriptions.refillDescription.toString() ?? '')),
],
),
Row(
@ -150,7 +151,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
'UOM',
color: Colors.grey,
),
AppText(" " + prescriptions.unitofMeasurement.toString() ?? ''),
AppText(" " + prescriptions.uomDescription.toString() ?? ''),
],
),
Row(
@ -177,18 +178,18 @@ class PrescriptionItemsInPatientPage extends StatelessWidget {
TranslationBase.of(context).processed,
color: Colors.grey,
),
// AppText(" " + prescriptions.editedBy.toString() ?? ''),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).dailyDoses,
color: Colors.grey,
),
AppText(" " + prescriptions.dose.toString() ?? ''),
AppText(" " + prescriptions.doctorName.toString() ?? ''),
],
),
// Row(
// children: [
// AppText(
// TranslationBase.of(context).num,
// color: Colors.grey,
// ),
// AppText(" " + prescriptions.dose.toString() ?? ''),
// ],
// ),
SizedBox(
height: 12,
),

@ -196,7 +196,7 @@ class PrescriptionsPage extends StatelessWidget {
appointmentDate: AppDateUtils.getDateTimeFromServerFormat(
model.medicationForInPatient[index].prescriptionDatetime,
),
createdBy: model.medicationForInPatient[index].createdBy.toString(),
createdBy: model.medicationForInPatient[index].doctorName.toString(),
));
}),
if (model.medicationForInPatient.length == 0)

@ -35,12 +35,9 @@ class ProcedureScreen extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure(
mrn: patient.patientId,
patientType: patientType,
),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
onModelReady: (model) =>
model.getProcedure(mrn: patient.patientId, patientType: patientType, appointmentNo: patient.appointmentNo),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model,
@ -56,8 +53,7 @@ class ProcedureScreen extends StatelessWidget {
SizedBox(
height: 12,
),
if (model.procedureList.length == 0 &&
patient.patientStatusType != 43)
if (model.procedureList.length == 0 && patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@ -77,8 +73,7 @@ class ProcedureScreen extends StatelessWidget {
],
),
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
if (patient.patientStatusType != null && patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@ -98,20 +93,19 @@ class ProcedureScreen extends StatelessWidget {
],
),
),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
model: model,
procedureType: ProcedureType.PROCEDURE,
), settings: RouteSettings(name: 'AddProcedureTabPage')
),
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
model: model,
procedureType: ProcedureType.PROCEDURE,
),
settings: RouteSettings(name: 'AddProcedureTabPage')),
);
},
child: Container(
@ -159,32 +153,21 @@ class ProcedureScreen extends StatelessWidget {
...List.generate(
model.procedureList[0].rowcount,
(index) => ProcedureCard(
categoryID:
model.procedureList[0].entityList[index].categoryID,
categoryID: model.procedureList[0].entityList[index].categoryID,
entityList: model.procedureList[0].entityList[index],
onTap: () {
if (model.procedureList[0].entityList[index].categoryID ==
2 ||
if (model.procedureList[0].entityList[index].categoryID == 2 ||
model.procedureList[0].entityList[index].categoryID == 4)
updateProcedureForm(context,
model: model,
patient: patient,
remarks: model
.procedureList[0].entityList[index].remarks,
orderType: model
.procedureList[0].entityList[index].orderType
.toString(),
orderNo: model
.procedureList[0].entityList[index].orderNo,
procedureName: model.procedureList[0]
.entityList[index].procedureName,
categoreId: model
.procedureList[0].entityList[index].categoryID
.toString(),
procedureId: model.procedureList[0]
.entityList[index].procedureId,
limetNo: model.procedureList[0].entityList[index]
.lineItemNo);
remarks: model.procedureList[0].entityList[index].remarks,
orderType: model.procedureList[0].entityList[index].orderType.toString(),
orderNo: model.procedureList[0].entityList[index].orderNo,
procedureName: model.procedureList[0].entityList[index].procedureName,
categoreId: model.procedureList[0].entityList[index].categoryID.toString(),
procedureId: model.procedureList[0].entityList[index].procedureId,
limetNo: model.procedureList[0].entityList[index].lineItemNo);
// } else
// Helpers.showErrorToast(
// 'You Cant Update This Procedure');
@ -194,8 +177,7 @@ class ProcedureScreen extends StatelessWidget {
),
),
if (model.state == ViewState.ErrorLocal ||
(model.procedureList.isNotEmpty &&
model.procedureList[0].entityList.isEmpty))
(model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty))
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -206,9 +188,7 @@ class ProcedureScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(22.0),
child: AppText(model.procedureList.isEmpty
? model.error
: 'No Procedure Found '),
child: AppText(model.procedureList.isEmpty ? model.error : 'No Procedure Found '),
)
],
),

@ -22,6 +22,7 @@ import 'package:provider/provider.dart';
class AddSickLeavScreen extends StatelessWidget {
PatiantInformtion patient;
@override
Widget build(BuildContext context) {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
@ -31,8 +32,10 @@ class AddSickLeavScreen extends StatelessWidget {
bool isInpatient = routeArgs['isInpatient'];
return BaseView<SickLeaveViewModel>(
onModelReady: (model) async {
await model.getSickLeavePatient(patient.patientMRN ?? patient.patientId);
await model.getSickLeaveDoctor(patient.patientMRN ?? patient.patientId);
await model
.getSickLeavePatient(patient.patientMRN ?? patient.patientId);
await model
.getSickLeaveDoctor(patient.patientMRN ?? patient.patientId);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -79,17 +82,21 @@ class AddSickLeavScreen extends StatelessWidget {
},
child: Container(
width: SizeConfig.screenWidth,
margin: EdgeInsets.only(left: 20, right: 20, top: 10, bottom: 10),
margin: EdgeInsets.only(
left: 20, right: 20, top: 10, bottom: 10),
padding: EdgeInsets.all(20),
decoration:
BoxDecoration(borderRadius: BorderRadius.circular(10), color: HexColor('#EAEAEA')),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: HexColor('#EAEAEA')),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: Container(
decoration:
BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(10)),
decoration: BoxDecoration(
color: Colors.grey,
borderRadius:
BorderRadius.circular(10)),
padding: EdgeInsets.all(3),
child: IconButton(
icon: Icon(
@ -106,7 +113,9 @@ class AddSickLeavScreen extends StatelessWidget {
),
)),
Padding(
child: AppText(TranslationBase.of(context).noSickLeaveApplied,
child: AppText(
TranslationBase.of(context)
.noSickLeaveApplied,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
fontSize: 16,
@ -122,7 +131,8 @@ class AddSickLeavScreen extends StatelessWidget {
: SizedBox(),
model.getAllSIckLeavePatient.length > 0
? Column(
children: model.getAllSIckLeavePatient.map<Widget>((SickLeavePatientModel item) {
children: model.getAllSIckLeavePatient
.map<Widget>((SickLeavePatientModel item) {
return RoundedContainer(
margin: EdgeInsets.all(10),
child: Column(
@ -141,7 +151,8 @@ class AddSickLeavScreen extends StatelessWidget {
// ))),
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 4,
@ -150,7 +161,8 @@ class AddSickLeavScreen extends StatelessWidget {
// MainAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.all(3),
@ -168,7 +180,8 @@ class AddSickLeavScreen extends StatelessWidget {
// : TranslationBase
// .of(context)
// .all,
fontWeight: FontWeight.bold,
fontWeight:
FontWeight.bold,
// color: item.status == 1
// ? Colors.yellow[800]
// : item.status == 2
@ -179,25 +192,48 @@ class AddSickLeavScreen extends StatelessWidget {
),
Row(
children: [
AppText(TranslationBase.of(context).daysSickleave + ": "),
AppText(TranslationBase
.of(context)
.daysSickleave +
": "),
AppText(
item.sickLeaveDays.toString() ?? item.noOfDays.toString(),
fontWeight: FontWeight.bold,
(item.sickLeaveDays
.toString() !=
null &&
item.sickLeaveDays
.toString() !=
"null")
? item.sickLeaveDays
.toString()
: item.noOfDays
.toString(),
fontWeight:
FontWeight.bold,
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).startDate + ' ' ?? "",
TranslationBase.of(
context)
.startDate +
' ' ??
"",
),
Flexible(
child: AppText(
AppDateUtils.getDayMonthYearDateFormatted(
item.startDate.contains("/Date(")
? AppDateUtils.convertStringToDate(item.startDate)
: DateTime.parse(item.startDate)),
fontWeight: FontWeight.bold,
AppDateUtils.getDayMonthYearDateFormatted(item
.startDate
.contains(
"/Date(")
? AppDateUtils
.convertStringToDate(item
.startDate)
: DateTime.parse(
item.startDate)),
fontWeight:
FontWeight.bold,
),
)
],
@ -205,18 +241,30 @@ class AddSickLeavScreen extends StatelessWidget {
Row(
children: [
AppText(
TranslationBase.of(context).endDate + ' ' ?? "",
TranslationBase.of(
context)
.endDate +
' ' ??
"",
),
Flexible(
child: AppText(
AppDateUtils.getDayMonthYearDateFormatted(
item.startDate.contains("/Date(")
? AppDateUtils.convertStringToDate(item.endDate ?? "")
.add(Duration(
days: item.noOfDays ?? item.sickLeaveDays))
: DateTime.parse(item.startDate ?? "")
.add(Duration(days: item.noOfDays ?? ""))),
fontWeight: FontWeight.bold,
AppDateUtils.getDayMonthYearDateFormatted(item
.startDate
.contains(
"/Date(")
? AppDateUtils.convertStringToDate(
item.endDate ??
"")
.add(Duration(
days: item.noOfDays ??
item
.sickLeaveDays))
: DateTime.parse(
item.startDate ?? "")
.add(Duration(days: item.noOfDays ?? ""))),
fontWeight:
FontWeight.bold,
),
)
],
@ -246,7 +294,8 @@ class AddSickLeavScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: AppText(TranslationBase.of(context).noSickLeave),
child: AppText(
TranslationBase.of(context).noSickLeave),
)
],
),
@ -255,7 +304,8 @@ class AddSickLeavScreen extends StatelessWidget {
]))));
}
openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse extendedData}) {
openSickLeave(BuildContext context, isExtend,
{GetAllSickLeaveResponse extendedData}) {
// showModalBottomSheet(
// context: context,
// builder: (context) {
@ -265,9 +315,13 @@ class AddSickLeavScreen extends StatelessWidget {
context,
FadePage(
page: SickLeaveScreen(
appointmentNo:
isExtend == true ? extendedData.appointmentNo : patient.appointmentNo, //extendedData.appointmentNo,
patientMRN: isExtend == true ? extendedData.patientMRN : patient.patientMRN,
appointmentNo: isExtend == true
? extendedData.appointmentNo
: patient.appointmentNo,
//extendedData.appointmentNo,
patientMRN: isExtend == true
? extendedData.patientMRN
: patient.patientMRN,
isExtended: isExtend,
extendedData: extendedData,
patient: patient)));

@ -71,43 +71,48 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
Widget createDialogList() {
return Container(
height: MediaQuery.of(context).size.height * 0.5,
child: SingleChildScrollView(
child: Column(
children: [
if (widget.searchWidget != null) widget.searchWidget,
if(widget.usingSearch)
Container(
child: Column(
children: [
if (widget.searchWidget != null) widget.searchWidget,
if (widget.usingSearch)
Container(
height: MediaQuery.of(context).size.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
widget.hintSearchText ?? TranslationBase
.of(context)
.search, null, false, suffixIcon: Icon(Icons.search,)),
enabled: true,
keyboardType: TextInputType.text,
onChanged: (value) {
filterSearchResults(value);
},
)),
...items
.map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId]
.toString(),
value: item[widget.attributeValueId].toString(),
activeColor: Colors.blue.shade700,
selected: item[widget.attributeValueId].toString() ==
widget.selectedValue[widget.attributeValueId]
.toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
.toList()
],
),
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
widget.hintSearchText ?? TranslationBase.of(context).search, null, false,
suffixIcon: Icon(
Icons.search,
)),
enabled: true,
keyboardType: TextInputType.text,
onChanged: (value) {
filterSearchResults(value);
},
)),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
...items
.map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId].toString(),
value: item[widget.attributeValueId].toString(),
activeColor: Colors.blue.shade700,
selected: item[widget.attributeValueId].toString() ==
widget.selectedValue[widget.attributeValueId].toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
.toList()
],
),
),
),
],
),
);
}

Loading…
Cancel
Save