Merge branch 'pharmacy-bugs' into 'development'

jira bugs

See merge request Cloud_Solution/diplomatic-quarter!291
merge-requests/292/merge
Mohammad Aljammal 4 years ago
commit 3468f847d3

@ -95,9 +95,12 @@ const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///ED Online ///ED Online
const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; const ER_GET_VISUAL_TRIAGE_QUESTIONS =
const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
const ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; const ER_SAVE_TRIAGE_INFORMATION =
"services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic =
"services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
///Er Nearest ///Er Nearest
const GET_AMBULANCE_REQUEST = const GET_AMBULANCE_REQUEST =
@ -312,7 +315,7 @@ var DEVICE_TOKEN = "";
var IS_VOICE_COMMAND_CLOSED = false; var IS_VOICE_COMMAND_CLOSED = false;
var IS_TEXT_COMPLETED = false; var IS_TEXT_COMPLETED = false;
var DeviceTypeID = Platform.isIOS ? 1 : 2; var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 1; const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE = const GET_PAtIENTS_INSURANCE =
@ -534,12 +537,9 @@ const GET_SPECIFICATION = "productspecification/";
const GET_BRAND_ITEMS = "products"; const GET_BRAND_ITEMS = "products";
// External API // External API
const ADD_ADDRESS_INFO = const ADD_ADDRESS_INFO = "addcustomeraddress";
"addcustomeraddress"; const GET_CUSTOMER_ADDRESSES = "Customers/";
const GET_CUSTOMER_ADDRESSES = const GET_CUSTOMER_INFO = "VerifyCustomer";
"Customers/";
const GET_CUSTOMER_INFO =
"VerifyCustomer";
//Pharmacy //Pharmacy

@ -216,11 +216,10 @@ class BaseAppClient {
postPharmacy(String endPoint, postPharmacy(String endPoint,
{Map<String, dynamic> body, {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
bool isAllowAny = false, bool isAllowAny = false,
bool isExternal = false}) async { bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
String url; String url;
@ -246,12 +245,12 @@ class BaseAppClient {
if (!isExternal) { if (!isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
: SETUP_ID : SETUP_ID
: SETUP_ID; : SETUP_ID;
} }
@ -263,17 +262,17 @@ class BaseAppClient {
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] != null
? body['PatientOutSA'] ? body['PatientOutSA']
: PATIENT_OUT_SA : PATIENT_OUT_SA
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend') body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] ? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = DeviceTypeID; body['DeviceTypeID'] = DeviceTypeID;
@ -281,18 +280,18 @@ class BaseAppClient {
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] != null
? body['PatientType'] ? body['PatientType']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE : PATIENT_TYPE
: PATIENT_TYPE; : PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
@ -587,7 +586,6 @@ class BaseAppClient {
return params; return params;
} }
pharmacyPost(String endPoint, pharmacyPost(String endPoint,
{Map<String, dynamic> body, {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,

@ -16,7 +16,7 @@ class InsurancePage extends StatelessWidget {
final InsuranceViewModel model; final InsuranceViewModel model;
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>(); InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
InsurancePage({Key key, this.model}) : super(key: key); InsurancePage({Key key, this.model}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
@ -31,24 +31,20 @@ class InsurancePage extends StatelessWidget {
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
if (model.user != null) if (model.user != null)
Expanded( Expanded(
flex: 3, flex: 3,
child: Container( child: Container(
margin: EdgeInsets.only( margin:
top: 2.0, EdgeInsets.only(top: 2.0, left: 10.0, right: 20.0),
left: 10.0,
right: 20.0),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Texts(
model.user.firstName ?? '' + " " + model.user.lastName ?? '', model.user.firstName + " " + model.user.lastName,
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -57,11 +53,9 @@ class InsurancePage extends StatelessWidget {
height: 8, height: 8,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).fileno +
.fileno +
": " + ": " +
model.user.patientID model.user.patientID.toString(),
.toString(),
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -78,9 +72,7 @@ class InsurancePage extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Container( Container(
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of( label: TranslationBase.of(context).fetchData,
context)
.fetchData,
small: true, small: true,
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
@ -88,15 +80,12 @@ class InsurancePage extends StatelessWidget {
setupID: '010266', setupID: '010266',
projectID: 15, projectID: 15,
patientIdentificationID: patientIdentificationID:
model.user model.user.patientIdentificationNo,
.patientIdentificationNo, patientID: model.user.patientID,
patientID: model name: model.user.firstName +
.user.patientID,
name: model.user
.firstName +
" " + " " +
model model.user.lastName,
.user.lastName,context: context); context: context);
}, },
), ),
), ),
@ -107,122 +96,115 @@ class InsurancePage extends StatelessWidget {
], ],
), ),
), ),
if(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false) if (model.getAllSharedRecordsByStatusResponse
...List.generate(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, (index) => .getAllSharedRecordsByStatusList !=
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 null ??
? Container( false)
margin: EdgeInsets.all(10.0), ...List.generate(
child: Card( model.getAllSharedRecordsByStatusResponse
margin: EdgeInsets.fromLTRB( .getAllSharedRecordsByStatusList.length,
8.0, 16.0, 8.0, 8.0), (index) => model.getAllSharedRecordsByStatusResponse
color: Colors.white, .getAllSharedRecordsByStatusList[index].status ==
shape: RoundedRectangleBorder( 3
borderRadius: ? Container(
BorderRadius.circular(10), margin: EdgeInsets.all(10.0),
), child: Card(
child: Container( margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
width: MediaQuery.of(context).size.width, color: Colors.white,
padding: EdgeInsets.all(10.0), shape: RoundedRectangleBorder(
child: Row( borderRadius: BorderRadius.circular(10),
crossAxisAlignment: ),
CrossAxisAlignment.start, child: Container(
mainAxisSize: MainAxisSize.max, width: MediaQuery.of(context).size.width,
children: <Widget>[ padding: EdgeInsets.all(10.0),
Expanded( child: Row(
flex: 3, crossAxisAlignment: CrossAxisAlignment.start,
child: Container( mainAxisSize: MainAxisSize.max,
margin: EdgeInsets.only( children: <Widget>[
top: 2.0, Expanded(
left: 10.0, flex: 3,
right: 20.0), child: Container(
child: Column( margin: EdgeInsets.only(
crossAxisAlignment: top: 2.0, left: 10.0, right: 20.0),
CrossAxisAlignment child: Column(
.start, crossAxisAlignment:
children: <Widget>[ CrossAxisAlignment.start,
Texts( children: <Widget>[
model Texts(
.getAllSharedRecordsByStatusResponse model
.getAllSharedRecordsByStatusList[ .getAllSharedRecordsByStatusResponse
index] .getAllSharedRecordsByStatusList[
.patientName, index]
fontSize: 14, .patientName,
color: Colors.black, fontSize: 14,
fontWeight: color: Colors.black,
FontWeight.w500, fontWeight: FontWeight.w500,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( Texts(
TranslationBase.of( TranslationBase.of(context).fileno +
context) ": " +
.fileno + model
": " + .getAllSharedRecordsByStatusResponse
model .getAllSharedRecordsByStatusList[
.getAllSharedRecordsByStatusResponse index]
.getAllSharedRecordsByStatusList[ .patientID
index] .toString(),
.patientID fontSize: 14,
.toString(), color: Colors.black,
fontSize: 14, fontWeight: FontWeight.w500,
color: Colors.black, )
fontWeight: ],
FontWeight.w500, ),
) ),
], ),
), Expanded(
), flex: 2,
), child: Container(
Expanded( margin: EdgeInsets.only(top: 2.0),
flex: 2, child: Column(
child: Container( children: <Widget>[
margin: Container(
EdgeInsets.only(top: 2.0), child: SecondaryButton(
child: Column( label: TranslationBase.of(context)
children: <Widget>[ .fetchData,
Container( small: true,
child: SecondaryButton( textColor: Colors.white,
label: TranslationBase onTap: () {
.of(context) getDetails(
.fetchData, projectID: 15,
small: true, patientIdentificationID: model
textColor: .getAllSharedRecordsByStatusResponse
Colors.white, .getAllSharedRecordsByStatusList[
onTap: () { index]
getDetails( .patientIdenficationNumber,
projectID: 15, setupID: '010266',
patientIdentificationID: model patientID: model
.getAllSharedRecordsByStatusResponse .getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[ .getAllSharedRecordsByStatusList[
index] index]
.patientIdenficationNumber, .responseID,
setupID: name: model
'010266', .getAllSharedRecordsByStatusResponse
patientID: model .getAllSharedRecordsByStatusList[
.getAllSharedRecordsByStatusResponse index]
.getAllSharedRecordsByStatusList[ .patientName,
index] context: context);
.responseID, },
name: model ),
.getAllSharedRecordsByStatusResponse ),
.getAllSharedRecordsByStatusList[ ],
index].patientName,context: context); ),
}, ),
), )
],
), ),
], ),
), ),
), )
) : Container()),
],
),
),
),
)
: Container()
),
], ],
), ),
); );
@ -230,29 +212,32 @@ class InsurancePage extends StatelessWidget {
getDetails( getDetails(
{String setupID, {String setupID,
int projectID, int projectID,
String patientIdentificationID, String patientIdentificationID,
int patientID, int patientID,
String name,BuildContext context}) { String name,
BuildContext context}) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService _insuranceCardService
.getPatientInsuranceDetails( .getPatientInsuranceDetails(
setupID: setupID, setupID: setupID,
projectID: projectID, projectID: projectID,
patientID: patientID, patientID: patientID,
patientIdentificationID: patientIdentificationID) patientIdentificationID: patientIdentificationID)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { if (!_insuranceCardService.hasError &&
_insuranceCardService.isHaveInsuranceCard) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: InsuranceCardUpdateDetails( page: InsuranceCardUpdateDetails(
insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList, insuranceCardDetailsModel:
patientID: patientID, _insuranceCardService.insuranceCardDetailsList,
patientIdentificationID: patientIdentificationID, patientID: patientID,
name: name, patientIdentificationID: patientIdentificationID,
))); name: name,
)));
} else { } else {
AppToast.showErrorToast(message: _insuranceCardService.error); AppToast.showErrorToast(message: _insuranceCardService.error);
} }

@ -32,7 +32,11 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png'));
} }
void dispose() { void dispose() {
@ -111,7 +115,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
InsurancePage(model:model), InsurancePage(model: model),
Container( Container(
child: ListView.builder( child: ListView.builder(
itemCount: model.insuranceUpdate == null itemCount: model.insuranceUpdate == null
@ -227,6 +231,4 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
), ),
); );
} }
} }

@ -169,29 +169,30 @@ class _MyVaccinesState extends State<MyVaccines> {
width: double.infinity, width: double.infinity,
// height: 80.0, // height: 80.0,
child: Button( child: Button(
disabled: true,
label: TranslationBase.of(context).checkVaccineAvailability, label: TranslationBase.of(context).checkVaccineAvailability,
backgroundColor: Color(0xff9EA3A4), backgroundColor: Color(0xff9EA3A4),
onTap: () => onTap: () => Navigator.push(
Navigator.push(context, FadePage(page: MyVaccinesItemPage())), context, FadePage(page: MyVaccinesItemPage())),
), ),
), ),
if(projectViewModel.havePrivilege(27)) if (projectViewModel.havePrivilege(27))
Container( Container(
width: double.infinity, width: double.infinity,
// height: 80.0, // height: 80.0,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).sendEmail, label: TranslationBase.of(context).sendEmail,
color: Color(0xffF62426), color: Color(0xffF62426),
textColor: Colors.white, textColor: Colors.white,
disabled: model.vaccineList.length == 0, disabled: model.vaccineList.length == 0,
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onTap: () async { onTap: () async {
model.sendEmail( model.sendEmail(
message: message: TranslationBase.of(context)
TranslationBase.of(context).emailSentSuccessfully); .emailSentSuccessfully);
}, },
),
), ),
),
], ],
), ),
), ),

Loading…
Cancel
Save