add livecare send instructions

merge-requests/722/head
mosazaid 4 years ago
parent 3edb4f68cf
commit 0fe6d880fd

@ -89,6 +89,7 @@ const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/RES
const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction';
const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';

@ -103,6 +103,19 @@ class LiveCarePatientServices extends BaseService {
}, isLiveCare: _isLive);
}
Future sendSMSInstruction(int vcID) async {
hasError = false;
await baseAppClient.post(SEND_SMS_INSTRUCTIONS,
onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"VC_ID": vcID,
}, isLiveCare: _isLive);
}
Future getAlternativeServices(int vcID) async {
hasError = false;
alternativeServicesList.clear();

@ -153,6 +153,18 @@ class LiveCarePatientViewModel extends BaseViewModel {
}
}
Future sendSMSInstruction(int vcID) async {
setState(ViewState.BusyLocal);
await _liveCarePatientServices.sendSMSInstruction(vcID);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
} else {
await getPendingPatientERForDoctorApp();
setState(ViewState.Idle);
}
}
searchData(String str) {
var strExist = str.length > 0 ? true : false;
if (strExist) {

@ -136,7 +136,24 @@ class _EndCallScreenState extends State<EndCallScreen> {
TranslationBase.of(context).instruction,
"",
'patient/health_summary.png',
onTap: () {},
onTap: () {
Helpers.showConfirmationDialog(context,
"${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).sendLC}${TranslationBase.of(context).instruction} ?",
() async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
liveCareModel.sendSMSInstruction(widget.patient.vcId);
GifLoaderDialogUtils.hideDialog(context);
if (liveCareModel.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else {
DrAppToastMsg.showSuccesToast("You successfully sent SMS instructions");
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
}
});
},
isInPatient: isInpatient,
isDartIcon: true,
isDisable: true,

Loading…
Cancel
Save