bug resolution

ipd-changes-for-vida-plus
parent 65ceda64d8
commit c3e4ef142d

@ -1216,6 +1216,10 @@ const Map<String, Map<String, String>> localizedValues = {
"moderate": {"en": "Moderate", "ar":"معتدل"},
"remarksCanNotBeEmpty": {"en": "Remarks Can Not Be Empty", "ar":"لا يمكن أن تكون الملاحظات فارغة"},
"kindlySelectCategory": {"en": "Kindly Select Any Diagnosis Category", "ar":"يرجى اختيار أي فئة تشخيص"},
"kindlySelectAllMandatoryField": {
"en": "Please complete all mandatory fields.",
"ar": "يرجى استكمال جميع الحقول الإلزامية"
},
"noRemarks": {"en": "No Remarks", "ar":"لا ملاحظات"},
"event": {"en": "Event: ", "ar":"حدث: "},
"editDiagnosis": {"en": "Edit Diagnosis ", "ar":"تحرير التشخيص"},

@ -1,9 +1,10 @@
class PrescriptionReqModel {
dynamic patientMRN;
dynamic appNo;
dynamic? episodeId;
PrescriptionReqModel(
{ this.patientMRN, this.appNo});
{ this.patientMRN, this.appNo, this.episodeId});
PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
@ -15,6 +16,9 @@ class PrescriptionReqModel {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appNo;
if(this.episodeId != null) {
data['EpisodeID'] = this.episodeId;
}
return data;
}
}

@ -51,6 +51,8 @@ class InsuranceApprovalModel {
String? expiryDate;
String? rceiptOn;
int? appointmentNo;
String? companyName;
String? companyNameN;
InsuranceApprovalModel(
{this.versionID,
@ -112,6 +114,8 @@ class InsuranceApprovalModel {
doctorName = json['DoctorName'];
doctorImage = json['DoctorImageURL'];
clinicName = json['ClinicName'];
companyName = json['CompanyName'];
companyNameN = json['CompanyNameN'];
if (json['ApporvalDetails'] != null) {
apporvalDetails = <ApporvalDetails>[];
json['ApporvalDetails'].forEach((v) {

@ -25,6 +25,7 @@ class MedicalReportModel {
String? clinicName;
String? clinicNameN;
String? reportDataHtml;
int? summaryId;
MedicalReportModel(
{this.reportData,
@ -113,4 +114,41 @@ class MedicalReportModel {
data['ReportDataHtml'] = this.reportDataHtml;
return data;
}
///handling this to change the status of vida 4 to make it as vida 3 so ui does not handle these things
///https://cloudsolutions-sa.atlassian.net/browse/V4-38664?focusedCommentId=469446
MedicalReportModel.fromJsonForVidaPlus(Map<String, dynamic> json) {
if(json['Status'] == 1){
json['Status'] = 0;
}else{
json['Status'] = 1;
}
reportData = json['ReportData'];
setupID = json['SetupID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
patientID = json['PatientID'];
invoiceNo = json['InvoiceNo']??"0";
status = json['Status'];
verifiedOn = json['VerifiedOn'];
verifiedBy = json['VerifiedBy'];
editedOn = json['EditedOn'];
editedBy = json['EditedBy'];
lineItemNo = json['LineItemNo']??0;
createdOn = json['CreatedOn'];
templateID = json['TemplateID'];
doctorID = json['DoctorID'];
doctorGender = json['DoctorGender'];
doctorGenderDescription = json['DoctorGenderDescription'];
doctorGenderDescriptionN = json['DoctorGenderDescriptionN'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicName = json['ClinicName'];
clinicNameN = json['ClinicNameN'];
reportDataHtml = json['ReportDataHtml'];
summaryId = json['summaryId'];
}
}

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
class OutPatientService extends BaseService {
List<PatiantInformtion> _patientList = [];
@ -9,6 +10,9 @@ class OutPatientService extends BaseService {
List<PatiantInformtion> get patientList => _patientList;
Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async {
if(ProjectViewModel.getVidaPlusStatus()){
patientSearchRequestModel.pageSize = 0;
}
hasError = false;
await baseAppClient.post(
GET_MY_OUT_PATIENT,

@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MedicalReportTemplate.dart';
import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/extenstions_utils.dart';
class PatientMedicalReportService extends BaseService {
List<MedicalReportModel> medicalReportList = [];
@ -21,7 +23,11 @@ class PatientMedicalReportService extends BaseService {
await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) {
if (response['DAPP_ListMedicalReportList'] != null) {
response['DAPP_ListMedicalReportList'].forEach((v) {
medicalReportList.add(MedicalReportModel.fromJson(v));
if (isVidaPlusProject) {
medicalReportList.add(MedicalReportModel.fromJsonForVidaPlus(v));
} else {
medicalReportList.add(MedicalReportModel.fromJson(v));
}
});
}
medicalReportList = medicalReportList.reversed.toList();
@ -64,11 +70,26 @@ class PatientMedicalReportService extends BaseService {
Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject,) async {
hasError = false;
print("the isVidaPlusProject flag in Service is $isVidaPlusProject");
Map<String, dynamic> body = Map();
body['SetupID'] = "91877";
if (isVidaPlusProject == true) {
body['SetupID'] = doctorProfile!.setupID;
} else
body['SetupID'] = "91877";
body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID : patient.admissionNo;
body['InvoiceNo'] = medicalReport.invoiceNo;
body['LineItemNo'] = medicalReport.lineItemNo;
if (isVidaPlusProject == true) {
body['TemplateID'] = medicalReport.templateID ?? 0;
body['summaryId'] = medicalReport.summaryId ?? 0;
try {
if (body['InvoiceNo'].toString().isEmpty) {
body['InvoiceNo'] = "0";
}
} catch (e) {
body['InvoiceNo'] = "0";
}
}
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;
}
@ -83,15 +104,17 @@ class PatientMedicalReportService extends BaseService {
Future addMedicalReport(PatiantInformtion patient, String htmlText, bool? isVidaPlusProject) async {
hasError = false;
Map<String, dynamic> body = Map();
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
print("isVidaPlusProject $isVidaPlusProject");
body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID ?? -1 :int.parse(patient.admissionNo!);
print('the admission no is ${body['AdmissionNo']}');
body['MedicalReportHTML'] = htmlText;
if (isVidaPlusProject == false) {
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID;
}
body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID ?? -1 :int.parse(patient.admissionNo!);
body['MedicalReportHTML'] = htmlText;
body['ProjectID'] = doctorProfile?.projectID;
body['PatientID'] = patient.patientId;
body['DoctorID'] = doctorProfile?.doctorID;
@ -111,6 +134,11 @@ class PatientMedicalReportService extends BaseService {
body['LineItemNo'] = limitNumber;
body['InvoiceNo'] = invoiceNumber;
if (ProjectViewModel.getVidaPlusStatus()) {
if (body['InvoiceNo'].toString().isEmpty) {
body['InvoiceNo'] = "0";
}
}
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null

@ -94,8 +94,8 @@ class PrescriptionService extends LookupService {
}, body: getAssessmentReqModel.toJson());
}
Future getPrescriptionListNew({required int mrn, required int appNo}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn, appNo: appNo);
Future getPrescriptionListNew({required int mrn, required int appNo, int? episodeID}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn, appNo: appNo, episodeId: episodeID);
hasError = false;
_prescriptionList.clear();
_prescriptionListNew.clear();
@ -127,10 +127,10 @@ class PrescriptionService extends LookupService {
}
Future getMedicationList({String drug = ''}) async {
allMedicationList = [];
hasError = false;
_drugRequestModel.search = ["$drug"];
await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) {
allMedicationList = [];
response['MedicationList']['entityList'].forEach((v) {
allMedicationList.add(GetMedicationResponseModel.fromJson(v));
});

@ -707,6 +707,9 @@ class SOAPService extends LookupService {
hasError = false;
await baseAppClient.post(POST_CHIEF_COMPLAINT_VP,
onSuccess: (dynamic response, int statusCode) {
response['List_CreateChiefComplaint']['resultData'].forEach((v) {
episodeID = v['episodeId'];
});
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;

@ -48,6 +48,7 @@ class PatientMedicalReportViewModel extends BaseViewModel {
Future verifyMedicalReport(
PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject) async {
setState(ViewState.Busy);
print("the isVidaPlusProject flag in VM is $isVidaPlusProject");
await _service.verifyMedicalReport(patient, medicalReport, isVidaPlusProject);
if (_service.hasError) {
error = _service.error;

@ -31,6 +31,7 @@ class PatientSearchViewModel extends BaseViewModel {
int firstSubsetIndex = 0;
int inPatientPageSize = 20;
int lastSubsetIndex = 20;
String noDataFoundText = "";
List<String> InpatientClinicList = [];
@ -192,6 +193,7 @@ class PatientSearchViewModel extends BaseViewModel {
FutureOr<void> paginatedInPatientCall(String? selectedClinicName, String? query, bool? isSortDes,{bool isMyInPatient = false,bool isAllClinic = false }) async {
if(isVidaPlusProject == false) return;
if(paginationLoading == true) return;
if(this.requestModel == null) return;
PatientSearchRequestModel requestModel = this.requestModel!;
@ -200,18 +202,23 @@ class PatientSearchViewModel extends BaseViewModel {
notifyListeners();
await _inPatientService.getInPatientList(requestModel, false, isVidaPlusProject: isVidaPlusProject);
paginationLoading = false;
notifyListeners();
if (_inPatientService.hasError) {
error = _inPatientService.error;
requestModel.pageIndex = (requestModel.pageIndex??1) - 1 ;
} else {
this.requestModel = requestModel;
if (inPatientList.isEmpty == true) {
requestModel.pageIndex = (requestModel.pageIndex??1) - 1 ;
Utils.showErrorToast(noDataFoundText);
return;
}
await setDefaultInPatientList(isFromPagination: true);
generateInpatientClinicList(isFromPagination: true);
sortInPatient(isDes:isSortDes == true, isAllClinic: isAllClinic, isMyInPatient: isMyInPatient );
filterSearchResults(query!, isAllClinic: isAllClinic, isMyInPatient: isMyInPatient);
filterByClinic(clinicName: selectedClinicName!);
}
notifyListeners();
}

@ -1100,8 +1100,11 @@ class SOAPViewModel extends BaseViewModel {
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
} else {
if(patientInfo.episodeNo == 0)
patientInfo.episodeNo = _SOAPService.episodeID;
setState(ViewState.Idle);
}
}
updateChiefComplaint(

@ -180,15 +180,15 @@ class MedicineViewModel extends BaseViewModel {
}
GetAssessmentReqModel getAssessmentReqModel =
GetAssessmentReqModel(patientMRN: patientInfo!.patientMRN!, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: patientInfo.appointmentNo);
if (medicationStrengthList.length == 0) {
// if (medicationStrengthList.length == 0) {
await getMedicationStrength(isLocalBusy: true);
}
if (medicationDurationList.length == 0) {
// }
// if (medicationDurationList.length == 0) {
await getMedicationDuration(isLocalBusy: true);
}
if (medicationDoseTimeList.length == 0) {
// }
// if (medicationDoseTimeList.length == 0) {
await getMedicationDoseTime(isLocalBusy: true);
}
// }
await getPatientAssessment(getAssessmentReqModel, isLocalBusy: true);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
@ -260,15 +260,15 @@ class MedicineViewModel extends BaseViewModel {
GetAssessmentReqModel getAssessmentReqModel =
GetAssessmentReqModel(patientMRN: patient!.patientMRN!, episodeID: patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: patient.appointmentNo);
if (medicationStrengthList.length == 0) {
// if (medicationStrengthList.length == 0) {
await getMedicationStrength();
}
if (medicationDurationList.length == 0) {
// }
// if (medicationDurationList.length == 0) {
await getMedicationDuration();
}
if (medicationDoseTimeList.length == 0) {
// }
// if (medicationDoseTimeList.length == 0) {
await getMedicationDoseTime();
}
// }
await getPatientAssessment(getAssessmentReqModel);
}

@ -126,9 +126,11 @@ class PatientReferralViewModel extends BaseViewModel {
}
}
mapHospitalToBranchList(){
mapHospitalToBranchList() async {
branchesList!.clear();
DoctorProfileModel doctorProfile = await getDoctorProfile();
_hospitalService.hospitals.forEach((element) {
if(doctorProfile.projectID != element.facilityId)
branchesList!.add({"facilityId": element.facilityId, "facilityName": element.facilityName});
});
}

@ -56,13 +56,13 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPrescriptionListNew({int? mrn, int appNo = 0, bool isLocalBusy = false}) async {
Future getPrescriptionListNew({int? mrn, int appNo = 0, bool isLocalBusy = false, int? episodeId}) async {
hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _prescriptionService.getPrescriptionListNew(mrn: mrn!, appNo: appNo);
await _prescriptionService.getPrescriptionListNew(mrn: mrn!, appNo: appNo, episodeID: episodeId);
if (_prescriptionService.hasError) {
error = _prescriptionService.error!;
setState(ViewState.ErrorLocal);
@ -78,7 +78,7 @@ class PrescriptionViewModel extends BaseViewModel {
error = _prescriptionService.error!;
setState(ViewState.ErrorLocal);
} else {
await getPrescriptionListNew(mrn: mrn);
await getPrescriptionListNew(mrn: mrn, episodeId: postProcedureReqModel.episodeID);
setState(ViewState.Idle);
}
}

@ -130,6 +130,7 @@ class ProcedureViewModel extends BaseViewModel {
}
setTemplateListDependOnId() {
templateList.clear();
procedureTemplate.forEach((element) {
List<ProcedureTempleteDetailsModelList> templateListData = templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList();
@ -444,22 +445,20 @@ class ProcedureViewModel extends BaseViewModel {
}
}
void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) {
List<ProcedureTempleteModel> dummySearchList = [];
void filterProcedureSearchResults(String query, List<ProcedureTempleteDetailsModelList> masterList, Function(List<ProcedureTempleteDetailsModelList>) onItemSearched) {
List<ProcedureTempleteDetailsModelList> dummySearchList = [];
if (masterList != null) dummySearchList.addAll(masterList);
if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = [];
List<ProcedureTempleteDetailsModelList> dummyListData = [];
dummySearchList.forEach((item) {
if (item.templateName!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item);
}
});
items.clear();
items.addAll(dummyListData);
onItemSearched(dummyListData);
return;
} else {
items.clear();
items.addAll(masterList);
onItemSearched(dummySearchList);
}
}

@ -24,6 +24,7 @@ class ProjectViewModel with ChangeNotifier {
String? currentLanguage = 'ar';
bool _isArabic = false;
static bool _isVidaPlusProject = false;
bool isInternetConnection = true;
List<ClinicModel> doctorClinicsList = [];
bool isLoading = false;
@ -149,4 +150,13 @@ class ProjectViewModel with ChangeNotifier {
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).getDoctorProfileBasedOnClinic(clinicModel);
}
static setVidaPlusStatus(bool isVidaPlus){
_isVidaPlusProject = isVidaPlus;
}
static getVidaPlusStatus(){
return _isVidaPlusProject;
}
}

@ -18,13 +18,14 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:timezone/data/latest_all.dart' as tz;
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
HttpOverrides.global = MyHttpOverrides();
setupLocator();
await clearPrefsOnFirstLaunch();
tz.initializeTimeZones();
runApp(MyApp());
}

@ -82,6 +82,8 @@ class _HomeScreenState extends State<HomeScreen> {
return BaseView<DashboardViewModel>(
onModelReady: (model) async {
var doctorProfile = await model.getDoctorProfile();
ProjectViewModel.setVidaPlusStatus(Utils.isVidaPlusProject(projectsProvider!, doctorProfile.projectID ?? -1));
model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) {
WidgetsBinding.instance.addPostFrameCallback((_) async {
if (model.radiologyCriticalFindingModel != null) {

@ -80,483 +80,486 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
model.getMedicalFile(mrn: pp!);
}
},
builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold(
appBar: PatientProfileAppBar(
patient!,
doctorName: doctorName!,
profileUrl: doctorImage!,
clinic: clinicName!,
isPrescriptions: true,
isMedicalFile: true,
episode: episode!,
visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate!,
), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true,
),
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
body: NetworkBaseView(
baseViewModel: model,
child: SingleChildScrollView(
child: Center(
child: Container(
child: Column(
children: [
model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0
? Padding(
padding: EdgeInsets.all(10.0),
child: Container(
child: Column(
children: [
SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).historyOfPresentIllness.toUpperCase(),
variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : true, color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
});
},
child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
],
builder: (BuildContext context, MedicalFileViewModel model, Widget? child) =>
// AppScaffold(
// isShowAppBar: false,
// appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(),
// body:
Material(
child: Column(
children: [
PatientProfileAppBar(
patient!,
doctorName: doctorName!,
profileUrl: doctorImage!,
clinic: clinicName!,
isPrescriptions: true,
isMedicalFile: true,
episode: episode!,
visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(
vistDate!,
), isArabic: projectViewModel.isArabic)}',
isAppointmentHeader: true,
),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0
? Padding(
padding: EdgeInsets.all(10.0),
child: Container(
child: Column(
children: [
SizedBox(height: 25.0),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint!.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint![index].hOPI!
.trim(),
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).historyOfPresentIllness.toUpperCase(),
variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : true, color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
});
},
child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint!.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint![index].hOPI!
.trim(),
),
),
),
SizedBox(width: 35.0),
],
),
],
SizedBox(width: 35.0),
],
),
],
),
),
),
);
}),
isExpand: isHistoryExpand,
);
}),
isExpand: isHistoryExpand,
),
),
),
// SizedBox(
// height: 30,
// ),
SizedBox(
height: 30,
),
// SizedBox(
// height: 30,
// ),
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).assessment.toUpperCase(),
variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : true, color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
],
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments!.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
AppText(
'ICD: ',
fontSize: 13.0,
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10!
.trim(),
fontSize: 13.5,
fontWeight: FontWeight.w700,
),
SizedBox(width: 15.0),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).condition + ": ",
fontSize: 12.5,
),
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index]
.condition!
.trim(),
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).assessment.toUpperCase(),
variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : true, color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments!.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
AppText(
'ICD: ',
fontSize: 13.0,
fontWeight: FontWeight.w700,
),
),
],
),
Row(
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index]
.description!,
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10!
.trim(),
fontSize: 13.5,
fontWeight: FontWeight.w700,
fontSize: 15.0,
),
)
],
),
Row(
children: [
AppText(
TranslationBase.of(context).type + ": ",
fontSize: 15.5,
),
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].type!,
fontSize: 16.0,
fontWeight: FontWeight.w700,
SizedBox(width: 15.0),
],
),
Row(
children: [
AppText(
TranslationBase.of(context).condition + ": ",
fontSize: 12.5,
),
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index]
.condition!
.trim(),
fontSize: 13.0,
fontWeight: FontWeight.w700,
),
),
],
),
Row(
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index]
.description!,
fontWeight: FontWeight.w700,
fontSize: 15.0,
),
)
],
),
Row(
children: [
AppText(
TranslationBase.of(context).type + ": ",
fontSize: 15.5,
),
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].type!,
fontSize: 16.0,
fontWeight: FontWeight.w700,
),
),
),
],
),
SizedBox(
height: 15.0,
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks!
.trim(),
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
),
],
],
),
SizedBox(
height: 15.0,
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks??""
.trim(),
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
),
],
),
),
),
);
}),
isExpand: isAssessmentExpand,
);
}),
isExpand: isAssessmentExpand,
),
),
),
SizedBox(
height: 30,
),
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).test.toUpperCase(),
variant: isProcedureExpand ? "bodyText" : '', bold: isProcedureExpand ? true : true, color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isProcedureExpand = !isProcedureExpand;
});
},
child: Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
],
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure!.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Column(
children: [
AppText(
'Procedure ID: ',
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index]
.procedureId!
.trim(),
fontSize: 13.5,
fontWeight: FontWeight.w700,
),
],
),
SizedBox(width: 35.0),
Column(
children: [
AppText(
TranslationBase.of(context).orderDate + ": ",
),
AppText(
AppDateUtils.getDateFormatted(DateTime.parse(
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).test.toUpperCase(),
variant: isProcedureExpand ? "bodyText" : '', bold: isProcedureExpand ? true : true, color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isProcedureExpand = !isProcedureExpand;
});
},
child: Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure!.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Column(
children: [
AppText(
'Procedure ID: ',
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index]
.orderDate!
.procedureId!
.trim(),
)),
fontSize: 13.5,
fontSize: 13.5,
fontWeight: FontWeight.w700,
),
],
),
SizedBox(width: 35.0),
Column(
children: [
AppText(
TranslationBase.of(context).orderDate + ": ",
),
AppText(
AppDateUtils.getDateFormatted(DateTime.parse(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index]
.orderDate!
.trim(),
)),
fontSize: 13.5,
fontWeight: FontWeight.w700,
),
],
),
],
),
SizedBox(
height: 20.0,
),
Row(
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].procName!,
fontWeight: FontWeight.w700,
),
],
),
],
),
SizedBox(
height: 20.0,
),
Row(
children: [
Expanded(
child: AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].procName!,
)
],
),
Row(
children: [
AppText(
'CPT Code : ',
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].patientID
.toString(),
fontWeight: FontWeight.w700,
),
)
],
),
Row(
children: [
AppText(
'CPT Code : ',
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].patientID
.toString(),
fontWeight: FontWeight.w700,
),
],
),
SizedBox(
height: 15.0,
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
),
],
],
),
SizedBox(
height: 15.0,
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
),
],
),
),
),
);
}),
isExpand: isProcedureExpand,
);
}),
isExpand: isProcedureExpand,
),
),
),
SizedBox(
height: 30,
),
SizedBox(
height: 30,
),
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).physicalSystemExamination.toUpperCase(),
variant: isPhysicalExam ? "bodyText" : '', bold: isPhysicalExam ? true : true, color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isPhysicalExam = !isPhysicalExam;
});
},
child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown))
],
if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0)
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam!.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
children: [
Row(
children: [
AppText(TranslationBase.of(context).examType + ": "),
AppText(
model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!,
fontWeight: FontWeight.w700,
),
],
),
Row(
children: [
AppText(
model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!,
fontWeight: FontWeight.w700,
)
],
),
Row(
children: [
AppText(TranslationBase.of(context).abnormal + ": "),
AppText(
model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].abnormal!,
fontWeight: FontWeight.w700,
),
],
),
SizedBox(
height: 15.0,
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].remarks!,
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
),
],
border: Border.all(color: Colors.grey[200]!, width: 0.5),
),
child: Padding(
padding: const EdgeInsets.all(15.0),
child: HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
AppText(TranslationBase.of(context).physicalSystemExamination.toUpperCase(),
variant: isPhysicalExam ? "bodyText" : '', bold: isPhysicalExam ? true : true, color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isPhysicalExam = !isPhysicalExam;
});
},
child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam!.length,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Column(
children: [
Row(
children: [
AppText(TranslationBase.of(context).examType + ": "),
AppText(
model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!,
fontWeight: FontWeight.w700,
),
],
),
// Row(
// children: [
// AppText(
// model
// .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!,
// fontWeight: FontWeight.w700,
// )
// ],
// ),
Row(
children: [
AppText(TranslationBase.of(context).abnormal + ": "),
AppText(
model
.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].abnormal!,
fontWeight: FontWeight.w700,
),
],
),
SizedBox(
height: 15.0,
),
AppText(
model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].remarks!,
),
Divider(
height: 1,
color: Colors.grey,
thickness: 1.0,
),
SizedBox(
height: 8.0,
),
],
),
),
),
);
}),
isExpand: isPhysicalExam,
);
}),
isExpand: isPhysicalExam,
),
),
),
SizedBox(
height: 30,
),
SizedBox(
height: 30,
),
],
],
),
),
),
)
: Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
))
],
)
: Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
))
],
),
),
),
),
],
),
),
),
// ),
);
}
}

@ -119,7 +119,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
addSickLeave.noOfDays = value;
});
},
validationError: isFormSubmitted && (addSickLeave.noOfDays == null) ? TranslationBase.of(context).pleaseEnterNoOfDays : "",
validationError: isFormSubmitted && (addSickLeave.noOfDays == null) ? TranslationBase.of(context).pleaseEnterNoOfDays : null,
onClick: () {},
onFieldSubmitted: () {},
),
@ -148,7 +148,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
addSickLeave.startDate = value;
});
},
validationError: isFormSubmitted && (addSickLeave.startDate == null) ? TranslationBase.of(context).pleaseEnterDate : "",
validationError: isFormSubmitted && (addSickLeave.startDate == null) ? TranslationBase.of(context).pleaseEnterDate : null,
onFieldSubmitted: () {},
),
SizedBox(
@ -293,6 +293,7 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
addSickLeave.patientMRN = widget.patient!.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient!.appointmentNo.toString();
await model.addSickLeave(addSickLeave);
print("the state is ${model.state}");
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {

@ -158,10 +158,10 @@ class _InPatientListPageState extends State<InPatientListPage> {
onFieldSubmitted: () {},
),
widget.patientSearchViewModel!.state == ViewState.Idle
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0)
? (widget.isMyInPatient && widget.patientSearchViewModel!.filteredMyInPatientItems.length > 0)
? ListOfMyInpatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget.isVidaPlusProject,)
: widget.patientSearchViewModel!.filteredInPatientItems.length > 0
? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length == 0)
? (widget.isMyInPatient && widget.patientSearchViewModel!.filteredMyInPatientItems.length == 0)
? NoData()
: ListOfAllInPatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget
.isVidaPlusProject,query: _searchController.text, selectedClinicName: widget.selectedClinicName,isSortDes: isSortDes)

@ -67,6 +67,7 @@ class _InPatientScreenState extends State<InPatientScreen> with SingleTickerProv
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
model.noDataFoundText = TranslationBase.of(context).noDataAvailable;
model.clearPatientList();
var doctorProfile = await model.getDoctorProfile();
if (widget.specialClinic != null && widget.specialClinic!.clinicID != null) {

@ -433,7 +433,7 @@ class _InsuranceApprovalsDetailsState extends State<InsuranceApprovalsDetails> {
TranslationBase.of(context).companyName + ": ",
color: Colors.grey[500],
),
AppText('Sample')
Expanded(child: AppText(projectViewModel.isArabic?model.insuranceApproval[indexInsurance].companyNameN??'':model.insuranceApproval[indexInsurance].companyName??''))
],
),
Row(

@ -32,7 +32,7 @@ class ProceduresWidget extends StatelessWidget {
SizedBox(width: 10,),
CustomRow(
label: "${TranslationBase.of(context).quantity}: ",
value: "${procedure.lineItemNo}",
value: "1",//done as prescribed https://cloudsolutions-sa.atlassian.net/browse/V4-40476?focusedCommentId=471705
isExpanded: false,
valueSize: SizeConfig.textMultiplier! * 1.8,
labelSize: SizeConfig.textMultiplier! * 1.6,

@ -86,8 +86,9 @@ class _VitalSignDetailsWidgetState extends State<DiabeticDetails> {
List<TableRow> tableRow = [];
widget.diabeticDetailsList!.forEach((diabetic) {
var data = diabetic.resultValue;
//https://cloudsolutions-sa.atlassian.net/browse/V4-39217?focusedCommentId=47028722
DateTime elementDate =
AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart!);
AppDateUtils.parseDateTimeWithRiyadhTZ(diabetic.dateChart!);
if (data != 0)
tableRow.add(TableRow(children: [
Container(

@ -52,145 +52,159 @@ class _LabsHomePageState extends State<LabsHomePage> {
model.getLabs(patient!, isInpatient: false);
model.isPrincipalCovered(patient: patient!);
},
builder: (context, ProcedureViewModel model, widget) => AppScaffold(
baseViewModel: model,
backgroundColor: Colors.grey[100]!,
isShowAppBar: true,
appBar: PatientProfileAppBar(
patient!,
isInpatient: isInpatient!,
),
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: FractionallySizedBox(
widthFactor: 1.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 12,
),
if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43))
ServiceTitle(
title: TranslationBase.of(context).lab,
subTitle: TranslationBase.of(context).result,
),
SizedBox(
height: 20,
),
!model.isPrincipalCovered_
? Center(
child: AppText(
TranslationBase.of(context).principalCoveredOrNot,
color: Colors.red,
textAlign: TextAlign.center,
))
: SizedBox(),
if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage(
patient: patient!,
previousProcedureViewModel: model,
procedureType: ProcedureType.LAB_RESULT,
),
settings: RouteSettings(name: 'AddProcedureTabPage'),
),
);
},
label: TranslationBase.of(context).applyForNewLabOrder,
),
...List.generate(
model.patientLabOrdersList.length,
(index) => Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
builder: (context, ProcedureViewModel model, widget) =>
// AppScaffold(
// baseViewModel: model,
// backgroundColor: Colors.grey[100]!,
// isShowAppBar: true,
// appBar: PatientProfileAppBar(
// patient!,
// isInpatient: isInpatient!,
// ),
// body:
Material(
child: Column(
children: [
PatientProfileAppBar(
patient!,
isInpatient: isInpatient!,
),
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: FractionallySizedBox(
widthFactor: 1.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 12,
),
if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43))
ServiceTitle(
title: TranslationBase.of(context).lab,
subTitle: TranslationBase.of(context).result,
),
borderRadius: BorderRadius.all(
Radius.circular(8.0),
SizedBox(
height: 20,
),
!model.isPrincipalCovered_
? Center(
child: AppText(
TranslationBase.of(context).principalCoveredOrNot,
color: Colors.red,
textAlign: TextAlign.center,
))
: SizedBox(),
if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage(
patient: patient!,
previousProcedureViewModel: model,
procedureType: ProcedureType.LAB_RESULT,
),
settings: RouteSettings(name: 'AddProcedureTabPage'),
),
);
},
label: TranslationBase.of(context).applyForNewLabOrder,
),
color: Colors.white),
child: Stack(
children: [
Positioned(
bottom: 1,
top: 1,
left: 1,
child: Container(
width: 20,
decoration: BoxDecoration(
color: model.patientLabOrdersList![index].isLiveCareAppointment!
? Colors.red[900]
: !model.patientLabOrdersList[index].isInOutPatient!
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
model.patientLabOrdersList[index].isLiveCareAppointment!
? TranslationBase.of(context).liveCare.toUpperCase()
...List.generate(
model.patientLabOrdersList.length,
(index) => Container(
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
border: Border.all(
width: 0.5,
color: Colors.white,
),
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
color: Colors.white),
child: Stack(
children: [
Positioned(
bottom: 1,
top: 1,
left: 1,
child: Container(
width: 20,
decoration: BoxDecoration(
color: model.patientLabOrdersList![index].isLiveCareAppointment!
? Colors.red[900]
: !model.patientLabOrdersList[index].isInOutPatient!
? TranslationBase.of(context).inPatientLabel.toUpperCase()
: TranslationBase.of(context).outpatient.toUpperCase(),
style: TextStyle(color: Colors.white),
? Colors.black
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
),
)),
),
),
Container(
color: Colors.white,
padding: EdgeInsets.all(0),
margin: EdgeInsets.only(left: 20),
child: DoctorCard(
isNoMargin: true,
onTap: () => Navigator.push(
context,
FadePage(
page: LaboratoryResultPage(
patientLabOrders: model.patientLabOrdersList[index],
patient: patient!,
isInpatient: isInpatient!,
arrivalType: arrivalType!,
patientType: patientType!,
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
model.patientLabOrdersList[index].isLiveCareAppointment!
? TranslationBase.of(context).liveCare.toUpperCase()
: !model.patientLabOrdersList[index].isInOutPatient!
? TranslationBase.of(context).inPatientLabel.toUpperCase()
: TranslationBase.of(context).outpatient.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
),
),
Container(
color: Colors.white,
padding: EdgeInsets.all(0),
margin: EdgeInsets.only(left: 20),
child: DoctorCard(
isNoMargin: true,
onTap: () => Navigator.push(
context,
FadePage(
page: LaboratoryResultPage(
patientLabOrders: model.patientLabOrdersList[index],
patient: patient!,
isInpatient: isInpatient!,
arrivalType: arrivalType!,
patientType: patientType!,
),
),
),
doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName),
invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
profileUrl: model.patientLabOrdersList[index].doctorImageURL,
branch: model.patientLabOrdersList[index].projectName,
clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription),
appointmentDate: model.patientLabOrdersList[index].createdOn,
orderNo: model.patientLabOrdersList[index].orderNo,
isShowTime: false,
),
),
),
doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName),
invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
profileUrl: model.patientLabOrdersList[index].doctorImageURL,
branch: model.patientLabOrdersList[index].projectName,
clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription),
appointmentDate: model.patientLabOrdersList[index].createdOn,
orderNo: model.patientLabOrdersList[index].orderNo,
isShowTime: false,
],
),
),
],
),
),
if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43)
Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
))
],
),
),
if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43)
Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
))
],
),
),
),
),
),
],
),
),
);
}

@ -98,8 +98,8 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.medicalReport != null
? await widget.model!.updateMedicalReport(widget.patient!, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport!.lineItemNo! : 0,
widget.medicalReport != null ? widget.medicalReport!.invoiceNo! : "", widget.isVidaPlusProject)
? await widget.model!.updateMedicalReport(widget.patient!, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport!.lineItemNo??0: 0,
widget.medicalReport != null ? widget.medicalReport!.invoiceNo??"" : "", widget.isVidaPlusProject)
: await widget.model!.addMedicalReport(widget.patient!, txtOfMedicalReport, widget.isVidaPlusProject);
//model.getMedicalReportList(patient);
@ -128,6 +128,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
txtOfMedicalReport = (await _controller.getText())!;
if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
print("isVidaPlusProject: ${widget.isVidaPlusProject}");
await widget.model!.verifyMedicalReport(widget.patient!, widget.medicalReport!, widget.isVidaPlusProject);
GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context);

@ -124,6 +124,7 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
model: model,
medicalNote: model
.medicalReportList[index].reportDataHtml,
isVidaPlusProject: isVidaPlusProject
),
settings:
RouteSettings(name: 'AddVerifyMedicalReport')),
@ -157,7 +158,10 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
children: [
AppText(
model.medicalReportList[index].status == 1
? TranslationBase.of(context).onHold
? isVidaPlusProject
? TranslationBase.of(context)
.pending
: TranslationBase.of(context).onHold
: TranslationBase.of(context).verified,
color:
model.medicalReportList[index].status ==

@ -267,6 +267,13 @@ String noteValidation ="";
height: 30,
),
onPressed: () async {
if(ProjectViewModel.getVidaPlusStatus() && !isInpatient){
Navigator.of(context).pushNamed(
UPDATE_EPISODE_VIDA_PLUS, arguments: {
'patient': patient
});
return;
}
if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) {
createEpisode(patient: patient, model: model);
}
@ -489,11 +496,12 @@ String noteValidation ="";
eventAction: "Create Episode",
);
GifLoaderDialogUtils.showMyDialog(context);
if (patient.admissionNo != null && patient.admissionNo!.isNotEmpty) {
var admissionNo = isVidaPlusProject?patient.admissionID?.toString()??"":patient.admissionNo??"";
if (admissionNo.isNotEmpty) {
PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: isVidaPlusProject?patient.admissionID:int.parse(patient.admissionNo!), patientID: patient.patientId);
await model.postEpisodeForInPatient(postEpisodeReqModel);
} else {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel);
}

@ -49,7 +49,7 @@ class RadiologyDetailsPage extends StatelessWidget {
clinic: finalRadiology.clinicDescription,
branch: finalRadiology.projectName,
profileUrl: finalRadiology.doctorImageURL,
invoiceNO: finalRadiology.invoiceNo.toString(),
invoiceNO: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(),
isAppointmentHeader: true,
),
isShowAppBar: true,

@ -51,6 +51,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
int _activePriority = 1;
String? appointmentDate;
String? branchError;
String? diagnosisError;
String? hospitalError;
String? clinicError;
String? doctorError;
@ -132,15 +133,15 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
@override
Widget build(BuildContext context) {
dynamic priority1 = {
"ParameterCode": 1,
"ParameterCode": isVidaPlusProject ? 2 :1,
"Description": TranslationBase.of(context).veryUrgent.toUpperCase(),
};
dynamic priority2 = {
"ParameterCode": 2,
"ParameterCode": isVidaPlusProject? 1 :2,
'Description': TranslationBase.of(context).urgent.toUpperCase(),
};
dynamic priority3 = {
"ParameterCode": 0,
"ParameterCode": isVidaPlusProject? 3 :0,
'Description': TranslationBase.of(context).routine.toUpperCase(),
};
@ -482,7 +483,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: selectedDiagnosis != null ? selectedDiagnosis['selectedDisease'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: branchError,
validationError: diagnosisError,
onClick: () {
ListSelectDialog dialog = ListSelectDialog(
list: model.diagnosisForInPatientList,
@ -619,6 +620,11 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
} else {
frequencyError = null;
}
if ( isVidaPlusProject && selectedDiagnosis == null) {
diagnosisError = TranslationBase.of(context).fieldRequired;
} else {
diagnosisError = null;
}
if (_selectedPriority == null) {
priorityError = TranslationBase.of(context).fieldRequired;
} else {

@ -103,9 +103,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch,
isReferral: true,
remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource!,
remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource,
nationality: model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName!,
nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl!,
nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl,
doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl!,
referralDoctorName: model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo!,
clinicDescription: "",

@ -123,7 +123,7 @@ class _AddDetailsToExaminationVidaPlusState
if (listOfSelectedCategory.isEmpty) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context)
.kindlySelectCategory);
.kindlySelectAllMandatoryField);
return;
}
/* if (listOfSelectedCategory.any((value) {

@ -128,7 +128,7 @@ class _AddExaminationPageVidaPlusState
fontWeight: FontWeight.w600,
onPressed: () async {
if(mySelectedExaminationLocal.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectCategory);
DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectAllMandatoryField);
return;
}
pushAddExamination(mySelectedExaminationLocal);

@ -240,11 +240,11 @@ class UpdatePresentIllnessState extends State<UpdatePresentIllness> {
);
}
saveHopi(SOAPViewModel model) async{
GifLoaderDialogUtils.showMyDialog(context);
if(patientController.text.isEmpty) {
DrAppToastMsg.showErrorToast("Please Enter Remarks");
return;
}
GifLoaderDialogUtils.showMyDialog(context);
Map<String,dynamic> request = {
"hpi": patientController.text,
"isHpiTakenPatient": isPatientSelected,

@ -151,6 +151,7 @@ class _AddDrugWidgetState extends State<AddDrugWidget> {
!.getPrescriptionListNew(
appNo: widget.patient!.appointmentNo,
mrn: widget.patient!.patientMRN,
episodeId: widget.patient!.episodeNo,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
DrAppToastMsg.showSuccesToast(

@ -160,32 +160,33 @@ getIcdCodeData() async{
SizedBox(
height: 15.0,
),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
width: 6,
),
AppText(
TranslationBase.of(context).orderType,
fontWeight: FontWeight.w500,
),
SizedBox(
width: 18,
),
Radio(
activeColor: AppGlobal.appRedColor,
value: 1,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value!);
},
),
Text(TranslationBase.of(context).regular),
],
),
),
// Container(
// child:
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// SizedBox(
// width: 6,
// ),
// AppText(
// TranslationBase.of(context).orderType,
// fontWeight: FontWeight.w500,
// ),
// SizedBox(
// width: 18,
// ),
// Radio(
// activeColor: AppGlobal.appRedColor,
// value: 1,
// groupValue: selectedType,
// onChanged: (value) {
// setSelectedType(value!);
// },
// ),
// Text(TranslationBase.of(context).regular),
// ],
// ),
// ),
Row(
children: [
Container(

@ -14,15 +14,27 @@ import '../../../widgets/shared/network_base_view.dart';
import '../../../widgets/shared/text_fields/app_text_form_field.dart';
import '../../base/base_view.dart';
final myController = TextEditingController();
class SearchPrescriptionWidget extends StatelessWidget {
class SearchPrescriptionWidget extends StatefulWidget {
final double? spaceBetweenTextFields;
final MedicineViewModel? medicineViewModel;
final PrescriptionViewModel? prescriptionViewModel;
final Function(GetMedicationResponseModel)? onItemSelected;
const SearchPrescriptionWidget({Key? key, this.spaceBetweenTextFields, this.medicineViewModel, this.prescriptionViewModel, this.onItemSelected}) : super(key: key);
SearchPrescriptionWidget({Key? key, this.spaceBetweenTextFields, this.medicineViewModel, this.prescriptionViewModel, this.onItemSelected}) : super(key: key);
@override
State<SearchPrescriptionWidget> createState() => _SearchPrescriptionWidgetState();
}
class _SearchPrescriptionWidgetState extends State<SearchPrescriptionWidget> {
final myController = TextEditingController();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
@ -93,7 +105,7 @@ class SearchPrescriptionWidget extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(context);
await model.getItem(itemID: model.allMedicationList[index].itemId!, isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
onItemSelected!(model.allMedicationList[index]);
widget.onItemSelected!(model.allMedicationList[index]);
// uom = _selectedMedication.uom;
},
);
@ -104,7 +116,7 @@ class SearchPrescriptionWidget extends StatelessWidget {
),
),
SizedBox(
height: spaceBetweenTextFields,
height: widget.spaceBetweenTextFields,
),
],
),

@ -36,7 +36,9 @@ class NewPrescriptionsPage extends StatelessWidget {
mrn: patient.patientMRN,
appNo: patient.appointmentNo == null
? 0
: int.parse(patient.appointmentNo.toString()));
: int.parse(patient.appointmentNo.toString()),
episodeId: patient.episodeNo,
);
// }
await model.isPrincipalCovered(patient: patient);

@ -217,15 +217,15 @@ class _PrescriptionCheckOutScreenState extends State<PrescriptionCheckOutScreen>
});
GetAssessmentReqModel getAssessmentReqModel =
GetAssessmentReqModel(patientMRN: widget.patient.patientMRN, episodeID: widget.patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: widget.patient.appointmentNo);
if (model.medicationStrengthList.length == 0) {
// if (model.medicationStrengthList.length == 0) {
await model.getMedicationStrength();
}
if (model.medicationDurationList.length == 0) {
// }
// if (model.medicationDurationList.length == 0) {
await model.getMedicationDuration();
}
if (model.medicationDoseTimeList.length == 0) {
// }
// if (model.medicationDoseTimeList.length == 0) {
await model.getMedicationDoseTime();
}
// }
await model.getPatientAssessment(getAssessmentReqModel);
},
builder: (

@ -148,11 +148,14 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
model: widget.model,
masterList: model.categoriesList[0].entityList!,
removeProcedure: (item) {
setState(() {
entityList.remove(item);
});
},
addProcedure: (history) {
EntityList? itemToBeRemoved = entityList.firstWhere((element) => item.procedureId == element.procedureId, orElse: () => EntityList());
if (itemToBeRemoved.procedureId != null) {
setState(() {
entityList.remove(itemToBeRemoved);
});
}
},
addProcedure: (history) {
setState(() {
entityList.add(history);
});

@ -60,7 +60,10 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> with
onModelReady: (model) async {
if (widget.previousProcedureViewModel == null) {
await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId());
}else{
await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId());
}
},
builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold(
baseViewModel: model,

@ -61,13 +61,14 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
});
}
List<ProcedureTempleteModel> items = [];
List<ProcedureTempleteDetailsModelList> items = [];
List<ProcedureTempleteDetailsModel> itemsProcedure = [];
List<String> remarksList = [];
List<int> typeList = [];
@override
void initState() {
items = [...widget.model!.templateList];
super.initState();
}
@ -90,7 +91,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
AppTextFieldCustomSearch(
searchController: patientFileInfoController,
onChangeFun: (value) {
widget.model!.filterProcedureSearchResults(value, widget.masterList!, items);
widget.model!.filterProcedureSearchResults(value, widget.model!.templateList, (items){
setState(() {
this.items = items;
});
});
},
marginTop: 5,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))],
@ -101,9 +106,9 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State<EntityList
SizedBox(
height: 15,
),
widget.model!.templateList.length != 0
this.items.length != 0
? Column(
children: widget.model!.templateList.map((historyInfo) {
children: this.items.map((historyInfo) {
return ExpansionProcedure(
procedureTempleteModel: historyInfo,
model: widget.model!,

@ -1,7 +1,8 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:intl/intl.dart';
import 'package:timezone/timezone.dart' as tz;
class AppDateUtils {
static String convertDateToFormat(DateTime dateTime, String dateFormat) {
return DateFormat(dateFormat).format(dateTime);
@ -37,8 +38,58 @@ class AppDateUtils {
return DateFormat(dateFormat).format(date);
}
static DateTime getDateTimeFromServerFormat(String str) {
if(ProjectViewModel.getVidaPlusStatus()){
return getDateTimeFromServerFormatForVida4(str);
}
return getDateTimeFromServerFormatForVida3(str);
}
static DateTime getDateTimeFromServerFormatForVida4(String str) {
DateTime date = DateTime.now();
const start = "/Date(";
const end = "+0300)";
if (str.contains("/Date")) {
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var epoch = int.parse(str.substring(startIndex + start.length, endIndex));
final riyadh = tz.getLocation('Asia/Riyadh');
final dateTime = tz.TZDateTime.fromMillisecondsSinceEpoch(riyadh, epoch);
// date = new DateTime.fromMillisecondsSinceEpoch(
// int.parse(str.substring(startIndex + start.length, endIndex), ), isUtc: true);
var dateString = DateFormat('yyyy-MM-dd HH:mm:ss').format(dateTime);
return DateTime.parse("${dateString}Z").toLocal();
} else {
if(str.contains("T")){
date = DateTime.parse("${str}").toLocal();
}else
date = DateTime.parse("${str}Z").toLocal();
}
return date;
}
static DateTime parseMicrosoftJsonDate(String jsonDate) {
// Remove /Date( and )/
RegExp regExp = RegExp(r'/Date\((\d+)([+-]\d{4})?\)/');
Match? match = regExp.firstMatch(jsonDate);
if (match == null) {
throw FormatException('Invalid Microsoft JSON date format: $jsonDate');
}
// Extract timestamp in milliseconds
int timestamp = int.parse(match.group(1)!);
// Create UTC DateTime from timestamp
DateTime utcTime = DateTime.fromMillisecondsSinceEpoch(timestamp, isUtc: true);
// Convert to local timezone
return utcTime.toLocal();
}
static DateTime getDateTimeFromServerFormatForVida3(String str) {
DateTime date = DateTime.now();
const start = "/Date(";
@ -56,6 +107,24 @@ class AppDateUtils {
return date;
}
static DateTime parseDateTimeWithRiyadhTZ(String str) {
DateTime date = DateTime.now();
const start = "/Date(";
const end = "+0300)";
if (str.contains("/Date")) {
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
final riyadh = tz.getLocation('Asia/Riyadh');
date = tz.TZDateTime.fromMillisecondsSinceEpoch(riyadh,
int.parse(str.substring(startIndex + start.length, endIndex)));
} else {
date = DateTime.parse(str);
}
return date;
}
static String differenceBetweenDateAndCurrentInYearMonthDay(
DateTime firstDate, BuildContext context) {
DateTime now = DateTime.now();
@ -328,7 +397,7 @@ class AppDateUtils {
/// get data formatted like 10:45 PM
/// [dateTime] convert DateTime to data formatted
static String getHour(DateTime dateTime) {
print("the time is ${DateFormat('hh:mm a').format(dateTime)}");
// print("the time is ${DateFormat('hh:mm a').format(dateTime)}");
return DateFormat('hh:mm a').format(dateTime);
}

@ -1947,6 +1947,7 @@ class TranslationBase {
String get noRemarks => localizedValues['noRemarks']![locale.languageCode]!;
String get kindlySelectCategory => localizedValues['kindlySelectCategory']![locale.languageCode]!;
String get kindlySelectAllMandatoryField => localizedValues['kindlySelectAllMandatoryField']![locale.languageCode]!;
String get remarksCanNotBeEmpty => localizedValues['remarksCanNotBeEmpty']![locale.languageCode]!;
String get selectedDiagnosis => localizedValues['selectedDiagnosis']![locale.languageCode]!;
String get selectConditionFirst => localizedValues['selectConditionFirst']![locale.languageCode]!;

@ -94,9 +94,9 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
children: [
...items
.map((item) => RadioListTile(
title: Text("${Utils.convertToTitleCase(item[widget.attributeName].toString())}"),
groupValue: Utils.convertToTitleCase(widget.selectedValue[widget.attributeValueId].toString()),
value: item[widget.attributeValueId].toString(),
title: Text(Utils.convertToTitleCase(item[widget.attributeName].toString())),
groupValue: widget.selectedValue[widget.attributeValueId].toString().toLowerCase(),
value: item[widget.attributeValueId].toString().toLowerCase(),
activeColor: AppGlobal.appRedColor,
selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(),
onChanged: (val) {

@ -42,13 +42,15 @@ class CustomRow extends StatelessWidget {
SizedBox(
width: 1,
),
AppText(
value,
fontSize: valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9,
color: valueColor ?? Color(0xFF2B353E),
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
isCopyable: isCopyable,
Expanded(
child: AppText(
value,
fontSize: valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9,
color: valueColor ?? Color(0xFF2B353E),
fontWeight: FontWeight.w700,
letterSpacing: -0.48,
isCopyable: isCopyable,
),
),
],
);

@ -1594,6 +1594,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.6"
timezone:
dependency: "direct main"
description:
name: timezone
sha256: dd14a3b83cfd7cb19e7888f1cbc20f258b8d71b54c06f79ac585f14093a287d1
url: "https://pub.dev"
source: hosted
version: "0.10.1"
timing:
dependency: transitive
description:

@ -138,6 +138,7 @@ dependencies:
flutter_zoom_videosdk: 1.12.10
dart_jsonwebtoken: ^2.14.0
two_dimensional_scrollables: ^0.3.3
timezone: ^0.10.1
dependency_overrides:

Loading…
Cancel
Save