Merge branch 'sultan' into 'development'

Sultan

See merge request Cloud_Solution/doctor_app_flutter!258
merge-requests/259/merge
Mohammad Aljammal 4 years ago
commit 588d98f8ed

@ -12,3 +12,4 @@ final LOGGED_IN_USER = 'loggedUser';
final DASHBOARD_DATA = 'dashboard-data'; final DASHBOARD_DATA = 'dashboard-data';
final OTP_TYPE = 'otp-type'; final OTP_TYPE = 'otp-type';
final LAST_LOGIN_USER = 'last-login-user'; final LAST_LOGIN_USER = 'last-login-user';
final PASSWORD = 'password';

@ -4,30 +4,30 @@ class GetIMEIDetailsModel {
int logInTypeID; int logInTypeID;
bool outSA; bool outSA;
String mobile; String mobile;
Null identificationNo; dynamic identificationNo;
int doctorID; int doctorID;
String doctorName; String doctorName;
String doctorNameN; String doctorNameN;
int clinicID; int clinicID;
String clinicDescription; String clinicDescription;
Null clinicDescriptionN; dynamic clinicDescriptionN;
int projectID; int projectID;
String projectName; String projectName;
String genderDescription; String genderDescription;
Null genderDescriptionN; dynamic genderDescriptionN;
String titleDescription; String titleDescription;
Null titleDescriptionN; dynamic titleDescriptionN;
Null zipCode; dynamic zipCode;
String createdOn; String createdOn;
Null createdBy; dynamic createdBy;
String editedOn; String editedOn;
int editedBy; dynamic editedBy;
bool biometricEnabled; bool biometricEnabled;
Null preferredLanguage; dynamic preferredLanguage;
bool isActive; bool isActive;
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
String password;
GetIMEIDetailsModel( GetIMEIDetailsModel(
{this.iD, {this.iD,
this.iMEI, this.iMEI,
@ -56,7 +56,8 @@ class GetIMEIDetailsModel {
this.preferredLanguage, this.preferredLanguage,
this.isActive, this.isActive,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID}); this.vidaRefreshTokenID,
this.password});
GetIMEIDetailsModel.fromJson(Map<String, dynamic> json) { GetIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iD = json['ID']; iD = json['ID'];
@ -87,6 +88,7 @@ class GetIMEIDetailsModel {
isActive = json['IsActive']; isActive = json['IsActive'];
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
password = json['Password'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -119,6 +121,7 @@ class GetIMEIDetailsModel {
data['IsActive'] = this.isActive; data['IsActive'] = this.isActive;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['Password'] = this.password;
return data; return data;
} }
} }

@ -1,9 +1,9 @@
class InsertIMEIDetailsModel { class InsertIMEIDetailsModel {
String iMEI; String iMEI;
int logInTypeID; int logInTypeID;
Null outSA; dynamic outSA;
Null mobile; String mobile;
Null identificationNo; dynamic identificationNo;
int doctorID; int doctorID;
String doctorName; String doctorName;
String doctorNameN; String doctorNameN;
@ -31,7 +31,7 @@ class InsertIMEIDetailsModel {
int patientOutSA; int patientOutSA;
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
dynamic password;
InsertIMEIDetailsModel( InsertIMEIDetailsModel(
{this.iMEI, {this.iMEI,
this.logInTypeID, this.logInTypeID,
@ -64,13 +64,14 @@ class InsertIMEIDetailsModel {
this.isLoginForDoctorApp, this.isLoginForDoctorApp,
this.patientOutSA, this.patientOutSA,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID}); this.vidaRefreshTokenID,
this.password});
InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) { InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iMEI = json['IMEI']; iMEI = json['IMEI'];
logInTypeID = json['LogInTypeID']; logInTypeID = json['LogInTypeID'];
outSA = json['OutSA']; outSA = json['OutSA'];
mobile = json['Mobile']; mobile = json['MobileNo'];
identificationNo = json['IdentificationNo']; identificationNo = json['IdentificationNo'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
@ -99,6 +100,7 @@ class InsertIMEIDetailsModel {
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
password = json['Password'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -106,7 +108,7 @@ class InsertIMEIDetailsModel {
data['IMEI'] = this.iMEI; data['IMEI'] = this.iMEI;
data['LogInTypeID'] = this.logInTypeID; data['LogInTypeID'] = this.logInTypeID;
data['OutSA'] = this.outSA; data['OutSA'] = this.outSA;
data['Mobile'] = this.mobile; data['MobileNo'] = this.mobile;
data['IdentificationNo'] = this.identificationNo; data['IdentificationNo'] = this.identificationNo;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
@ -135,6 +137,7 @@ class InsertIMEIDetailsModel {
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['Password'] = this.password;
return data; return data;
} }
} }

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends BaseService {
@ -93,9 +94,24 @@ class PrescriptionService extends BaseService {
} }
Future getDrugToDrug( Future getDrugToDrug(
VitalSignData vital, List<GetAllergiesResModel> allergy) async { VitalSignData vital,
List<MasterKeyModel> diagnosis,
List<GetAllergiesResModel> allergy,
PatiantInformtion patient,
List<PrescriptionModel> prescription) async {
Map<String, dynamic> request = {
"Prescription": {
"objPatientInfo": {"Gender": patient.gender, "Age": patient.age},
"objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg},
"objPrescriptionItems": prescription[0].entityList,
"objAllergies": allergy,
"objDiagnosis": diagnosis,
"IsDoctor": "false",
"IsPharmacist": "false"
}
};
hasError = false; hasError = false;
var request = {};
await baseAppClient.post(DRUG_TO_DRUG, await baseAppClient.post(DRUG_TO_DRUG,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
drugToDrug = []; drugToDrug = [];
@ -103,6 +119,6 @@ class PrescriptionService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _drugRequestModel.toJson()); }, body: request);
} }
} }

@ -81,11 +81,15 @@ class AuthViewModel extends BaseViewModel {
Future insertDeviceImei(request) async { Future insertDeviceImei(request) async {
var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); var loggedIn = await sharedPref.getObj(LOGGED_IN_USER);
var user = await sharedPref.getObj(LAST_LOGIN_USER);
if (user != null) {
user = GetIMEIDetailsModel.fromJson(user);
}
request['IMEI'] = DEVICE_TOKEN; request['IMEI'] = DEVICE_TOKEN;
request['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); request['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE);
request['BioMetricEnabled'] = true; request['BioMetricEnabled'] = true;
request['MobileNo'] = loggedIn['MobileNumber']; request['MobileNo'] =
loggedIn != null ? loggedIn['MobileNumber'] : user.mobile;
InsertIMEIDetailsModel nRequest = InsertIMEIDetailsModel.fromJson(request); InsertIMEIDetailsModel nRequest = InsertIMEIDetailsModel.fromJson(request);
nRequest.genderDescription = request['Gender_Description']; nRequest.genderDescription = request['Gender_Description'];
nRequest.genderDescriptionN = request['Gender_DescriptionN']; nRequest.genderDescriptionN = request['Gender_DescriptionN'];
@ -93,9 +97,14 @@ class AuthViewModel extends BaseViewModel {
nRequest.titleDescription = request['Title_Description']; nRequest.titleDescription = request['Title_Description'];
nRequest.titleDescriptionN = request['Title_DescriptionN']; nRequest.titleDescriptionN = request['Title_DescriptionN'];
nRequest.projectID = await sharedPref.getInt(PROJECT_ID); nRequest.projectID = await sharedPref.getInt(PROJECT_ID);
nRequest.doctorID = loggedIn != null
? loggedIn['List_MemberInformation'][0]['MemberID']
: user.doctorID;
nRequest.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA;
nRequest.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); nRequest.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
nRequest.vidaRefreshTokenID = nRequest.vidaRefreshTokenID =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
nRequest.password = await sharedPref.getString(PASSWORD);
try { try {
var localRes; var localRes;
await baseAppClient.post(INSERT_DEVICE_IMEI, await baseAppClient.post(INSERT_DEVICE_IMEI,

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
class PrescriptionViewModel extends BaseViewModel { class PrescriptionViewModel extends BaseViewModel {
@ -72,10 +73,15 @@ class PrescriptionViewModel extends BaseViewModel {
} }
Future getDrugToDrug( Future getDrugToDrug(
VitalSignData vital, List<GetAllergiesResModel> allergy) async { VitalSignData vital,
List<MasterKeyModel> listOfDiagnosisType,
List<GetAllergiesResModel> allergy,
PatiantInformtion patient,
List<PrescriptionModel> prescription) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getDrugToDrug(vital, allergy); await _prescriptionService.getDrugToDrug(
vital, listOfDiagnosisType, allergy, patient, prescription);
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {
error = _prescriptionService.error; error = _prescriptionService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -11,7 +11,7 @@ class ActivationCodeModel2 {
int isMobileFingerPrint; int isMobileFingerPrint;
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
String iMEI;
ActivationCodeModel2( ActivationCodeModel2(
{this.oTPSendType, {this.oTPSendType,
this.mobileNumber, this.mobileNumber,
@ -24,7 +24,8 @@ class ActivationCodeModel2 {
this.generalid, this.generalid,
this.isMobileFingerPrint, this.isMobileFingerPrint,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID}); this.vidaRefreshTokenID,
this.iMEI});
ActivationCodeModel2.fromJson(Map<String, dynamic> json) { ActivationCodeModel2.fromJson(Map<String, dynamic> json) {
oTPSendType = json['OTP_SendType']; oTPSendType = json['OTP_SendType'];
@ -39,6 +40,7 @@ class ActivationCodeModel2 {
isMobileFingerPrint = json['IsMobileFingerPrint']; isMobileFingerPrint = json['IsMobileFingerPrint'];
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
iMEI = json['IMEI'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -55,6 +57,7 @@ class ActivationCodeModel2 {
data['IsMobileFingerPrint'] = this.isMobileFingerPrint; data['IsMobileFingerPrint'] = this.isMobileFingerPrint;
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['IMEI'] = this.iMEI;
return data; return data;
} }
} }

@ -70,7 +70,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
var request = await sharedPref.getObj(DOCTOR_PROFILE); var request = await sharedPref.getObj(DOCTOR_PROFILE);
authProvider.insertDeviceImei(request).then((value) { authProvider.insertDeviceImei(request).then((value) {
print(value['ReturnValue']); print(value);
changeIsLoading(false); changeIsLoading(false);
}); });
} }

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescription_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
@ -25,13 +26,13 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
addPrescriptionForm( addPrescriptionForm(context, PrescriptionViewModel model,
context, PrescriptionViewModel model, PatiantInformtion patient) { PatiantInformtion patient, prescription) {
showModalBottomSheet( showModalBottomSheet(
isScrollControlled: true, isScrollControlled: true,
context: context, context: context,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return PrescriptionFormWidget(model, patient); return PrescriptionFormWidget(model, patient, prescription);
}); });
} }
@ -85,7 +86,8 @@ postProcedure(
class PrescriptionFormWidget extends StatefulWidget { class PrescriptionFormWidget extends StatefulWidget {
final PrescriptionViewModel model; final PrescriptionViewModel model;
PatiantInformtion patient; PatiantInformtion patient;
PrescriptionFormWidget(this.model, this.patient); List<PrescriptionModel> prescriptionList;
PrescriptionFormWidget(this.model, this.patient, this.prescriptionList);
@override @override
_PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState();
@ -308,7 +310,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model.drugsList, list: model.drugsList,
attributeName: 'Description', attributeName: 'GenericName',
attributeValueId: 'ItemId', attributeValueId: 'ItemId',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)
@ -713,8 +715,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.addMedication, .addMedication,
onPressed: () { onPressed: () {
formKey.currentState.save(); formKey.currentState.save();
// Navigator.pop(context); Navigator.pop(context);
// openDrugToDrug(); openDrugToDrug();
if (strength == null || if (strength == null ||
route == null || route == null ||
frequency == null || frequency == null ||
@ -819,9 +821,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column( child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
DrugToDrug(widget.patient), DrugToDrug(widget.patient, widget.prescriptionList),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
child: AppButton( child: AppButton(
title: TranslationBase.of(context).addMedication, title: TranslationBase.of(context).addMedication,
onPressed: () { onPressed: () {

@ -1,5 +1,8 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/prescription_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
@ -16,13 +19,15 @@ import 'package:flutter/material.dart';
class DrugToDrug extends StatefulWidget { class DrugToDrug extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
DrugToDrug(this.patient); final prescription;
DrugToDrug(this.patient, this.prescription);
@override @override
_DrugToDrug createState() => _DrugToDrug(); _DrugToDrug createState() => _DrugToDrug();
} }
class _DrugToDrug extends State<DrugToDrug> { class _DrugToDrug extends State<DrugToDrug> {
int typeID = 1; int typeID = 1;
bool isLoaded = false;
List<Map<dynamic, dynamic>> expandableList = [ List<Map<dynamic, dynamic>> expandableList = [
{'name': 'CRITICAL'}, {'name': 'CRITICAL'},
{'name': 'HIGH'}, {'name': 'HIGH'},
@ -30,38 +35,39 @@ class _DrugToDrug extends State<DrugToDrug> {
{'name': 'LOW'}, {'name': 'LOW'},
{'name': 'INFO'}, {'name': 'INFO'},
]; ];
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: 2954208, //widget.patient.patientMRN,
episodeId: 210011002, //widget.patient.episodeNo,
appointmentNo: 2016055308, //widget.patient.appointmentNo,
doctorID: '',
editedBy: '');
VitalSignsViewModel model = new VitalSignsViewModel();
SOAPViewModel model2 = new SOAPViewModel();
@override @override
void initState() { void initState() {
getTypeID(); getTypeID();
getRequestedData();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( return isLoaded == true
patientMRN: 2954208, //widget.patient.patientMRN, ? BaseView<PrescriptionViewModel>(
episodeId: 210011002, //widget.patient.episodeNo,
appointmentNo: 2016055308, //widget.patient.appointmentNo,
doctorID: '',
editedBy: '');
return BaseView<VitalSignsViewModel>(
onModelReady: (model) => model.getPatientVitalSign(widget.patient),
builder: (BuildContext context, model, Widget child) {
return BaseView<SOAPViewModel>(
onModelReady: (model2) =>
model2.getPatientAllergy(generalGetReqForSOAP),
builder: (BuildContext context, model2, Widget child) {
return BaseView<PrescriptionViewModel>(
onModelReady: (model3) => model3.getDrugToDrug( onModelReady: (model3) => model3.getDrugToDrug(
model.patientVitalSigns, model2.patientAllergiesList), model.patientVitalSigns,
builder: (BuildContext context, model2.listOfDiagnosisType,
PrescriptionViewModel model3, Widget child) => model2.patientAllergiesList,
widget.patient,
widget.prescription),
builder: (BuildContext context, PrescriptionViewModel model3,
Widget child) =>
NetworkBaseView( NetworkBaseView(
baseViewModel: model3, baseViewModel: model3,
child: Container( child: Container(
height: SizeConfig.realScreenHeight * .45, height: SizeConfig.realScreenHeight * .4,
child: new ListView.builder( child: new ListView.builder(
itemCount: expandableList.length, itemCount: expandableList.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
@ -75,9 +81,13 @@ class _DrugToDrug extends State<DrugToDrug> {
), ),
children: <Widget>[Text('Hi')], children: <Widget>[Text('Hi')],
); );
})))); }))))
}); : Container(
}); height: SizeConfig.realScreenHeight * .45,
child: Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.black),
)));
} }
getTypeID() async { getTypeID() async {
@ -86,4 +96,15 @@ class _DrugToDrug extends State<DrugToDrug> {
typeID = type; typeID = type;
}); });
} }
getRequestedData() async {
await model.getPatientVitalSign(widget.patient);
await model2.getPatientAllergy(generalGetReqForSOAP);
await model2.getMasterLookup(MasterKeysService.DiagnosisType);
if (model.state == ViewState.Idle && model2.state == ViewState.Idle) {
setState(() {
isLoaded = true;
});
}
}
} }

@ -128,7 +128,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
InkWell( InkWell(
onTap: () { onTap: () {
addPrescriptionForm( addPrescriptionForm(
context, model, patient); context,
model,
patient,
model.prescriptionList);
//model.postPrescription(); //model.postPrescription();
}, },
child: CircleAvatar( child: CircleAvatar(
@ -219,7 +222,10 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
), ),
onTap: () { onTap: () {
addPrescriptionForm( addPrescriptionForm(
context, model, patient); context,
model,
patient,
model.prescriptionList);
//model.postPrescription(); //model.postPrescription();
}, },
), ),
@ -516,8 +522,8 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
addPrescriptionForm( addPrescriptionForm(context, model,
context, model, patient); patient, model.prescriptionList);
//model.postPrescription(); //model.postPrescription();
}, },
child: CircleAvatar( child: CircleAvatar(

@ -63,6 +63,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
bool authenticated; bool authenticated;
var fingrePrintBefore;
var selectedOption;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -105,7 +109,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
helpers.showErrorToast('Error: ${snapshot.error}'); helpers.showErrorToast('Error: ${snapshot.error}');
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
return Container( return SingleChildScrollView(
child: Container(
height: SizeConfig.realScreenHeight,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -155,18 +161,17 @@ class _VerificationMethodsState extends State<VerificationMethods> {
TextOverflow.ellipsis, TextOverflow.ellipsis,
), ),
subtitle: Text( subtitle: Text(
// user. != null user.editedOn != null
// ? formatDate(Helpers ? formatDate(Helpers
// .convertStringToDate( .convertStringToDate(
// user user
// .)) .editedOn))
// : user != : user.createdOn !=
// null null
// ? formatDate(Helpers ? formatDate(Helpers
// .convertStringToDate(user .convertStringToDate(user
// .createdOn)) .createdOn))
//: : '--',
'--',
overflow: overflow:
TextOverflow.ellipsis, TextOverflow.ellipsis,
textAlign: textAlign:
@ -263,7 +268,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
3, authProv)), 3, authProv)),
Expanded( Expanded(
child: getButton( child: getButton(
2, authProv)) 4, authProv))
], ],
) )
: SizedBox(), : SizedBox(),
@ -275,7 +280,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
child: child:
getButton(1, authProv)), getButton(1, authProv)),
Expanded( Expanded(
child: getButton(4, authProv)) child: getButton(2, authProv))
], ],
), ),
]), ]),
@ -307,7 +312,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
)) ))
], ],
), ),
); ));
} }
} }
}); });
@ -342,14 +347,13 @@ class _VerificationMethodsState extends State<VerificationMethods> {
authProv authProv
.sendActivationCodeForDoctorApp(activationCodeModel) .sendActivationCodeForDoctorApp(activationCodeModel)
.then((res) { .then((res) {
widget.changeLoadingStata(false);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print("VerificationCode : " + res["VerificationCode"]); print("VerificationCode : " + res["VerificationCode"]);
sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]);
sharedPref.setString( sharedPref.setString(
VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]);
sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]);
sharedPref.setString(PASSWORD, widget.password);
this.startSMSService(oTPSendType, authProv); this.startSMSService(oTPSendType, authProv);
} else { } else {
print(res['ErrorEndUserMessage']); print(res['ErrorEndUserMessage']);
@ -380,9 +384,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
sendActivationCodeVerificationScreen( sendActivationCodeVerificationScreen(
oTPSendType, AuthViewModel authProv) async { oTPSendType, AuthViewModel authProv) async {
// TODO : build enum for verfication method // TODO : build enum for verfication method
if (oTPSendType == 1 || oTPSendType == 2) { //if (oTPSendType == 1 || oTPSendType == 2) {
widget.changeLoadingStata(true); widget.changeLoadingStata(true);
ActivationCodeModel2 activationCodeModel = ActivationCodeModel2( ActivationCodeModel2 activationCodeModel = ActivationCodeModel2(
iMEI: user.iMEI,
facilityId: user.projectID, facilityId: user.projectID,
memberID: user.doctorID, memberID: user.doctorID,
zipCode: user.outSA == true ? '971' : '966', zipCode: user.outSA == true ? '971' : '966',
@ -396,15 +401,18 @@ class _VerificationMethodsState extends State<VerificationMethods> {
authProv authProv
.sendActivationCodeVerificationScreen(activationCodeModel) .sendActivationCodeVerificationScreen(activationCodeModel)
.then((res) { .then((res) {
widget.changeLoadingStata(false);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print("VerificationCode : " + res["VerificationCode"]); print("VerificationCode : " + res["VerificationCode"]);
sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]);
sharedPref.setString( sharedPref.setString(
VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]);
sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]);
if (oTPSendType == 1 || oTPSendType == 2) {
widget.changeLoadingStata(false);
this.startSMSService(oTPSendType, authProv); this.startSMSService(oTPSendType, authProv);
} else {
checkActivationCode(authProv);
}
} else { } else {
print(res['ErrorEndUserMessage']); print(res['ErrorEndUserMessage']);
helpers.showErrorToast(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']);
@ -416,19 +424,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
helpers.showErrorToast(); helpers.showErrorToast();
}); });
} catch (e) {} } catch (e) {}
} else { // }
// TODO route to this page with parameters to inicate we should present 2 option // else {
if (Platform.isAndroid && oTPSendType == 3) { // checkActivationCode(authProv);
helpers.showErrorToast('Your device not support this feature'); // }
} else {
// Navigator.of(context).push(MaterialPageRoute(
// builder: (BuildContext context) =>
// VerificationMethodsScreen(password: widget.password,)));
// Navigator.of(context).pushNamed(VERIFICATION_METHODS,
// arguments: {'verificationMethod': oTPSendType});
}
}
} }
Widget getButton(flag, authProv) { Widget getButton(flag, authProv) {
@ -635,10 +634,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
authenticateUser(type, isActive, authProv) { authenticateUser(type, isActive, authProv) {
//GifLoaderDialogUtils.showMyDialog(context); //GifLoaderDialogUtils.showMyDialog(context);
// if (type == 2 || type == 3) { if (type == 3 || type == 4) {
// fingrePrintBefore = type; fingrePrintBefore = type;
// } }
//this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type; this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type;
switch (type) { switch (type) {
case 1: case 1:
@ -657,55 +656,14 @@ class _VerificationMethodsState extends State<VerificationMethods> {
default: default:
break; break;
} }
// sharedPref.setInt(LAST_LOGIN, sharedPref.setInt(OTP_TYPE, selectedOption);
// this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); // sharedPref.setInt(LAST_LOGIN),
} }
loginWithSMS(type, isActive, authProv) { loginWithSMS(type, isActive, authProv) {
this.sendActivationCode(type, authProv); this.sendActivationCode(type, authProv);
// //if (!el.disabled) {
// if (this.user != null) {
// this.checkUserAuthentication(type);
// } else {
// // if (this.loginTokenID != null) {
// this.sendActivationCode(type, authProv);
// // } else {
// //this.checkUserAuthentication(type);
// // }
// }
} }
// checkUserAuthentication(type) {
// // showLoader(true);
// // var req = getCommonRequest(type: type);
// // req.logInTokenID = "";
// // var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
// // sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
// // authService
// // .checkPatientAuthentication(request)
// // .then((value) => {
// // GifLoaderDialogUtils.hideDialog(context),
// // if (value['isSMSSent'])
// // {
// // sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
// // this.loginTokenID = value['LogInTokenID'],
// // sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
// // // Future.delayed(Duration(seconds: 1), () {
// // this.sendActivationCode(type)
// // // })
// // }
// // else
// // {
// // if (value['IsAuthenticated']) {this.checkActivationCode()}
// // }
// // })
// // .catchError((err) {
// // print(err);
// // GifLoaderDialogUtils.hideDialog(context);
// // });
// }
Future<void> _getAvailableBiometrics() async { Future<void> _getAvailableBiometrics() async {
var availableBiometrics; var availableBiometrics;
try { try {
@ -729,11 +687,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
startSMSService(type, authProv) { startSMSService(type, authProv) {
sharedPref.setInt(OTP_TYPE, type);
new SMSOTP( new SMSOTP(
context, context,
type, type,
_loggedUser['MobileNumber'], _loggedUser != null ? _loggedUser['MobileNumber'] : user.mobile,
(value) { (value) {
showDialog( showDialog(
context: context, context: context,
@ -746,7 +703,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
this.checkActivationCode(authProv, value: value); this.checkActivationCode(authProv, value: value);
}, },
() => { () => {
Navigator.pop(context), //Navigator.pop(context),
print('Faild..'), print('Faild..'),
}, },
).displayDialog(context); ).displayDialog(context);
@ -759,31 +716,29 @@ class _VerificationMethodsState extends State<VerificationMethods> {
localizedReason: 'Scan your fingerprint to authenticate', localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true, useErrorDialogs: true,
stickyAuth: true); stickyAuth: true);
if (user.logInTypeID == 1 || user.logInTypeID == 2) { if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) {
this.onlySMSBox = true; this.sendActivationCode(type, authProv);
// this.checkActivationCode(authProv);
} else { } else {
this.checkActivationCode(authProv); setState(() {
this.onlySMSBox = true;
});
} }
// if (authenticated == true) {
// if (user != null && (user.logInTypeID == 4 || user.logInTypeID == 3)) {
// //this.checkActivationCode();
// } else {
// // var request = this.getCommonRequest(type: type);
// // this.getMobileInfo(request);
// }
// }
} }
} }
checkActivationCode(AuthViewModel authProv, {value}) async { checkActivationCode(AuthViewModel authProv, {value}) async {
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel( new CheckActivationCodeRequestModel(
zipCode: _loggedUser['ZipCode'], zipCode:
mobileNumber: _loggedUser['MobileNumber'], _loggedUser != null ? _loggedUser['ZipCode'] : user.zipCode,
projectID: await sharedPref.getInt(PROJECT_ID), mobileNumber:
_loggedUser != null ? _loggedUser['MobileNumber'] : user.mobile,
projectID: await sharedPref.getInt(PROJECT_ID) != null
? await sharedPref.getInt(PROJECT_ID)
: user.projectID,
logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID),
activationCode: value, activationCode: value ?? '0000',
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
generalid: "Cs2020@2016\$2958"); generalid: "Cs2020@2016\$2958");

Loading…
Cancel
Save