Merge branch 'development' into feature-ucaf

# Conflicts:
#	lib/config/localized_values.dart
#	lib/util/translations_delegate_base.dart
merge-requests/242/head
mosazaid 4 years ago
commit ca9f1a022b

@ -190,4 +190,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.10.0
COCOAPODS: 1.10.0.rc.1

@ -44,6 +44,7 @@ class BaseAppClient {
body['DoctorID'] = doctorProfile?.doctorID;
if (body['DoctorID'] == "")
body['DoctorID'] = null;
if( body['EditedBy'] ==null)
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID;
@ -51,6 +52,12 @@ class BaseAppClient {
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
}
if (body['DoctorID'] == '') {
body['DoctorID'] =null;
}
if (body['EditedBy'] == '') {
body.remove("EditedBy");
}
body['TokenID'] = token ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')

@ -536,6 +536,11 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "There is no Chief Complaint",
'ar': "ليس هناك شكوى رئيس"
},
'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" },
'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" },
'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" },
'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" },
'addExamination': {'en': "Add Examination", 'ar':"اضافه" },
'patientNoDetailErrMsg': {
'en': "There is no detail for this patient",
'ar': "لا توجد تفاصيل لهذا المريض"

@ -3,16 +3,19 @@ class GetChiefComplaintReqModel {
int appointmentNo;
int episodeId;
int episodeID;
dynamic doctorID;
GetChiefComplaintReqModel(
{this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID});
{this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID});
GetChiefComplaintReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId'];
episodeID = json['EpisodeID'];
}
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
@ -20,6 +23,8 @@ class GetChiefComplaintReqModel {
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId;
data['EpisodeID'] = this.episodeID;
data['DoctorID'] = this.doctorID;
return data;
}
}

@ -2,16 +2,23 @@ class GeneralGetReqForSOAP {
int patientMRN;
int appointmentNo;
int episodeId;
String doctorID;
dynamic editedBy;
dynamic doctorID;
GeneralGetReqForSOAP(
{this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID});
GeneralGetReqForSOAP({
this.patientMRN,
this.appointmentNo,
this.episodeId,
this.doctorID,
this.editedBy,
});
GeneralGetReqForSOAP.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeId'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
}
Map<String, dynamic> toJson() {
@ -20,6 +27,8 @@ class GeneralGetReqForSOAP {
data['AppointmentNo'] = this.appointmentNo;
data['EpisodeId'] = this.episodeId;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data;
}
}

@ -5,7 +5,8 @@ class GetAssessmentReqModel {
String from;
String to;
int clinicID;
int doctorID;
dynamic doctorID;
dynamic editedBy;
GetAssessmentReqModel(
{this.patientMRN,
@ -14,6 +15,7 @@ class GetAssessmentReqModel {
this.from,
this.to,
this.clinicID,
this.editedBy,
this.doctorID});
GetAssessmentReqModel.fromJson(Map<String, dynamic> json) {
@ -24,6 +26,7 @@ class GetAssessmentReqModel {
to = json['To'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
}
Map<String, dynamic> toJson() {
@ -35,6 +38,7 @@ class GetAssessmentReqModel {
data['To'] = this.to;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data;
}
}

@ -5,7 +5,8 @@ class GetGetProgressNoteReqModel {
String from;
String to;
int clinicID;
int doctorID;
dynamic doctorID;
dynamic editedBy;
GetGetProgressNoteReqModel(
{this.patientMRN,
@ -14,6 +15,7 @@ class GetGetProgressNoteReqModel {
this.from,
this.to,
this.clinicID,
this.editedBy,
this.doctorID});
GetGetProgressNoteReqModel.fromJson(Map<String, dynamic> json) {
@ -24,6 +26,8 @@ class GetGetProgressNoteReqModel {
to = json['To'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
}
Map<String, dynamic> toJson() {
@ -35,6 +39,7 @@ class GetGetProgressNoteReqModel {
data['To'] = this.to;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data;
}
}

@ -5,8 +5,9 @@ class GetHistoryReqModel {
String from;
String to;
int clinicID;
int doctorID;
int appointmentNo;
dynamic editedBy;
dynamic doctorID;
GetHistoryReqModel(
{this.patientMRN,
@ -16,6 +17,7 @@ class GetHistoryReqModel {
this.to,
this.clinicID,
this.doctorID,
this.editedBy,
this.appointmentNo});
GetHistoryReqModel.fromJson(Map<String, dynamic> json) {
@ -27,6 +29,7 @@ class GetHistoryReqModel {
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
appointmentNo = json['AppointmentNo'];
editedBy = json['EditedBy'];
}
@ -40,6 +43,8 @@ class GetHistoryReqModel {
data['To'] = this.to;
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data;
}
}

@ -4,13 +4,18 @@ class GetPhysicalExamReqModel {
String episodeID;
String from;
String to;
dynamic editedBy;
dynamic doctorID;
GetPhysicalExamReqModel(
{this.patientMRN,
this.appointmentNo,
this.episodeID,
this.from,
this.to});
GetPhysicalExamReqModel({
this.patientMRN,
this.appointmentNo,
this.episodeID,
this.from,
this.to,
this.doctorID,
this.editedBy,
});
GetPhysicalExamReqModel.fromJson(Map<String, dynamic> json) {
patientMRN = json['PatientMRN'];
@ -18,6 +23,8 @@ class GetPhysicalExamReqModel {
episodeID = json['EpisodeID'];
from = json['From'];
to = json['To'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
}
Map<String, dynamic> toJson() {
@ -27,6 +34,8 @@ class GetPhysicalExamReqModel {
data['EpisodeID'] = this.episodeID;
data['From'] = this.from;
data['To'] = this.to;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data;
}
}

@ -5,9 +5,14 @@ class MySelectedAllergy {
MasterKeyModel selectedAllergy;
String remark;
bool isChecked;
int createdBy;
MySelectedAllergy(
{this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked});
{this.selectedAllergySeverity,
this.selectedAllergy,
this.remark,
this.isChecked,
this.createdBy});
MySelectedAllergy.fromJson(Map<String, dynamic> json) {
selectedAllergySeverity = json['selectedAllergySeverity'] != null
@ -18,6 +23,7 @@ class MySelectedAllergy {
: null;
remark = json['remark'];
remark = json['isChecked'];
createdBy = json['createdBy'];
}
Map<String, dynamic> toJson() {
@ -30,6 +36,7 @@ class MySelectedAllergy {
}
data['remark'] = this.remark;
data['isChecked'] = this.remark;
data['createdBy'] = this.createdBy;
return data;
}
}

@ -6,12 +6,21 @@ class MySelectedAssessment {
MasterKeyModel selectedDiagnosisType;
String remark;
int appointmentId;
int createdBy;
String createdOn;
int doctorID;
String doctorName;
String icdCode10ID;
MySelectedAssessment(
{this.selectedICD,
this.selectedDiagnosisCondition,
this.selectedDiagnosisType,
this.remark, this.appointmentId});
this.remark, this.appointmentId, this.createdBy,
this.createdOn,
this.doctorID,
this.doctorName,
this.icdCode10ID});
MySelectedAssessment.fromJson(Map<String, dynamic> json) {
selectedICD = json['selectedICD'] != null
@ -25,6 +34,11 @@ class MySelectedAssessment {
: null;
remark = json['remark'];
appointmentId = json['appointmentId'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
doctorID = json['doctorID'];
doctorName = json['doctorName'];
icdCode10ID = json['icdCode10ID'];
}
Map<String, dynamic> toJson() {
@ -41,7 +55,11 @@ class MySelectedAssessment {
}
data['remark'] = this.remark;
data['appointmentId'] = this.appointmentId;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['doctorID'] = this.doctorID;
data['doctorName'] = this.doctorName;
data['icdCode10ID'] = this.icdCode10ID;
return data;
}
}

@ -5,18 +5,23 @@ class MySelectedExamination {
String remark;
bool isNormal;
bool isAbnormal;
int createdBy;
MySelectedExamination(
{this.selectedExamination, this.remark, this.isNormal = true, this.isAbnormal = false});
{this.selectedExamination,
this.remark,
this.isNormal = true,
this.isAbnormal = false,
this.createdBy});
MySelectedExamination.fromJson(Map<String, dynamic> json) {
selectedExamination = json['selectedExamination'] != null
? new MasterKeyModel.fromJson(json['selectedExamination'])
: null;
remark = json['remark'];
remark = json['isNormal'];
remark = json['isAbnormal'];
createdBy = json['createdBy'];
}
Map<String, dynamic> toJson() {
@ -28,6 +33,7 @@ class MySelectedExamination {
data['remark'] = this.remark;
data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal;
data['createdBy'] = this.createdBy;
return data;
}
}

@ -0,0 +1,30 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedHistory {
MasterKeyModel selectedHistory;
String remark;
bool isChecked;
MySelectedHistory(
{ this.selectedHistory, this.remark, this.isChecked});
MySelectedHistory.fromJson(Map<String, dynamic> json) {
selectedHistory = json['selectedHistory'] != null
? new MasterKeyModel.fromJson(json['selectedHistory'])
: null;
remark = json['remark'];
remark = json['isChecked'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.selectedHistory != null) {
data['selectedHistory'] = this.selectedHistory.toJson();
}
data['remark'] = this.remark;
data['isChecked'] = this.remark;
return data;
}
}

@ -8,17 +8,22 @@ class PostChiefComplaintRequestModel {
bool ispregnant;
bool isLactation;
int numberOfWeeks;
dynamic doctorID;
dynamic editedBy;
PostChiefComplaintRequestModel(
{this.appointmentNo,
this.episodeID,
this.patientMRN,
this.chiefComplaint,
this.hopi,
this.currentMedication,
this.ispregnant,
this.isLactation,
this.numberOfWeeks});
this.episodeID,
this.patientMRN,
this.chiefComplaint,
this.hopi,
this.currentMedication,
this.ispregnant,
this.isLactation,
this.doctorID,
this.editedBy,
this.numberOfWeeks});
PostChiefComplaintRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
@ -30,6 +35,8 @@ class PostChiefComplaintRequestModel {
ispregnant = json['ispregnant'];
isLactation = json['isLactation'];
numberOfWeeks = json['numberOfWeeks'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
}
Map<String, dynamic> toJson() {
@ -43,6 +50,9 @@ class PostChiefComplaintRequestModel {
data['ispregnant'] = this.ispregnant;
data['isLactation'] = this.isLactation;
data['numberOfWeeks'] = this.numberOfWeeks;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data;
}
}

@ -1,7 +1,8 @@
class PostHistoriesRequestModel {
List<ListMedicalHistoryVM> listMedicalHistoryVM;
dynamic doctorID;
PostHistoriesRequestModel({this.listMedicalHistoryVM});
PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID});
PostHistoriesRequestModel.fromJson(Map<String, dynamic> json) {
if (json['listMedicalHistoryVM'] != null) {
@ -10,6 +11,7 @@ class PostHistoriesRequestModel {
listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v));
});
}
doctorID = json['DoctorID'];
}
Map<String, dynamic> toJson() {
@ -18,6 +20,7 @@ class PostHistoriesRequestModel {
data['listMedicalHistoryVM'] =
this.listMedicalHistoryVM.map((v) => v.toJson()).toList();
}
data['DoctorID'] = this.doctorID;
return data;
}
}

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class PostPhysicalExamRequestModel {
List<ListHisProgNotePhysicalExaminationVM> listHisProgNotePhysicalExaminationVM;

@ -3,15 +3,24 @@ class PostProgressNoteRequestModel {
int episodeId;
int patientMRN;
String planNote;
dynamic doctorID;
dynamic editedBy;
PostProgressNoteRequestModel(
{this.appointmentNo, this.episodeId, this.patientMRN, this.planNote});
{this.appointmentNo,
this.episodeId,
this.patientMRN,
this.planNote,
this.doctorID,
this.editedBy});
PostProgressNoteRequestModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
episodeId = json['EpisodeID'];
patientMRN = json['PatientMRN'];
planNote = json['PlanNote'];
doctorID = json['DoctorID'];
editedBy = json['EditedBy'];
}
Map<String, dynamic> toJson() {
@ -20,6 +29,8 @@ class PostProgressNoteRequestModel {
data['EpisodeID'] = this.episodeId;
data['PatientMRN'] = this.patientMRN;
data['PlanNote'] = this.planNote;
data['DoctorID'] = this.doctorID;
data['EditedBy'] = this.editedBy;
return data;
}
}

@ -28,13 +28,14 @@ class GetPatientArrivalListRequestModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['From'] = this.from;
data['To'] = this.to;
data['DoctorID'] = this.doctorID;
data['PageIndex'] = this.pageIndex;
data['PageSize'] = this.pageSize;
data['ClinicID'] = this.clinicID;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}

@ -552,7 +552,12 @@ class TranslationBase {
String get covered => localizedValues['covered'][locale.languageCode];
String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode];
String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode];
String get addAssessment => localizedValues['addAssessment'][locale.languageCode];
String get assessment => localizedValues['assessment'][locale.languageCode];
String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode];
String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode];
String get searchExamination => localizedValues['searchExamination'][locale.languageCode];
String get addExamination => localizedValues['addExamination'][locale.languageCode];
String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode];
}

@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -71,41 +72,42 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: Expanded(
child: Texts(
Container(
child: Expanded(
child: Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
.toUpperCase(),
variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.5,
),
Texts(
projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr
: selectedAllergy.selectedAllergy.nameEn
? selectedAllergy.selectedAllergySeverity.nameAr
: selectedAllergy.selectedAllergySeverity.nameEn
.toUpperCase(),
variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.5,
),
Texts(
projectViewModel.isArabic ? selectedAllergy
.selectedAllergySeverity.nameAr : selectedAllergy
.selectedAllergySeverity.nameEn
.toUpperCase(),
variant: "bodyText",
textDecoration: selectedAllergy.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: AppGlobal.appPrimaryColor),
if(selectedAllergy.isChecked)
color: AppGlobal.appPrimaryColor),
if (selectedAllergy.isChecked)
InkWell(
child: Icon(
FontAwesomeIcons.trash,
@ -115,6 +117,20 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
onTap: () => removeAllergy(selectedAllergy),
)
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Container(
width: MediaQuery.of(context).size.width * 0.6,
child: AppText(
selectedAllergy.remark ?? '',
fontSize: 10,
color: Colors.grey,
),
),
),
DividerWithSpacesAround()
],
),
SizedBox(
height: 10,
@ -154,31 +170,40 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
builder: (context) {
return AddAllergies(
addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
widget.myAllergiesList.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id
).toList();
if (allergy.isEmpty) {
widget.myAllergiesList.add(mySelectedAllergy);
Navigator.of(context).pop();
} else {
allergy.first.selectedAllergy =
mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
Navigator.of(context).pop();
if (mySelectedAllergy.selectedAllergySeverity == null ||
mySelectedAllergy.selectedAllergy == null) {
helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
} else {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
widget.myAllergiesList
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
}
if (allergy.isEmpty) {
widget.myAllergiesList.add(mySelectedAllergy);
Navigator.of(context).pop();
} else {
allergy.first.selectedAllergy =
mySelectedAllergy.selectedAllergy;
allergy.first.selectedAllergySeverity =
mySelectedAllergy.selectedAllergySeverity;
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
Navigator.of(context).pop();
});
// helpers.showErrorToast(TranslationBase
// .of(context)
// .itemExist);
}
});
}
},);
});
}
@ -383,7 +408,7 @@ class _AddAllergiesState extends State<AddAllergies> {
height: 10,
),
AppButton(
title: "Add".toUpperCase(),
title: TranslationBase.of(context).add.toUpperCase(),
onPressed: () {
MySelectedAllergy mySelectedAllergy = new MySelectedAllergy(
remark: remarkController.text,

@ -1,18 +1,15 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -20,7 +17,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class UpdateHistoryWidget extends StatefulWidget {
final List<MasterKeyModel> myHistoryList;
final List<MySelectedHistory> myHistoryList;
const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key);
@ -86,19 +83,28 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
children: [
Container(
child: Expanded(
child: Texts(projectViewModel.isArabic?myHistory.nameAr:myHistory.nameEn,
variant: "bodyText", bold: true, color: Colors.black),
child: Texts(
projectViewModel.isArabic
? myHistory.selectedHistory.nameAr
: myHistory.selectedHistory.nameEn,
variant: "bodyText",
textDecoration: myHistory.isChecked
? null
: TextDecoration.lineThrough,
bold: true,
color: Colors.black),
),
width: MediaQuery.of(context).size.width * 0.7,
),
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
),
onTap: () => removeHistory(myHistory),
)
if (myHistory.isChecked)
InkWell(
child: Icon(
FontAwesomeIcons.trash,
color: Colors.grey,
size: 20,
),
onTap: () => removeHistory(myHistory.selectedHistory),
)
],
),
SizedBox(
@ -113,13 +119,24 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget>
);
}
removeHistory(MasterKeyModel masterKey) {
Iterable<MasterKeyModel> history = widget.myHistoryList.where((element) =>
masterKey.id == element.id && masterKey.typeId == element.typeId);
removeHistory(MasterKeyModel historyKey) {
// Iterable<MasterKeyModel> history = widget.myHistoryList.where((element) =>
// masterKey.id == element.id && masterKey.typeId == element.typeId);
//
List<MySelectedHistory> history =
// ignore: missing_return
widget.myHistoryList.where((element) =>
historyKey.id ==
element.selectedHistory.id &&
historyKey.typeId ==
element.selectedHistory.typeId
).toList();
if (history.length > 0)
setState(() {
widget.myHistoryList.remove(history.first);
history[0].isChecked = false;
});
}
@ -233,7 +250,7 @@ class _PriorityBarState extends State<PriorityBar> {
class AddHistoryDialog extends StatefulWidget {
final Function changePageViewIndex;
final PageController controller;
final List<MasterKeyModel> myHistoryList;
final List<MySelectedHistory> myHistoryList;
final Function addSelectedHistories;
final Function (MasterKeyModel) removeHistory;
@ -306,7 +323,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
@ -324,7 +342,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
@ -342,7 +361,8 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
},
addHistory: (history){
setState(() {
widget.myHistoryList.add(history);
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
@ -361,12 +381,35 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
));
}
createAndAddHistory(MasterKeyModel history) {
List<MySelectedHistory> myhistory = widget.myHistoryList.where((element) =>
history.id ==
element.selectedHistory.id &&
history.typeId ==
element.selectedHistory.typeId
).toList();
if (myhistory.isEmpty) {
setState(() {
MySelectedHistory mySelectedHistory = MySelectedHistory(
remark: history.remarks ?? "",
selectedHistory: history,
isChecked: true);
widget.myHistoryList.add(mySelectedHistory);
});
} else {
myhistory.first.isChecked = true;
}
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MasterKeyModel> history =
Iterable<MySelectedHistory> history =
widget
.myHistoryList
.where((element) =>
masterKey.id == element.id && masterKey.typeId == element.typeId);
masterKey.id == element.selectedHistory.id &&
masterKey.typeId == element.selectedHistory.typeId &&
element.isChecked);
if (history.length > 0) {
return true;
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
@ -8,9 +9,11 @@ import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -28,7 +31,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class UpdateSubjectivePage extends StatefulWidget {
final Function changePageViewIndex;
final List<MySelectedAllergy> myAllergiesList;
final List<MasterKeyModel> myHistoryList;
final List<MySelectedHistory> myHistoryList;
final PatiantInformtion patientInfo;
UpdateSubjectivePage(
@ -53,20 +56,11 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
appointmentNo: widget.patientInfo.appointmentNo);
getHistoryReqModel.historyType =
MasterKeysService.HistoryFamily.getMasterKeyService();
await model.getPatientHistories(getHistoryReqModel, isFirst: true);
getHistoryReqModel.historyType =
MasterKeysService.HistoryMedical.getMasterKeyService();
await model.getPatientHistories(getHistoryReqModel);
getHistoryReqModel.historyType =
MasterKeysService.HistorySurgical.getMasterKeyService();
await model.getPatientHistories(getHistoryReqModel);
getHistoryReqModel.historyType =
MasterKeysService.HistorySports.getMasterKeyService();
await model.getPatientHistories(getHistoryReqModel);
appointmentNo: widget.patientInfo.appointmentNo,
doctorID: '',
editedBy: '');
await model.getPatientHistories(getHistoryReqModel,isFirst: true);
if (model.patientHistoryList.isNotEmpty) {
if (model.historyFamilyList.isEmpty) {
@ -90,7 +84,12 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
id: element.historyId,
);
if (history != null) {
widget.myHistoryList.add(history);
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history,
isChecked: element.isChecked,
remark: element.remarks);
widget.myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
@ -100,7 +99,12 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
id: element.historyId,
);
if (history != null) {
widget.myHistoryList.add(history);
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history,
isChecked: element.isChecked,
remark: element.remarks);
widget.myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
@ -110,7 +114,12 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
id: element.historyId,
);
if (history != null) {
widget.myHistoryList.add(history);
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history,
isChecked: element.isChecked,
remark: element.remarks);
widget.myHistoryList.add(mySelectedHistory);
}
}
if (element.historyType ==
@ -120,64 +129,75 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
id: element.historyId,
);
if (history != null) {
widget.myHistoryList.add(history);
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history,
isChecked: element.isChecked,
remark: element.remarks);
widget.myHistoryList.add(mySelectedHistory);
}
}
});
}
}
getAllergies(SOAPViewModel model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP);
if (model.patientAllergiesList.isNotEmpty) {
if (model.allergiesList.isEmpty)
await model.getMasterLookup(MasterKeysService.Allergies);
if (model.allergySeverityList.isEmpty)
await model.getMasterLookup(MasterKeysService.AllergySeverity);
model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey(
masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity,
id: element.severity,
);
MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
selectedAllergy: selectedAllergy,
isChecked: element.isChecked,
createdBy: element.createdBy,
selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null)
widget.myAllergiesList.add(mySelectedAllergy);
});
}
}
@override
Widget build(BuildContext context) {
return BaseView<SOAPViewModel>(
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
widget.myAllergiesList.clear();
widget.myHistoryList.clear();
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo);
GetChiefComplaintReqModel getChiefComplaintReqModel =
GetChiefComplaintReqModel(
patientMRN: widget.patientInfo.patientMRN,
appointmentNo: widget.patientInfo.appointmentNo,
episodeId: widget.patientInfo.episodeNo,
episodeID: widget.patientInfo.episodeNo);
episodeID: widget.patientInfo.episodeNo,
doctorID: '');
await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) {
complaintsController.text = helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint)
;
complaintsController.text = helpers.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi;
}
await model.getPatientAllergy(generalGetReqForSOAP);
if (model.patientAllergiesList.isNotEmpty) {
if (model.allergiesList.isEmpty)
await model.getMasterLookup(MasterKeysService.Allergies);
if (model.allergySeverityList.isEmpty)
await model.getMasterLookup(MasterKeysService.AllergySeverity);
model.patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = model.getOneMasterKey(
masterKeys: MasterKeysService.Allergies,
id: element.allergyDiseaseId,
typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity = model.getOneMasterKey(
masterKeys: MasterKeysService.AllergySeverity,
id: element.severity,
);
MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
selectedAllergy: selectedAllergy,
isChecked: element.isChecked,
selectedAllergySeverity: selectedAllergySeverity);
if (selectedAllergy != null && selectedAllergySeverity != null)
widget.myAllergiesList.add(mySelectedAllergy);
});
}
await getHistory(model);
await getAllergies(model);
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: false,
@ -408,10 +428,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
);
}
addSubjectiveInfo(
{SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MasterKeyModel> myHistoryList}) async {
addSubjectiveInfo({SOAPViewModel model,
List<MySelectedAllergy> myAllergiesList,
List<MySelectedHistory> myHistoryList}) async {
formKey.currentState.save();
formKey.currentState.validate();
@ -452,29 +471,30 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
{List<MySelectedAllergy> myAllergiesList, SOAPViewModel model}) async {
PostAllergyRequestModel postAllergyRequestModel =
new PostAllergyRequestModel();
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
widget.myAllergiesList.forEach((allergy) {
if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==
null)
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = [];
//TODO: make static value dynamic
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM
.add(ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: 4709,
//
createdOn: DateTime.now().toIso8601String(),
//"2020-08-14T20:37:22.780Z",
editedBy: 4709,
editedOn: DateTime.now().toIso8601String(),
//"2020-08-14T20:37:22.780Z",
isChecked: false,
isUpdatedByNurse: false));
postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(
ListHisProgNotePatientAllergyDiseaseVM(
allergyDiseaseId: allergy.selectedAllergy.id,
allergyDiseaseType: allergy.selectedAllergy.typeId,
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
severity: allergy.selectedAllergySeverity.id,
remarks: allergy.remark,
createdBy: allergy.createdBy??doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
isChecked: allergy.isChecked,
isUpdatedByNurse: false));
});
if (model.patientAllergiesList.isEmpty) {
await model.postAllergy(postAllergyRequestModel);
@ -488,9 +508,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
}
postHistories(
{List<MasterKeyModel> myHistoryList, SOAPViewModel model}) async {
{List<MySelectedHistory> myHistoryList, SOAPViewModel model}) async {
PostHistoriesRequestModel postHistoriesRequestModel =
new PostHistoriesRequestModel();
new PostHistoriesRequestModel(doctorID: '');
widget.myHistoryList.forEach((history) {
if (postHistoriesRequestModel.listMedicalHistoryVM == null)
postHistoriesRequestModel.listMedicalHistoryVM = [];
@ -500,9 +520,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: "",
historyId: history.id,
historyType: history.typeId,
isChecked: false,
historyId: history.selectedHistory.id,
historyType: history.selectedHistory.typeId,
isChecked: history.isChecked,
));
});
@ -532,10 +552,13 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
currentMedication: " currentMedication ",
hopi: illnessController.text,
isLactation: false,
ispregnant: true,
numberOfWeeks: 22);
ispregnant: false,
doctorID: '',
numberOfWeeks: 0);
if (model.patientChiefComplaintList.isEmpty) {
// TODO: make it postChiefComplaint after it start to work
postChiefComplaintRequestModel.editedBy='';
await model.postChiefComplaint(postChiefComplaintRequestModel);
} else {
await model.patchChiefComplaint(postChiefComplaintRequestModel);

@ -25,11 +25,13 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex;
final MySelectedAssessment mySelectedAssessment;
List<MySelectedAssessment> mySelectedAssessmentList;
final PatiantInformtion patientInfo;
UpdateAssessmentPage(
{Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo});
UpdateAssessmentPage({Key key,
this.changePageViewIndex,
this.mySelectedAssessmentList,
this.patientInfo});
@override
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
@ -43,11 +45,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
return BaseView<SOAPViewModel>(
onModelReady: (model) async{
widget.mySelectedAssessment.appointmentId =widget.patientInfo.appointmentNo;
widget.mySelectedAssessmentList.clear();
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientAssessment(getAssessmentReqModel);
if(model.patientAssessmentList.isNotEmpty){
@ -60,25 +63,33 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
if (model.listOfICD10.length == 0) {
await model.getMasterLookup(MasterKeysService.ICD10);
}
model.patientAssessmentList.forEach((element) {
MasterKeyModel diagnosisType = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisType,
id: element.diagnosisTypeID,
);
MasterKeyModel selectedICD = model.getOneMasterKey(
masterKeys: MasterKeysService.ICD10,
id: element.icdCode10ID,
);
MasterKeyModel diagnosisCondition = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisCondition,
id: element.conditionID,
);
MySelectedAssessment temMySelectedAssessment = MySelectedAssessment(
appointmentId: element.appointmentNo,
remark: element.remarks,
selectedDiagnosisType: diagnosisType,
selectedDiagnosisCondition: diagnosisCondition,
selectedICD: selectedICD,
doctorID: element.doctorID,
doctorName: element.doctorName,
createdBy: element.createdBy,
icdCode10ID: element.icdCode10ID
);
MasterKeyModel selectedICD = model.getOneMasterKey(
masterKeys: MasterKeysService.ICD10,
id: model.patientAssessmentList[0].icdCode10ID,
);
widget.mySelectedAssessment.selectedICD= selectedICD;
MasterKeyModel diagnosisCondition = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisCondition,
id: model.patientAssessmentList[0].conditionID,
);
widget.mySelectedAssessment.selectedDiagnosisCondition = diagnosisCondition;
MasterKeyModel diagnosisType = model.getOneMasterKey(
masterKeys: MasterKeysService.DiagnosisType,
id: model.patientAssessmentList[0].diagnosisTypeID,
);
widget.mySelectedAssessment.selectedDiagnosisType = diagnosisType;
widget.mySelectedAssessment.remark = model.patientAssessmentList[0].remarks;
widget.mySelectedAssessmentList.add(temMySelectedAssessment);
});
}
},
builder: (_, model, w) => AppScaffold(
@ -101,7 +112,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
children: [
Row(
children: [
Texts('ASSESSMENT',
Texts(TranslationBase.of(context).assessment.toUpperCase(),
variant:
isAssessmentExpand ? "bodyText" : '',
bold: isAssessmentExpand ? true : false,
@ -130,15 +141,15 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
),
Column(
children: [
if(model.patientAssessmentList.isEmpty)
Container(
margin:
EdgeInsets.only(left: 5, right: 5, top: 15),
child: TextFields(
hintText: "Add ASSESSMENT",
hintText: TranslationBase.of(context).addAssessment,
fontSize: 13.5,
onTapTextFields: () {
openAssessmentDialog(context);
openAssessmentDialog(context,isUpdate: false,
model: model);
},
readOnly: true,
// hintColor: Colors.black,
@ -159,266 +170,239 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
SizedBox(
height: 20,
),
if(widget.mySelectedAssessment != null &&
widget.mySelectedAssessment
.appointmentId !=
null && widget.mySelectedAssessment
.selectedDiagnosisType != null &&
widget.mySelectedAssessment
.selectedDiagnosisCondition != null)
Container(
margin: EdgeInsets.only(
left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment
.spaceBetween,
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment
.start,
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"12".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"DEC".toUpperCase(),
fontSize: 10,
color: Colors.grey,
),
],
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Appointment #: ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.mySelectedAssessment
.appointmentId
.toString(),
fontSize: 10,
color: Colors.grey,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
widget.mySelectedAssessment
.selectedDiagnosisCondition
.nameEn,
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Type : ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
widget.mySelectedAssessment
.selectedDiagnosisType
.nameEn,
fontSize: 10,
color: Colors.grey,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Doc : ",
fontWeight: FontWeight.bold,
fontSize: 16,
),
AppText(
"Anas Abdullah",
fontSize: 10,
color: Colors.grey,
),
],
),
SizedBox(
height: 6,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
child: AppText(
widget.mySelectedAssessment.remark??"",
Column(
children: widget.mySelectedAssessmentList.map((
assessment) {
return Container(
margin: EdgeInsets.only(
left: 5, right: 5, top: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment
.spaceBetween,
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment
.start,
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
"12".toUpperCase(),
fontWeight: FontWeight
.bold,
fontSize: 16,
),
AppText(
"DEC".toUpperCase(),
fontSize: 10,
color: Colors.grey,
),
),
],
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
children: [
AppText(
"ICD: ".toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: 16,
),
Container(
child: AppText(
widget.mySelectedAssessment.selectedICD.code.trim().toUpperCase()??"",
],
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Appointment #: ",
fontWeight: FontWeight
.bold,
fontSize: 16,
),
AppText(
assessment
.appointmentId
.toString(),
fontSize: 10,
color: Colors.grey,
),
),
],
)
],
),
Column(
children: [
InkWell(
onTap: () {
openAssessmentDialog(context);
},
child: Icon(EvaIcons
.edit2Outline),
)
],
),
],
),
)
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
assessment
.selectedDiagnosisCondition
.nameEn,
fontWeight: FontWeight
.bold,
fontSize: 16,
),
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Type : ",
fontWeight: FontWeight
.bold,
fontSize: 16,
),
AppText(
assessment
.selectedDiagnosisType
.nameEn,
fontSize: 10,
color: Colors.grey,
),
],
),
if(assessment.doctorName != null)
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Doc : ",
fontWeight: FontWeight
.bold,
fontSize: 16,
),
AppText(
assessment.doctorName??'',
fontSize: 10,
color: Colors.grey,
),
],
),
SizedBox(
height: 6,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
SizedBox(
height: 6,
),
Container(
width: MediaQuery
.of(context)
.size
.width * 0.5,
child: AppText(
assessment.remark ?? "",
fontSize: 10,
color: Colors.grey,
),
),
],
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
Row(
children: [
AppText(
"ICD: ".toUpperCase(),
fontWeight: FontWeight
.bold,
fontSize: 16,
),
Container(
child: AppText(
assessment.selectedICD
.code.trim()
.toUpperCase() ??
"",
fontSize: 10,
color: Colors.grey,
),
),
],
)
],
),
Column(
children: [
InkWell(
onTap: () {
openAssessmentDialog(
context, isUpdate: true,
assessment: assessment,
model: model);
},
child: Icon(EvaIcons
.edit2Outline),
)
],
),
],
),
);
}).toList(),)
],
)
]),
isExpand: isAssessmentExpand,
),
DividerWithSpacesAround(
height: 30,
),
AppButton(
title: TranslationBase
.of(context)
.next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
await submitAssessment(model);
},
),
SizedBox(
height: 30,
),
],
DividerWithSpacesAround(
height: 30,
),
),
AppButton(
title: TranslationBase
.of(context)
.next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.changePageViewIndex(3);
},
),
SizedBox(
height: 30,
),
],
),
)));
),
),
)));
}
submitAssessment(SOAPViewModel model) async {
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD !=null ) {
if(model.patientAssessmentList.isEmpty){
PostAssessmentRequestModel postAssessmentRequestModel =
new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
icdCodeDetails: [
new IcdCodeDetails(
remarks: widget.mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId:
widget.mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId:
widget.mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: widget.mySelectedAssessment.selectedICD.code)
]);
await model.postAssessment(postAssessmentRequestModel);
} else {
PatchAssessmentReqModel patchAssessmentReqModel =
PatchAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: widget.mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId:
widget.mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId:
widget.mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: widget.mySelectedAssessment.selectedICD.code,
prevIcdCode10ID: model.patientAssessmentList[0].icdCode10ID
);
await model.patchAssessment(patchAssessmentReqModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changePageViewIndex(3);
}
} else {
helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
openAssessmentDialog(BuildContext context,
{
MySelectedAssessment assessment, bool isUpdate,
SOAPViewModel model
}) {
if (assessment == null) {
assessment = MySelectedAssessment(
remark: '', appointmentId: widget.patientInfo.appointmentNo);
}
widget.changePageViewIndex(3);
}
openAssessmentDialog(BuildContext context) {
showModalBottomSheet(
backgroundColor: Colors.white,
isScrollControlled: true,
context: context,
builder: (context) {
return AddAssessmentDetails(
mySelectedAssessment: widget.mySelectedAssessment,
addSelectedAssessment: () {
mySelectedAssessment: assessment,
patientInfo: widget.patientInfo,
isUpdate: isUpdate,
mySelectedAssessmentList: widget.mySelectedAssessmentList,
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
bool isUpdate) async {
setState(() {
Navigator.of(context).pop();
});
});
});
@ -428,32 +412,34 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment;
final Function() addSelectedAssessment;
final List<MySelectedAssessment> mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment;
final PatiantInformtion patientInfo;
const AddAssessmentDetails(
{Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo})
: super(key: key);
final bool isUpdate;
AddAssessmentDetails(
{Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList});
@override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
}
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
// MasterKeyModel _selectedDiagnosisCondition;
// MasterKeyModel _selectedDiagnosisType;
TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
@override
Widget build(BuildContext context) {
remarkController.text = widget.mySelectedAssessment.remark??"";
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString();
remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text =
widget.mySelectedAssessment.appointmentId.toString();
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown,{IconData icon}) {
String selectedText, bool isDropDown, {IconData icon}) {
//TODO: make one Input InputDecoration for all
return InputDecoration(
focusedBorder: OutlineInputBorder(
@ -686,16 +672,34 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
),
AppButton(
title: "Add".toUpperCase(),
onPressed: () {
setState(() {
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.mySelectedAssessment.remark =
remarkController.text;
widget.mySelectedAssessment
.appointmentId = int.parse(
appointmentIdController.text);
widget.addSelectedAssessment();
});
if (widget.mySelectedAssessment
.selectedDiagnosisCondition !=
null &&
widget.mySelectedAssessment
.selectedDiagnosisType !=
null &&
widget.mySelectedAssessment
.selectedICD != null) {
widget.addSelectedAssessment(
widget.mySelectedAssessment,
widget.isUpdate);
await submitAssessment(
isUpdate: widget.isUpdate,
model: model,
mySelectedAssessment: widget
.mySelectedAssessment);
} else {
helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
}
},
),
])),
@ -704,6 +708,61 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
))),
);
}
submitAssessment(
{SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async {
if (isUpdate) {
PatchAssessmentReqModel patchAssessmentReqModel =
PatchAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId:
mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId:
mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code,
prevIcdCode10ID: mySelectedAssessment.icdCode10ID
);
await model.patchAssessment(patchAssessmentReqModel);
} else {
PostAssessmentRequestModel postAssessmentRequestModel =
new PostAssessmentRequestModel(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
icdCodeDetails: [
new IcdCodeDetails(
remarks: mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId:
mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId:
mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: mySelectedAssessment.selectedICD.code)
]);
await model.postAssessment(postAssessmentRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code;
if (!isUpdate) {
widget.mySelectedAssessmentList.add(mySelectedAssessment);
}
Navigator.of(context).pop();
}
// widget.changePageViewIndex(3);
}
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -77,6 +79,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
selectedExamination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
createdBy: element.createdBy,
isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam);
});
@ -102,7 +105,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
children: [
Row(
children: [
Texts('Physical/System Examination',
Texts(TranslationBase.of(context).physicalSystemExamination,
variant: isSysExaminationExpand
? "bodyText"
: '',
@ -137,7 +140,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
margin:
EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
hintText: "Add Examination",
hintText: TranslationBase.of(context).physicalSystemExamination,
fontSize: 13.5,
onTapTextFields: () {
openExaminationList(context);
@ -351,7 +354,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
}
submitUpdateObjectivePage(SOAPViewModel model) async {
if(widget.mySelectedExamination.isNotEmpty){
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
@ -364,9 +371,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: 4709,
createdBy: exam.createdBy??doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(),
editedBy: 4709,
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
@ -505,8 +512,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
hintSearchText: 'Search Examination',
buttonName: 'Add Examination',
hintSearchText: TranslationBase.of(context).searchExamination,
buttonName: TranslationBase.of(context).addExamination,
masterList: model.physicalExaminationList,
removeHistory: (history){
setState(() {

@ -59,7 +59,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
GetGetProgressNoteReqModel(
appointmentNo: widget.patientInfo.appointmentNo,
patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString());
episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) {
@ -285,15 +285,15 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo,
planNote: progressNoteController.text);
planNote: progressNoteController.text, doctorID: '', editedBy: '');
if(model.patientProgressNoteList.isEmpty){
// if(model.patientProgressNoteList.isEmpty){
await model.postProgressNote(postProgressNoteRequestModel);
}else {
await model.patchProgressNote(postProgressNoteRequestModel);
}
// }else {
// await model.patchProgressNote(postProgressNoteRequestModel);
//
// }
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -30,9 +31,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
PageController _controller;
int _currentIndex = 0;
List<MySelectedAllergy> myAllergiesList= List();
List<MasterKeyModel> myHistoryList = List();
List<MySelectedHistory> myHistoryList = List();
List<MySelectedExamination> mySelectedExamination = List();
MySelectedAssessment mySelectedAssessment = new MySelectedAssessment();
List<MySelectedAssessment> mySelectedAssessment = List();
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
}
@ -105,7 +106,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
),
UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex,
mySelectedAssessment:
mySelectedAssessmentList:
mySelectedAssessment,
patientInfo: patient,
),

Loading…
Cancel
Save