From 5e6722dde0be43c6d38482901996b504cd9bdb29 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 29 Apr 2020 14:20:06 +0300 Subject: [PATCH] finsih vital sign desing --- lib/models/patient/vital_sign_req_model.dart | 2 +- lib/models/patient/vital_sign_res_model.dart | 114 +++++++++--------- .../patients/patient_search_screen.dart | 80 ++++++------ .../profile/vital_sign/vital_sign_screen.dart | 77 ++++++++---- lib/widgets/auth/login_form.dart | 2 +- 5 files changed, 150 insertions(+), 125 deletions(-) diff --git a/lib/models/patient/vital_sign_req_model.dart b/lib/models/patient/vital_sign_req_model.dart index 0c3592b8..ddd1f7d2 100644 --- a/lib/models/patient/vital_sign_req_model.dart +++ b/lib/models/patient/vital_sign_req_model.dart @@ -59,7 +59,7 @@ class VitalSignReqModel { final Map data = new Map(); data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; - data['InOutpatientType'] = this.inOutpatientType; + data['InOutPatientType'] = this.inOutpatientType; data['TransNo'] = this.transNo; data['LanguageID'] = this.languageID; data['stamp'] = this.stamp; diff --git a/lib/models/patient/vital_sign_res_model.dart b/lib/models/patient/vital_sign_res_model.dart index 5d0eabff..70aa135b 100644 --- a/lib/models/patient/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign_res_model.dart @@ -1,65 +1,65 @@ class VitalSignResModel { - int transNo; - Null projectID; - int weightKg; - int heightCm; + var transNo; + var projectID; + var weightKg; + var heightCm; var temperatureCelcius; - int pulseBeatPerMinute; - int respirationBeatPerMinute; - int bloodPressureLower; - int bloodPressureHigher; - int sAO2; - int fIO2; - Null painScore; + var pulseBeatPerMinute; + var respirationBeatPerMinute; + var bloodPressureLower; + var bloodPressureHigher; + var sAO2; + var fIO2; + var painScore; var bodyMassIndex; - int headCircumCm; - int leanBodyWeightLbs; - int idealBodyWeightLbs; - int temperatureCelciusMethod; - int pulseRhythm; - int respirationPattern; - Null bloodPressureCuffLocation; - Null bloodPressureCuffSize; - Null bloodPressurePatientPosition; - String painLocation; - String painDuration; - String painCharacter; - String painFrequency; + var headCircumCm; + var leanBodyWeightLbs; + var idealBodyWeightLbs; + var temperatureCelciusMethod; + var pulseRhythm; + var respirationPattern; + var bloodPressureCuffLocation; + var bloodPressureCuffSize; + var bloodPressurePatientPosition; + var painLocation; + var painDuration; + var painCharacter; + var painFrequency; bool isPainManagementDone; - int status; + var status; bool isVitalsRequired; - int patientID; - String createdOn; - int doctorID; - int clinicID; - Null triageCategory; - Null gCScore; - Null lineItemNo; - Null vitalSignDate; - Null actualTimeTaken; - Null sugarLevel; - Null fBS; - Null rBS; - Null observationType; - Null heartRate; - Null muscleTone; - Null reflexIrritability; - Null bodyColor; - Null isFirstAssessment; - Null dateofBirth; - Null timeOfBirth; - String bloodPressure; - String bloodPressureCuffLocationDesc; - String bloodPressureCuffSizeDesc; - String bloodPressurePatientPositionDesc; - String clinicName; - String doctorImageURL; - String doctorName; - String painScoreDesc; - String pulseRhythmDesc; - String respirationPatternDesc; - String temperatureCelciusMethodDesc; - Null time; + var patientID; + var createdOn; + var doctorID; + var clinicID; + var triageCategory; + var gCScore; + var lineItemNo; + var vitalSignDate; + var actualTimeTaken; + var sugarLevel; + var fBS; + var rBS; + var observationType; + var heartRate; + var muscleTone; + var reflexIrritability; + var bodyColor; + var isFirstAssessment; + var dateofBirth; + var timeOfBirth; + var bloodPressure; + var bloodPressureCuffLocationDesc; + var bloodPressureCuffSizeDesc; + var bloodPressurePatientPositionDesc; + var clinicName; + var doctorImageURL; + var doctorName; + var painScoreDesc; + var pulseRhythmDesc; + var respirationPatternDesc; + var temperatureCelciusMethodDesc; + var time; VitalSignResModel( {this.transNo, diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 78b9abea..c900a2ff 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -37,8 +37,8 @@ class _PatientSearchScreenState extends State { var _patientSearchFormValues = PatientModel( ProjectID: 15, - ClinicID: 0, - DoctorID: 4709, + ClinicID: 90, + DoctorID: 145642, FirstName: "0", MiddleName: "0", LastName: "0", @@ -57,22 +57,21 @@ class _PatientSearchScreenState extends State { IsLoginForDoctorApp: true, PatientOutSA: false); - void _validateInputs() { - print("####IBRAHIM TEST#####"+_patientSearchFormValues.From); + void _validateInputs() async { + print("####IBRAHIM TEST#####" + _patientSearchFormValues.From); // _patientSearchFormValues.TokenID = if (_formKey.currentState.validate()) { // If all data are correct then save data to out variables - // _formKey.currentState.save(); - - sharedPref.getString(TOKEN).then((token) { - _patientSearchFormValues.TokenID = '@dm!n'; - _patientSearchFormValues.ProjectID= 15; - // print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); - Navigator.of(context).pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType - }); + // _formKey.currentState.save(); + String token = await sharedPref.getString(TOKEN); + int projectID = await sharedPref.getInt(PROJECT_ID); + _patientSearchFormValues.TokenID = token; + _patientSearchFormValues.ProjectID = projectID; + // print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": _selectedType }); } else { // If all data are not valid then start auto validation. @@ -169,41 +168,38 @@ class _PatientSearchScreenState extends State { height: 10, ), AppTextFormField( - hintText: 'First Name', - onSaved: (value) { - _patientSearchFormValues.FirstName = value; - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS - ), + hintText: 'First Name', + onSaved: (value) { + _patientSearchFormValues.FirstName = value; + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), SizedBox( height: 10, ), AppTextFormField( - hintText: 'Middle Name', - onSaved: (value) { - _patientSearchFormValues.MiddleName = value; - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS - ), + hintText: 'Middle Name', + onSaved: (value) { + _patientSearchFormValues.MiddleName = value; + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), SizedBox( height: 10, ), AppTextFormField( - hintText: 'Last Name', - onSaved: (value) { - _patientSearchFormValues.LastName = value; - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS - ), + hintText: 'Last Name', + onSaved: (value) { + _patientSearchFormValues.LastName = value; + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), SizedBox( height: 10, ), @@ -225,7 +221,7 @@ class _PatientSearchScreenState extends State { AppTextFormField( textInputType: TextInputType.number, hintText: 'Patiant ID', - // + // inputFormatter: ONLY_NUMBERS, onSaved: (value) { _patientSearchFormValues.PatientID = 89000; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart index ab36a618..80a0ff7d 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart @@ -38,22 +38,20 @@ class _VitalSignScreenState extends State { *@return: *@desc: getVitalSignList Function */ - getVitalSignList(context) { + getVitalSignList(context) async { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - sharedPref.getString(TOKEN).then((token) { - VitalSignReqModel vitalSignReqModel = VitalSignReqModel( - patientID: 1237159, //patient.patientId, - projectID: 12, //patient.projectId, - tokenID: '@dm!n', + String token = await sharedPref.getString(TOKEN); + VitalSignReqModel vitalSignReqModel = VitalSignReqModel( + patientID: patient.patientId, + projectID: patient.projectId, + tokenID: token, patientTypeID: patient.patientType, - inOutpatientType: 2, + inOutpatientType: 1, languageID: 2, - transNo: 0, - ); - //patient.admissionNo != null ? int.parse(patient.admissionNo) : 0); - patientsProv.getPatientVitalSign(vitalSignReqModel.toJson()); - }); + transNo: + patient.admissionNo != null ? int.parse(patient.admissionNo) : 0); + patientsProv.getPatientVitalSign(vitalSignReqModel.toJson()); } @override @@ -70,6 +68,8 @@ class _VitalSignScreenState extends State { Widget build(BuildContext context) { return AppScaffold( appBarTitle: "VITAL SIGN", + showAppDrawer: false, + showBottomBar: false, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError @@ -87,6 +87,11 @@ class _VitalSignScreenState extends State { ), ) : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), child: ListView.builder( itemCount: patientsProv.patientVitalSignList.length, itemBuilder: (BuildContext ctxt, int index) { @@ -95,18 +100,42 @@ class _VitalSignScreenState extends State { widget: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - 'DoctorName - ${patientsProv.patientVitalSignList[index].doctorName}', - fontSize: 2.5 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 8, - ), - AppText('painScoreDesc - ${patientsProv.patientVitalSignList[index].painScoreDesc}', - fontSize: - 2.5 * SizeConfig.textMultiplier), - SizedBox( - height: 8, + Row( + children: [ + CircleAvatar( + radius: + SizeConfig.imageSizeMultiplier * + 12, + backgroundImage: NetworkImage( + patientsProv + .patientVitalSignList[index] + .doctorImageURL), + backgroundColor: Colors.transparent, + ), + Padding( + padding: const EdgeInsets.fromLTRB(8,0,0,0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + '${patientsProv.patientVitalSignList[index].doctorName}', + fontSize: 2.5 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 8, + ), + AppText( + ' ${patientsProv.patientVitalSignList[index].clinicName}', + fontSize: 2.5 * + SizeConfig.textMultiplier), + SizedBox( + height: 8, + ), + ], + ), + ) + ], ), ], ), diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index a15b019e..f20cb0f3 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -99,7 +99,7 @@ class _LoginFormState extends State { controller: projectIdController, onTap: () { helpers.showCupertinoPicker( - context, projectsList, 'Desciption', onSelectProject); + context, projectsList, 'Name', onSelectProject); }, showCursor: false, readOnly: true,