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 4 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 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_PATIENT_VITAL_SIGN =

@ -49,6 +49,20 @@ class PatientReferralService extends LookupService {
}, 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 {
Map<String, dynamic> body = Map();
body['ProjectID'] = projectId;

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

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

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

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

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

Loading…
Cancel
Save