Dubai registration fixed

Dev_3.3_MedicalReportCR
Sultan khan 3 years ago
parent af90ab3aa3
commit c48f393f95

@ -19,9 +19,9 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
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:3334/';
// 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://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -591,6 +591,8 @@ var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCar
var INSERT_FREE_SLOTS_LOGS = 'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs';
var GET_NATIONALITY ='Services/Lists.svc/REST/GetNationality';
class AppGlobal {
static var context;

@ -42,3 +42,4 @@ const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL';
const CLINICS_LIST = 'CLINICS_LIST';
const COVID_QA_LIST = 'COVID_QA_LIST';
const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN';
const REGISTER_INFO_DUBAI ='register-info-dubai';

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
@ -38,9 +39,10 @@ class ProjectViewModel extends BaseViewModel {
double _latitude;
double _longitude;
RegisterInfoResponse _registerInfo =RegisterInfoResponse();
double get latitude => _latitude;
double get longitude => _longitude;
RegisterInfoResponse get registerInfo=> _registerInfo;
dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale;
@ -164,4 +166,8 @@ class ProjectViewModel extends BaseViewModel {
searchvalue = data;
notifyListeners();
}
setRegisterData(RegisterInfoResponse data){
_registerInfo =data;
notifyListeners();
}
}

@ -15,7 +15,9 @@ class CheckPatientAuthenticationReq {
Null sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
String dob;
int isHijri;
String healthId;
CheckPatientAuthenticationReq(
{this.patientMobileNumber,
this.zipCode,
@ -32,7 +34,11 @@ class CheckPatientAuthenticationReq {
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID});
this.deviceTypeID,
this.dob,
this.isHijri,
this.healthId
});
CheckPatientAuthenticationReq.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber'];
@ -51,6 +57,9 @@ class CheckPatientAuthenticationReq {
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
dob = json['dob'];
isHijri = json['isHijri'];
healthId = json['HealthId'];
}
Map<String, dynamic> toJson() {
@ -71,6 +80,9 @@ class CheckPatientAuthenticationReq {
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['dob'] =this.dob;
data['isHijri'] = this.isHijri;
data['HealthId'] = healthId;
return data;
}
}

@ -0,0 +1,21 @@
class CountriesLists {
String iD;
String name;
dynamic nameN;
CountriesLists({this.iD, this.name, this.nameN});
CountriesLists.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
name = json['Name'];
nameN = json['NameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ID'] = this.iD;
data['Name'] = this.name;
data['NameN'] = this.nameN;
return data;
}
}

@ -42,8 +42,8 @@ import 'package:provider/provider.dart';
class ConfirmLogin extends StatefulWidget {
final Function changePageViewIndex;
final fromRegistration;
const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false}) : super(key: key);
final bool isDubai;
const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key);
@override
_ConfirmLogin createState() => _ConfirmLogin();
@ -385,8 +385,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var request = this.getCommonRequest(type: type);
request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null) {
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
if (healthId != null || widget.isDubai) {
if(!widget.isDubai){
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
}
request.healthId = healthId;
request.isHijri = isHijri;
await this.authService.sendActivationCodeRegister(request).then((result) {
@ -547,7 +549,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.searchType = this.registerd_data.searchType != null ? this.registerd_data.searchType : 1;
request.patientID = this.registerd_data.patientID != null ? this.registerd_data.patientID : 0;
request.patientIdentificationID = request.nationalID = this.registerd_data.patientIdentificationID != null ? this.registerd_data.patientIdentificationID : '0';
request.dob = this.registerd_data.dob;
request.isRegister = this.registerd_data.isRegister;
} else {
request.searchType = request.searchType != null ? request.searchType : 2;
@ -565,8 +567,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
GifLoaderDialogUtils.showMyDialog(context);
var request = this.getCommonRequest().toJson();
dynamic res;
if (healthId != null) {
request['DOB'] = dob;
if (healthId != null || widget.isDubai) {
if(!widget.isDubai) {
request['DOB'] = dob;
}
request['HealthId'] = healthId;
request['IsHijri'] = isHijri;
@ -579,6 +583,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
result = CheckActivationCode.fromJson(result),
if (this.registerd_data != null && this.registerd_data.isRegister == true)
{
// if(widget.isDubai ==false){
widget.changePageViewIndex(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
}

File diff suppressed because it is too large Load Diff

@ -349,12 +349,19 @@ class _Register extends State<Register> {
cancelFunction: () {})
.showAlertDialog(context);
} else {
final intl.DateFormat dateFormat = intl.DateFormat('dd/MM/yyyy');
nRequest['forRegister'] = true;
nRequest['isRegister'] = true;
nRequest["PatientIdentificationID"] = nRequest["PatientIdentificationID"].toString();
nRequest['dob'] = isHijri == 1 ? dob.text : dateFormat.format(selectedDate);
nRequest['isHijri'] = isHijri;
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest);
sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']);
this.chekUserData(response['LogInTokenID']);
if(request.patientOutSA ==0 ) {
this.chekUserData(response['LogInTokenID']);
}else{
Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex, fromRegistration: true, isDubai:true)));
}
}
} else {
// if (response['ErrorCode'] == '-986') {

@ -247,7 +247,7 @@ class AuthProvider with ChangeNotifier {
return Future.value(localRes);
}
Future<dynamic> checkActivationCode(request, [value]) async {
Future<dynamic> checkActivationCode(request, [value]) async {
var neRequest = CheckActivationCodeReq.fromJson(request);
neRequest.activationCode = value ?? "0000";
@ -376,10 +376,16 @@ class AuthProvider with ChangeNotifier {
requestN.patientOutSA = requestN.patientobject.patientOutSA;
final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth']));
if(nhic !=null) {
requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(
dateFormat.parse(nhic['DateOfBirth']));
requestN.isHijri = nhic['IsHijri'] ? 1 : 0;
requestN.healthId = requestN.patientobject.eHealthIDField;
}
requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966';
requestN.healthId = requestN.patientobject.eHealthIDField;
requestN.isHijri = nhic['IsHijri'] ? 1 : 0;
await sharedPref.remove(USER_PROFILE);
dynamic localRes;

@ -177,4 +177,14 @@ class ClinicListService extends BaseService {
}, body: request);
return Future.value(localRes);
}
Future<Map> getCountries() async {
Map<String, dynamic> request ={};
dynamic localRes;
await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

Loading…
Cancel
Save