Merge branch 'development' into 'feature-ucaf'

# Conflicts:
#   lib/config/localized_values.dart
#   lib/util/translations_delegate_base.dart
merge-requests/242/head
Mohammad Aljammal 4 years ago
commit 21114fc88f

@ -132,6 +132,9 @@ const GET_PATIENT_ARRIVAL_LIST =
const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies';
const GET_MASTER_LOOKUP_LIST =
'Services/DoctorApplication.svc/REST/GetMasterLookUpList';
const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode';
const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies';
const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory';
const POST_CHIEF_COMPLAINT =

@ -295,7 +295,7 @@ const Map<String, Map<String, String>> localizedValues = {
},
'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'},
'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'},
"empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"},
"empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"},
'no-sickleve-applied': {
'en': "No sick leave applied",
'ar': 'لم تطبق إجازة مرضية'
@ -545,4 +545,5 @@ const Map<String, Map<String, String>> localizedValues = {
'en': "There is no detail for this patient",
'ar': "لا توجد تفاصيل لهذا المريض"
},
'doc': {'en': "Doc :", 'ar':" د: " },
};

@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
@ -31,6 +32,7 @@ class SOAPService extends LookupService {
List<GetGetProgressNoteResModel> patientProgressNoteList = [];
List<GetAssessmentResModel> patientAssessmentList = [];
int episodeID;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
await baseAppClient.post(
GET_ALLERGIES,
@ -48,6 +50,20 @@ class SOAPService extends LookupService {
);
}
Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async {
hasError = false;
await baseAppClient.post(POST_EPISODE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
episodeID = response['EpisodeID'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postEpisodeReqModel.toJson());
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
hasError = false;

@ -15,12 +15,11 @@ class PrescriptionService extends BaseService {
List<dynamic> specialityList = [];
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(
patientMRN: 3120877,
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8",
);
//patientMRN: 3120877,
);
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
search: ["panadol"],
search: ["Acetaminophen"],
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
);
@ -29,7 +28,7 @@ class PrescriptionService extends BaseService {
PostPrescriptionReqModel();
Future getPrescription({int mrn}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: 3120877);
_prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn);
hasError = false;
_prescriptionList.clear();
await baseAppClient.post(GET_PRESCRIPTION_LIST,

@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
@ -78,6 +79,8 @@ class SOAPViewModel extends BaseViewModel {
List<GetAssessmentResModel> get patientAssessmentList =>
_SOAPService.patientAssessmentList;
int get episodeID =>
_SOAPService.episodeID;
Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async {
setState(ViewState.Busy);
@ -99,6 +102,17 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postEpisode(postEpisodeReqModel);
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
setState(ViewState.BusyLocal);
await _SOAPService.postAllergy(postAllergyRequestModel);
@ -222,6 +236,7 @@ class SOAPViewModel extends BaseViewModel {
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
setState(ViewState.Busy);
await _SOAPService.getPatientAllergy(generalGetReqForSOAP);
if (_SOAPService.hasError) {
@ -231,6 +246,14 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
String getAllergicNames(){
String allergiesString='';
patientAllergiesList.forEach((element) {
allergiesString += element.allergyDiseaseName+' , ';
});
return allergiesString;
}
Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async {
setState(ViewState.Busy);
await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst);

@ -0,0 +1,28 @@
class PostEpisodeReqModel {
int appointmentNo;
int patientMRN;
int doctorID;
String vidaAuthTokenID;
PostEpisodeReqModel(
{this.appointmentNo,
this.patientMRN,
this.doctorID,
this.vidaAuthTokenID});
PostEpisodeReqModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['AppointmentNo'];
patientMRN = json['PatientMRN'];
doctorID = json['DoctorID'];
vidaAuthTokenID = json['VidaAuthTokenID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['AppointmentNo'] = this.appointmentNo;
data['PatientMRN'] = this.patientMRN;
data['DoctorID'] = this.doctorID;
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
return data;
}
}

@ -9,9 +9,11 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart';
import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -77,6 +79,25 @@ class _DashboardScreenState extends State<DashboardScreen> {
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
var _patientSearchFormValues = PatientModel(
FirstName: "0",
MiddleName: "0",
LastName: "0",
PatientMobileNumber: "0",
PatientIdentificationID: "0",
PatientID: 0,
From: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(),
To: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(),
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11",
VersionID: 1.2,
Channel: 9,
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true,
PatientOutSA: false);
return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getDashboard(),
builder: (_, model, w) => AppScaffold(
@ -957,6 +978,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
height: 20,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DashboardItem(
child: Column(
@ -984,6 +1007,30 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
);
},
),
SizedBox(width: 8,),
DashboardItem(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
DoctorApp.patient,
size: 50,
),
AppText(
TranslationBase.of(context).arrived,
color: Colors.black,
textAlign: TextAlign.center,
)
],
),
hasBorder: true,
onTap: () {
Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": "7"
});
},
)
],
),

File diff suppressed because it is too large Load Diff

@ -68,21 +68,9 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
try {
/* Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile)*/;
if (_formKey.currentState.validate()) {
_formKey.currentState.save();
/* sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType);
String token = await sharedPref.getString(TOKEN);
_patientSearchFormValues.TokenID = token;
_patientSearchFormValues.ProjectID = doctorProfile.projectID; //15
_patientSearchFormValues.DoctorID = doctorProfile.doctorID;
_patientSearchFormValues.ClinicID = doctorProfile.clinicID;*/
if ((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") &&
_selectedType == "7") {

@ -274,7 +274,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
.then((res) {
setState(() {
_isLoading = false;
if (res['MessageStatus'] == 1) {
if (res != null && res['MessageStatus'] == 1) {
if (val2 == 7) {
if (res[SERVICES_PATIANT2[val2]] == null) {
_isError = true;
@ -282,6 +283,9 @@ class _PatientsScreenState extends State<PatientsScreen> {
this.error = error.toString();
} else {
var localList = [];
if(res["patientArrivalList"]["entityList"] == null){
res["patientArrivalList"]["entityList"] = [];
}
res["patientArrivalList"]["entityList"].forEach((v) {
Map<String, dynamic> mergedPatient = {
...v,
@ -289,7 +293,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
};
localList.add(mergedPatient);
});
print(localList.toString());
lItems = localList;
}
} else {
@ -301,7 +304,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
_isError = false;
} else {
_isError = true;
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
error = model.error; //res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
}
});
}).catchError((error) {

File diff suppressed because it is too large Load Diff

@ -453,21 +453,30 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.edit),
onTap: () {
updatePrescriptionForm(
context,
model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
model
.prescriptionList[
0]
.entityList[
index]
.medicineCode,
model,
);
patient:
patient,
drugId: model
.prescriptionList[
0]
.entityList[
index]
.medicineCode,
drugName: model
.prescriptionList[
0]
.entityList[
index]
.medicationName,
remarks: model
.prescriptionList[
0]
.entityList[
index]
.remarks,
model:
model,
context:
context);
//model.postPrescription();
},
),
@ -563,7 +572,12 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
}
void updatePrescriptionForm(
context, String drugName, int drugId, PrescriptionViewModel model) {
{context,
String drugName,
int drugId,
String remarks,
PrescriptionViewModel model,
PatiantInformtion patient}) {
TextEditingController remarksController = TextEditingController();
TextEditingController doseController = TextEditingController();
TextEditingController frequencyController = TextEditingController();
@ -635,6 +649,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
SizedBox(
height: 12.0,
),
AppText('Remarks'),
Container(
decoration: BoxDecoration(
borderRadius:
@ -642,7 +657,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))),
child: TextFields(
hintText: 'Remarks',
hintText: remarks,
controller: remarksController,
maxLines: 7,
minLines: 4,
@ -664,6 +679,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
title: 'update prescription'.toUpperCase(),
onPressed: () {
updatePrescription(
patient: patient,
model: model,
drugId: drugId,
remarks: remarksController.text,
@ -685,23 +701,23 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
});
}
updatePrescription({
PrescriptionViewModel model,
int drugId,
String remarks,
String dose,
String frequency,
String route,
}) async {
updatePrescription(
{PrescriptionViewModel model,
int drugId,
String remarks,
String dose,
String frequency,
String route,
PatiantInformtion patient}) async {
//PrescriptionViewModel model = PrescriptionViewModel();
PostPrescriptionReqModel updatePrescriptionReqModel =
new PostPrescriptionReqModel();
List<PrescriptionRequestModel> sss = List();
updatePrescriptionReqModel.appointmentNo = 2016055159;
updatePrescriptionReqModel.clinicID = 17;
updatePrescriptionReqModel.episodeID = 200012330;
updatePrescriptionReqModel.patientMRN = 3120877;
updatePrescriptionReqModel.appointmentNo = patient.appointmentNo;
updatePrescriptionReqModel.clinicID = patient.clinicId;
updatePrescriptionReqModel.episodeID = patient.episodeNo;
updatePrescriptionReqModel.patientMRN = patient.patientMRN;
updatePrescriptionReqModel.vidaAuthTokenID =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY";
sss.add(PrescriptionRequestModel(

@ -559,6 +559,8 @@ class TranslationBase {
String get searchExamination => localizedValues['searchExamination'][locale.languageCode];
String get addExamination => localizedValues['addExamination'][locale.languageCode];
String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode];
String get doc => localizedValues['doc'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -59,22 +59,49 @@ class _DynamicElementsState extends State<DynamicElements> {
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery
.of(context)
.size;
InputDecoration textFieldSelectorDecoration({String hintText,
String selectedText, bool isDropDown,IconData icon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
)
;
}
return LayoutBuilder(
builder: (ctx, constraints) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
),
SizedBox(
height: 10,
),
AppTextFormField(
textInputType: TextInputType.number,
onTap: ()=> _presentDatePicker('_selectedFromDate'),
hintText: TranslationBase.of(context).fromDate,
controller: _fromDateController,
inputFormatter: ONLY_DATE,
onTap: () {
_presentDatePicker('_selectedFromDate');
},
onSaved: (value) {
if (_fromDateController.text.toString().trim().isEmpty) {
widget._patientSearchFormValues.From = "0";
@ -82,12 +109,14 @@ class _DynamicElementsState extends State<DynamicElements> {
widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-");
}
},
readOnly: true,
),
SizedBox(
height: 10,
),
AppTextFormField(
textInputType: TextInputType.number,
readOnly: true,
hintText: TranslationBase
.of(context)
.toDate,

@ -1,92 +1,109 @@
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart';
class PatientPageHeaderWidget extends StatelessWidget {
final PatiantInformtion patient;
PatientPageHeaderWidget(this.patient);
@override
Widget build(BuildContext context) {
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 5,
),
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 20,
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
patientMRN: patient.patientMRN,
episodeId: patient.episodeNo,
appointmentNo: patient.appointmentNo,
doctorID: '',
editedBy: '');
await model.getPatientAllergy(generalGetReqForSOAP);
},
builder: (_, model, w) => Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
SizedBox(
width: 20,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: 5,
),
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).age,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 20,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
NetworkBaseView(
baseViewModel: model,
child: model.patientAllergiesList.isNotEmpty ?AppText(
"ALLERGIC TO: "+model.getAllergicNames(),
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
) : AppText(''),
),
],
),
],
),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
width: 20,
),
)
],
),
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
width: 20,
),
],
),
);
],
),
));
}
}

@ -1,7 +1,13 @@
import 'package:doctor_app_flutter/config/config.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/models/SOAP/PostEpisodeReqModel.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
@ -22,26 +28,46 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
String patientType;
@override
Widget build(BuildContext context) {
return SliverGrid.count(
return BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => SliverGrid.count(
crossAxisSpacing: 10,
mainAxisSpacing: 20,
crossAxisCount: 2,
childAspectRatio: 1.5,
children: [
if (int.parse(patientType) == 7)
PatientProfileButton(
key: key,
patient: patient,
isDisable: patient.episodeNo != 0 ? true : false,
nameLine1: TranslationBase.of(context).createNew,
nameLine2: TranslationBase.of(context).episode,
route: CREATE_EPISODE,
onTap: () async {
PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(
appointmentNo: patient.appointmentNo,
patientMRN: patient.patientMRN);
await model.postEpisode(postEpisodeReqModel);
patient.episodeNo = model.episodeID;
Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient});
},
isLoading: model.state == ViewState.BusyLocal,
icon: 'create-episod.png'
),
if(int.parse(patientType) ==7)
PatientProfileButton(
key: key,
patient: patient,
nameLine1: TranslationBase.of(context).createNew,
nameLine2: TranslationBase.of(context).episode,
route: CREATE_EPISODE,
icon: 'create-episod.png'),
if(int.parse(patientType) ==7)
PatientProfileButton(
key: key,
patient: patient,
nameLine1: TranslationBase.of(context).update,
nameLine2: TranslationBase.of(context).episode,
isDisable: patient.episodeNo == 0 ? true : false,
nameLine1: TranslationBase
.of(context)
.update,
nameLine2: TranslationBase
.of(context)
.episode,
route: UPDATE_EPISODE,
icon: 'modilfy-episode.png'),
PatientProfileButton(
@ -67,7 +93,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'),
if (selectedPatientType != 0 && selectedPatientType != 5)
if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7)
PatientProfileButton(
key: key,
patient: patient,
@ -145,7 +171,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
.of(context)
.ucaf,
icon: 'lab.png'),
]);
],),);
}
}
@ -205,20 +231,25 @@ class PatientProfileButton extends StatelessWidget {
final dynamic route;
final PatiantInformtion patient;
final String url = "assets/images/";
PatientProfileButton(
{Key key,
this.patient,
this.nameLine1,
this.nameLine2,
this.icon,
this.route})
final bool isDisable;
final bool isLoading;
final Function onTap;
PatientProfileButton({Key key,
this.patient,
this.nameLine1,
this.nameLine2,
this.icon,
this.route, this.isDisable = false, this.onTap, this.isLoading = false})
: super(key: key);
@override
Widget build(BuildContext context) {
return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell(
onTap: () {
onTap: isDisable?null:onTap != null ? onTap : () {
navigator(context, this.route);
},
child: Column(children: <Widget>[
@ -242,6 +273,8 @@ class PatientProfileButton extends StatelessWidget {
textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2,
),
if(isLoading)
DrAppCircularProgressIndeicator()
],
),
),
@ -260,7 +293,7 @@ class PatientProfileButton extends StatelessWidget {
),
decoration: BoxDecoration(
// border: Border.all(),
color: Colors.white,
color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB),

@ -41,7 +41,6 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
bool isAssessmentExpand = false;
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
onModelReady: (model) async{
@ -152,12 +151,10 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
model: model);
},
readOnly: true,
// hintColor: Colors.black,
suffixIcon: EvaIcons.plusCircleOutline,
suffixIconColor: AppGlobal
.appPrimaryColor,
fontWeight: FontWeight.w600,
// controller: messageController,
validator: (value) {
if (value == null)
return TranslationBase
@ -217,7 +214,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start,
children: [
AppText(
"Appointment #: ",
TranslationBase.of(context).appointmentNo,
fontWeight: FontWeight
.bold,
fontSize: 16,
@ -250,7 +247,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start,
children: [
AppText(
"Type : ",
TranslationBase.of(context).type +':',
fontWeight: FontWeight
.bold,
fontSize: 16,
@ -270,7 +267,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
MainAxisAlignment.start,
children: [
AppText(
"Doc : ",
TranslationBase.of(context).doc,
fontWeight: FontWeight
.bold,
fontSize: 16,
@ -671,7 +668,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
height: 10,
),
AppButton(
title: "Add".toUpperCase(),
title: (widget.isUpdate?TranslationBase.of(context).update:TranslationBase.of(context).add).toUpperCase(),
loading: model.state == ViewState.BusyLocal,
onPressed: () async {
widget.mySelectedAssessment.remark =

@ -397,10 +397,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
widget.changePageViewIndex(2);
}
} else {
helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
}
widget.changePageViewIndex(2);
widget.changePageViewIndex(2);
// helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
}
}
removeExamination(MasterKeyModel masterKey) {

@ -51,8 +51,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return BaseView<SOAPViewModel>(
onModelReady: (model) async {
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
@ -287,13 +285,13 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
appointmentNo: widget.patientInfo.appointmentNo,
planNote: progressNoteController.text, doctorID: '', editedBy: '');
// if(model.patientProgressNoteList.isEmpty){
if(model.patientProgressNoteList.isEmpty){
await model.postProgressNote(postProgressNoteRequestModel);
// }else {
// await model.patchProgressNote(postProgressNoteRequestModel);
//
// }
}else {
await model.patchProgressNote(postProgressNoteRequestModel);
}
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);

@ -4,10 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
// OWNER : Ibrahim albitar
// DATE : 19-04-2020
// DESCRIPTION : Custom Text Form Field for app.
class AppTextFormField extends FormField<String> {
AppTextFormField(
{FormFieldSetter<String> onSaved,
@ -41,6 +37,7 @@ class AppTextFormField extends FormField<String> {
obscureText: obscureText,
focusNode: focusNode,
keyboardType: textInputType,
readOnly: readOnly,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(inputFormatter)),

Loading…
Cancel
Save