first step form create episode

merge-requests/244/head
Elham Rababah 5 years ago
parent caddbdb53c
commit 4f1a892be4

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

@ -295,7 +295,7 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'},
'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'},
"empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, "empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"},
'no-sickleve-applied': { 'no-sickleve-applied': {
'en': "No sick leave applied", 'en': "No sick leave applied",
'ar': 'لم تطبق إجازة مرضية' '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/GetHistoryResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.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/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/get_Allergies_request_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/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
@ -48,6 +49,18 @@ class SOAPService extends LookupService {
); );
} }
Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async {
hasError = false;
await baseAppClient.post(POST_EPISODE,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: postEpisodeReqModel.toJson());
}
Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
hasError = false; hasError = false;

@ -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/GetHistoryResModel.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.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/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/get_Allergies_request_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/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart';
@ -99,6 +100,17 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); 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 { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.postAllergy(postAllergyRequestModel); await _SOAPService.postAllergy(postAllergyRequestModel);
@ -222,6 +234,7 @@ class SOAPViewModel extends BaseViewModel {
Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientAllergy(generalGetReqForSOAP); await _SOAPService.getPatientAllergy(generalGetReqForSOAP);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {

@ -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/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospital_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/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/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.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/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/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -77,6 +79,25 @@ class _DashboardScreenState extends State<DashboardScreen> {
if (!currentFocus.hasPrimaryFocus) { if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus(); 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>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getDashboard(), onModelReady: (model) => model.getDashboard(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -957,6 +978,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
height: 20, height: 20,
), ),
Row( Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
DashboardItem( DashboardItem(
child: Column( 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"
});
},
) )
], ],
), ),

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

@ -1,92 +1,112 @@
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/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/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/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.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/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PatientPageHeaderWidget extends StatelessWidget { class PatientPageHeaderWidget extends StatelessWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
String allergiesString='';
PatientPageHeaderWidget(this.patient); PatientPageHeaderWidget(this.patient);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return BaseView<SOAPViewModel>(
child: Column( onModelReady: (model) async {
mainAxisAlignment: MainAxisAlignment.start, GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP(
children: [ patientMRN: patient.patientMRN,
Padding( episodeId: patient.episodeNo,
padding: const EdgeInsets.all(8.0), appointmentNo: patient.appointmentNo,
child: Row( doctorID: '',
crossAxisAlignment: CrossAxisAlignment.start, editedBy: '');
mainAxisSize: MainAxisSize.min, await model.getPatientAllergy(generalGetReqForSOAP);
children: <Widget>[ model.patientAllergiesList.forEach((element) {
AvatarWidget( allergiesString += element.allergyDiseaseName+' , ';
Icon( });
patient.genderDescription == "Male" },
? DoctorApp.male builder: (_, model, w) => Container(
: DoctorApp.female_icon, child: Column(
size: 70, mainAxisAlignment: MainAxisAlignment.start,
color: Colors.white, children: [
), Padding(
), padding: const EdgeInsets.all(8.0),
SizedBox( child: Row(
width: 20, crossAxisAlignment: CrossAxisAlignment.start,
), mainAxisSize: MainAxisSize.min,
Expanded( children: <Widget>[
child: Column( AvatarWidget(
crossAxisAlignment: CrossAxisAlignment.start, Icon(
mainAxisAlignment: MainAxisAlignment.start, patient.genderDescription == "Male"
children: [ ? DoctorApp.male
SizedBox( : DoctorApp.female_icon,
height: 5, size: 70,
), color: Colors.white,
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(), SizedBox(
color: Colors.black, width: 20,
fontWeight: FontWeight.normal, ),
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: AppText(
"ALLERGIC TO: $allergiesString",
color: Color(0xFFB9382C),
fontWeight: FontWeight.bold,
),
),
],
), ),
], )
), ],
AppText( ),
"ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", ),
color: Color(0xFFB9382C), Container(
fontWeight: FontWeight.bold, 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/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/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.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/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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -22,26 +28,42 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
String patientType; String patientType;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SliverGrid.count( return BaseView<SOAPViewModel>(
onModelReady: (model) async {},
builder: (_, model, w) => SliverGrid.count(
crossAxisSpacing: 10, crossAxisSpacing: 10,
mainAxisSpacing: 20, mainAxisSpacing: 20,
crossAxisCount: 2, crossAxisCount: 2,
childAspectRatio: 1.5, childAspectRatio: 1.5,
children: [ 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);
},
isLoading: model.state == ViewState.BusyLocal,
icon: 'create-episod.png'
),
if(int.parse(patientType) ==7) if(int.parse(patientType) ==7)
PatientProfileButton( PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
nameLine1: TranslationBase.of(context).createNew, isDisable: patient.episodeNo == 0 ? true : false,
nameLine2: TranslationBase.of(context).episode, nameLine1: TranslationBase
route: CREATE_EPISODE, .of(context)
icon: 'create-episod.png'), .update,
if(int.parse(patientType) ==7) nameLine2: TranslationBase
PatientProfileButton( .of(context)
key: key, .episode,
patient: patient,
nameLine1: TranslationBase.of(context).update,
nameLine2: TranslationBase.of(context).episode,
route: UPDATE_EPISODE, route: UPDATE_EPISODE,
icon: 'modilfy-episode.png'), icon: 'modilfy-episode.png'),
if(selectedPatientType == 6 || selectedPatientType == 7) if(selectedPatientType == 6 || selectedPatientType == 7)
@ -146,7 +168,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
.of(context) .of(context)
.ucaf, .ucaf,
icon: 'lab.png'), icon: 'lab.png'),
]); ],),);
} }
} }
@ -206,20 +228,25 @@ class PatientProfileButton extends StatelessWidget {
final dynamic route; final dynamic route;
final PatiantInformtion patient; final PatiantInformtion patient;
final String url = "assets/images/"; final String url = "assets/images/";
PatientProfileButton( final bool isDisable;
{Key key, final bool isLoading;
this.patient, final Function onTap;
this.nameLine1,
this.nameLine2,
this.icon, PatientProfileButton({Key key,
this.route}) this.patient,
this.nameLine1,
this.nameLine2,
this.icon,
this.route, this.isDisable = false, this.onTap, this.isLoading = false})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0), margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: InkWell( child: InkWell(
onTap: () { onTap: isDisable?null:onTap != null ? onTap : () {
navigator(context, this.route); navigator(context, this.route);
}, },
child: Column(children: <Widget>[ child: Column(children: <Widget>[
@ -243,6 +270,8 @@ class PatientProfileButton extends StatelessWidget {
textAlign: TextAlign.left, textAlign: TextAlign.left,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
), ),
if(isLoading)
DrAppCircularProgressIndeicator()
], ],
), ),
), ),
@ -261,7 +290,7 @@ class PatientProfileButton extends StatelessWidget {
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
// border: Border.all(), // border: Border.all(),
color: Colors.white, color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: Color(0xffBBBBBB), color: Color(0xffBBBBBB),

Loading…
Cancel
Save