Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into medical-file

merge-requests/243/head
hussam al-habibeh 5 years ago
commit f767467a67

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

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

@ -160,6 +160,7 @@ const GET_CHIEF_COMPLAINT =
const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam';
const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote';
const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment';
const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const GET_CATEGORISE_PROCEDURE = const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetProcedure'; 'Services/DoctorApplication.svc/REST/GetProcedure';

@ -536,4 +536,9 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "There is no Chief Complaint", 'en': "There is no Chief Complaint",
'ar': "ليس هناك شكوى رئيس" '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':"اضافه" },
}; };

@ -30,13 +30,19 @@ class BaseService {
} }
} }
Future getPatientArrivalList(String date,{String fromDate}) async{ Future getPatientArrivalList(String date,{String fromDate, int patientMrn = -1, int appointmentNo = -1}) async{
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['From'] = fromDate == null ? date : fromDate; body['From'] = fromDate == null ? date : fromDate;
body['To'] = date; body['To'] = date;
body['PageIndex'] = 0; body['PageIndex'] = 0;
body['PageSize'] = 0; body['PageSize'] = 0;
if(patientMrn == -1){
body['PatientMRN'] = patientMrn;
}
if(appointmentNo == -1){
body['AppointmentNo'] = appointmentNo;
}
await baseAppClient.post( await baseAppClient.post(
GET_PATIENT_ARRIVAL_LIST, GET_PATIENT_ARRIVAL_LIST,

@ -1,14 +1,19 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
class UcafService extends BaseService { class UcafService extends LookupService {
List<GetChiefComplaintResModel> patientChiefComplaintList = []; List<GetChiefComplaintResModel> patientChiefComplaintList = [];
VitalSignData patientVitalSigns; VitalSignData patientVitalSigns;
List<GetAssessmentResModel> patientAssessmentList = [];
List<OrderProcedure> orderProcedureList = [];
Future getPatientChiefComplaint(PatiantInformtion patient) async { Future getPatientChiefComplaint(PatiantInformtion patient) async {
hasError = false; hasError = false;
@ -55,4 +60,45 @@ class UcafService extends BaseService {
body: body, body: body,
); );
} }
Future getPatientAssessment(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post (GET_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
print("Success");
patientAssessmentList.clear();
response['AssessmentList']['entityList'].forEach((v) {
patientAssessmentList.add(GetAssessmentResModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getOrderProcedures(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
// body['AppointmentNo'] = patient.appointmentNo;
// body['EpisodeID'] = patient.episodeNo;
await baseAppClient.post (GET_ORDER_PROCEDURE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
orderProcedureList.clear();
response['OrderedProcedureList']['entityList'].forEach((v) {
orderProcedureList.add(OrderProcedure.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
} }

@ -133,4 +133,19 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn, appointmentNo: appointmentNo);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
/*
* model
.getPatientArrivalList()*/
} }

@ -1,19 +1,42 @@
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/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:flutter/material.dart';
import '../../locator.dart'; import '../../locator.dart';
class UcafViewModel extends BaseViewModel { class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator<UcafService>(); UcafService _ucafService = locator<UcafService>();
List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList; List<GetChiefComplaintResModel> get patientChiefComplaintList =>
_ucafService.patientChiefComplaintList;
VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns; VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns;
List<GetAssessmentResModel> get patientAssessmentList =>
_ucafService.patientAssessmentList;
List<MasterKeyModel> get diagnosisTypes => _ucafService.listOfDiagnosisType;
List<MasterKeyModel> get diagnosisConditions =>
_ucafService.listOfDiagnosisCondition;
List<OrderProcedure> get orderProcedures => _ucafService.orderProcedureList;
String selectedLanguage;
Future getLanguage() async {
selectedLanguage = await sharedPref.getString(APP_Language);
}
Future getUCAFData(PatiantInformtion patient) async { Future getUCAFData(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _ucafService.getPatientVitalSign(patient); await _ucafService.getPatientVitalSign(patient);
@ -27,4 +50,69 @@ class UcafViewModel extends BaseViewModel {
} }
} }
Future getPatientAssessment(PatiantInformtion patient) async {
if (patientAssessmentList.isEmpty) {
setState(ViewState.Busy);
await _ucafService.getPatientAssessment(patient);
if (_ucafService.hasError) {
error = _ucafService.error;
setState(ViewState.Error);
} else {
if (patientAssessmentList.isNotEmpty) {
if (diagnosisConditions.length == 0) {
await _ucafService
.getMasterLookup(MasterKeysService.DiagnosisCondition);
}
if (diagnosisTypes.length == 0) {
await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType);
}
if (_ucafService.hasError) {
error = _ucafService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
} else
setState(ViewState.Idle); // but with empty list
}
}
}
Future getOrderProcedures(PatiantInformtion patient) async {
if (orderProcedures.isEmpty) {
setState(ViewState.Busy);
await _ucafService.getOrderProcedures(patient);
if (_ucafService.hasError) {
error = _ucafService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}
MasterKeyModel findMasterDataById(
{@required MasterKeysService masterKeys, dynamic id}) {
switch (masterKeys) {
case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = diagnosisConditions.where((element) {
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
return null;
case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = diagnosisTypes.where((element) {
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
}
return null;
default:
return null;
}
}
} }

@ -16,35 +16,6 @@ class VitalSignsViewModel extends BaseViewModel {
VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns;
/*Future getPatientArrivalList(String date, PatiantInformtion patient,
{String fromDate}) async {
// TODO when arrival list work un comment below lines
*//* setState(ViewState.Busy);
await _vitalSignService.getPatientArrivalList(date, fromDate: fromDate);
if (_vitalSignService.hasError) {
error = _vitalSignService.error;
setState(ViewState.Error);
} else {
await getPatientVitalSign(patient);
}*//*
makeVitalSignDemoData();
}
PatientArrivalEntity getPatientAppointmentEntity(PatiantInformtion patient) {
String ffName = "${patient.firstName} ${patient.lastName}";
String fmfName =
"${patient.firstName} ${patient.middleName} ${patient.lastName}";
for (var element in patientArrivalList) {
int index = patientArrivalList.indexOf(element);
if (element.patientName == ffName || element.patientName == fmfName) {
return element;
}
// print("patient index: $index");
}
return null;
}*/
Future getPatientVitalSign(PatiantInformtion patient) async { Future getPatientVitalSign(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _vitalSignService.getPatientVitalSign(patient); await _vitalSignService.getPatientVitalSign(patient);

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

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

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

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

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

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

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

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

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

@ -0,0 +1,110 @@
class OrderProcedure {
String achiCode;
String appointmentDate;
int appointmentNo;
int categoryID;
String clinicDescription;
String cptCode;
int createdBy;
String createdOn;
String doctorName;
bool isApprovalCreated;
bool isApprovalRequired;
bool isCovered;
bool isInvoiced;
bool isReferralInvoiced;
bool isUncoveredByDoctor;
int lineItemNo;
String orderDate;
int orderNo;
int orderType;
String procedureId;
String procedureName;
String remarks;
String status;
String template;
OrderProcedure(
{this.achiCode,
this.appointmentDate,
this.appointmentNo,
this.categoryID,
this.clinicDescription,
this.cptCode,
this.createdBy,
this.createdOn,
this.doctorName,
this.isApprovalCreated,
this.isApprovalRequired,
this.isCovered,
this.isInvoiced,
this.isReferralInvoiced,
this.isUncoveredByDoctor,
this.lineItemNo,
this.orderDate,
this.orderNo,
this.orderType,
this.procedureId,
this.procedureName,
this.remarks,
this.status,
this.template});
OrderProcedure.fromJson(Map<String, dynamic> json) {
achiCode = json['achiCode'];
appointmentDate = json['appointmentDate'];
appointmentNo = json['appointmentNo'];
categoryID = json['categoryID'];
clinicDescription = json['clinicDescription'];
cptCode = json['cptCode'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
doctorName = json['doctorName'];
isApprovalCreated = json['isApprovalCreated'];
isApprovalRequired = json['isApprovalRequired'];
isCovered = json['isCovered'];
isInvoiced = json['isInvoiced'];
isReferralInvoiced = json['isReferralInvoiced'];
isUncoveredByDoctor = json['isUncoveredByDoctor'];
lineItemNo = json['lineItemNo'];
orderDate = json['orderDate'];
orderNo = json['orderNo'];
orderType = json['orderType'];
procedureId = json['procedureId'];
procedureName = json['procedureName'];
remarks = json['remarks'];
status = json['status'];
template = json['template'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['achiCode'] = this.achiCode;
data['appointmentDate'] = this.appointmentDate;
data['appointmentNo'] = this.appointmentNo;
data['categoryID'] = this.categoryID;
data['clinicDescription'] = this.clinicDescription;
data['cptCode'] = this.cptCode;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['doctorName'] = this.doctorName;
data['isApprovalCreated'] = this.isApprovalCreated;
data['isApprovalRequired'] = this.isApprovalRequired;
data['isCovered'] = this.isCovered;
data['isInvoiced'] = this.isInvoiced;
data['isReferralInvoiced'] = this.isReferralInvoiced;
data['isUncoveredByDoctor'] = this.isUncoveredByDoctor;
data['lineItemNo'] = this.lineItemNo;
data['orderDate'] = this.orderDate;
data['orderNo'] = this.orderNo;
data['orderType'] = this.orderType;
data['procedureId'] = this.procedureId;
data['procedureName'] = this.procedureName;
data['remarks'] = this.remarks;
data['status'] = this.status;
data['template'] = this.template;
return data;
}
}

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

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

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

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

@ -1,5 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_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/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -7,9 +11,12 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../../../routes.dart';
class UcafDetailScreen extends StatefulWidget { class UcafDetailScreen extends StatefulWidget {
@override @override
_UcafDetailScreenState createState() => _UcafDetailScreenState(); _UcafDetailScreenState createState() => _UcafDetailScreenState();
@ -25,39 +32,86 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>( return BaseView<UcafViewModel>(
onModelReady: (model) async {
await model.getLanguage();
await model.getPatientAssessment(patient);
},
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).ucaf, appBarTitle: TranslationBase.of(context).ucaf,
body: Container( body: Column(
child: SingleChildScrollView( children: [
child: Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ child: SingleChildScrollView(
PatientHeaderWidgetNoAvatar(patient),
SizedBox(
height: 10,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
treatmentStepsBar(context, screenSize), PatientHeaderWidgetNoAvatar(patient),
SizedBox( SizedBox(
height: 16, height: 10,
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
children: [
treatmentStepsBar(
context, model, screenSize, patient),
SizedBox(
height: 16,
),
...getSelectedTreatmentStepItem(context, model),
],
),
), ),
...getSelectedTreatmentStepItem(context),
], ],
), ),
), ),
], ),
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: BorderedButton(
TranslationBase.of(context).save,
hasBorder: true,
vPadding: 16,
hPadding: 8,
borderColor: HexColor("#B8382B"),
backgroundColor: HexColor("#B8382B"),
textColor: Colors.white,
fontSize: SizeConfig.textMultiplier * 2.0,
handler: () {},
),
),
Container(
margin:
EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 16),
child: BorderedButton(
TranslationBase.of(context).cancel,
hasBorder: true,
vPadding: 16,
hPadding: 8,
borderColor: Colors.white,
backgroundColor: Colors.white,
textColor: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.2,
handler: () {
Navigator.of(context).popUntil((route){
return route.settings.name == PATIENTS_PROFILE;
});
},
),
), ),
), ],
), ),
)); ));
} }
Widget treatmentStepsBar(BuildContext _context, Size screenSize) { Widget treatmentStepsBar(BuildContext _context, UcafViewModel model,
Size screenSize, PatiantInformtion patient) {
List<String> __treatmentSteps = [ List<String> __treatmentSteps = [
TranslationBase.of(context).diagnosis.toUpperCase(), TranslationBase.of(context).diagnosis.toUpperCase(),
TranslationBase.of(context).medications.toUpperCase(), TranslationBase.of(context).medications.toUpperCase(),
@ -93,8 +147,16 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
), ),
)), )),
), ),
onTap: () { onTap: () async {
print(__treatmentSteps.indexOf(item)); print(__treatmentSteps.indexOf(item));
if (__treatmentSteps.indexOf(item) == 0) {
await model.getPatientAssessment(patient);
} else if (__treatmentSteps.indexOf(item) == 1) {
print("call Medications");
}
if (__treatmentSteps.indexOf(item) == 2) {
await model.getOrderProcedures(patient);
}
setState(() { setState(() {
_activeTap = __treatmentSteps.indexOf(item); _activeTap = __treatmentSteps.indexOf(item);
}); });
@ -106,14 +168,41 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
); );
} }
List<Widget> getSelectedTreatmentStepItem(BuildContext _context) { List<Widget> getSelectedTreatmentStepItem(
BuildContext _context, UcafViewModel model) {
switch (_activeTap) { switch (_activeTap) {
case 0: case 0:
return [...List.generate(2, (index) => DiagnosisWidget()).toList()]; if (model.patientAssessmentList != null) {
return [
...List.generate(
model.patientAssessmentList.length,
(index) => DiagnosisWidget(
model, model.patientAssessmentList[index])).toList()
];
} else {
return [
Container(),
];
}
break;
case 1: case 1:
return [...List.generate(2, (index) => MedicationWidget()).toList()]; return [...List.generate(2, (index) => MedicationWidget()).toList()];
break;
case 2: case 2:
return [...List.generate(2, (index) => ProceduresWidget()).toList()]; if (model.orderProcedures != null) {
return [
...List.generate(
model.orderProcedures.length,
(index) =>
ProceduresWidget(model, model.orderProcedures[index]))
.toList()
];
} else {
return [
Container(),
];
}
break;
default: default:
return [ return [
Container(), Container(),
@ -123,8 +212,20 @@ class _UcafDetailScreenState extends State<UcafDetailScreen> {
} }
class DiagnosisWidget extends StatelessWidget { class DiagnosisWidget extends StatelessWidget {
final UcafViewModel model;
final GetAssessmentResModel diagnosis;
DiagnosisWidget(this.model, this.diagnosis);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
MasterKeyModel diagnosisType = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisType,
id: diagnosis.diagnosisTypeID);
MasterKeyModel diagnosisCondition = model.findMasterDataById(
masterKeys: MasterKeysService.DiagnosisCondition,
id: diagnosis.conditionID);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -136,7 +237,11 @@ class DiagnosisWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"Preliminary Diagnosis", diagnosisType != null
? model.selectedLanguage == 'ar'
? diagnosisType.nameAr
: diagnosisType.nameEn
: "-",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -149,7 +254,7 @@ class DiagnosisWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
"B34.2 | CORONA VIRUS INFECTION, UNSPECIFIED SITE", diagnosis.asciiDesc,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -167,7 +272,7 @@ class DiagnosisWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"174.00 Same", "${diagnosis.icdCode10ID} ${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -284,6 +389,11 @@ class MedicationWidget extends StatelessWidget {
} }
class ProceduresWidget extends StatelessWidget { class ProceduresWidget extends StatelessWidget {
final UcafViewModel model;
final OrderProcedure procedure;
ProceduresWidget(this.model, this.procedure);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
@ -296,7 +406,7 @@ class ProceduresWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"019054846", procedure.achiCode,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -310,14 +420,13 @@ class ProceduresWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"1", "${procedure.lineItemNo}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
], ],
), ),
), ),
], ],
), ),
SizedBox( SizedBox(
@ -327,7 +436,7 @@ class ProceduresWidget extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
"SCAN - RENAL MASS PROTOCOL", procedure.procedureName,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -345,9 +454,9 @@ class ProceduresWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"Yes", "${procedure.isCovered}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.green, color: procedure.isCovered ? Colors.green : Colors.red,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
SizedBox( SizedBox(
@ -359,7 +468,7 @@ class ProceduresWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"Yes", "${procedure.isApprovalRequired}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
@ -376,7 +485,7 @@ class ProceduresWidget extends StatelessWidget {
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),
AppText( AppText(
"Yes", "${procedure.isUncoveredByDoctor}",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 2.0,
), ),

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart';
@ -13,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../routes.dart';
class MyReferralDetailScreen extends StatelessWidget { class MyReferralDetailScreen extends StatelessWidget {
PendingReferral pendingReferral; PendingReferral pendingReferral;
@ -25,6 +28,14 @@ class MyReferralDetailScreen extends StatelessWidget {
pendingReferral = routeArgs['referral']; pendingReferral = routeArgs['referral'];
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getPatientDetails(
DateUtils.convertStringToDateFormat(
DateTime.now().subtract(Duration(days: 350)).toString(),
"yyyy-MM-dd"),
DateUtils.convertStringToDateFormat(
DateTime.now().toString(), "yyyy-MM-dd"),
pendingReferral.patientID,
pendingReferral.sourceAppointmentNo),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
@ -63,8 +74,10 @@ class MyReferralDetailScreen extends StatelessWidget {
patientName: pendingReferral.patientName, patientName: pendingReferral.patientName,
referralStatus: null, referralStatus: null,
isReferredTo: false, isReferredTo: false,
isSameBranch: pendingReferral.isReferralDoctorSameBranch, isSameBranch:
referralDoctorName: pendingReferral.referredByDoctorInfo, pendingReferral.isReferralDoctorSameBranch,
referralDoctorName:
pendingReferral.referredByDoctorInfo,
clinicDescription: null, clinicDescription: null,
remark: pendingReferral.remarksFromSource, remark: pendingReferral.remarksFromSource,
), ),
@ -73,7 +86,8 @@ class MyReferralDetailScreen extends StatelessWidget {
childAspectRatio: 1.8, childAspectRatio: 1.8,
crossAxisSpacing: 8, crossAxisSpacing: 8,
mainAxisSpacing: 10, mainAxisSpacing: 10,
controller: new ScrollController(keepScrollOffset: false), controller:
new ScrollController(keepScrollOffset: false),
shrinkWrap: true, shrinkWrap: true,
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
crossAxisCount: 2, crossAxisCount: 2,
@ -82,8 +96,10 @@ class MyReferralDetailScreen extends StatelessWidget {
key: key, key: key,
// patient: patient, // patient: patient,
// route: RADIOLOGY, // route: RADIOLOGY,
nameLine1: TranslationBase.of(context).previewHealth, nameLine1:
nameLine2: TranslationBase.of(context).summaryReport, TranslationBase.of(context).previewHealth,
nameLine2:
TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'), icon: 'radiology-1.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
@ -95,7 +111,7 @@ class MyReferralDetailScreen extends StatelessWidget {
PatientProfileButton( PatientProfileButton(
key: key, key: key,
// patient: patient, // patient: patient,
// route: VITAL_SIGN_DETAILS, route: PATIENT_VITAL_SIGN,
nameLine1: TranslationBase.of(context).vital, nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs, nameLine2: TranslationBase.of(context).signs,
icon: 'heartbeat.png'), icon: 'heartbeat.png'),
@ -119,7 +135,7 @@ class MyReferralDetailScreen extends StatelessWidget {
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: (){ handler: () {
model.responseReferral(pendingReferral, true); model.responseReferral(pendingReferral, true);
}, },
), ),
@ -135,7 +151,7 @@ class MyReferralDetailScreen extends StatelessWidget {
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: (){ handler: () {
model.responseReferral(pendingReferral, false); model.responseReferral(pendingReferral, false);
}, },
), ),

@ -552,7 +552,12 @@ class TranslationBase {
String get covered => localizedValues['covered'][locale.languageCode]; String get covered => localizedValues['covered'][locale.languageCode];
String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode];
String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][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 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];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -44,13 +44,12 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine2: TranslationBase.of(context).episode, nameLine2: TranslationBase.of(context).episode,
route: UPDATE_EPISODE, route: UPDATE_EPISODE,
icon: 'modilfy-episode.png'), icon: 'modilfy-episode.png'),
if(selectedPatientType == 6 || selectedPatientType == 7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
nameLine1: TranslationBase.of(context).vital, nameLine1: TranslationBase.of(context).vital,
nameLine2: TranslationBase.of(context).signs, nameLine2: TranslationBase.of(context).signs,
route: PATIENT_VITAL_SIGN, route: (selectedPatientType == 6 || selectedPatientType == 7) ? PATIENT_VITAL_SIGN : VITAL_SIGN_DETAILS,
icon: 'heartbeat.png'), icon: 'heartbeat.png'),
if(selectedPatientType != 7) if(selectedPatientType != 7)
PatientProfileButton( PatientProfileButton(

@ -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_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_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/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:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -71,41 +72,42 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
child: Expanded(
child: Expanded( child: Texts(
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 projectViewModel.isArabic
? selectedAllergy.selectedAllergy.nameAr ? selectedAllergy.selectedAllergySeverity.nameAr
: selectedAllergy.selectedAllergy.nameEn : selectedAllergy.selectedAllergySeverity.nameEn
.toUpperCase(), .toUpperCase(),
variant: "bodyText", variant: "bodyText",
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy.isChecked
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
bold: true, bold: true,
color: Colors.black), color: AppGlobal.appPrimaryColor),
), if (selectedAllergy.isChecked)
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)
InkWell( InkWell(
child: Icon( child: Icon(
FontAwesomeIcons.trash, FontAwesomeIcons.trash,
@ -115,6 +117,20 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
onTap: () => removeAllergy(selectedAllergy), 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( SizedBox(
height: 10, height: 10,
@ -154,31 +170,40 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
builder: (context) { builder: (context) {
return AddAllergies( return AddAllergies(
addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { addAllergiesFun: (MySelectedAllergy mySelectedAllergy) {
setState(() { if (mySelectedAllergy.selectedAllergySeverity == null ||
List<MySelectedAllergy> allergy = mySelectedAllergy.selectedAllergy == null) {
// ignore: missing_return helpers.showErrorToast(TranslationBase
widget.myAllergiesList.where((element) => .of(context)
mySelectedAllergy.selectedAllergy.id == .requiredMsg);
element.selectedAllergy.id
).toList(); } else {
if (allergy.isEmpty) { setState(() {
widget.myAllergiesList.add(mySelectedAllergy); List<MySelectedAllergy> allergy =
Navigator.of(context).pop(); // ignore: missing_return
} else { widget.myAllergiesList
allergy.first.selectedAllergy = .where((element) =>
mySelectedAllergy.selectedAllergy; mySelectedAllergy.selectedAllergy.id ==
allergy.first.selectedAllergySeverity = element.selectedAllergy.id)
mySelectedAllergy.selectedAllergySeverity; .toList();
allergy.first.remark = mySelectedAllergy.remark;
allergy.first.isChecked = mySelectedAllergy.isChecked;
Navigator.of(context).pop();
// helpers.showErrorToast(TranslationBase if (allergy.isEmpty) {
// .of(context) widget.myAllergiesList.add(mySelectedAllergy);
// .itemExist); 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, height: 10,
), ),
AppButton( AppButton(
title: "Add".toUpperCase(), title: TranslationBase.of(context).add.toUpperCase(),
onPressed: () { onPressed: () {
MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( MySelectedAllergy mySelectedAllergy = new MySelectedAllergy(
remark: remarkController.text, remark: remarkController.text,

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

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

@ -25,11 +25,13 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class UpdateAssessmentPage extends StatefulWidget { class UpdateAssessmentPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
final MySelectedAssessment mySelectedAssessment; List<MySelectedAssessment> mySelectedAssessmentList;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
UpdateAssessmentPage( UpdateAssessmentPage({Key key,
{Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo}); this.changePageViewIndex,
this.mySelectedAssessmentList,
this.patientInfo});
@override @override
_UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState();
@ -43,11 +45,12 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async{ onModelReady: (model) async{
widget.mySelectedAssessmentList.clear();
widget.mySelectedAssessment.appointmentId =widget.patientInfo.appointmentNo;
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString(), episodeID: widget.patientInfo.episodeNo.toString(),
editedBy: '',
doctorID: '',
appointmentNo: widget.patientInfo.appointmentNo); appointmentNo: widget.patientInfo.appointmentNo);
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
if(model.patientAssessmentList.isNotEmpty){ if(model.patientAssessmentList.isNotEmpty){
@ -60,25 +63,33 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
if (model.listOfICD10.length == 0) { if (model.listOfICD10.length == 0) {
await model.getMasterLookup(MasterKeysService.ICD10); 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( widget.mySelectedAssessmentList.add(temMySelectedAssessment);
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;
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -101,7 +112,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('ASSESSMENT', Texts(TranslationBase.of(context).assessment.toUpperCase(),
variant: variant:
isAssessmentExpand ? "bodyText" : '', isAssessmentExpand ? "bodyText" : '',
bold: isAssessmentExpand ? true : false, bold: isAssessmentExpand ? true : false,
@ -130,15 +141,15 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
), ),
Column( Column(
children: [ children: [
if(model.patientAssessmentList.isEmpty)
Container( Container(
margin: margin:
EdgeInsets.only(left: 5, right: 5, top: 15), EdgeInsets.only(left: 5, right: 5, top: 15),
child: TextFields( child: TextFields(
hintText: "Add ASSESSMENT", hintText: TranslationBase.of(context).addAssessment,
fontSize: 13.5, fontSize: 13.5,
onTapTextFields: () { onTapTextFields: () {
openAssessmentDialog(context); openAssessmentDialog(context,isUpdate: false,
model: model);
}, },
readOnly: true, readOnly: true,
// hintColor: Colors.black, // hintColor: Colors.black,
@ -159,266 +170,239 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
if(widget.mySelectedAssessment != null &&
widget.mySelectedAssessment Column(
.appointmentId != children: widget.mySelectedAssessmentList.map((
null && widget.mySelectedAssessment assessment) {
.selectedDiagnosisType != null && return Container(
widget.mySelectedAssessment margin: EdgeInsets.only(
.selectedDiagnosisCondition != null) left: 5, right: 5, top: 15),
Container( child: Row(
margin: EdgeInsets.only( mainAxisAlignment: MainAxisAlignment
left: 5, right: 5, top: 15), .spaceBetween,
child: Row( crossAxisAlignment: CrossAxisAlignment
mainAxisAlignment: MainAxisAlignment .start,
.spaceBetween, children: [
crossAxisAlignment: CrossAxisAlignment Column(
.start, mainAxisAlignment: MainAxisAlignment
children: [ .start,
Column( children: [
mainAxisAlignment: MainAxisAlignment Column(
.start, mainAxisAlignment:
children: [ MainAxisAlignment.start,
Column( crossAxisAlignment:
mainAxisAlignment: CrossAxisAlignment.start,
MainAxisAlignment.start, children: [
crossAxisAlignment: AppText(
CrossAxisAlignment.start, "12".toUpperCase(),
children: [ fontWeight: FontWeight
AppText( .bold,
"12".toUpperCase(), fontSize: 16,
fontWeight: FontWeight.bold, ),
fontSize: 16, AppText(
), "DEC".toUpperCase(),
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??"",
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
), ),
), ],
], )
), ],
], ),
), Column(
Column( crossAxisAlignment: CrossAxisAlignment
crossAxisAlignment: CrossAxisAlignment .start,
.start, children: [
children: [ Row(
Row( mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
AppText( AppText(
"ICD: ".toUpperCase(), "Appointment #: ",
fontWeight: FontWeight.bold, fontWeight: FontWeight
fontSize: 16, .bold,
), fontSize: 16,
Container( ),
child: AppText( AppText(
widget.mySelectedAssessment.selectedICD.code.trim().toUpperCase()??"", assessment
.appointmentId
.toString(),
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
), ),
), ],
], ),
) Row(
], mainAxisAlignment:
), MainAxisAlignment.start,
Column( children: [
children: [ AppText(
InkWell( assessment
onTap: () { .selectedDiagnosisCondition
openAssessmentDialog(context); .nameEn,
}, fontWeight: FontWeight
child: Icon(EvaIcons .bold,
.edit2Outline), 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, isExpand: isAssessmentExpand,
), ),
DividerWithSpacesAround( DividerWithSpacesAround(
height: 30, height: 30,
),
AppButton(
title: TranslationBase
.of(context)
.next,
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
await submitAssessment(model);
},
),
SizedBox(
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);
}
openAssessmentDialog(BuildContext context,
if (model.state == ViewState.ErrorLocal) { {
helpers.showErrorToast(model.error); MySelectedAssessment assessment, bool isUpdate,
} else { SOAPViewModel model
widget.changePageViewIndex(3); }) {
} if (assessment == null) {
} else { assessment = MySelectedAssessment(
helpers.showErrorToast(TranslationBase.of(context).requiredMsg); remark: '', appointmentId: widget.patientInfo.appointmentNo);
} }
widget.changePageViewIndex(3);
}
openAssessmentDialog(BuildContext context) {
showModalBottomSheet( showModalBottomSheet(
backgroundColor: Colors.white, backgroundColor: Colors.white,
isScrollControlled: true, isScrollControlled: true,
context: context, context: context,
builder: (context) { builder: (context) {
return AddAssessmentDetails( return AddAssessmentDetails(
mySelectedAssessment: widget.mySelectedAssessment, mySelectedAssessment: assessment,
addSelectedAssessment: () { patientInfo: widget.patientInfo,
isUpdate: isUpdate,
mySelectedAssessmentList: widget.mySelectedAssessmentList,
addSelectedAssessment: (MySelectedAssessment mySelectedAssessment,
bool isUpdate) async {
setState(() { setState(() {
Navigator.of(context).pop();
}); });
}); });
}); });
@ -428,32 +412,34 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
class AddAssessmentDetails extends StatefulWidget { class AddAssessmentDetails extends StatefulWidget {
final MySelectedAssessment mySelectedAssessment; final MySelectedAssessment mySelectedAssessment;
final Function() addSelectedAssessment; final List<MySelectedAssessment> mySelectedAssessmentList;
final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment;
final PatiantInformtion patientInfo; final PatiantInformtion patientInfo;
const AddAssessmentDetails( final bool isUpdate;
{Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo})
: super(key: key); AddAssessmentDetails(
{Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList});
@override @override
_AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState();
} }
class _AddAssessmentDetailsState extends State<AddAssessmentDetails> { class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
// MasterKeyModel _selectedDiagnosisCondition;
// MasterKeyModel _selectedDiagnosisType;
TextEditingController remarkController = TextEditingController(); TextEditingController remarkController = TextEditingController();
TextEditingController appointmentIdController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController();
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>(); GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<MasterKeyModel>>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
remarkController.text = widget.mySelectedAssessment.remark??""; remarkController.text = widget.mySelectedAssessment.remark ?? "";
appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); appointmentIdController.text =
widget.mySelectedAssessment.appointmentId.toString();
final screenSize = MediaQuery final screenSize = MediaQuery
.of(context) .of(context)
.size; .size;
InputDecoration textFieldSelectorDecoration(String hintText, InputDecoration textFieldSelectorDecoration(String hintText,
String selectedText, bool isDropDown,{IconData icon}) { String selectedText, bool isDropDown, {IconData icon}) {
//TODO: make one Input InputDecoration for all //TODO: make one Input InputDecoration for all
return InputDecoration( return InputDecoration(
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -686,16 +672,34 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
), ),
AppButton( AppButton(
title: "Add".toUpperCase(), title: "Add".toUpperCase(),
onPressed: () { loading: model.state == ViewState.BusyLocal,
setState(() { onPressed: () async {
widget.mySelectedAssessment.remark = widget.mySelectedAssessment.remark =
remarkController.text; remarkController.text;
widget.mySelectedAssessment widget.mySelectedAssessment
.appointmentId = int.parse( .appointmentId = int.parse(
appointmentIdController.text); appointmentIdController.text);
if (widget.mySelectedAssessment
widget.addSelectedAssessment(); .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/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.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/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.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/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/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/util/translations_delegate_base.dart';
@ -77,6 +79,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
selectedExamination: examMaster, selectedExamination: examMaster,
remark: element.remarks, remark: element.remarks,
isNormal: element.isNormal, isNormal: element.isNormal,
createdBy: element.createdBy,
isAbnormal: element.isAbnormal); isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam); widget.mySelectedExamination.add(tempEam);
}); });
@ -102,7 +105,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
children: [ children: [
Row( Row(
children: [ children: [
Texts('Physical/System Examination', Texts(TranslationBase.of(context).physicalSystemExamination,
variant: isSysExaminationExpand variant: isSysExaminationExpand
? "bodyText" ? "bodyText"
: '', : '',
@ -137,7 +140,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
margin: margin:
EdgeInsets.only(left: 10, right: 10, top: 15), EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: "Add Examination", hintText: TranslationBase.of(context).physicalSystemExamination,
fontSize: 13.5, fontSize: 13.5,
onTapTextFields: () { onTapTextFields: () {
openExaminationList(context); openExaminationList(context);
@ -351,7 +354,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if(widget.mySelectedExamination.isNotEmpty){ if(widget.mySelectedExamination.isNotEmpty){
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) { widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
@ -364,9 +371,9 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '', remarks: exam.remark ?? '',
createdBy: 4709, createdBy: exam.createdBy??doctorProfile.doctorID,
createdOn: DateTime.now().toIso8601String(), createdOn: DateTime.now().toIso8601String(),
editedBy: 4709, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id, examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId, examType: exam.selectedExamination.typeId,
@ -505,8 +512,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
baseViewModel: model, baseViewModel: model,
child: MasterKeyCheckboxSearchWidget( child: MasterKeyCheckboxSearchWidget(
model: model, model: model,
hintSearchText: 'Search Examination', hintSearchText: TranslationBase.of(context).searchExamination,
buttonName: 'Add Examination', buttonName: TranslationBase.of(context).addExamination,
masterList: model.physicalExaminationList, masterList: model.physicalExaminationList,
removeHistory: (history){ removeHistory: (history){
setState(() { setState(() {

@ -59,7 +59,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
GetGetProgressNoteReqModel( GetGetProgressNoteReqModel(
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeID: widget.patientInfo.episodeNo.toString()); episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: '');
await model.getPatientProgressNote(getGetProgressNoteReqModel); await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) { if (model.patientProgressNoteList.isNotEmpty) {
@ -285,15 +285,15 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
patientMRN: widget.patientInfo.patientMRN, patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo, episodeId: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo, appointmentNo: widget.patientInfo.appointmentNo,
planNote: progressNoteController.text); planNote: progressNoteController.text, doctorID: '', editedBy: '');
if(model.patientProgressNoteList.isEmpty){ // if(model.patientProgressNoteList.isEmpty){
await model.postProgressNote(postProgressNoteRequestModel); await model.postProgressNote(postProgressNoteRequestModel);
}else { // }else {
await model.patchProgressNote(postProgressNoteRequestModel); // await model.patchProgressNote(postProgressNoteRequestModel);
//
} // }
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); 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_allergy.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.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_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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.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/util/translations_delegate_base.dart';
@ -30,9 +31,9 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
PageController _controller; PageController _controller;
int _currentIndex = 0; int _currentIndex = 0;
List<MySelectedAllergy> myAllergiesList= List(); List<MySelectedAllergy> myAllergiesList= List();
List<MasterKeyModel> myHistoryList = List(); List<MySelectedHistory> myHistoryList = List();
List<MySelectedExamination> mySelectedExamination = List(); List<MySelectedExamination> mySelectedExamination = List();
MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); List<MySelectedAssessment> mySelectedAssessment = List();
changePageViewIndex(pageIndex) { changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex); _controller.jumpToPage(pageIndex);
} }
@ -105,7 +106,7 @@ class _UpdateSoapIndexState extends State<UpdateSoapIndex>
), ),
UpdateAssessmentPage( UpdateAssessmentPage(
changePageViewIndex: changePageViewIndex, changePageViewIndex: changePageViewIndex,
mySelectedAssessment: mySelectedAssessmentList:
mySelectedAssessment, mySelectedAssessment,
patientInfo: patient, patientInfo: patient,
), ),

Loading…
Cancel
Save