Updates & fixes

Dev_3.3_MedicalReportCR
haroon amjad 2 years ago
parent 5ddf8d4b7a
commit 0f863cd259

@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';

@ -12,21 +12,23 @@ class InsuranceManualUpdateRequest {
String policyNo;
String schemeClass;
int requestType;
int patientID;
InsuranceManualUpdateRequest(
{this.setupID,
this.patientIdentificationID,
this.projectID,
this.mobileNo,
this.activityId,
this.component,
this.enableLogging,
this.insuranceCompanyName,
this.cardHolderName,
this.memberShipNo,
this.policyNo,
this.schemeClass,
this.requestType});
this.patientIdentificationID,
this.projectID,
this.mobileNo,
this.activityId,
this.component,
this.enableLogging,
this.insuranceCompanyName,
this.cardHolderName,
this.memberShipNo,
this.policyNo,
this.schemeClass,
this.requestType,
this.patientID});
InsuranceManualUpdateRequest.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
@ -42,6 +44,7 @@ class InsuranceManualUpdateRequest {
policyNo = json['PolicyNo'];
schemeClass = json['SchemeClass'];
requestType = json['RequestType'];
patientID = json['PatientID'];
}
Map<String, dynamic> toJson() {
@ -59,6 +62,7 @@ class InsuranceManualUpdateRequest {
data['PolicyNo'] = this.policyNo;
data['SchemeClass'] = this.schemeClass;
data['RequestType'] = this.requestType;
data['PatientID'] = this.patientID;
return data;
}
}

@ -149,7 +149,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021";
// body['PatientID'] = 2001273; //3844083
// body['PatientID'] = 4767370; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574

@ -13,9 +13,11 @@ import 'package:flutter/material.dart';
class AttachInsuranceCardImageDialog extends StatefulWidget {
final String name;
final String fileNo;
final String identificationNo;
final String mobileNo;
final Function(File file, String image) image;
const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.image}) : super(key: key);
const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.identificationNo, this.mobileNo, this.image}) : super(key: key);
@override
_AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState();
@ -134,7 +136,16 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
TranslationBase.of(context).updateInsuranceManually,
() {
Navigator.pop(context);
Navigator.push(context, FadePage(page: UpdateInsuranceManually()));
Navigator.push(
context,
FadePage(
page: UpdateInsuranceManually(
patientIdentificationNo: widget.identificationNo,
patientMobileNumber: widget.mobileNo,
patientID: num.parse(widget.fileNo),
),
),
);
},
textColor: Colors.white,
color: CustomColors.accentColor,

@ -16,7 +16,11 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class UpdateInsuranceManually extends StatefulWidget {
const UpdateInsuranceManually({Key key}) : super(key: key);
String patientIdentificationNo;
String patientMobileNumber;
int patientID;
UpdateInsuranceManually({@required this.patientIdentificationNo, @required this.patientMobileNumber, @required this.patientID});
@override
State<UpdateInsuranceManually> createState() => _UpdateInsuranceManuallyState();
@ -51,7 +55,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
_nationalIDTextController.text = projectViewModel.user.patientIdentificationNo;
_nationalIDTextController.text = widget.patientIdentificationNo;
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
@ -160,7 +164,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
child: DefaultButton(
TranslationBase.of(context).submit,
() {
if(isFormValid())
if (isFormValid())
submitManualInsuranceUpdateRequest();
else
AppToast.showErrorToast(message: TranslationBase.of(context).enterInsuranceDetails);
@ -240,16 +244,18 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
insuranceManualUpdateRequest.projectID = selectedInsuranceCompanyObj.projectID;
insuranceManualUpdateRequest.requestType = 2;
insuranceManualUpdateRequest.mobileNo = projectViewModel.user.mobileNumber;
insuranceManualUpdateRequest.mobileNo = widget.patientMobileNumber;
insuranceManualUpdateRequest.cardHolderName = _cardHolderNameTextController.text;
insuranceManualUpdateRequest.insuranceCompanyName = selectedInsuranceCompanyObj.companyName;
insuranceManualUpdateRequest.memberShipNo = _membershipNoTextController.text;
insuranceManualUpdateRequest.policyNo = _policyNoTextController.text;
insuranceManualUpdateRequest.patientIdentificationID = projectViewModel.user.patientIdentificationNo;
insuranceManualUpdateRequest.patientIdentificationID = widget.patientIdentificationNo;
insuranceManualUpdateRequest.schemeClass = selectedInsuranceCompaniesSchemesObj.subCategoryDesc;
insuranceManualUpdateRequest.setupID = selectedInsuranceCompanyObj.setupID;
insuranceManualUpdateRequest.patientID = widget.patientID;
_insuranceCardService.submitManualInsuranceUpdateRequest(insuranceManualUpdateRequest).then((value) {
print(value);
AppToast.showSuccessToast(message: TranslationBase.of(context).insuranceRequestSubmit);
Navigator.pop(context);
GifLoaderDialogUtils.hideDialog(context);

@ -22,8 +22,9 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
final String patientIdentificationID;
final int patientID;
final String name;
final String mobileNo;
const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name}) : super(key: key);
const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name, this.mobileNo}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -304,7 +305,8 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
color: CustomColors.accentColor,
small: true,
onTap: () async {
confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model);
confirmAttachInsuranceCardImageDialogDialog(
context: context, name: name, fileNo: patientID.toString(), identificationNo: patientIdentificationID, mobileNo: mobileNo, model: model);
},
),
if (insuranceCardDetailsModel.isNotEmpty)
@ -334,7 +336,8 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
label: TranslationBase.of(context).disagree.toUpperCase(),
color: Colors.grey[800],
onTap: () async {
confirmAttachInsuranceCardImageDialogDialog(context: context, name: name, fileNo: patientID.toString(), model: model);
confirmAttachInsuranceCardImageDialogDialog(
context: context, name: name, fileNo: patientID.toString(), identificationNo: patientIdentificationID, mobileNo: mobileNo, model: model);
},
)
],
@ -346,12 +349,14 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
);
}
void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, InsuranceViewModel model}) {
void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, String identificationNo, String mobileNo, InsuranceViewModel model}) {
showDialog(
context: context,
builder: (cxt) => AttachInsuranceCardImageDialog(
fileNo: fileNo,
name: name,
identificationNo: identificationNo,
mobileNo: mobileNo,
image: (file, image) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.uploadInsuranceCard(context, patientIdentificationID: patientIdentificationID, patientID: patientID, image: image);

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/insurance/UpdateInsuranceManually.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../locator.dart';
import '../../widgets/dialogs/confirm_dialog.dart';
@ -18,8 +20,11 @@ class InsurancePage extends StatelessWidget {
InsurancePage({Key key, this.model}) : super(key: key);
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(12.0),
@ -36,11 +41,16 @@ class InsurancePage extends StatelessWidget {
getDetails(
setupID: '010266',
projectID: 15,
patientIdentificationID: model.user.patientIdentificationNo,
patientID: model.user.patientID,
patientIdentificationID: projectViewModel.user.patientIdentificationNo,
//model.user.patientIdentificationNo,
patientID: projectViewModel.user.patientID,
//model.user.patientID,
parentID: 0,
isFamily: false,
name: model.user.firstName + " " + model.user.lastName,
isFamily: projectViewModel.isLoginChild,
//false,
name: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
mobileNumber: projectViewModel.user.mobileNumber,
//model.user.firstName + " " + model.user.lastName,
context: context,
);
},
@ -54,7 +64,7 @@ class InsurancePage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
model.user.firstName + " " + model.user.lastName,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
@ -62,7 +72,7 @@ class InsurancePage extends StatelessWidget {
),
),
Text(
TranslationBase.of(context).fileno + ": " + model.user.patientID.toString(),
TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), //model.user.patientID.toString(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
@ -79,71 +89,73 @@ class InsurancePage extends StatelessWidget {
),
),
),
if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
? InkWell(
onTap: () {
getDetails(
projectID: 15,
patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber,
setupID: '010266',
patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID,
name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
parentID: model.user.patientID,
isFamily: true,
context: context);
},
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 12.0),
if (!projectViewModel.isLoginChild)
if (model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
? InkWell(
onTap: () {
getDetails(
projectID: 15,
patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber,
setupID: '010266',
patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID,
name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
parentID: model.user.patientID,
isFamily: true,
mobileNumber: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].mobileNumber,
context: context);
},
child: Container(
decoration: cardRadius(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46),
),
Text(
TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46),
),
],
width: double.infinity,
margin: EdgeInsets.only(top: 12.0),
child: Container(
decoration: cardRadius(12),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46),
),
Text(
TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46),
),
],
),
),
),
Icon(Icons.arrow_forward),
],
Icon(Icons.arrow_forward),
],
),
),
),
),
),
)
: Container();
},
separatorBuilder: (context, index) {
return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0);
},
itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length,
),
)
: Container();
},
separatorBuilder: (context, index) {
return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0);
},
itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length,
),
],
),
),
);
}
getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, bool isFamily, int parentID = 0, BuildContext context}) {
getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, String mobileNumber, bool isFamily, int parentID = 0, BuildContext context}) {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService
.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID)
@ -158,23 +170,34 @@ class InsurancePage extends StatelessWidget {
patientID: patientID,
patientIdentificationID: patientIdentificationID,
name: name,
mobileNo: mobileNumber,
))).then((value) {
model.getInsuranceUpdated();
});
} else {
// AppToast.showErrorToast(message: _insuranceCardService.error);
updateManually(context, _insuranceCardService.error);
updateManually(context, _insuranceCardService.error, patientIdentificationID, patientID, mobileNumber);
}
});
}
void updateManually(BuildContext context, String errorMsg) {
void updateManually(BuildContext context, String errorMsg, String patientIdentificationID, int patientID, String mobileNumber) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () => {Navigator.pop(context), Navigator.push(context, FadePage(page: UpdateInsuranceManually()))},
okFunction: () => {
Navigator.pop(context),
Navigator.push(
context,
FadePage(
page: UpdateInsuranceManually(
patientIdentificationNo: patientIdentificationID,
patientID: patientID,
patientMobileNumber: mobileNumber,
)))
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}

@ -1,10 +1,12 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../base/base_view.dart';
import 'insurance_page.dart';
@ -17,6 +19,7 @@ class InsuranceUpdate extends StatefulWidget {
class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProviderStateMixin {
TabController _tabController;
List<ImagesInfo> imagesInfo = List();
ProjectViewModel projectViewModel;
@override
void initState() {
@ -33,6 +36,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
}
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsuranceUpdated(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
@ -123,7 +127,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
model.user.firstName + " " + model.user.lastName,
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
@ -141,7 +145,6 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
letterSpacing: -0.46,
),
),
Text(
model.insuranceUpdate[index].createdOn,
style: TextStyle(

@ -110,7 +110,7 @@ class _RequestTypePageState extends State<RequestTypePage> {
TranslationBase.of(context).submit,
() => {
model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) {
if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) {
if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) {
Navigator.pop(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).RRTRequestSuccess);
}

@ -18,7 +18,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:open_file/open_file.dart';
import 'package:open_filex/open_filex.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
@ -183,7 +183,7 @@ class ReportListWidget extends StatelessWidget {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
try {
String path = await _createFileFromString(value["MedicalReportBase64"], "pdf");
OpenFile.open(path);
OpenFilex.open(path);
} catch (ex) {
AppToast.showErrorToast(message: "Cannot open file.");
}

@ -207,7 +207,8 @@ dependencies:
sms_otp_auto_verify: ^2.1.0
flutter_ios_voip_kit: ^0.0.5
google_api_availability: ^3.0.1
open_file: ^3.2.1
# open_file: ^3.2.1
open_filex: ^4.3.2
path_provider: ^2.0.8
# flutter_callkit_incoming: ^1.0.3+3
# firebase_core: 1.12.0

Loading…
Cancel
Save