gub fixes

merge-requests/267/head
Sultan Khan 4 years ago
parent 40cfad7f7b
commit 896078507f

@ -96,8 +96,9 @@ class BaseAppClient {
} else {
var parsed = json.decode(response.body.toString());
if (!parsed['IsAuthenticated']) {
await helpers.logout();
helpers.showErrorToast('Your session expired Please login agian');
onFailure(getError(parsed), statusCode);
//await helpers.logout();
//helpers.showErrorToast('Your session expired Please login agian');
} else if (parsed['MessageStatus'] == 1) {
if (!parsed['IsAuthenticated'])
onFailure(getError(parsed), statusCode);

@ -101,7 +101,60 @@ class PrescriptionService extends BaseService {
List<PrescriptionModel> prescription) async {
Map<String, dynamic> request = {
"Prescription": {
"objPatientInfo": {"Gender": patient.gender, "Age": patient.age},
"objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"},
"objVitalSign": {"Height": "180", "Weight": "37"},
"objPrescriptionItems": [
{
"DrugId": "83-20-00-30-20-03-03",
"DrugName": "WARFARIN 1 MG TAB 28'S (N)",
"Dose": "1",
"DoseType": "04",
"Unit": "actuation(s)",
"FrequencyType": "1/3/Day",
"Duration": "3/Day",
"IsScreen": "true"
},
{
"DrugId": "64-20-00-10-00-03-15",
"DrugName": "PANADOL 500 MG TAB 24'S(DIS)",
"Dose": "1",
"DoseType": "04",
"Unit": "MG",
"FrequencyType": "3/1/Day",
"Duration": "4/Day",
"RouteID": "24",
"IsScreen": "true"
}
],
"objAllergies": {
"Allergy": {
"objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"}
}
},
"objDiagnosis": {
"Diagnosis": {
"objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"}
}
},
"IsDoctor": "false",
"IsPharmacist": "false"
},
"IPAdress": "10.10.10.10",
"Channel": 9,
"LanguageID": 2,
"VersionID": 5.3,
"SessionID": "BlUSkYymTt",
"IsLoginForDoctorApp": true,
"PatientOutSA": 0,
"TokenID": "@dm!n",
"OutSA": true
};
Map<String, dynamic> requestN = {
"Prescription": {
"objPatientInfo": {
"Gender": patient.gender == 1 ? 'Male' : 'Female',
"Age": patient.age
},
"objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg},
"objPrescriptionItems": prescription[0].entityList,
"objAllergies": allergy,

@ -714,9 +714,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
title: TranslationBase.of(context)
.addMedication,
onPressed: () {
formKey.currentState.save();
Navigator.pop(context);
openDrugToDrug();
// formKey.currentState.save();
// Navigator.pop(context);
// openDrugToDrug();
if (strength == null ||
route == null ||
frequency == null ||

@ -71,6 +71,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
void initState() {
super.initState();
_loggedUserFuture = getSharedPref();
_getAvailableBiometrics();
}
Future<void> getSharedPref() async {
@ -499,9 +500,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
authenticateUser(3, BiometricType.fingerprint.index, authProv)
},
child: RoundedContainer(
backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
backgroundColor:
checkIfBiometricAvailable(BiometricType.fingerprint)
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey,
showBorder: true,
child: Padding(
@ -566,9 +568,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
})
},
child: RoundedContainer(
backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
backgroundColor: Colors.white,
borderColor: Colors.grey,
showBorder: true,
child: Padding(
@ -756,11 +756,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
getDocProfiles(clinic, authProv);
}
} else {
//changeLoadingStata(false);
Navigator.pop(context);
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
}).catchError((err) {
//changeLoadingStata(false);
Navigator.pop(context);
helpers.showErrorToast(err);
});
}

@ -52,7 +52,7 @@ class SMSOTP {
String errorMsg;
ProjectViewModel projectProvider;
String displayTime = '';
bool isClosed = false;
displayDialog(BuildContext context) async {
return showDialog(
context: context,
@ -65,6 +65,7 @@ class SMSOTP {
IconButton(
icon: Icon(Icons.close),
onPressed: () {
this.isClosed = true;
Navigator.pop(context);
this.onFailure();
},
@ -307,7 +308,7 @@ class SMSOTP {
timer = Future.delayed(Duration(seconds: 1), () {
if (this.remainingTime > 0) {
startTimer(setState);
if (isClosed == false) startTimer(setState);
} else {
Navigator.pop(context);
}

Loading…
Cancel
Save