Fix live care issues and qr code

merge-requests/753/head
Mohammad Aljammal 5 years ago
parent e4a7f4e105
commit e70eabe68d

@ -86,7 +86,7 @@ class BaseAppClient {
int projectID = await sharedPref.getInt(PROJECT_ID);
if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true;
else if(body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3)
else if((body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3)|| body['ProjectID']==2 || body['ProjectID']==3)
body['PatientOutSA'] = true;
else
body['PatientOutSA'] = false;

@ -57,6 +57,7 @@ const Map<String, Map<String, String>> localizedValues = {
'operations': {'en': 'Operations', 'ar': 'عمليات'},
'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'},
'searchMedicineDashboard': {'en': 'Search\nMedicines', 'ar': 'بحث\nعن الدواء'},
'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'},
'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'},
'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'},
'myReferral': {'en': 'My Referral', 'ar': 'إحالة'},

@ -16,7 +16,7 @@ class PatientSearchRequestModel {
int clinicID=0;
PatientSearchRequestModel(
{this.doctorID = 0,
{this.doctorID ,
this.firstName = "0",
this.middleName = "0",
this.lastName = "0",
@ -29,7 +29,7 @@ class PatientSearchRequestModel {
this.from = "0",
this.to = "0",
this.clinicID,
this.nursingStationID = 0,this.projectID=0});
this.nursingStationID = 0,this.projectID});
PatientSearchRequestModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
@ -51,7 +51,7 @@ class PatientSearchRequestModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DoctorID'] = 0;
data['DoctorID'] = this.doctorID;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
@ -63,7 +63,7 @@ class PatientSearchRequestModel {
data['SearchType'] = this.searchType;
data['MobileNo'] = this.mobileNo;
data['IdentificationNo'] = this.identificationNo;
data['NursingStationID'] = this.nursingStationID;
//data['NursingStationID'] = this.nursingStationID;
data['ClinicID'] = this.clinicID;
data['ProjectID'] =this.projectID;
return data;

@ -27,9 +27,9 @@ class VideoCallService extends BaseService{
this.patient = patientModel;
DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true);
await VideoChannel.openVideoCallScreen(
kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", // startCallRes.openTokenID,
kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg", // startCallRes.openSessionID,
kApiKey: '47247954' ,//'46209962'
kToken: startCallRes.openTokenID,
kSessionId:startCallRes.openSessionID,
kApiKey: '46209962' ,//'46209962'
vcId: patient.vcId,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await sharedPref.getString(TOKEN),

@ -11,11 +11,11 @@ class ScanQrService extends BaseService {
hasError = false;
await getDoctorProfile();
if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID;
} else {
// if (isMyInpatient) {
// requestModel.doctorID = doctorProfile.doctorID;
// } else {
requestModel.doctorID = 0;
}
//}
await baseAppClient.post(
GET_PATIENT_IN_PATIENT_LIST,

@ -77,9 +77,11 @@ class PatientSearchViewModel extends BaseViewModel {
sortOutPatient({bool isDes = false}){
if(isDes)
filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm));
filterData= filterData.reversed.toList();
// filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm));
else
filterData.sort((PatiantInformtion a, PatiantInformtion b)=>AppDateUtils.convertStringToDate(a.appointmentDate).compareTo(AppDateUtils.convertStringToDate(b.appointmentDate)));
filterData= filterData.reversed.toList();
// filterData.sort((PatiantInformtion a, PatiantInformtion b)=>a.appointmentDateWithDateTimeForm.compareTo(b.appointmentDateWithDateTimeForm));
setState(ViewState.Idle);
}

@ -255,7 +255,7 @@ class AuthenticationViewModel extends BaseViewModel {
/// add  token to shared preferences in case of send activation code is success
setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) {
print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
// DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode);
sharedPref.setString(VIDA_AUTH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
sharedPref.setString(VIDA_REFRESH_TOKEN_ID,

@ -39,7 +39,7 @@ class _InsuranceApprovalScreenNewState
? (model) => model.getInsuranceInPatient(mrn: patient.patientId)
: patient.appointmentNo != null
? (model) => model.getInsuranceApproval(patient,
appointmentNo: patient?.appointmentNo,
appointmentNo: int.parse(patient?.appointmentNo.toString()) ,
projectId: patient.projectId)
: (model) => model.getInsuranceApproval(patient),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>

@ -46,6 +46,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
bool isCallFinished = false;
bool isDischargedPatient = false;
bool isSearchAndOut = false;
bool isCallStarted = false;
String patientType;
String arrivalType;
String from;
@ -228,16 +229,12 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
height: 30,
),
onPressed: () async {
if ((isFromLiveCare &&
patient.appointmentNo != null &&
patient.appointmentNo != 0) ||
patient.patientStatusType ==
43) {
if ((isFromLiveCare && patient.appointmentNo != null ) || patient.patientStatusType == 43) {
PostEpisodeReqModel
postEpisodeReqModel =
PostEpisodeReqModel(
appointmentNo:
patient.appointmentNo,
int.parse(patient.appointmentNo.toString()),
patientMRN:
patient.patientMRN);
GifLoaderDialogUtils.showMyDialog(
@ -283,10 +280,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
height: 30,
),
onPressed: () {
if ((isFromLiveCare &&
patient.appointmentNo !=
null &&
patient.appointmentNo != 0) ||
if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) ||
patient.patientStatusType ==
43) {
Navigator.of(context).pushNamed(
@ -294,7 +288,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
arguments: {
'patient': patient
});
}
}
}),
],
),
@ -331,18 +325,13 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
title: isCallFinished?
TranslationBase.of(context).endCall:
TranslationBase.of(context).initiateCall,
disabled: model.state == ViewState.BusyLocal,
disabled: isCallStarted || model.state == ViewState.BusyLocal,
onPressed: () async {
// Navigator.push(context, MaterialPageRoute(
// builder: (BuildContext context) =>
// EndCallScreen(patient:patient)));
// TODO MOSA remov it and uncomment the below code
AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
});
/* if(isCallFinished) {
if(isCallFinished) {
Navigator.push(context, MaterialPageRoute(
builder: (BuildContext context) => EndCallScreen(patient:patient)));
} else {
@ -354,15 +343,23 @@ class _PatientProfileScreenState extends State<PatientProfileScreen>
Helpers.showErrorToast(model.error);
} else {
await model.getDoctorProfile();
patient.appointmentNo = model.startCallRes.appointmentNo;
patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
patient.episodeNo = 0;
setState(() {
isCallStarted = true;
});
GifLoaderDialogUtils.hideDialog(context);
AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
});
}
}*/
}
// AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){
// locator<VideoCallService>().openVideo(model.startCallRes, patient, callConnected, callDisconnected);
// });
},

@ -55,7 +55,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: widget.patientInfo.appointmentNo);
appointmentNo: int.parse(widget.patientInfo.appointmentNo));
await model.getPatientAssessment(getAssessmentReqModel);
if (model.patientAssessmentList.isNotEmpty) {
if (model.listOfDiagnosisCondition.length == 0) {

@ -67,7 +67,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
GetPhysicalExamReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo);
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()));
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
if (model.patientPhysicalExamList.isNotEmpty) {

@ -78,7 +78,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
onModelReady: (model) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
GetGetProgressNoteReqModel(
appointmentNo: widget.patientInfo.appointmentNo,
appointmentNo: int.parse(widget.patientInfo.appointmentNo),
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);

@ -63,7 +63,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo,
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
doctorID: '',
editedBy: '');
@ -152,7 +152,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP);
@ -201,7 +201,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN,
appointmentNo: widget.patientInfo.appointmentNo,
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()),
episodeId: widget.patientInfo.episodeNo,
episodeID: widget.patientInfo.episodeNo,
doctorID: '');

@ -186,7 +186,7 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
setState(() {
SpeechToText.closeAlertDialog(context);
speech.stop();
indicationController.text += reconizedWord + '\n';
instructionController.text += reconizedWord + '\n';
});
} else {
print(result.finalResult);

@ -82,7 +82,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
int patientID = 0;
if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]);
PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel(
patientID: patientID,
patientID: patientID,clinicID: 0,
doctorID: 0,
projectID: int.parse(listOfParams[0])
);
@ -93,6 +94,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
else
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.inPatientList[0],
"isInpatient": true,
});
} else {
DrAppToastMsg.showErrorToast(model.error);

Loading…
Cancel
Save