Null Safety Fixes

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent 941134da49
commit 3b2ee0ef65

@ -24,7 +24,6 @@ class LabResultHistory {
String? verifiedOn;
String? verifiedOnDateTime;
LabResultHistory(
{this.description,
this.femaleInterpretativeData,
@ -79,7 +78,7 @@ class LabResultHistory {
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
final Map<String, dynamic> data = Map<String, dynamic>();
data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender;

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart';
@ -183,6 +185,7 @@ class LabsService extends BaseService {
await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultHistoryList.clear();
response['ListGeneralResultHistory'].forEach((lab) {
print(jsonEncode(lab));
labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab));
});
}, onFailure: (String error, int statusCode) {

@ -3,26 +3,24 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart';
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart';
class LiveCarePatientViewModel extends BaseViewModel {
List<PatiantInformtion> filterData = [];
LiveCarePatientServices _liveCarePatientServices =
locator<LiveCarePatientServices>();
LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>();
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes;
StartCallRes? get startCallRes => _liveCarePatientServices.startCallRes;
List<AlternativeService> get alternativeServicesList =>
_liveCarePatientServices.alternativeServicesList;
List<AlternativeService> get alternativeServicesList => _liveCarePatientServices.alternativeServicesList;
DashboardService _dashboardService = locator<DashboardService>();
@ -33,12 +31,8 @@ class LiveCarePatientViewModel extends BaseViewModel {
setState(ViewState.BusyLocal);
}
PendingPatientERForDoctorAppRequestModel
pendingPatientERForDoctorAppRequestModel =
PendingPatientERForDoctorAppRequestModel(
sErServiceID: _dashboardService.sServiceID, outSA: false);
await _liveCarePatientServices.getPendingPatientERForDoctorApp(
pendingPatientERForDoctorAppRequestModel);
PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false);
await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
@ -170,16 +164,11 @@ class LiveCarePatientViewModel extends BaseViewModel {
if (strExist) {
filterData = [];
for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) {
String fullName =
_liveCarePatientServices.patientList[i].fullName!.toUpperCase();
String patientID =
_liveCarePatientServices.patientList[i].patientId.toString();
String mobile =
_liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase();
if (fullName.contains(str.toUpperCase()) ||
patientID.contains(str) ||
mobile.contains(str)) {
String fullName = _liveCarePatientServices.patientList[i].fullName!.toUpperCase();
String patientID = _liveCarePatientServices.patientList[i].patientId.toString();
String mobile = _liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase();
if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) {
filterData.add(_liveCarePatientServices.patientList[i]);
}
}
@ -193,16 +182,13 @@ class LiveCarePatientViewModel extends BaseViewModel {
Future isLogin(int loginStatus) async {
await getDoctorProfile(isGetProfile: true);
LiveCareUserLoginRequestModel userLoginRequestModel =
new LiveCareUserLoginRequestModel();
userLoginRequestModel.isOutKsa =
(doctorProfile!.projectID == 2 || doctorProfile!.projectID == 3) ? 1 : 0;
LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel();
userLoginRequestModel.isOutKsa = (doctorProfile!.projectID == 2 || doctorProfile!.projectID == 3) ? 1 : 0;
userLoginRequestModel.isLogin = loginStatus;
userLoginRequestModel.generalid = "Cs2020@2016\$2958";
setState(ViewState.BusyLocal);
await _liveCarePatientServices.isLogin(
loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel);
await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel);
if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal);
@ -220,8 +206,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 2, serviceName: "LABORATORY"),
);
alternativeServicesList.add(
AlternativeService(
serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"),
AlternativeService(serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"),
);
alternativeServicesList.add(
AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"),
@ -242,8 +227,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"),
);
alternativeServicesList.add(
AlternativeService(
serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"),
AlternativeService(serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"),
);
alternativeServicesList.add(
AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"),

@ -95,7 +95,7 @@ class SOAPViewModel extends BaseViewModel {
get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel;
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList;
List<GetMedicationResponseModel>? get allMedicationList => _prescriptionService.allMedicationList;
late SubjectiveCallBack subjectiveCallBack;
@ -249,8 +249,8 @@ class SOAPViewModel extends BaseViewModel {
String getAllergicNames(isArabic) {
String allergiesString = '';
patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!)!;
if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ')!;
MasterKeyModel? selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!);
if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ');
});
return allergiesString;
}
@ -447,7 +447,7 @@ class SOAPViewModel extends BaseViewModel {
episodeId: patientInfo.episodeNo,
episodeID: patientInfo.episodeNo,
doctorID: '');
var services = [_SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)];
var services = [await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)];
if (patientInfo.admissionNo == null) {
complaintsControllerError = '';
@ -455,62 +455,62 @@ class SOAPViewModel extends BaseViewModel {
illnessControllerError = '';
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
services.add(_SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true));
services.add(await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true));
GeneralGetReqForSOAP generalGetReqForSOAP =
GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
services.add(_SOAPService.getPatientAllergy(generalGetReqForSOAP));
services.add(await _SOAPService.getPatientAllergy(generalGetReqForSOAP));
}
final results = await Future.wait(services);
final results = services;
await callServicesAfterGetPatientInfoForUpdateSubject();
}
callServicesAfterGetPatientInfoForUpdateSubject() async {
var services;
List services = [];
if (patientHistoryList.isNotEmpty) {
if (historyFamilyList.isEmpty) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)];
if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily));
}
}
if (historyMedicalList.isEmpty) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)];
if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical));
}
if (historySurgicalList.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)];
if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical));
}
if (historySportList.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySports)];
if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.HistorySports)];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySports));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistorySports));
}
}
if (patientAllergiesList.isNotEmpty) {
if (allergiesList.isEmpty) if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.Allergies)];
if (allergiesList.isEmpty) if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.Allergies)];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.Allergies));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.Allergies));
if (allergySeverityList.isEmpty) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)];
if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)];
} else
services.add(_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity));
}
}
final results = await Future.wait(services ?? []);
final results = services;
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -524,37 +524,37 @@ class SOAPViewModel extends BaseViewModel {
List services = [];
if (medicationStrengthList.length == 0) {
if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)];
services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength));
}
}
if (medicationFrequencyList.length == 0) {
if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)];
services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency));
}
}
if (medicationDoseTimeList.length == 0) {
if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)];
services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime));
}
}
if (medicationRouteList.length == 0) {
if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)];
services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute));
}
}
if (allMedicationList.length == 0) {
if (allMedicationList!.isEmpty) {
if (services.isEmpty) {
services = [_prescriptionService.getMedicationList()];
services = [await _prescriptionService.getMedicationList()];
} else {
services.add(_prescriptionService.getMedicationList());
services.add(await _prescriptionService.getMedicationList());
}
}
@ -568,30 +568,30 @@ class SOAPViewModel extends BaseViewModel {
callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async {
if (allowSetState) setState(ViewState.Busy);
var services;
if (listOfDiagnosisCondition.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)];
List services = [];
if (listOfDiagnosisCondition.isEmpty) {
if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition));
}
}
if (listOfDiagnosisType.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)];
if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
}
}
if (listOfICD10.length == 0) {
if (services == null) {
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)];
if (services.isEmpty) {
services = [await _SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)];
} else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey));
services.add(await _SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey));
}
}
final results = await Future.wait(services ?? []);
final results = services;
if (allowSetState) {
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -605,9 +605,9 @@ class SOAPViewModel extends BaseViewModel {
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)];
var services = [await _SOAPService.getPatientAssessment(getAssessmentReqModel)];
final results = await Future.wait(services);
final results = services;
if (patientAssessmentList.isNotEmpty) {
await callAddAssessmentLookupsServices(allowSetState: false);
@ -621,38 +621,38 @@ class SOAPViewModel extends BaseViewModel {
}
postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List<MySelectedHistory>? myHistoryList, List<MySelectedAllergy>? myAllergiesList}) async {
var services;
List services = [];
PostChiefComplaintRequestModel postChiefComplaintRequestModel =
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!);
if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
services = [await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
} else {
postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
services = [await _SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
}
if (myHistoryList!.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
if (patientHistoryList.isEmpty) {
services.add(_SOAPService.postHistories(postHistoriesRequestModel));
services.add(await _SOAPService.postHistories(postHistoriesRequestModel));
} else {
services.add(_SOAPService.patchHistories(postHistoriesRequestModel));
services.add(await _SOAPService.patchHistories(postHistoriesRequestModel));
}
}
if (myAllergiesList!.length != 0) {
PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo);
if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel));
services.add(await _SOAPService.postAllergy(postAllergyRequestModel));
} else {
services.add(_SOAPService.patchAllergy(postAllergyRequestModel));
services.add(await _SOAPService.patchAllergy(postAllergyRequestModel));
}
}
final results = await Future.wait(services);
final results = services;
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -662,7 +662,7 @@ class SOAPViewModel extends BaseViewModel {
}
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) {
return new PostChiefComplaintRequestModel(
return PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo ?? 0,

@ -1,5 +1,10 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart';
@ -7,57 +12,41 @@ import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService
import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart';
import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:flutter/cupertino.dart';
import '../../locator.dart';
class PatientReferralViewModel extends BaseViewModel {
PatientReferralService _referralPatientService =
locator<PatientReferralService>();
PatientReferralService _referralPatientService = locator<PatientReferralService>();
ReferralService _referralService = locator<ReferralService>();
MyReferralInPatientService _myReferralService =
locator<MyReferralInPatientService>();
MyReferralInPatientService _myReferralService = locator<MyReferralInPatientService>();
DischargedPatientService _dischargedPatientService =
locator<DischargedPatientService>();
DischargedPatientService _dischargedPatientService = locator<DischargedPatientService>();
List<DischargeReferralPatient> get myDischargeReferralPatient =>
_dischargedPatientService.myDischargeReferralPatients;
List<DischargeReferralPatient> get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients;
List<dynamic> get branchesList => _referralPatientService.projectsList;
List<dynamic>? get branchesList => _referralPatientService.projectsList;
List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get referralFrequencyList =>
_referralPatientService.frequencyList;
List<dynamic> get referralFrequencyList => _referralPatientService.frequencyList;
List<dynamic> doctorsList = [];
List<ClinicDoctor> get clinicDoctorsList =>
_referralPatientService.doctorsList;
List<ClinicDoctor> get clinicDoctorsList => _referralPatientService.doctorsList;
List<MyReferralPatientModel> get myReferralPatients =>
_myReferralService.myReferralPatients;
List<MyReferralPatientModel> get myReferralPatients => _myReferralService.myReferralPatients;
List<MyReferredPatientModel> get listMyReferredPatientModel =>
_referralPatientService.listMyReferredPatientModel;
List<MyReferredPatientModel> get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel;
List<PendingReferral> get pendingReferral =>
_referralPatientService.pendingReferralList;
List<PendingReferral> get pendingReferral => _referralPatientService.pendingReferralList;
List<PendingReferral> get patientReferral =>
_referralPatientService.patientReferralList;
List<PendingReferral> get patientReferral => _referralPatientService.patientReferralList;
List<PatiantInformtion> get patientArrivalList =>
_referralPatientService.patientArrivalList;
List<PatiantInformtion> get patientArrivalList => _referralPatientService.patientArrivalList;
Future getPatientReferral(PatiantInformtion patient) async {
setState(ViewState.Busy);
@ -106,8 +95,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getClinicDoctors(
PatiantInformtion patient, int clinicId, int branchId) async {
Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async {
setState(ViewState.BusyLocal);
await _referralPatientService.getDoctorsList(patient, clinicId, branchId);
if (_referralPatientService.hasError) {
@ -125,10 +113,7 @@ class PatientReferralViewModel extends BaseViewModel {
Future<dynamic> getDoctorBranch() async {
DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) {
dynamic _selectedBranch = {
"facilityId": doctorProfile.projectID,
"facilityName": doctorProfile.projectName
};
dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName};
return _selectedBranch;
}
return null;
@ -206,8 +191,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel referral) async {
Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
setState(ViewState.Busy);
await _myReferralService.replay(referredDoctorRemarks, referral);
if (_myReferralService.hasError) {
@ -217,8 +201,7 @@ class PatientReferralViewModel extends BaseViewModel {
getMyReferralPatientService();
}
Future responseReferral(
MyReferralPatientModel referralPatient, bool isAccepted) async {
Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async {
setState(ViewState.Busy);
await _referralPatientService.responseReferral(referralPatient, isAccepted);
if (_referralPatientService.hasError) {
@ -228,11 +211,9 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future makeReferral(PatiantInformtion patient, String isoStringDate,
int projectID, int clinicID, int doctorID, String remarks) async {
Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, String remarks) async {
setState(ViewState.BusyLocal);
await _referralPatientService.makeReferral(
patient, isoStringDate, projectID, clinicID, doctorID, remarks);
await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.ErrorLocal);
@ -252,7 +233,7 @@ class PatientReferralViewModel extends BaseViewModel {
String? remarks,
String? ext,
bool isLocalBusy = false}) async {
if(isLocalBusy)
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
@ -286,8 +267,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future verifyReferralDoctorRemarks(
MyReferredPatientModel referredPatient) async {
Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async {
setState(ViewState.Busy);
await _referralPatientService.verifyReferralDoctorRemarks(referredPatient);
if (_referralPatientService.hasError) {
@ -326,8 +306,7 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
PatiantInformtion getPatientFromReferral(
MyReferredPatientModel referredPatient) {
PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -355,8 +334,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient;
}
PatiantInformtion getPatientFromReferralO(
MyReferralPatientModel referredPatient) {
PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -381,8 +359,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient;
}
PatiantInformtion getPatientFromDischargeReferralPatient(
DischargeReferralPatient referredPatient) {
PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) {
PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName;
@ -401,18 +378,15 @@ class PatientReferralViewModel extends BaseViewModel {
patient.roomId = referredPatient.roomID;
patient.bedId = referredPatient.bedID;
patient.nationalityName = referredPatient.nationalityName;
patient.nationalityFlagURL =
''; // TODO from backend referredPatient.nationalityFlagURL;
patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL;
patient.age = referredPatient.age;
patient.clinicDescription = referredPatient.clinicDescription;
return patient;
}
Future replayReferred(String referredDoctorRemarks,
MyReferralPatientModel referral, int referralStatus) async {
Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referralStatus) async {
setState(ViewState.Busy);
await _myReferralService.replayReferred(
referredDoctorRemarks, referral, referralStatus);
await _myReferralService.replayReferred(referredDoctorRemarks, referral, referralStatus);
if (_myReferralService.hasError) {
error = _myReferralService.error;
setState(ViewState.ErrorLocal);

@ -252,6 +252,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
)),
),
Expanded(
@ -276,12 +277,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.Fingerprint,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.FaceID,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
))
],
)
@ -294,12 +297,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.SMS,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
)),
Expanded(
child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.WhatsApp,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
))
],
),

@ -72,11 +72,11 @@ class _EndCallScreenState extends State<EndCallScreen> {
DrAppToastMsg.showErrorToast(liveCareModel.error);
} else
await VideoChannel.openVideoCallScreen(
kToken: liveCareModel.startCallRes.openTokenID,
kSessionId: liveCareModel.startCallRes.openSessionID,
kToken: liveCareModel.startCallRes!.openTokenID,
kSessionId: liveCareModel.startCallRes!.openSessionID,
kApiKey: '46209962',
vcId: patient.vcId!,
isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording! : false,
isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes!.isRecording! : false,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID,

@ -47,7 +47,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
super.didChangeDependencies();
if (_isInit) {
_liveCareProvider = Provider.of<LiveCareViewModel>(context);
connectOpenTok(widget.model.startCallRes);
connectOpenTok(widget.model.startCallRes!);
// widget.model.startCall(vCID: widget.patientData.vcId, isReCall: false);
}
_isInit = false;

@ -3,25 +3,21 @@ import 'dart:typed_data';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../locator.dart';
import 'package:url_launcher/url_launcher_string.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
@ -157,7 +153,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
),
InkWell(
onTap: () {
launch("tel://" + model.pharmaciesList[index]["PhoneNumber"]);
launchUrlString("tel://" + model.pharmaciesList[index]["PhoneNumber"]);
},
child: Container(
decoration: BoxDecoration(
@ -247,7 +243,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
return Image.memory(base64Decode(base64String));
}
Uint8List dataFromBase64String(String base64String) {
Uint8List dataFromBase64String(String? base64String) {
if (base64String != null) {
return base64Decode(base64String);
} else {

@ -19,8 +19,8 @@ class ECGPage extends StatelessWidget {
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patient-type'];
String arrivalType = routeArgs['arrival-type'];
String patientType = routeArgs['patient-type'] ?? "";
String arrivalType = routeArgs['arrival-type'] ?? "";
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientMuseViewModel>(
onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId),

@ -5,18 +5,13 @@ import 'package:flutter/material.dart';
import '../../../../config/config.dart';
class PageStepperWidget extends StatelessWidget {
final int stepsCount;
final int currentStepIndex;
final Size? screenSize;
final List<String>? stepsTitles;
PageStepperWidget(
{this.stepsCount = 0,
this.currentStepIndex = 0,
this.screenSize,
this.stepsTitles});
PageStepperWidget({this.stepsCount = 0, this.currentStepIndex = 0, this.screenSize, this.stepsTitles});
@override
Widget build(BuildContext context) {
@ -37,7 +32,7 @@ class PageStepperWidget extends StatelessWidget {
i == stepsCount,
i < currentStepIndex,
dividerWidth,
stepsTitles: stepsTitles!,
stepsTitles: stepsTitles,
)
else
StepWidget(
@ -46,7 +41,7 @@ class PageStepperWidget extends StatelessWidget {
i == stepsCount,
i < currentStepIndex,
dividerWidth,
stepsTitles: stepsTitles!,
stepsTitles: stepsTitles,
)
],
)
@ -64,9 +59,7 @@ class StepWidget extends StatelessWidget {
final double dividerWidth;
final List<String>? stepsTitles;
StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish,
this.dividerWidth,
{this.stepsTitles});
StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles});
@override
Widget build(BuildContext context) {
@ -110,9 +103,7 @@ class StepWidget extends StatelessWidget {
child: Icon(
Icons.check,
size: 20,
color: status == StepStatus.Locked
? Color(0xFF969696)
: Colors.white,
color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.white,
)),
),
if (!isFinalStep)
@ -120,9 +111,7 @@ class StepWidget extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 4),
width: dividerWidth,
height: 2,
color: status == StepStatus.Completed
? AppGlobal.appGreenColor
: Color(0xFFCCCCCC),
color: status == StepStatus.Completed ? AppGlobal.appGreenColor : Color(0xFFCCCCCC),
),
],
),
@ -130,9 +119,7 @@ class StepWidget extends StatelessWidget {
height: 8,
),
AppText(
stepsTitles == null
? "${TranslationBase.of(context).step} $index"
: "${stepsTitles![index - 1]}",
stepsTitles == null ? "${TranslationBase.of(context).step} $index" : "${stepsTitles![index - 1]}",
fontWeight: FontWeight.bold,
color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black,
fontFamily: 'Poppins',

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-prof
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart';
import 'ucaf_detail_screen.dart';
import 'ucaf_input_screen.dart';
@ -20,8 +21,7 @@ class UCAFPagerScreen extends StatefulWidget {
_UCAFPagerScreenState createState() => _UCAFPagerScreenState();
}
class _UCAFPagerScreenState extends State<UCAFPagerScreen>
with TickerProviderStateMixin {
class _UCAFPagerScreenState extends State<UCAFPagerScreen> with TickerProviderStateMixin {
PageController? _controller;
int _currentIndex = 0;
bool _isLoading = true;
@ -60,73 +60,72 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isLoading: _isLoading,
appBar: PatientProfileAppBar(patient!),
appBarTitle: TranslationBase.of(context).ucaf,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ServiceTitle(
title: "${TranslationBase.of(context).patient}",
subTitle: "${TranslationBase.of(context).ucaf}",
),
PageStepperWidget(
stepsCount: 2,
currentStepIndex: _currentIndex + 1,
screenSize: screenSize,
),
SizedBox(
height: 10,
),
Expanded(
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UCAFInputScreen(
patient!,
changeLoadingState: changeLoadingState,
),
UcafDetailScreen(
patient!,
model,
changeLoadingState: changeLoadingState,
),
]),
),
),
],
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isLoading: _isLoading,
appBar: PatientProfileAppBar(patient!),
appBarTitle: TranslationBase.of(context).ucaf,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ServiceTitle(
title: "${TranslationBase.of(context).patient}",
subTitle: "${TranslationBase.of(context).ucaf}",
),
PageStepperWidget(
stepsCount: 2,
currentStepIndex: _currentIndex + 1,
screenSize: screenSize,
),
SizedBox(
height: 10,
),
Expanded(
child: Container(
color: Theme.of(context).scaffoldBackgroundColor,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
UCAFInputScreen(
patient!,
changeLoadingState: changeLoadingState,
),
UcafDetailScreen(
patient!,
model,
changeLoadingState: changeLoadingState,
),
]),
),
),
),
],
],
),
),
bottomSheet: _isLoading
? Container(
height: 0,
)
: UcafButtons(model),),);
),
],
),
bottomSheet: _isLoading
? Container(
height: 0,
)
: UcafButtons(model),
),
);
}
/// TODO Elham* Move to real widget
/// TODO Elham* Move to real widget
Widget UcafButtons(UcafViewModel model) {
switch (_currentIndex) {
case 0:

@ -4,7 +4,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -19,8 +18,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget {
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
}
class _VitalSignDetailsWidgetState
extends State<LabResultHistoryDetailsWidget> {
class _VitalSignDetailsWidgetState extends State<LabResultHistoryDetailsWidget> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -79,33 +77,39 @@ class _VitalSignDetailsWidgetState
List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
widget.labResultHistory.forEach((vital) {
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!);
tableRow.add(TableRow(children: [
Container(
child: Container(
padding: EdgeInsets.all(8),
color: Colors.white,
child: AppText(
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}',
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(8),
color: Colors.white,
child: AppText(
'${vital.resultValue}',
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
),
widget.labResultHistory.forEach(
(vital) {
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!);
tableRow.add(
TableRow(
children: [
Container(
child: Container(
padding: EdgeInsets.all(8),
color: Colors.white,
child: AppText(
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}',
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(8),
color: Colors.white,
child: AppText(
'${vital.resultValue}',
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
]));
});
);
},
);
return tableRow;
}
}

@ -47,8 +47,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
String? token = await sharedPref.getString(TOKEN);
String? type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
print(type);
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(

@ -158,7 +158,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
children: [
Column(
children: [
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!,
PatientProfileHeaderNewDesignAppBar(patient, arrivalType!, patientType!,
videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare,
@ -356,9 +356,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Utils.showErrorToast(model.error);
} else {
await model.getDoctorProfile();
patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString());
patient.appointmentNo = int.parse(model.startCallRes!.appointmentNo.toString());
patient.episodeNo = 0;
model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes.appointmentNo.toString()));
model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes!.appointmentNo.toString()));
setState(() {
isCallStarted = true;
});
@ -367,7 +367,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
context: context,
onTapGrant: () {
locator<VideoCallService>()
.openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording! : true, callConnected, callDisconnected);
.openVideo(model.startCallRes!, patient, model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected);
});
}
}

@ -31,7 +31,6 @@ class ProfileGridForInPatient extends StatelessWidget {
VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
@ -39,7 +38,6 @@ class ProfileGridForInPatient extends StatelessWidget {
LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).lab,
@ -47,7 +45,6 @@ class ProfileGridForInPatient extends StatelessWidget {
ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).radiology,
@ -55,7 +52,6 @@ class ProfileGridForInPatient extends StatelessWidget {
RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/Radiology.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patient,
@ -63,7 +59,6 @@ class ProfileGridForInPatient extends StatelessWidget {
ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patient,
@ -71,7 +66,6 @@ class ProfileGridForInPatient extends StatelessWidget {
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).progress,
@ -80,7 +74,6 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).order,
@ -89,7 +82,6 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/order sheets.svg',
isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).orders,
@ -105,7 +97,6 @@ class ProfileGridForInPatient extends StatelessWidget {
HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).medical,
@ -114,7 +105,6 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient,
isDisable: false,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).referral,
@ -123,7 +113,6 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).insurance,
@ -139,7 +128,6 @@ class ProfileGridForInPatient extends StatelessWidget {
DISCHARGE_SUMMARY,
'assets/images/svgs/profile_screen/discharge summary.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).patientSick,
@ -155,7 +143,6 @@ class ProfileGridForInPatient extends StatelessWidget {
GET_OPERATION_REPORT,
'assets/images/svgs/profile_screen/operating report.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).pending,
@ -163,7 +150,6 @@ class ProfileGridForInPatient extends StatelessWidget {
PENDING_ORDERS,
'assets/images/svgs/profile_screen/pending orders.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).admission,
@ -171,7 +157,6 @@ class ProfileGridForInPatient extends StatelessWidget {
ADMISSION_ORDERS,
'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
"Nursing",
@ -179,7 +164,6 @@ class ProfileGridForInPatient extends StatelessWidget {
NURSING_PROGRESS_NOTE,
'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).diagnosis,
@ -187,7 +171,6 @@ class ProfileGridForInPatient extends StatelessWidget {
DIAGNOSIS_FOR_IN_PATIENT,
'assets/images/svgs/profile_screen/diagnosis.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).diabetic,
@ -195,7 +178,6 @@ class ProfileGridForInPatient extends StatelessWidget {
DIABETIC_CHART_VALUES,
'assets/images/svgs/profile_screen/diabetic chart.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
"VTE",
@ -203,7 +185,6 @@ class ProfileGridForInPatient extends StatelessWidget {
VTE_ASSESSMENT,
'assets/images/svgs/profile_screen/diabetic chart.svg',
isInPatient: isInpatient,
//onTap: () {},
),
PatientProfileCardModel(
TranslationBase.of(context).pharmacy,
@ -211,7 +192,6 @@ class ProfileGridForInPatient extends StatelessWidget {
PHARMACY_INTERVENTION,
'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient,
//onTap: () {},
),
];
@ -219,7 +199,6 @@ class ProfileGridForInPatient extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
child: GridView(
shrinkWrap: true,
physics: BouncingScrollPhysics(),
// if you want IOS bouncing effect, otherwise remove this line
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -242,9 +221,7 @@ class ProfileGridForInPatient extends StatelessWidget {
isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable,
onTap: () {
//item.onTap();
},
onTap: item.onTap,
isLoading: item.isLoading,
);
}).toList(),

@ -51,14 +51,8 @@ class ProfileGridForOther extends StatelessWidget {
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(
TranslationBase.of(context).referral,
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null,
),
PatientProfileCardModel(TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient,

@ -3,9 +3,8 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
class RadiologyReportScreen extends StatelessWidget {
final String reportData;
@ -64,7 +63,7 @@ class RadiologyReportScreen extends StatelessWidget {
AppButton(
title: TranslationBase.of(context).openRad,
onPressed: () async {
launch(url);
launchUrlString(url);
},
),
],

@ -188,7 +188,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _referTo != null ? _referTo['name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: branchError!,
validationError: branchError,
onClick: referToList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
@ -238,11 +238,11 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: hospitalError!,
onClick: model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2
validationError: hospitalError,
onClick: model.branchesList != null && model.branchesList!.length > 0 && _referTo != null && _referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
list: model.branchesList!,
attributeName: 'facilityName',
attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok,
@ -278,7 +278,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError!,
validationError: clinicError,
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
@ -319,7 +319,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: doctorError!,
validationError: doctorError,
onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
@ -362,7 +362,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedPriority != null ? _selectedPriority['Description'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: frequencyError!,
validationError: frequencyError,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: _priorityList,
@ -408,7 +408,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedFrequency != null ? _selectedFrequency['Description'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: frequencyError!,
validationError: frequencyError,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: model.referralFrequencyList,
@ -451,7 +451,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
Stack(
children: [
AppTextFieldCustom(
validationError: remarkError!,
validationError: remarkError,
hintText: "Remarks",
controller: _remarksController,
inputType: TextInputType.multiline,

@ -224,10 +224,10 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
enabled: false,
isTextFieldHasSuffix: true,
validationError: hospitalError,
onClick: model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2
onClick: model.branchesList != null && model.branchesList!.length > 0 && _referTo != null && _referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
list: model.branchesList!,
attributeName: 'facilityName',
attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok,

@ -60,7 +60,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn!;
if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD!.code;
}
InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon, String? validationError}) {
InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, {IconData? icon, String? validationError}) {
return new InputDecoration(
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
@ -161,7 +161,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
if (icdNameController.text.length <= 3) {
DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
} else {
model.listOfICD10.clear();
model.listOfICD10!.clear();
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
}
},
@ -172,20 +172,20 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onFieldSubmitted: () {},
)),
model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty
model.listOfICD10!.length > 0 && icdNameController.text.isNotEmpty
? Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child: ListView.builder(
shrinkWrap: true,
itemCount: model.listOfICD10.length,
itemCount: model.listOfICD10!.length,
itemBuilder: (context, index) {
return InkWell(
child: ListTile(title: AppText(model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
child: ListTile(title: AppText(model.listOfICD10![index].description + " / " + model.listOfICD10![index].code.toString(), fontSize: 12.0)),
onTap: () {
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
icdNameController.text = model.listOfICD10[index].description;
model.listOfICD10.clear();
widget.mySelectedAssessment.selectedICD = model.listOfICD10![index];
icdNameController.text = model.listOfICD10![index].description;
model.listOfICD10!.clear();
setState(() {});
});
},
@ -264,9 +264,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onClick: model.listOfDiagnosisCondition != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition,
list: model.listOfDiagnosisCondition!,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition!,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
okFunction: (MasterKeyModel selectedValue) {
setState(() {
widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
@ -303,7 +303,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onClick: model.listOfDiagnosisType != null
? () {
MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType,
list: model.listOfDiagnosisType!,
okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType!,
okFunction: (MasterKeyModel selectedValue) {

@ -19,7 +19,7 @@ class AddExaminationWidget extends StatefulWidget {
final bool Function(MasterKeyModel)? isServiceSelected;
bool isExpand;
final Function? expandClick;
final Function() expandClick;
final List<MySelectedExamination>? mySelectedExamination;
AddExaminationWidget({
@ -28,7 +28,7 @@ class AddExaminationWidget extends StatefulWidget {
this.addExamination,
this.isServiceSelected,
this.isExpand = false,
this.expandClick,
required this.expandClick,
this.mySelectedExamination,
});
@ -44,10 +44,10 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
@override
void initState() {
if (getSelectedExam(widget.item!) != null) {
examination = getSelectedExam(widget.item!);
status = examination.isNormal!
examination = getSelectedExam(widget.item!)!;
status = examination.isNormal
? 1
: examination.isAbnormal!
: examination.isAbnormal
? 2
: 3;
remarksController.text = examination.remark!;
@ -96,8 +96,8 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
Container(
margin: EdgeInsets.symmetric(horizontal: 8),
child: InkWell(
onTap: widget.expandClick!(),
child: Icon(widget.isExpand! ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down),
onTap: widget.expandClick,
child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down),
),
),
],
@ -264,23 +264,23 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
setState(() {
if (widget.isServiceSelected!(widget.item!)) {
if (examination.isLocal) widget.removeExamination!(examination);
widget.expandClick!();
widget.expandClick;
} else {
examination.isNormal = status == 1;
examination.isAbnormal = status == 2;
examination.notExamined = status == 3;
examination.remark = remarksController.text;
widget.addExamination!(examination);
widget.expandClick!();
widget.expandClick;
}
});
}
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) {
MySelectedExamination? getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) {
return exam.first;
}
return MySelectedExamination();
return null;
}
}

@ -34,10 +34,10 @@ class AddMedication extends StatefulWidget {
}
class _AddMedicationState extends State<AddMedication> {
MasterKeyModel _selectedMedicationDose = MasterKeyModel();
MasterKeyModel _selectedMedicationStrength = MasterKeyModel();
MasterKeyModel _selectedMedicationRoute = MasterKeyModel();
MasterKeyModel _selectedMedicationFrequency = MasterKeyModel();
MasterKeyModel? _selectedMedicationDose;
MasterKeyModel? _selectedMedicationStrength;
MasterKeyModel? _selectedMedicationRoute;
MasterKeyModel? _selectedMedicationFrequency;
TextEditingController doseController = TextEditingController();
TextEditingController strengthController = TextEditingController();
@ -45,7 +45,7 @@ class _AddMedicationState extends State<AddMedication> {
TextEditingController frequencyController = TextEditingController();
GetMedicationResponseModel? _selectedMedication;
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false;
@override
@ -101,7 +101,7 @@ class _AddMedicationState extends State<AddMedication> {
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() => _selectedMedication = item),
key: key,
suggestions: model.allMedicationList,
suggestions: model.allMedicationList!,
itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
@ -165,7 +165,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() {
_selectedMedicationDose = selectedValue;
doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr! : _selectedMedicationDose.nameEn!;
doseController.text = projectViewModel.isArabic ? _selectedMedicationDose!.nameAr! : _selectedMedicationDose!.nameEn!;
});
},
);
@ -204,7 +204,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() {
_selectedMedicationStrength = selectedValue;
strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr! : _selectedMedicationStrength.nameEn!;
strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength!.nameAr! : _selectedMedicationStrength!.nameEn!;
});
},
);
@ -245,7 +245,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() {
_selectedMedicationRoute = selectedValue;
routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr! : _selectedMedicationRoute.nameEn!;
routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute!.nameAr! : _selectedMedicationRoute!.nameEn!;
});
},
);
@ -284,7 +284,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() {
_selectedMedicationFrequency = selectedValue;
frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr! : _selectedMedicationFrequency.nameEn!;
frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency!.nameAr! : _selectedMedicationFrequency!.nameEn!;
});
},
);

@ -95,7 +95,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (model.patientAllergiesList.isNotEmpty) {
model.patientAllergiesList.forEach((element) {
MasterKeyModel? selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity;
MasterKeyModel? selectedAllergySeverity;
if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
} else {

@ -45,7 +45,7 @@ class _AddPrescriptionState extends State<AddPrescription> {
final myController = TextEditingController();
DateTime? selectedDate;
int strengthChar = 0;
GetMedicationResponseModel? _selectedMedication;
GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel();
MedicineViewModel? medicineViewModel;
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
@ -138,7 +138,7 @@ class _AddPrescriptionState extends State<AddPrescription> {
prescriptionViewModel: widget.prescriptionViewModel,
medicineViewModel: model,
prescriptionList: widget.prescriptionList,
selectedMedication: _selectedMedication!,
selectedMedication: _selectedMedication,
),
],
),

@ -1,12 +1,12 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import '../../../config/config.dart';
import '../../../core/model/search_drug/get_medication_response_model.dart';
import '../../../core/viewModel/medicine_view_model.dart';
import '../../../core/viewModel/prescription/prescription_view_model.dart';
import '../../../utils/utils.dart';
import '../../../utils/translations_delegate_base_utils.dart';
import '../../../utils/utils.dart';
import '../../../widgets/medicine/medicine_item_widget.dart';
import '../../../widgets/shared/buttons/app_buttons_widget.dart';
import '../../../widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -41,9 +41,9 @@ class SearchPrescriptionWidget extends StatelessWidget {
widthFactor: 0.9,
child: Container(
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
padding: EdgeInsets.all(6),
child: AppTextFormField(
borderColor: Colors.white,
borderColor: Colors.transparent,
hintText: TranslationBase.of(context).searchMedicineNameHere,
controller: myController,
onSaved: (value) {},

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
@ -12,8 +12,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../utils/utils.dart';
import '../../widgets/shared/errors/error_message.dart';
@ -26,8 +26,7 @@ class NewPrescriptionsPage extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) async {
model.getPrescriptionListNew(
mrn: patient.patientMRN, appNo: patient.appointmentNo);
model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo ?? 0);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -58,9 +57,7 @@ class NewPrescriptionsPage extends StatelessWidget {
],
),
),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
@ -74,8 +71,7 @@ class NewPrescriptionsPage extends StatelessWidget {
settingRoute: 'AddProcedureTabPage'),
);
},
label: TranslationBase.of(context)
.applyForNewPrescriptionsOrder,
label: TranslationBase.of(context).applyForNewPrescriptionsOrder,
),
Center(
child: FractionallySizedBox(
@ -86,80 +82,63 @@ class NewPrescriptionsPage extends StatelessWidget {
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return InkWell(
child: CardWithBgWidget(
bgColor: Colors.transparent,
widget: Column(
children: [
CustomRow(
label: "",
value: Utils.convertToTitleCase(model
.prescriptionListNew[index]
.medicationName),
valueSize: SizeConfig
.getTextMultiplierBasedOnWidth() *
3.5,
),
SizedBox(
height: 10,
),
CustomRow(
label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :",
value: model
.prescriptionListNew[index].doctorName,
),
CustomRow(
label: TranslationBase.of(context).orderTypeDescription + ': ',//"Order Type Description :",
value: model.prescriptionListNew[index]
.orderTypeDescription,
),
CustomRow(
label: TranslationBase.of(context).status + ': ',
value:
model.prescriptionListNew[index].status,
),
CustomRow(
label: TranslationBase.of(context).indication + ': ', //"indication :",
value: model
.prescriptionListNew[index].indication,
),
CustomRow(
label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :",
value: model
.prescriptionListNew[index].doseDetail,
),
CustomRow(
label: TranslationBase.of(context).quantity + ': ',//"quantity :",
value: model
.prescriptionListNew[index].quantity
.toString(),
),CustomRow(
label: TranslationBase.of(context).startDate + ': ', //"start Date :",
value: model
.prescriptionListNew[index].startDate
.toString(),
),CustomRow(
label: TranslationBase.of(context).stopDate + ': ',//"stop Date :",
value: model
.prescriptionListNew[index].stopDate
.toString(),
),
if(model
.prescriptionListNew[index].remarks != null&& model
.prescriptionListNew[index].remarks!= "")
CustomRow(
label: TranslationBase.of(context).remarks + ': ',//"Remark :",
value: model
.prescriptionListNew[index].remarks
.toString(),
),
],
child: CardWithBgWidget(
bgColor: Colors.transparent,
widget: Column(
children: [
CustomRow(
label: "",
value: Utils.convertToTitleCase(model.prescriptionListNew[index].medicationName),
valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
),
SizedBox(
height: 10,
),
CustomRow(
label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :",
value: model.prescriptionListNew[index].doctorName,
),
CustomRow(
label: TranslationBase.of(context).orderTypeDescription + ': ', //"Order Type Description :",
value: model.prescriptionListNew[index].orderTypeDescription,
),
CustomRow(
label: TranslationBase.of(context).status + ': ',
value: model.prescriptionListNew[index].status,
),
CustomRow(
label: TranslationBase.of(context).indication + ': ', //"indication :",
value: model.prescriptionListNew[index].indication,
),
CustomRow(
label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :",
value: model.prescriptionListNew[index].doseDetail,
),
CustomRow(
label: TranslationBase.of(context).quantity + ': ', //"quantity :",
value: model.prescriptionListNew[index].quantity.toString(),
),
CustomRow(
label: TranslationBase.of(context).startDate + ': ', //"start Date :",
value: model.prescriptionListNew[index].startDate.toString(),
),
CustomRow(
label: TranslationBase.of(context).stopDate + ': ', //"stop Date :",
value: model.prescriptionListNew[index].stopDate.toString(),
),
if (model.prescriptionListNew[index].remarks != null && model.prescriptionListNew[index].remarks != "")
CustomRow(
label: TranslationBase.of(context).remarks + ': ', //"Remark :",
value: model.prescriptionListNew[index].remarks.toString(),
),
],
),
),
),);
);
}),
),
),
if (model.prescriptionListNew.isEmpty &&
patient.patientStatusType != 43)
if (model.prescriptionListNew.isEmpty && patient.patientStatusType != 43)
Center(
child: ErrorMessage(
error: TranslationBase.of(context).noPrescriptionsFound,

@ -9,14 +9,13 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
/// TODO Roaa Add translation and make sure it working fine
class ProcedureCard extends StatelessWidget {
final Function? onTap;
final Function()? onTap;
final EntityList? entityList;
final String? categoryName;
final int? categoryID;
@ -59,15 +58,12 @@ class ProcedureCard extends StatelessWidget {
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10),
),
color:
entityList!.orderType == 0 ? Colors.black : Colors.red[500],
color: entityList!.orderType == 0 ? Colors.black : Colors.red[500],
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(
left: projectViewModel.isArabic ? 0 : 15,
right: projectViewModel.isArabic ? 15 : 0),
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0),
child: InkWell(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -80,20 +76,15 @@ class ProcedureCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
entityList!.orderType == 0
? 'Routine'
: 'Urgent',
color: entityList!.orderType == 0
? Colors.black
: AppGlobal.appRedColor,
entityList!.orderType == 0 ? 'Routine' : 'Urgent',
color: entityList!.orderType == 0 ? Colors.black : AppGlobal.appRedColor,
fontWeight: FontWeight.w600,
),
SizedBox(
height: 5,
),
AppText(
Utils.convertToTitleCase(
entityList!.procedureName!),
Utils.convertToTitleCase(entityList!.procedureName!),
bold: true,
fontSize: 14,
),
@ -109,8 +100,7 @@ class ProcedureCard extends StatelessWidget {
children: [
AppText(
'${AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertISOStringToDateTime(
entityList!.createdOn!),
AppDateUtils.convertISOStringToDateTime(entityList!.createdOn!),
isMonthShort: true,
isArabic: projectViewModel.isArabic,
)}',
@ -145,8 +135,7 @@ class ProcedureCard extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.only(
left: 0, top: 25, right: 0, bottom: 0),
margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: Container(
width: 40,
@ -157,9 +146,7 @@ class ProcedureCard extends StatelessWidget {
'assets/images/dr_avatar.png',
height: 25,
width: 30,
errorBuilder: (BuildContext context,
Object exception,
StackTrace? stackTrace) {
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Text('No Image');
},
))),
@ -167,14 +154,12 @@ class ProcedureCard extends StatelessWidget {
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(
left: 10, top: 25, right: 10, bottom: 0),
margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
Utils.convertToTitleCase(
entityList!.doctorName!),
Utils.convertToTitleCase(entityList!.doctorName!),
fontFamily: 'Poppins',
fontWeight: FontWeight.w800,
fontSize: 1.7 * SizeConfig.textMultiplier!,
@ -182,12 +167,10 @@ class ProcedureCard extends StatelessWidget {
),
if (entityList!.clinicDescription != null)
AppText(
Utils.convertToTitleCase(
entityList!.clinicDescription!),
Utils.convertToTitleCase(entityList!.clinicDescription!),
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.4 * SizeConfig.textMultiplier!,
fontSize: 1.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A),
),
],
@ -203,20 +186,14 @@ class ProcedureCard extends StatelessWidget {
children: [
Expanded(
child: AppText(
entityList!.remarks != null
? Utils.convertToTitleCase(
entityList!.remarks.toString())
: '',
entityList!.remarks != null ? Utils.convertToTitleCase(entityList!.remarks.toString()) : '',
fontSize: 12,
),
),
if ((entityList!.categoryID == 2 ||
entityList!.categoryID == 4) &&
doctorID == entityList!.doctorID &&
!isInpatient!)
if ((entityList!.categoryID == 2 || entityList!.categoryID == 4) && doctorID == entityList!.doctorID && !isInpatient!)
InkWell(
child: Icon(DoctorApp.edit),
onTap: onTap!(),
onTap: onTap,
)
],
),

@ -10,20 +10,13 @@ import 'package:provider/provider.dart';
class VerificationMethodsList extends StatefulWidget {
final AuthMethodTypes? authMethodType;
final Function(AuthMethodTypes type, bool isActive)? authenticateUser;
final Function? onShowMore;
final Function() onShowMore;
final AuthenticationViewModel? authenticationViewModel;
const VerificationMethodsList(
{Key? key,
this.authMethodType,
this.authenticateUser,
this.onShowMore,
this.authenticationViewModel})
: super(key: key);
const VerificationMethodsList({Key? key, this.authMethodType, this.authenticateUser, required this.onShowMore, this.authenticationViewModel}) : super(key: key);
@override
_VerificationMethodsListState createState() =>
_VerificationMethodsListState();
_VerificationMethodsListState createState() => _VerificationMethodsListState();
}
class _VerificationMethodsListState extends State<VerificationMethodsList> {
@ -38,51 +31,44 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
case AuthMethodTypes.WhatsApp:
return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg',
onTap: () =>
{widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)},
label: TranslationBase.of(context).verifyWith +
TranslationBase.of(context).verifyWhatsApp,
onTap: () => {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)},
label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyWhatsApp,
);
break;
case AuthMethodTypes.SMS:
return MethodTypeCard(
assetPath: "assets/images/svgs/verification/verify-sms.svg",
onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)},
label: TranslationBase.of(context).verifyWith +
TranslationBase.of(context).verifySMS,
label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifySMS,
);
break;
case AuthMethodTypes.Fingerprint:
return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-finger.svg',
onTap: () async {
if (await widget.authenticationViewModel!
.checkIfBiometricAvailable(BiometricType.fingerprint)) {
if (await widget.authenticationViewModel!.checkIfBiometricAvailable(BiometricType.fingerprint)) {
widget.authenticateUser!(AuthMethodTypes.Fingerprint, true);
}
},
label: TranslationBase.of(context).verifyWith +
TranslationBase.of(context).verifyFingerprint,
label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyFingerprint,
);
break;
case AuthMethodTypes.FaceID:
return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-face.svg',
onTap: () async {
if (await widget.authenticationViewModel!
.checkIfBiometricAvailable(BiometricType.face)) {
if (await widget.authenticationViewModel!.checkIfBiometricAvailable(BiometricType.face)) {
widget.authenticateUser!(AuthMethodTypes.FaceID, true);
}
},
label: TranslationBase.of(context).verifyWith +
TranslationBase.of(context).verifyFaceID,
label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyFaceID,
);
break;
default:
return MethodTypeCard(
assetPath: 'assets/images/login/more_icon.png',
onTap: widget.onShowMore!(),
onTap: widget.onShowMore,
isSvg: false,
label: TranslationBase.of(context).moreVerification,
height: 0,

@ -42,7 +42,7 @@ class PatientProfileButton extends StatelessWidget {
this.icon,
this.route,
this.isDisable = false,
required this.onTap,
this.onTap,
this.isLoading = false,
this.from,
this.to,
@ -66,7 +66,7 @@ class PatientProfileButton extends StatelessWidget {
onTap: isDisable
? null
: onTap != null
? onTap!()
? onTap
: () {
navigator(context, this.route);
},

@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import '../large_avatar.dart';
import 'header_row.dart';
@ -86,7 +86,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge
icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black,
onPressed: () {
if (onPressed != null) onPressed!();
if (onPressed != null) onPressed;
Navigator.pop(context);
},
),
@ -115,7 +115,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
launch("tel://" + patient.mobileNumber!);
launchUrlString("tel://" + patient.mobileNumber!);
},
child: Icon(
Icons.phone,

@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'header_row.dart';
@ -91,7 +91,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget implements Pre
eventCategory: "Patient Profile Header",
eventAction: "Call Patient",
);
launch("tel://" + patient.mobileNumber!);
launchUrlString("tel://" + patient.mobileNumber!);
},
child: Icon(
Icons.phone,

Loading…
Cancel
Save