procedure update

merge-requests/211/head
hussam al-habibeh 5 years ago
parent b3567df020
commit d1a261c847

@ -157,6 +157,8 @@ const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure';
const UPDATE_PRESCRIPTION = const UPDATE_PRESCRIPTION =
'Services/DoctorApplication.svc/REST/PatchPrescription'; 'Services/DoctorApplication.svc/REST/PatchPrescription';
const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile';
var selectedPatientType = 1; var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************

@ -1,7 +1,7 @@
class MedicalFileModel { class MedicalFileModel {
List<EntityList> entityList; List<EntityList> entityList;
int rowcount; int rowcount;
Null statusMessage; dynamic statusMessage;
MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); MedicalFileModel({this.entityList, this.rowcount, this.statusMessage});

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

@ -0,0 +1,29 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/medical_file_model.dart';
import 'package:doctor_app_flutter/core/model/medical_file_request_model.dart';
import 'package:doctor_app_flutter/core/model/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class MedicalFileService extends BaseService {
List<MedicalFileModel> _medicalFileList = List();
List<MedicalFileModel> get medicalFileList => _medicalFileList;
MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel(
patientMRN: 1231755,
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU",
);
Future getMedicalFile() async {
hasError = false;
_medicalFileList.clear();
await baseAppClient.post(GET_MEDICAL_FILE,
onSuccess: (dynamic response, int statusCode) {
_medicalFileList
.add(MedicalFileModel.fromJson(response['PatientFileList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _fileRequestModel.toJson());
}
}

@ -73,18 +73,15 @@ class ProcedureService extends BaseService {
}, body: postProcedureReqModel.toJson()); }, body: postProcedureReqModel.toJson());
} }
Future updateProcedure() async { Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post( await baseAppClient.post(UPDATE_PROCEDURE,
GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { print("ACCEPTED");
print("ACCEPTED"); }, onFailure: (String error, int statusCode) {
}, hasError = true;
onFailure: (String error, int statusCode) { super.error = error;
hasError = true; }, body: postProcedureReqModel.toJson());
super.error = error;
},
);
} }
} }

@ -0,0 +1,26 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/medical_file_model.dart';
import 'package:doctor_app_flutter/core/service/medical_file_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
class MedicalFileViewModel extends BaseViewModel {
bool hasError = false;
MedicalFileService _medicalFileService = locator<MedicalFileService>();
List<MedicalFileModel> get medicalFileList =>
_medicalFileService.medicalFileList;
Future getMedicalFile() async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _medicalFileService.getMedicalFile();
if (_medicalFileService.hasError) {
error = _medicalFileService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -51,11 +51,11 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
Future updateProcedure() async { Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.updateProcedure(); await _procedureService.updateProcedure(postProcedureReqModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -1,9 +1,11 @@
import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/medical_file_service.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart';
import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; import 'package:doctor_app_flutter/core/service/sickleave_service.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
@ -45,6 +47,7 @@ void setupLocator() {
locator.registerLazySingleton(() => PrescriptionService()); locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => ProcedureService()); locator.registerLazySingleton(() => ProcedureService());
locator.registerLazySingleton(() => VitalSignsService()); locator.registerLazySingleton(() => VitalSignsService());
locator.registerLazySingleton(() => MedicalFileService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
@ -60,4 +63,5 @@ void setupLocator() {
locator.registerFactory(() => PrescriptionViewModel()); locator.registerFactory(() => PrescriptionViewModel());
locator.registerFactory(() => ProcedureViewModel()); locator.registerFactory(() => ProcedureViewModel());
locator.registerFactory(() => VitalSignsViewModel()); locator.registerFactory(() => VitalSignsViewModel());
locator.registerFactory(() => MedicalFileViewModel());
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/root_page.dart';
import 'package:doctor_app_flutter/screens/medical-file/medical_file_page.dart';
import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart';
@ -71,7 +72,7 @@ const String SETTINGS = 'settings';
const String VITAL_SIGN = 'patients/vital-sign'; const String VITAL_SIGN = 'patients/vital-sign';
const String LAB_ORDERS = 'patients/lab_orders'; const String LAB_ORDERS = 'patients/lab_orders';
const String PRESCRIPTIONS = 'patients/prescription'; const String PRESCRIPTIONS = 'patients/prescription';
const String RADIOLOGY = 'patients/radiology'; const String MEDICAL_FILE = 'patients/radiology';
const String PROGRESS_NOTE = 'patients/progress-note'; const String PROGRESS_NOTE = 'patients/progress-note';
const String REFER_PATIENT = 'patients/refer-patient'; const String REFER_PATIENT = 'patients/refer-patient';
const String MY_REFERRAL_DETAIL = 'my_referral_detail'; const String MY_REFERRAL_DETAIL = 'my_referral_detail';
@ -119,7 +120,7 @@ var routes = {
SERVICES: (_) => ServicesScreen(), SERVICES: (_) => ServicesScreen(),
LAB_ORDERS: (_) => LabOrdersScreen(), LAB_ORDERS: (_) => LabOrdersScreen(),
PRESCRIPTIONS: (_) => PrescriptionScreen(), PRESCRIPTIONS: (_) => PrescriptionScreen(),
RADIOLOGY: (_) => RadiologyScreen(), MEDICAL_FILE: (_) => MedicalFilePage(),
PROGRESS_NOTE: (_) => ProgressNoteScreen(), PROGRESS_NOTE: (_) => ProgressNoteScreen(),
REFER_PATIENT: (_) => ReferPatientScreen(), REFER_PATIENT: (_) => ReferPatientScreen(),
REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(),
@ -128,7 +129,9 @@ var routes = {
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(),
CREATE_EPISODE: (_) => AddSOAPIndex(), CREATE_EPISODE: (_) => AddSOAPIndex(),
UPDATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,), UPDATE_EPISODE: (_) => UpdateSoapIndex(
isUpdate: true,
),
BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(),
IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(),
// VIDEO_CALL: (_) => VideoCallPage(patientData: null), // VIDEO_CALL: (_) => VideoCallPage(patientData: null),

@ -0,0 +1,428 @@
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/Text.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/expandable-widget-header-body.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
class MedicalFileDetails extends StatefulWidget {
String age;
String firstName;
String lastName;
String gender;
MedicalFileDetails({this.age, this.firstName, this.lastName, this.gender});
@override
_MedicalFileDetailsState createState() => _MedicalFileDetailsState(
firstName: firstName, age: age, lastName: lastName, gender: gender);
}
class _MedicalFileDetailsState extends State<MedicalFileDetails> {
String age;
String firstName;
String lastName;
String gender;
_MedicalFileDetailsState(
{this.age, this.firstName, this.lastName, this.gender});
bool isPhysicalExam = false;
bool isProcedureExpand = false;
bool isHistoryExpand = false;
bool isAssessmentExpand = false;
@override
Widget build(BuildContext context) {
return BaseView<MedicalFileViewModel>(
//onModelReady: (model) => model.getMedicalFile(),
builder:
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: 'medical file'.toUpperCase(),
body: SingleChildScrollView(
child: Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
gender == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
firstName + ' ' + lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
children: [
AppText(
TranslationBase.of(context).age2,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 5.0,
),
AppText(
age,
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
],
)
],
),
),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
Padding(
padding: EdgeInsets.all(10.0),
child: Container(
child: Column(
children: [
Row(
children: [
AppText(
'Visit Date : ',
fontWeight: FontWeight.w700,
),
AppText(
'23/12/2020',
),
SizedBox(width: 35.0),
AppText(
'Appt Date : ',
fontWeight: FontWeight.w700,
),
AppText(
'23/12/2020',
),
],
),
Row(
children: [
AppText(
'Doctor : '.toUpperCase(),
fontWeight: FontWeight.w700,
),
AppText(
'Muhammad assad'.toUpperCase(),
fontWeight: FontWeight.w700,
),
],
),
Row(
children: [
AppText(
'Clinic : ',
fontWeight: FontWeight.w700,
),
AppText(
'Gastroenterology',
),
],
),
Row(
children: [
AppText(
'Episode Number : ',
fontWeight: FontWeight.w700,
),
AppText(
'200012334',
),
],
),
SizedBox(height: 15.0),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey.shade400,
),
SizedBox(height: 25.0),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts(
'History of present illness'
.toUpperCase(),
variant:
isHistoryExpand ? "bodyText" : '',
bold: isHistoryExpand ? true : false,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isHistoryExpand = !isHistoryExpand;
});
},
child: Icon(isHistoryExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(
children: [
Texts(
'Ms J. K. is an 83 year old retired nurse with a long history of hypertension that was previously well controlled on diuretic therapy. She was first admitted to CPMC in 1995 when she presented with a complaint of intermittent midsternal chest pain.')
],
),
isExpand: isHistoryExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('assessment'.toUpperCase(),
variant:
isAssessmentExpand ? "bodyText" : '',
bold: isAssessmentExpand ? true : false,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isAssessmentExpand = !isAssessmentExpand;
});
},
child: Icon(isAssessmentExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(
children: [
Texts('ssss'),
],
),
isExpand: isAssessmentExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('Test / procedures'.toUpperCase(),
variant:
isProcedureExpand ? "bodyText" : '',
bold: isProcedureExpand ? true : false,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isProcedureExpand = !isProcedureExpand;
});
},
child: Icon(isProcedureExpand
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(
children: [
SizedBox(
height: 20.0,
),
Row(
children: [
AppText(
'Exam Type : ',
fontWeight: FontWeight.w700,
),
AppText(
'59',
),
],
),
Row(
children: [
AppText(
'ABDOMEN',
fontWeight: FontWeight.w700,
),
],
),
Row(
children: [
AppText(
'Abnormal: ',
fontWeight: FontWeight.w700,
),
AppText(
'no',
),
],
),
SizedBox(height: 15.0),
Row(
children: [
AppText(
'Some short remark about the allergy',
fontWeight: FontWeight.w300,
),
],
),
],
),
isExpand: isProcedureExpand,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
SizedBox(
height: 30,
),
HeaderBodyExpandableNotifier(
headerWidget: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Texts('physical exam'.toUpperCase(),
variant: isPhysicalExam ? "bodyText" : '',
bold: isPhysicalExam ? true : false,
color: Colors.black),
],
),
InkWell(
onTap: () {
setState(() {
isPhysicalExam = !isPhysicalExam;
});
},
child: Icon(isPhysicalExam
? EvaIcons.minus
: EvaIcons.plus))
],
),
bodyWidget: Column(
children: [
SizedBox(
height: 20.0,
),
Row(
children: [
AppText(
'Exam Type : ',
fontWeight: FontWeight.w700,
),
AppText(
'59',
),
],
),
Row(
children: [
AppText(
'ABDOMEN',
fontWeight: FontWeight.w700,
),
],
),
Row(
children: [
AppText(
'Abnormal: ',
fontWeight: FontWeight.w700,
),
AppText(
'no',
),
],
),
SizedBox(height: 15.0),
Row(
children: [
AppText(
'Some short remark about the allergy',
fontWeight: FontWeight.w300,
),
],
),
],
),
isExpand: isPhysicalExam,
),
SizedBox(
height: 30,
),
Container(
width: double.infinity,
height: 1,
color: Color(0xffCCCCCC),
),
],
),
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,173 @@
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/medical-file/medical_file_details.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_scaffold_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 MedicalFilePage extends StatefulWidget {
@override
_MedicalFilePageState createState() => _MedicalFilePageState();
}
class _MedicalFilePageState extends State<MedicalFilePage> {
PatiantInformtion patient;
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient'];
return BaseView<MedicalFileViewModel>(
onModelReady: (model) => model.getMedicalFile(),
builder:
(BuildContext context, MedicalFileViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true,
appBarTitle: 'medical Report'.toUpperCase(),
body: NetworkBaseView(
baseViewModel: model,
child: Container(
child: Column(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
AvatarWidget(
Icon(
patient.genderDescription == "Male"
? DoctorApp.male
: DoctorApp.female_icon,
size: 70,
color: Colors.white,
),
),
SizedBox(
width: 20,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
patient.firstName + ' ' + patient.lastName,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Row(
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
fontWeight: FontWeight.bold,
),
SizedBox(
width: 5.0,
),
AppText(
patient.age.toString(),
color: Colors.black,
fontWeight: FontWeight.normal,
),
],
),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
],
)
],
),
),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey,
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: 2,
itemBuilder: (BuildContext ctxt, int index) {
return Padding(
padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 8.0),
child: InkWell(
child: Container(
child: Column(
children: [
Row(
children: [
AppText(
'Branch : ',
fontWeight: FontWeight.w700,
),
AppText(
model.medicalFileList[0].entityList[0]
.admissions[index].projectName,
),
],
),
Row(
children: [
AppText(
'Doctor : '.toUpperCase(),
fontWeight: FontWeight.w700,
),
AppText(
model.medicalFileList[0].entityList[0]
.admissions[index].doctor
.toUpperCase(),
fontWeight: FontWeight.w700,
),
],
),
Row(
children: [
AppText(
'Clinic : ',
fontWeight: FontWeight.w700,
),
AppText(
model.medicalFileList[0].entityList[0]
.admissions[index].clinic,
),
],
),
SizedBox(height: 10.0),
Divider(
height: 1.0,
thickness: 1.0,
color: Colors.grey.shade400,
)
],
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MedicalFileDetails(
age: patient.age,
firstName: patient.firstName,
lastName: patient.lastName,
gender: patient.genderDescription,
)),
);
},
),
);
})
],
),
),
),
),
);
}
}

@ -76,7 +76,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNo, TranslationBase.of(context).age2,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -84,12 +84,17 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
width: 5.0, width: 5.0,
), ),
AppText( AppText(
patient.patientId.toString(), patient.age.toString(),
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
], ],
), ),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
], ],
) )
], ],

@ -20,19 +20,21 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
EntityListCheckboxSearchWidget( EntityListCheckboxSearchWidget(
{Key key, {Key key,
this.model, this.model,
this.addSelectedHistories, this.addSelectedHistories,
this.removeHistory, this.removeHistory,
this.masterList, this.masterList,
this.addHistory, this.addHistory,
this.isEntityListSelected}) this.isEntityListSelected})
: super(key: key); : super(key: key);
@override @override
_EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState(); _EntityListCheckboxSearchWidgetState createState() =>
_EntityListCheckboxSearchWidgetState();
} }
class _EntityListCheckboxSearchWidgetState extends State<EntityListCheckboxSearchWidget> { class _EntityListCheckboxSearchWidgetState
extends State<EntityListCheckboxSearchWidget> {
List<EntityList> items = List(); List<EntityList> items = List();
@override @override
@ -49,75 +51,70 @@ class _EntityListCheckboxSearchWidgetState extends State<EntityListCheckboxSearc
NetworkBaseView( NetworkBaseView(
baseViewModel: widget.model, baseViewModel: widget.model,
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.5, height: MediaQuery.of(context).size.height * 0.45,
child: Center( child: Center(
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: ListView( child: ListView(
children: [ children: [
TextFields( TextFields(
hintText: 'Search ', hintText: 'Search ',
suffixIcon: EvaIcons.search, suffixIcon: EvaIcons.search,
onChanged: (value) { onChanged: (value) {
filterSearchResults(value); filterSearchResults(value);
}, },
), ),
SizedBox(height: 15,), SizedBox(
Column( height: 15,
children: items.map((historyInfo) { ),
return Column( Column(
children: items.map((historyInfo) {
return Column(
children: [
Row(
children: [ children: [
Row( Checkbox(
children: [ value: widget
Checkbox( .isEntityListSelected(historyInfo),
value: activeColor: Colors.red[800],
widget.isEntityListSelected(historyInfo), onChanged: (bool newValue) {
activeColor: Colors.red[800], setState(() {
onChanged: (bool newValue) { if (widget.isEntityListSelected(
setState(() { historyInfo)) {
if (widget widget.removeHistory(historyInfo);
.isEntityListSelected(historyInfo)) { } else {
widget.removeHistory(historyInfo); widget.addHistory(historyInfo);
} else { }
widget.addHistory(historyInfo); });
} }),
}); Expanded(
}), child: Padding(
Expanded( padding: const EdgeInsets.symmetric(
child: Padding( horizontal: 10, vertical: 0),
padding: const EdgeInsets.symmetric( child: Texts(historyInfo.procedureName,
horizontal: 10, vertical: 0), variant: "bodyText",
child: Texts(historyInfo.procedureName, bold: true,
variant: "bodyText", color: Colors.black),
bold: true, ),
color: Colors.black),
),
),
],
), ),
DividerWithSpacesAround(),
], ],
); ),
}).toList(), DividerWithSpacesAround(),
), ],
], );
}).toList(),
), ),
)), ],
),
)),
), ),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
if (widget.model.state == ViewState.Idle)
AppButton(//TODO change the button name
title: "Add ".toUpperCase(),
onPressed: () {
widget.addSelectedHistories();
},
),
], ],
), ),
); );
@ -129,7 +126,7 @@ class _EntityListCheckboxSearchWidgetState extends State<EntityListCheckboxSearc
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<EntityList> dummyListData = List(); List<EntityList> dummyListData = List();
dummySearchList.forEach((item) { dummySearchList.forEach((item) {
if (item.procedureName.toLowerCase().contains(query.toLowerCase()) ) { if (item.procedureName.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(item); dummyListData.add(item);
} }
}); });

@ -78,7 +78,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase.of(context).fileNo, TranslationBase.of(context).age2,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -86,12 +86,17 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
width: 5.0, width: 5.0,
), ),
AppText( AppText(
patient.patientId.toString(), patient.age.toString(),
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
], ],
), ),
AppText(
"ALLERGIC TO: FOOD, ASPIRIN",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
], ],
) )
], ],
@ -268,7 +273,8 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
fontWeight: fontWeight:
FontWeight FontWeight
.w700, .w700,
fontSize: 15.0, fontSize:
15.0,
), ),
AppText( AppText(
model model
@ -278,7 +284,8 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
index] index]
.procedureId .procedureId
.toString(), .toString(),
fontSize: 13.0, fontSize:
13.0,
), ),
SizedBox( SizedBox(
width: 12.0, width: 12.0,
@ -288,20 +295,23 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
fontWeight: fontWeight:
FontWeight FontWeight
.w700, .w700,
fontSize: 15.0, fontSize:
15.0,
), ),
AppText( AppText(
'Urgent', 'Urgent',
fontSize: 13.0, fontSize:
color: 13.0,
Colors.red, color: Colors
.red,
), ),
], ],
), ),
Row( Row(
children: [ children: [
Container( Container(
child: Expanded( child:
Expanded(
child: child:
AppText( AppText(
model model
@ -349,7 +359,8 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
children: [ children: [
AppText( AppText(
'Some short remark about the procedure', 'Some short remark about the procedure',
fontSize: 13.5, fontSize:
13.5,
), ),
], ],
), ),
@ -360,7 +371,8 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
Divider( Divider(
height: 5.0, height: 5.0,
thickness: 1.0, thickness: 1.0,
color: Colors.grey, color:
Colors.grey,
) )
// SizedBox( // SizedBox(
// height: 40, // height: 40,
@ -372,7 +384,20 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
Container( Container(
child: Column( child: Column(
children: [ children: [
Icon(Icons.edit) InkWell(
child: Icon(
Icons.edit),
onTap: () {
updateProcedureForm(
context,
procedureName: model
.procedureList[
0]
.entityList[
index]
.procedureName);
},
)
], ],
), ),
) )
@ -423,6 +448,37 @@ postProcedure({ProcedureViewModel model}) async {
} }
} }
updateProcedure({ProcedureViewModel model, String remarks}) async {
PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List();
List<Procedures> controlsProcedure = List();
updateProcedureReqModel.appointmentNo = 2016054575;
updateProcedureReqModel.episodeID = 200012166;
updateProcedureReqModel.patientMRN = 3120725;
updateProcedureReqModel.vidaAuthTokenID =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI';
controls.add(
Controls(
code: remarks.isEmpty ? '' : remarks,
controlValue: 'Testing',
),
);
controlsProcedure.add(
Procedures(category: "02", procedure: "02011002", controls: controls));
updateProcedureReqModel.procedures = controlsProcedure;
await model.updateProcedure(updateProcedureReqModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated');
}
}
void addSelectedProcedure(context, ProcedureViewModel model) { void addSelectedProcedure(context, ProcedureViewModel model) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
@ -444,14 +500,14 @@ class AddSelectedProcedure extends StatefulWidget {
class _AddSelectedProcedureState extends State<AddSelectedProcedure> { class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
TextEditingController procedureController = TextEditingController(); TextEditingController procedureController = TextEditingController();
List<EntityList> entityList= List(); List<EntityList> entityList = List();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return NetworkBaseView( return NetworkBaseView(
baseViewModel: widget.model, baseViewModel: widget.model,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
//height: 490, height: 790,
child: Padding( child: Padding(
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
child: Column( child: Column(
@ -462,28 +518,28 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
), ),
if (widget.model.categoriesList.length != 0) if (widget.model.categoriesList.length != 0)
EntityListCheckboxSearchWidget( EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model,
masterList: widget.model.categoriesList[0].entityList, masterList: widget.model.categoriesList[0].entityList,
removeHistory: (item){ removeHistory: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
}); });
}, },
addHistory: (history){ addHistory: (history) {
setState(() { setState(() {
entityList.add(history); entityList.add(history);
}); });
}, },
addSelectedHistories: (){ addSelectedHistories: () {
//TODO build your fun herr //TODO build your fun herr
// widget.addSelectedHistories(); // widget.addSelectedHistories();
}, },
isEntityListSelected: (master) => isEntityListSelected(master), isEntityListSelected: (master) =>
), isEntityListSelected(master),
),
SizedBox( SizedBox(
height: 0.0, height: 15.0,
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -493,14 +549,19 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField( child: TextFields(
labelText: 'Add Delected Procedures'.toUpperCase(), hintText: 'Order Type'.toUpperCase(),
borderColor: Colors.white,
textInputType: TextInputType.text,
inputFormatter: ONLY_LETTERS,
controller: procedureController, controller: procedureController,
), ),
), ),
SizedBox(
height: 15.0,
),
TextFields(
hintText: 'Remarks',
minLines: 3,
maxLines: 5,
),
SizedBox( SizedBox(
height: 80.0, height: 80.0,
), ),
@ -510,7 +571,7 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: TranslationBase.of(context).addMedication, title: 'add Selected Procedures'.toUpperCase(),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
postProcedure(model: widget.model); postProcedure(model: widget.model);
@ -528,9 +589,10 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
), ),
); );
} }
bool isEntityListSelected(EntityList masterKey) { bool isEntityListSelected(EntityList masterKey) {
Iterable<EntityList> history = Iterable<EntityList> history = entityList
entityList.where((element) => masterKey.procedureId == element.procedureId); .where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }
@ -538,15 +600,16 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
} }
} }
void updateProcedureForm(context, {String procedureName}) {
ProcedureViewModel procedureViewModel = ProcedureViewModel();
void updateProcedureForm(context) { TextEditingController remarksController = TextEditingController();
TextEditingController orderController = TextEditingController();
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return Container( return Container(
height: 500, height: 400,
child: Form( child: Form(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
@ -554,8 +617,8 @@ void updateProcedureForm(context) {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
'Procedure Name'.toUpperCase(), procedureName.toUpperCase(),
fontWeight: FontWeight.w900, fontWeight: FontWeight.w700,
), ),
SizedBox( SizedBox(
height: 30.0, height: 30.0,
@ -565,11 +628,9 @@ void updateProcedureForm(context) {
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField( child: TextFields(
labelText: 'Order ', hintText: 'Order ',
borderColor: Colors.white, controller: orderController,
textInputType: TextInputType.number,
inputFormatter: ONLY_NUMBERS,
), ),
), ),
SizedBox( SizedBox(
@ -580,16 +641,15 @@ void updateProcedureForm(context) {
borderRadius: BorderRadius.all(Radius.circular(6.0)), borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: HexColor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
child: AppTextFormField( child: TextFields(
labelText: 'Password', hintText: 'Remarks',
borderColor: Colors.white, controller: remarksController,
textInputType: TextInputType.text, maxLines: 5,
inputFormatter: ONLY_LETTERS, minLines: 3,
obscureText: true,
), ),
), ),
SizedBox( SizedBox(
height: 190.0, height: 100.0,
), ),
Container( Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2),
@ -597,9 +657,12 @@ void updateProcedureForm(context) {
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: 'CONTINUE', title: 'Update procedure'.toUpperCase(),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
updateProcedure(
model: procedureViewModel,
remarks: remarksController.text);
// authorizationForm(context); // authorizationForm(context);
}, },
), ),

@ -18,7 +18,6 @@ import 'PatientProfileButton.dart';
*@desc: Profile Medical Info Widget *@desc: Profile Medical Info Widget
*/ */
class ProfileMedicalInfoWidget extends StatelessWidget { class ProfileMedicalInfoWidget extends StatelessWidget {
ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key);
PatiantInformtion patient; PatiantInformtion patient;
@override @override
@ -57,17 +56,17 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
nameLine1: TranslationBase.of(context).lab, nameLine1: TranslationBase.of(context).lab,
nameLine2: TranslationBase.of(context).result, nameLine2: TranslationBase.of(context).result,
icon: 'lab.png'), icon: 'lab.png'),
// PatientProfileButton(
// key: key,
// patient: patient,
// route: PRESCRIPTIONS,
// nameLine1: TranslationBase.of(context).medicines,
// nameLine2: TranslationBase.of(context).prescription,
// icon: 'note.png'),
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
route: PRESCRIPTIONS, route: MEDICAL_FILE,
nameLine1: TranslationBase.of(context).medicines,
nameLine2: TranslationBase.of(context).prescription,
icon: 'note.png'),
PatientProfileButton(
key: key,
patient: patient,
route: RADIOLOGY,
nameLine1: TranslationBase.of(context).previewHealth, nameLine1: TranslationBase.of(context).previewHealth,
nameLine2: TranslationBase.of(context).summaryReport, nameLine2: TranslationBase.of(context).summaryReport,
icon: 'radiology-1.png'), icon: 'radiology-1.png'),

Loading…
Cancel
Save