Merge branch 'update_flutter_3.16.0' of http://34.17.52.79/Haroon6138/doctor_app_flutter into update_flutter_3.16.0

# Conflicts:
#	lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart
update_flutter_3.16.0_voipcall
Sultan khan 2 years ago
commit 0f2593f56d

@ -113,6 +113,8 @@ class BaseAppClient {
// }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
// body['ClinicID'] = 501;
// body['ProjectID'] = 12;
// body['DoctorID'] = 1002; //3844083
// body['TokenID'] = "@dm!n";
@ -347,8 +349,9 @@ class BaseAppClient {
get({required String endPoint, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure}) async {
String token = await sharedPref.getString(TOKEN);
String url = DOCTOR_ROTATION + endPoint + '&token=' + token;
print(url);
final response = await http.get(Uri.parse(url));
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) {
onFailure(Utils.generateContactAdminMsg(), statusCode);

@ -0,0 +1,8 @@
import 'dart:io';
class MyHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext? context) {
return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
}
}

@ -19,7 +19,7 @@ const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplicathttps://uat.hmgwebservices.com/Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorAppion.svc/REST/GetProgressNoteForInPatient";
const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor";
const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID";

@ -9,7 +9,7 @@ class PatientRegistrationModel {
String? iPAdress;
String? generalid;
int? patientOutSA;
Null sessionID;
dynamic sessionID;
bool? isDentalAllowedBackend;
int? deviceTypeID;
String? tokenID;
@ -39,9 +39,7 @@ class PatientRegistrationModel {
this.zipCode});
PatientRegistrationModel.fromJson(Map<String, dynamic> json) {
patientobject = json['Patientobject'] != null
? new Patientobject.fromJson(json['Patientobject'])
: null;
patientobject = json['Patientobject'] != null ? new Patientobject.fromJson(json['Patientobject']) : null;
patientIdentificationID = json['PatientIdentificationID'];
patientMobileNumber = json['PatientMobileNumber'];
logInTokenID = json['LogInTokenID'];

@ -3,11 +3,11 @@ import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/model/live_care/add_patient_to_doctor_list_request_model.dart';
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.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/base/base_service.dart';
class LiveCarePatientServices extends BaseService {
List<PatiantInformtion> _patientList = [];
@ -34,9 +34,7 @@ class LiveCarePatientServices extends BaseService {
StartCallRes get startCallRes => _startCallRes;
Future getPendingPatientERForDoctorApp(
PendingPatientERForDoctorAppRequestModel
pendingPatientERForDoctorAppRequestModel) async {
Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async {
hasError = false;
await baseAppClient.post(
GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP,
@ -49,10 +47,7 @@ class LiveCarePatientServices extends BaseService {
/// add new items.
localPatientList.forEach((element) {
if ((_patientList.singleWhere(
(it) => it.patientId == element.patientId,
orElse: () => PatiantInformtion())) ==
null) {
if (!_patientList.any((it) => it.patientId == element.patientId)) {
_patientList.add(element);
}
});
@ -60,10 +55,7 @@ class LiveCarePatientServices extends BaseService {
/// remove items.
List<PatiantInformtion> removedPatientList = [];
_patientList.forEach((element) {
if ((localPatientList.singleWhere(
(it) => it.patientId == element.patientId,
orElse: () => PatiantInformtion())) ==
null) {
if (localPatientList.any((it) => it.patientId == element.patientId)) {
removedPatientList.add(element);
}
});
@ -92,8 +84,7 @@ class LiveCarePatientServices extends BaseService {
Future startCall(StartCallReq startCallReq) async {
hasError = false;
await baseAppClient.post(START_LIVE_CARE_CALL,
onSuccess: (response, statusCode) async {
await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async {
_startCallRes = StartCallRes.fromJson(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -103,23 +94,17 @@ class LiveCarePatientServices extends BaseService {
Future endCallWithCharge(int vcID, List<int> altServiceList) async {
hasError = false;
await baseAppClient.post(END_CALL_WITH_CHARGE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(END_CALL_WITH_CHARGE, onSuccess: (dynamic response, int statusCode) {
endCallResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: {
"VC_ID": vcID,
"AltServiceList": altServiceList,
"generalid": GENERAL_ID
}, isLiveCare: _isLive);
}, body: {"VC_ID": vcID, "AltServiceList": altServiceList, "generalid": GENERAL_ID}, isLiveCare: _isLive);
}
Future transferToAdmin(int vcID, String notes) async {
hasError = false;
await baseAppClient.post(TRANSFERT_TO_ADMIN,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(TRANSFERT_TO_ADMIN, onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -133,8 +118,7 @@ class LiveCarePatientServices extends BaseService {
Future sendSMSInstruction(int vcID) async {
hasError = false;
await baseAppClient.post(SEND_SMS_INSTRUCTIONS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(SEND_SMS_INSTRUCTIONS, onSuccess: (dynamic response, int statusCode) {
transferToAdminResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -142,14 +126,11 @@ class LiveCarePatientServices extends BaseService {
}, body: {"VC_ID": vcID, "generalid": GENERAL_ID}, isLiveCare: _isLive);
}
Future isLogin(
{LiveCareUserLoginRequestModel? isLoginRequestModel,
int? loginStatus}) async {
Future isLogin({LiveCareUserLoginRequestModel? isLoginRequestModel, int? loginStatus}) async {
hasError = false;
await getDoctorProfile();
isLoginRequestModel!.doctorId = super.doctorProfile!.doctorID;
await baseAppClient.post(LIVE_CARE_IS_LOGIN,
onSuccess: (response, statusCode) async {
await baseAppClient.post(LIVE_CARE_IS_LOGIN, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -161,8 +142,7 @@ class LiveCarePatientServices extends BaseService {
hasError = false;
alternativeServicesList.clear();
await baseAppClient.post(GET_ALTERNATIVE_SERVICE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_ALTERNATIVE_SERVICE, onSuccess: (dynamic response, int statusCode) {
response['AlternativeServicesList'].forEach((v) {
alternativeServicesList.add(AlternativeService.fromJson(v));
});
@ -175,16 +155,14 @@ class LiveCarePatientServices extends BaseService {
Future addPatientToDoctorList({int? vcID}) async {
hasError = false;
await getDoctorProfile();
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel =
AddPatientToDoctorListRequestModel();
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
await baseAppClient.post(ADD_PATIENT_TO_DOCTOR,
onSuccess: (response, statusCode) async {
await baseAppClient.post(ADD_PATIENT_TO_DOCTOR, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -194,16 +172,14 @@ class LiveCarePatientServices extends BaseService {
Future removePatientFromDoctorList({int? vcID}) async {
hasError = false;
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel =
AddPatientToDoctorListRequestModel();
AddPatientToDoctorListRequestModel addPatientToDoctorListRequestModel = AddPatientToDoctorListRequestModel();
await getDoctorProfile();
addPatientToDoctorListRequestModel.doctorId = super.doctorProfile!.doctorID;
addPatientToDoctorListRequestModel.vCID = vcID;
addPatientToDoctorListRequestModel.isOutKsa = false;
addPatientToDoctorListRequestModel.generalid = GENERAL_ID;
await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR,
onSuccess: (response, statusCode) async {
await baseAppClient.post(REMOVE_PATIENT_FROM_DOCTOR, onSuccess: (response, statusCode) async {
isLoginResponse = response;
}, onFailure: (String error, int statusCode) {
hasError = true;

@ -137,12 +137,15 @@ class SOAPViewModel extends BaseViewModel {
planCallBack.nextFunction(model);
}
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async {
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = "", bool allowSetState = false}) async {
if (isBusyLocal) {
setState(ViewState.Busy);
} else {
} else
setState(ViewState.Busy);
}
//else
// setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey);
if (_SOAPService.hasError) {
error = _SOAPService.error;
@ -559,7 +562,7 @@ class SOAPViewModel extends BaseViewModel {
final results = services;
if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error! + _prescriptionService.error!;
error = _SOAPService.error.toString() + _prescriptionService.error.toString();
if (allowSetState) setState(ViewState.ErrorLocal);
} else if (allowSetState) setState(ViewState.Idle);
}

@ -66,7 +66,7 @@ class AuthenticationViewModel extends BaseViewModel {
bool unverified = false;
bool isFromLogin = false;
APP_STATUS appStatus = APP_STATUS.LOADING;
String localToken = "";
String? localToken = "";
bool isHuawei = false;
AuthenticationViewModel({bool checkDeviceInfo = false}) {

@ -25,7 +25,7 @@ class BaseViewModel extends ChangeNotifier {
Future<DoctorProfileModel> getDoctorProfile({bool isGetProfile = false}) async {
if (isGetProfile) {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE);
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {

@ -30,7 +30,7 @@ class PatientReferralViewModel extends BaseViewModel {
List<dynamic>? get branchesList => _referralPatientService.projectsList;
List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic>? get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get referralFrequencyList => _referralPatientService.frequencyList;

@ -1,3 +1,6 @@
import 'dart:io';
import 'package:doctor_app_flutter/client/http_Overrides.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
@ -18,6 +21,7 @@ import 'package:provider/provider.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
HttpOverrides.global = MyHttpOverrides();
setupLocator();
runApp(MyApp());
}

@ -1,20 +1,20 @@
import 'dart:async';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:flutter/material.dart';
import '../../routes.dart';
import '../../utils/translations_delegate_base_utils.dart';
import '../../widgets/shared/errors/error_message.dart';
class LiveCarePatientScreen extends StatefulWidget {
@override
@ -102,6 +102,74 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
shrinkWrap: true,
itemCount: model.filterData.length,
itemBuilder: (BuildContext ctxt, int index) {
//
String jsonString = '''
{
"PatientID": 1231755,
"SetupID": "010266",
"PatientType": 1,
"FirstName": "TAMER",
"MiddleName": "MUSA",
"LastName": "FANASHEH",
"FirstNameN": "",
"MiddleNameN": "موسى",
"LastNameN": "",
"Gender": 1,
"DateofBirth": "/Date(558910800000+0300)/",
"DateofBirthN": "25/01/1408",
"NationalityID": "JOR",
"PhoneResi": "",
"PhoneOffice": "",
"MobileNumber": "0537503378",
"FaxNumber": "",
"EmailAddress": "sultan.khan@cloudsolutions.com.sa",
"IsEmailAlertRequired": true,
"IsSMSAlertRequired": true,
"PreferredLanguage": "1",
"EmergencyContactName": "MOH",
"EmergencyContactNo": "0507845867",
"PatientIdentificationType": 2,
"PatientIdentificationNo": "2344670985",
"ProjectID": 15,
"ReceiveHealthSummaryReport": true,
"NoShowCount": 0,
"IsPatientHasMobileDeviceToken": true,
"EditedBy": 102,
"IsIVRStopped": true,
"CRSClientIdentifierID": null,
"CRSVerificationStatus": null,
"CRSVerifiedBy": null,
"CRSVerificationStatusDesc": "Sent for Manual Verification",
"CRSVerificationStatusDescN": "Sent for Manual Verification",
"NumberPosition": 1,
"Status": 2,
"IsPrivilegedMember": null,
"Address": "gffffff al malga",
"Age": 36,
"EmaiLAddress": "sultan.khan@cloudsolutions.com.sa",
"GenderDescription": "Male",
"GenderImage": "https://hmgwebservices.com/Images/GenderAvtar/Male.jpg",
"IsPatientDataVerified": false,
"IsPatientPrivilegedMember": false,
"NationalityDescription": "Jordanian",
"NationalityFlagURL": "https://hmgwebservices.com/Images/flag/JOR.png",
"POBox": "",
"PatientDataVerified": 3,
"PatientName": "TAMER MUSA FANASHEH",
"PatientTypeDescription": "Permanent File",
"PatientTypeDescriptionN": null,
"StatusDscription": "Active ",
"TempAddress": "",
"UpcomingAppointmentsNumber": 0,
"ZipCode": "966"
}
''';
// Map<String, dynamic> jsonObject = json.decode(jsonString);
//
return Padding(
padding: EdgeInsets.all(8.0),
child: PatientCard(
@ -112,7 +180,7 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
isInpatient: false,
isFromLiveCare: true,
onTap: () {
// TODO change the parameter to daynamic
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": PatiantInformtion.fromJson(model.filterData[index].toJson()),
"patientType": "0",
@ -122,6 +190,13 @@ class _LiveCarePatientScreenState extends State<LiveCarePatientScreen> {
"isSearchAndOut": false,
"isFromLiveCare": true,
});
// AppPermissionsUtils.requestVideoCallPermission(
// context: context,
// onTapGrant: () {
// locator<VideoCallService>().openVideo(model.startCallRes!, PatiantInformtion.fromJson(model.filterData[index].toJson()),
// model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected);
// });
},
// isFromSearch: widget.isSearch,
),

@ -99,6 +99,7 @@ class _PatientsSearchResultScreenState extends State<PatientsSearchResultScreen>
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.filterData.length,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
@ -109,11 +110,6 @@ class _PatientsSearchResultScreenState extends State<PatientsSearchResultScreen>
isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient,
onTap: () {
print("TODO change the parameter to daynamic");
print("TODO change the parameter to daynamic");
print("TODO change the parameter to daynamic");
print("TODO change the parameter to daynamic");
print("TODO change the parameter to daynamic");
// TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filterData[index],

@ -1,10 +1,10 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
@ -33,19 +33,17 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model,
{bool isLocalBusy = false}) async {
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
String? type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
print(type);
GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel =
GetNursingProgressNoteRequestModel(
admissionNo: int.parse(patient.admissionNo!),
patientTypeID: patient.patientType,
patientID: patient.patientId,
);
GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel(
admissionNo: int.parse(patient.admissionNo!),
patientTypeID: patient.patientType,
patientID: patient.patientId,
);
model.getNursingProgressNote(getNursingProgressNoteRequestModel);
}
@ -55,8 +53,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold(
@ -67,8 +64,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
patient,
isInpatient: true,
),
body: model.patientNursingProgressNoteList == null ||
model.patientNursingProgressNoteList.length == 0
body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0
? Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
@ -81,8 +77,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
Expanded(
child: Container(
child: ListView.builder(
itemCount:
model.patientNursingProgressNoteList.length,
itemCount: model.patientNursingProgressNoteList.length,
itemBuilder: (BuildContext ctxt, int index) {
return FractionallySizedBox(
widthFactor: 0.95,
@ -92,48 +87,31 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
widget: Column(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: MediaQuery.of(context)
.size
.width *
0.60,
width: MediaQuery.of(context).size.width * 0.60,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment:
CrossAxisAlignment
.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(
context)
.createdBy,
TranslationBase.of(context).createdBy,
fontSize: 10,
),
Expanded(
child: AppText(
model
.patientNursingProgressNoteList[
index]
.createdByName
.toString() ??
'',
fontWeight:
FontWeight.w600,
model.patientNursingProgressNoteList[index].createdByName.toString() ?? '',
fontWeight: FontWeight.w600,
fontSize: 12,
isCopyable: true,
),
@ -146,73 +124,39 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
Column(
children: [
AppText(
model
.patientNursingProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientNursingProgressNoteList[
index]
.createdOn!),
isArabic:
projectViewModel
.isArabic,
isMonthShort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now(),
isArabic:
projectViewModel
.isArabic),
model.patientNursingProgressNoteList[index].createdOn != null
? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientNursingProgressNoteList[index].createdOn!),
isArabic: projectViewModel.isArabic, isMonthShort: true)
: AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
),
AppText(
model
.patientNursingProgressNoteList[
index]
.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientNursingProgressNoteList[
index]
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
model.patientNursingProgressNoteList[index].createdOn != null
? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientNursingProgressNoteList[index].createdOn!))
: AppDateUtils.getHour(DateTime.now()),
fontWeight: FontWeight.w600,
fontSize: 14,
isCopyable: true,
),
],
crossAxisAlignment:
CrossAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
)
],
),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Expanded(
child: AppText(
model
.patientNursingProgressNoteList[
index]
.notes!,
fontSize: 10,
isCopyable: true,
),
),
])
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
Expanded(
child: AppText(
model.patientNursingProgressNoteList[index].notes!,
fontSize: 10,
isCopyable: true,
),
),
])
],
),
SizedBox(

@ -203,8 +203,8 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
arrivalType: arrivalType!,
isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare,
from: from!,
to: to!,
from: from ?? "",
to: to ?? "",
projectViewModel: projectViewModel,
),
),

@ -279,10 +279,10 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError,
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList!.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
list: model.clinicsList!,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
usingSearch: true,

@ -264,10 +264,10 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError,
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList!.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
list: model.clinicsList!,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
usingSearch: true,

@ -1,25 +1,23 @@
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/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'examinations_list_search_widget.dart';
class AddExaminationPage extends StatefulWidget {
final List<MySelectedExamination>? mySelectedExamination;
final Function(List<MySelectedExamination>)? addSelectedExamination;
final Function(MasterKeyModel)? removeExamination;
final Function(List<MySelectedExamination>) addSelectedExamination;
final Function(MasterKeyModel) removeExamination;
AddExaminationPage(
{this.mySelectedExamination,
this.addSelectedExamination,
this.removeExamination});
AddExaminationPage({this.mySelectedExamination, required this.addSelectedExamination, required this.removeExamination});
@override
_AddExaminationPageState createState() => _AddExaminationPageState();
@ -39,7 +37,9 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
await model.getMasterLookup(
MasterKeysService.PhysicalExamination,
);
}
},
builder: (_, model, w) => AppScaffold(
@ -71,21 +71,17 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
child: Column(
children: [
ExaminationsListSearchWidget(
mySelectedExamination:
widget.mySelectedExamination!,
mySelectedExamination: widget.mySelectedExamination!,
masterList: model.physicalExaminationList,
isServiceSelected: (master) =>
isServiceSelected(master),
isServiceSelected: (master) => isServiceSelected(master),
removeExamination: (selectedExamination) {
setState(() {
mySelectedExaminationLocal
.remove(selectedExamination);
mySelectedExaminationLocal.remove(selectedExamination);
});
},
addExamination: (selectedExamination) {
mySelectedExaminationLocal.insert(
0, selectedExamination);
// setState(() {});
mySelectedExaminationLocal.insert(0, selectedExamination);
//setState(() {});
},
),
],
@ -104,19 +100,16 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
: CustomBottomSheetContainer(
label: "${TranslationBase.of(context).addExamination}",
onTap: () {
widget
.addSelectedExamination!(mySelectedExaminationLocal);
widget.addSelectedExamination(mySelectedExaminationLocal);
},
),
));
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where(
(element) =>
masterKey.id == element.selectedExamination!.id &&
masterKey.typeId == element.selectedExamination!.typeId);
Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) {
print("--------------");
return true;
}
return false;

@ -14,9 +14,9 @@ import 'package:provider/provider.dart';
// ignore: must_be_immutable
class AddExaminationWidget extends StatefulWidget {
MasterKeyModel? item;
final Function(MySelectedExamination)? removeExamination;
final Function(MySelectedExamination)? addExamination;
final bool Function(MasterKeyModel)? isServiceSelected;
final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand;
final Function() expandClick;
@ -24,9 +24,9 @@ class AddExaminationWidget extends StatefulWidget {
AddExaminationWidget({
this.item,
this.removeExamination,
this.addExamination,
this.isServiceSelected,
required this.removeExamination,
required this.addExamination,
required this.isServiceSelected,
this.isExpand = false,
required this.expandClick,
this.mySelectedExamination,
@ -73,7 +73,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
child: Row(
children: [
Checkbox(
value: widget.isServiceSelected!(widget.item!),
value: widget.isServiceSelected(widget.item!),
activeColor: Colors.red[800],
onChanged: (bool? newValue) {
onExamTap();
@ -262,16 +262,16 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
onExamTap() {
setState(() {
if (widget.isServiceSelected!(widget.item!)) {
if (examination.isLocal) widget.removeExamination!(examination);
widget.expandClick;
if (widget.isServiceSelected(widget.item!)) {
if (examination.isLocal) widget.removeExamination(examination);
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.addExamination(examination);
widget.expandClick();
}
});
}

@ -9,13 +9,13 @@ import 'package:flutter/material.dart';
import 'add_examination_widget.dart';
class ExaminationsListSearchWidget extends StatefulWidget {
final Function(MySelectedExamination)? removeExamination;
final Function(MySelectedExamination)? addExamination;
final bool Function(MasterKeyModel)? isServiceSelected;
final Function(MySelectedExamination) removeExamination;
final Function(MySelectedExamination) addExamination;
final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel>? masterList;
final List<MySelectedExamination>? mySelectedExamination;
ExaminationsListSearchWidget({this.removeExamination, this.addExamination, this.isServiceSelected, this.masterList, this.mySelectedExamination});
ExaminationsListSearchWidget({required this.removeExamination, required this.addExamination, required this.isServiceSelected, this.masterList, this.mySelectedExamination});
@override
_ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState();

@ -54,9 +54,7 @@ class _AddMedicationState extends State<AddMedication> {
return FractionallySizedBox(
child: BaseView<SOAPViewModel>(
onModelReady: (model) async {
model.onAddMedicationStart(allowSetState: false).whenComplete(() {
setState(() {});
});
model.onAddMedicationStart(allowSetState: false).whenComplete(() {});
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,

@ -26,7 +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,

@ -101,8 +101,7 @@ class OldPrescriptionsPage extends StatelessWidget {
),
),
)
: Center(
child: FractionallySizedBox(
: FractionallySizedBox(
widthFactor: 0.9,
child: SingleChildScrollView(
child: Column(
@ -182,7 +181,7 @@ class OldPrescriptionsPage extends StatelessWidget {
],
),
),
),
)));
}
}

@ -56,8 +56,8 @@ class PatientCard extends StatelessWidget {
decoration: Utils.getCardBoxDecoration(),
child: CardWithBgWidget(
padding: 0,
marginLeft: (!isMyPatient && isInpatient) || isFromLiveCare ? 0 : 10,
marginSymmetric: isFromSearch ? 10 : 0.0,
marginLeft: (!isMyPatient && isInpatient) || isFromLiveCare ? 0 : 0,
marginSymmetric: isFromSearch ? 0 : 0.0,
hasBorder: false,
bgColor: isFromLiveCare
? Colors.white
@ -292,7 +292,7 @@ class PatientCard extends StatelessWidget {
),
Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 12.0, top: 5),
padding: EdgeInsets.only(left: 12.0, top: 5, bottom: 10),
child: Container(
width: 60,
height: 60,
@ -394,7 +394,7 @@ class PatientCard extends StatelessWidget {
children: [
CustomRow(
label: TranslationBase.of(context).clinic + " : ",
value: patientInfo!.clinicName!,
value: patientInfo!.clinicName ?? "",
),
],
),

@ -25,7 +25,7 @@ class _MasterKeyDailogState extends State<MasterKeyDailog> {
@override
void initState() {
super.initState();
widget.selectedValue = widget.selectedValue ?? widget.list[0];
widget.selectedValue = widget.selectedValue ?? widget.list.first;
}
@override

Loading…
Cancel
Save