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 5 years ago
commit cdc3b36174

@ -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";

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

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

@ -28,16 +28,12 @@ class ProcedureService extends BaseService {
List<ProcedureTempleteDetailsModel> templateList = List(); List<ProcedureTempleteDetailsModel> templateList = List();
List<ProcedureTempleteDetailsModel> _templateDetailsList = List(); List<ProcedureTempleteDetailsModel> _templateDetailsList = List();
List<ProcedureTempleteDetailsModel> get templateDetailsList => List<ProcedureTempleteDetailsModel> get templateDetailsList => _templateDetailsList;
_templateDetailsList;
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel();
GetOrderedProcedureRequestModel();
ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel();
ProcedureTempleteRequestModel(); ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel();
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
// clinicId: 17, // clinicId: 17,
@ -63,8 +59,7 @@ class ProcedureService extends BaseService {
//search: ["DENTAL"], //search: ["DENTAL"],
); );
Future getProcedureTemplate( Future getProcedureTemplate({int doctorId, int projectId, int clinicId, String categoryID}) async {
{int doctorId, int projectId, int clinicId, String categoryID}) async {
_procedureTempleteRequestModel = ProcedureTempleteRequestModel( _procedureTempleteRequestModel = ProcedureTempleteRequestModel(
// tokenID: "@dm!n", // tokenID: "@dm!n",
patientID: 0, patientID: 0,
@ -72,19 +67,18 @@ class ProcedureService extends BaseService {
); );
hasError = false; 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) { onSuccess: (dynamic response, int statusCode) {
templateList.clear(); templateList.clear();
response['DAPP_TemplateGetList'].forEach((template) { response['DAPP_TemplateGetList'].forEach((template) {
ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template);
if(categoryID != null){ if (categoryID != null) {
if(categoryID == templateElement.categoryID){ if (categoryID == templateElement.categoryID) {
templateList.add(templateElement); templateList.add(templateElement);
} }
} else { } else {
templateList.add(templateElement); templateList.add(templateElement);
} }
}); });
// response['HIS_ProcedureTemplateList'].forEach((template) { // response['HIS_ProcedureTemplateList'].forEach((template) {
// _templateList.add(ProcedureTempleteModel.fromJson(template)); // _templateList.add(ProcedureTempleteModel.fromJson(template));
@ -95,21 +89,17 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteRequestModel.toJson()); }, body: _procedureTempleteRequestModel.toJson());
} }
Future getProcedureTemplateDetails( Future getProcedureTemplateDetails({int doctorId, int projectId, int clinicId, int templateId}) async {
{int doctorId, int projectId, int clinicId, int templateId}) async {
_procedureTempleteDetailsRequestModel = _procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel( ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0);
templateID: templateId, searchType: 1, patientID: 0);
hasError = false; hasError = false;
//insuranceApprovalInPatient.clear(); //insuranceApprovalInPatient.clear();
_templateDetailsList.clear(); _templateDetailsList.clear();
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
//prescriptionsList.clear(); //prescriptionsList.clear();
response['HIS_ProcedureTemplateDetailsList'].forEach((template) { response['HIS_ProcedureTemplateDetailsList'].forEach((template) {
_templateDetailsList _templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template));
.add(ProcedureTempleteDetailsModel.fromJson(template));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -117,15 +107,14 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteDetailsRequestModel.toJson()); }, body: _procedureTempleteDetailsRequestModel.toJson());
} }
Future getProcedure({int mrn}) async { Future getProcedure({int mrn, int appointmentNo}) async {
_getOrderedProcedureRequestModel = _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(
GetOrderedProcedureRequestModel(patientMRN: mrn); patientMRN: mrn,
);
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(GET_PROCEDURE_LIST, await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _procedureList.add(GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
_procedureList.add(
GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -135,8 +124,7 @@ class ProcedureService extends BaseService {
Future getCategory() async { Future getCategory() async {
hasError = false; hasError = false;
await baseAppClient.post(GET_LIST_CATEGORISE, await baseAppClient.post(GET_LIST_CATEGORISE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
categoryList = []; categoryList = [];
categoryList = response['listProcedureCategories']['entityList']; categoryList = response['listProcedureCategories']['entityList'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -145,7 +133,7 @@ class ProcedureService extends BaseService {
}, body: Map()); }, body: Map());
} }
Future getProcedureCategory({String categoryName, String categoryID,patientId}) async { Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel( _getProcedureCategoriseReqModel = GetProcedureReqModel(
search: ["$categoryName"], search: ["$categoryName"],
patientMRN: patientId, patientMRN: patientId,
@ -156,10 +144,8 @@ class ProcedureService extends BaseService {
); );
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();
await baseAppClient.post(GET_CATEGORISE_PROCEDURE, await baseAppClient.post(GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _categoriesList.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
_categoriesList
.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -169,8 +155,7 @@ class ProcedureService extends BaseService {
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { Future postProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(POST_PROCEDURE_LIST, await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print("Success"); print("Success");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -178,12 +163,10 @@ class ProcedureService extends BaseService {
}, body: postProcedureReqModel.toJson()); }, body: postProcedureReqModel.toJson());
} }
Future updateProcedure( Future updateProcedure(UpdateProcedureRequestModel updateProcedureRequestModel) async {
UpdateProcedureRequestModel updateProcedureRequestModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(UPDATE_PROCEDURE, await baseAppClient.post(UPDATE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print("ACCEPTED"); print("ACCEPTED");
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -191,14 +174,11 @@ class ProcedureService extends BaseService {
}, body: updateProcedureRequestModel.toJson()); }, body: updateProcedureRequestModel.toJson());
} }
Future valadteProcedure( Future valadteProcedure(ProcedureValadteRequestModel procedureValadteRequestModel) async {
ProcedureValadteRequestModel procedureValadteRequestModel) async {
hasError = false; hasError = false;
_valadteProcedureList.clear(); _valadteProcedureList.clear();
await baseAppClient.post(GET_PROCEDURE_VALIDATION, await baseAppClient.post(GET_PROCEDURE_VALIDATION, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _valadteProcedureList.add(ProcedureValadteModel.fromJson(response['ValidateProcedureList']));
_valadteProcedureList.add(
ProcedureValadteModel.fromJson(response['ValidateProcedureList']));
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; 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/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
as cpe;
class ProcedureViewModel extends BaseViewModel { class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it //TODO Hussam clean it
@ -61,13 +60,13 @@ class ProcedureViewModel extends BaseViewModel {
List<PatientLabOrdersList> _patientLabOrdersListClinic = List(); List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List(); List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
Future getProcedure({int mrn, String patientType}) async { Future getProcedure({int mrn, String patientType, int appointmentNo}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn); await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
if (patientType == "7") if (patientType == "7")
@ -78,15 +77,12 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureCategory( Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
{String categoryName, String categoryID, patientId}) async {
if (categoryName == null) return; if (categoryName == null) return;
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedureCategory( await _procedureService.getProcedureCategory(
categoryName: categoryName, categoryName: categoryName, categoryID: categoryID, patientId: patientId);
categoryID: categoryID,
patientId: patientId);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -321,8 +317,7 @@ class ProcedureViewModel extends BaseViewModel {
List<cpe.EntityList> entityList, List<cpe.EntityList> entityList,
ProcedureType procedureType}) async { ProcedureType procedureType}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel = ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel();
new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
@ -337,21 +332,13 @@ class ProcedureViewModel extends BaseViewModel {
procedureValadteRequestModel.procedure = [element.procedureId]; procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List(); List<Controls> controls = List();
controls.add( controls.add(
Controls( Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
); );
controls.add( controls.add(
Controls( Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"),
code: "ordertype",
controlValue: procedureType == ProcedureType.PROCEDURE
? element.type ?? "1"
: "0"),
); );
controlsProcedure.add(Procedures( controlsProcedure
category: element.categoryID, .add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls));
procedure: element.procedureId,
controls: controls));
}); });
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
@ -371,8 +358,7 @@ class ProcedureViewModel extends BaseViewModel {
Helpers.showErrorToast(error); Helpers.showErrorToast(error);
getProcedure(mrn: patient.patientMRN); getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) { } else if (state == ViewState.Idle) {
Helpers.showErrorToast( Helpers.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
valadteProcedureList[0].entityList[0].warringMessages);
} }
} }
} else { } else {

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

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

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

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

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

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

Loading…
Cancel
Save