Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into fix-issues

 Conflicts:
	lib/screens/prescription/update_prescription_form.dart
merge-requests/312/head
hussam al-habibeh 5 years ago
commit 925d21f29a

@ -27,7 +27,8 @@ const PATIENT_GET_CLINIC_BY_PROJECT_URL =
const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo";
const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics";
//const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities';
const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo';
const GET_PATIENT_VITAL_SIGN = const GET_PATIENT_VITAL_SIGN =

@ -49,6 +49,20 @@ class PatientReferralService extends LookupService {
}, body: info); }, body: info);
} }
Future getReferralFacilities() async {
hasError = false;
Map<String, dynamic> body = Map();
body['isSameBranch'] = false;
await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async {
projectsList = response['ProjectInfo'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getProjectInfo(int projectId) async { Future getProjectInfo(int projectId) async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['ProjectID'] = projectId; body['ProjectID'] = projectId;

@ -62,7 +62,7 @@ class PatientReferralViewModel extends BaseViewModel {
Future getBranches() async { Future getBranches() async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _referralPatientService.getProjectsList(); await _referralPatientService.getReferralFacilities();
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -77,7 +77,7 @@ class PatientReferralViewModel extends BaseViewModel {
await _referralPatientService.getProjectInfo(projectId); await _referralPatientService.getProjectInfo(projectId);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
@ -87,7 +87,7 @@ class PatientReferralViewModel extends BaseViewModel {
await _referralPatientService.getDoctorsList(clinicId); await _referralPatientService.getDoctorsList(clinicId);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
@ -177,15 +178,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedBranch = null; _selectedBranch = null;
_selectedClinic = null; _selectedClinic = null;
_selectedDoctor = null; _selectedDoctor = null;
model.getDoctorBranch().then((value) { model.getDoctorBranch().then((value) async {
_selectedBranch = value; _selectedBranch = value;
if (_referTo['id'] == 1) { if (_referTo['id'] == 1) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model await model
.getClinics(_selectedBranch['facilityId']) .getClinics(_selectedBranch['facilityId'])
.then((_) => .then((_) =>
GifLoaderDialogUtils.hideDialog( GifLoaderDialogUtils.hideDialog(
context)); context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
} }
}); });
}); });
@ -226,15 +230,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
attributeValueId: 'facilityId', attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() async {
_selectedBranch = selectedValue; _selectedBranch = selectedValue;
_selectedClinic = null; _selectedClinic = null;
_selectedDoctor = null; _selectedDoctor = null;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model await model
.getClinics(_selectedBranch['facilityId']) .getClinics(_selectedBranch['facilityId'])
.then((_) => .then((_) =>
GifLoaderDialogUtils.hideDialog(context)); GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
}); });
}, },
); );
@ -277,15 +284,18 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
TranslationBase.of(context).clinicSearch, TranslationBase.of(context).clinicSearch,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() async {
_selectedDoctor = null; _selectedDoctor = null;
_selectedClinic = selectedValue; _selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model await model
.getClinicDoctors( .getClinicDoctors(
_selectedClinic['ClinicID'].toString()) _selectedClinic['ClinicID'].toString())
.then((_) => .then((_) =>
GifLoaderDialogUtils.hideDialog(context)); GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
}); });
}, },
); );

@ -343,17 +343,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.width * .width *
0.550, 0.550,
child: TextFields( child: TextFields(
inputFormatters: [ // inputFormatters: [
LengthLimitingTextInputFormatter( // LengthLimitingTextInputFormatter(
4), // 4),
WhitelistingTextInputFormatter // WhitelistingTextInputFormatter
.digitsOnly // .digitsOnly
], // ],
hintText: hintText:
TranslationBase.of(context) TranslationBase.of(context)
.strength, .strength,
controller: strengthController, controller: strengthController,
keyboardType: TextInputType.number, keyboardType: TextInputType.numberWithOptions(decimal: true,),
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = value.length; strengthChar = value.length;

@ -578,10 +578,10 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration(
model model
.patientAssessmentList[ .patientAssessmentList.isNotEmpty? model.patientAssessmentList[
0] 0]
.icdCode10ID .icdCode10ID
.toString(), .toString():'',
indication != null indication != null
? indication['name'] ? indication['name']
: null, : null,
@ -608,10 +608,10 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
decoration: decoration:
textFieldSelectorDecoration( textFieldSelectorDecoration(
model model
.patientAssessmentList[ .patientAssessmentList.isNotEmpty? model.patientAssessmentList[
0] 0]
.asciiDesc .asciiDesc
.toString(), .toString():'',
indication != null indication != null
? indication['name'] ? indication['name']
: null, : null,

@ -233,11 +233,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => { onTap: () => {
authenticateUser( authenticateUser(3, true, authProv)
3,
BiometricType
.face.index,
authProv)
}, },
child: getButton( child: getButton(
user.logInTypeID, user.logInTypeID,
@ -488,8 +484,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
onTap: () => { onTap: () => {
if (checkIfBiometricAvailable(BiometricType.fingerprint)) if (checkIfBiometricAvailable(BiometricType.fingerprint))
{ {
authenticateUser( authenticateUser(3, true, authProv)
3, BiometricType.fingerprint.index, authProv)
} }
}, },
child: RoundedContainer( child: RoundedContainer(
@ -524,7 +519,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (checkIfBiometricAvailable(BiometricType.face)) { if (checkIfBiometricAvailable(BiometricType.face)) {
authenticateUser(4, BiometricType.face.index, authProv); authenticateUser(4, true, authProv);
} }
}, },
child: RoundedContainer( child: RoundedContainer(
@ -706,7 +701,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
loginWithFingurePrintFace(type, isActive, authProv) async { loginWithFingurePrintFace(type, isActive, authProv) async {
if (isActive == 1) { if (isActive) {
// this.startBiometricLoginIfAvailable(); // this.startBiometricLoginIfAvailable();
authenticated = await auth.authenticateWithBiometrics( authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate', localizedReason: 'Scan your fingerprint to authenticate',

Loading…
Cancel
Save