Merge branch 'outpatient_referral_change' into 'development'

outpatirnt referral changes

See merge request Cloud_Solution/doctor_app_flutter!762
merge-requests/761/merge
Mohammad Aljammal 5 years ago
commit b1f3cf3ece

@ -322,6 +322,7 @@ class PatientReferralViewModel extends BaseViewModel {
patient.doctorId = referredPatient.doctorID; patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName; patient.doctorName = referredPatient.doctorName;
patient.patientId = referredPatient.patientID; patient.patientId = referredPatient.patientID;
patient.patientMRN = referredPatient.patientID;
patient.firstName = referredPatient.firstName; patient.firstName = referredPatient.firstName;
patient.middleName = referredPatient.middleName; patient.middleName = referredPatient.middleName;
patient.lastName = referredPatient.lastName; patient.lastName = referredPatient.lastName;
@ -339,6 +340,8 @@ class PatientReferralViewModel extends BaseViewModel {
patient.nationalityFlagURL = referredPatient.nationalityFlagURL; patient.nationalityFlagURL = referredPatient.nationalityFlagURL;
patient.age = referredPatient.age; patient.age = referredPatient.age;
patient.clinicDescription = referredPatient.clinicDescription; patient.clinicDescription = referredPatient.clinicDescription;
patient.appointmentNo = referredPatient.appointmentNo;
return patient; return patient;
} }

@ -12,8 +12,13 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ReferredPatientScreen extends StatelessWidget { class ReferredPatientScreen extends StatefulWidget {
@override
_ReferredPatientScreenState createState() => _ReferredPatientScreenState();
}
class _ReferredPatientScreenState extends State<ReferredPatientScreen> {
PatientType patientType = PatientType.IN_PATIENT; PatientType patientType = PatientType.IN_PATIENT;
@override @override
@ -30,7 +35,9 @@ class ReferredPatientScreen extends StatelessWidget {
margin: EdgeInsets.only(top: 70), margin: EdgeInsets.only(top: 70),
child: PatientTypeRadioWidget( child: PatientTypeRadioWidget(
(patientType) async { (patientType) async {
this.patientType = patientType; setState(() {
this.patientType = patientType;
});
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (patientType == PatientType.IN_PATIENT) { if (patientType == PatientType.IN_PATIENT) {
await model.getMyReferredPatient(isFirstTime: false); await model.getMyReferredPatient(isFirstTime: false);
@ -75,7 +82,7 @@ class ReferredPatientScreen extends StatelessWidget {
context, context,
FadePage( FadePage(
page: ReferredPatientDetailScreen( page: ReferredPatientDetailScreen(
model.getReferredPatientItem(index)), model.getReferredPatientItem(index), this.patientType),
), ),
); );
}, },

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/PatientType.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
@ -18,8 +19,9 @@ import '../../../../routes.dart';
class ReferredPatientDetailScreen extends StatelessWidget { class ReferredPatientDetailScreen extends StatelessWidget {
final MyReferredPatientModel referredPatient; final MyReferredPatientModel referredPatient;
final PatientType patientType;
ReferredPatientDetailScreen(this.referredPatient); ReferredPatientDetailScreen(this.referredPatient, this.patientType);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -74,7 +76,8 @@ class ReferredPatientDetailScreen extends StatelessWidget {
.pushNamed(PATIENTS_PROFILE, arguments: { .pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient, "patient": patient,
"patientType": "1", "patientType": "1",
"isInpatient": true, "isInpatient":
patientType == PatientType.IN_PATIENT,
"arrivalType": "1", "arrivalType": "1",
"from": AppDateUtils.convertDateToFormat( "from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'), DateTime.now(), 'yyyy-MM-dd'),
@ -93,14 +96,15 @@ class ReferredPatientDetailScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
InkWell( InkWell(
onTap: (){ onTap: () {
PatiantInformtion patient = PatiantInformtion patient =
model.getPatientFromReferral(referredPatient); model.getPatientFromReferral(referredPatient);
Navigator.of(context) Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: { .pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patient, "patient": patient,
"patientType": "1", "patientType": "1",
"isInpatient": true, "isInpatient":
patientType == PatientType.IN_PATIENT,
"arrivalType": "1", "arrivalType": "1",
"from": AppDateUtils.convertDateToFormat( "from": AppDateUtils.convertDateToFormat(
DateTime.now(), 'yyyy-MM-dd'), DateTime.now(), 'yyyy-MM-dd'),
@ -236,36 +240,37 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
], ],
), ),
if(referredPatient if (referredPatient
.frequencyDescription != null) .frequencyDescription !=
Row( null)
mainAxisAlignment: Row(
MainAxisAlignment.start, mainAxisAlignment:
crossAxisAlignment: MainAxisAlignment.start,
CrossAxisAlignment.start, crossAxisAlignment:
children: [ CrossAxisAlignment.start,
AppText( children: [
TranslationBase.of(context) AppText(
.frequency + TranslationBase.of(context)
": ", .frequency +
fontFamily: 'Poppins', ": ",
fontWeight: FontWeight.w600,
fontSize: 1.7 *
SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient
.frequencyDescription,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 1.7 *
color: Color(0XFF2E303A), SizeConfig.textMultiplier,
color: Color(0XFF575757),
), ),
), Expanded(
], child: AppText(
), referredPatient
.frequencyDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
color: Color(0XFF2E303A),
),
),
],
),
], ],
), ),
), ),
@ -303,56 +308,65 @@ class ReferredPatientDetailScreen extends StatelessWidget {
) )
], ],
), ),
if(referredPatient.priorityDescription != null) if (referredPatient.priorityDescription != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
children: [ CrossAxisAlignment.start,
AppText( children: [
TranslationBase.of(context).priority + AppText(
": ", TranslationBase.of(context).priority +
fontFamily: 'Poppins', ": ",
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
referredPatient.priorityDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
color: Color(0XFF2E303A),
),
],
),
if(referredPatient.mAXResponseTime != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.maxResponseTime +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.mAXResponseTime != null?AppDateUtils.convertDateFromServerFormat(
referredPatient.mAXResponseTime,
"dd MMM,yyyy"):'',
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w600,
fontSize: fontSize:
1.8 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
AppText(
referredPatient.priorityDescription,
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize: 14,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
), ],
], ),
), if (referredPatient.mAXResponseTime != null)
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.maxResponseTime +
": ",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize:
1.7 * SizeConfig.textMultiplier,
color: Color(0XFF575757),
),
Expanded(
child: AppText(
referredPatient.mAXResponseTime !=
null
? AppDateUtils
.convertDateFromServerFormat(
referredPatient
.mAXResponseTime,
"dd MMM,yyyy")
: '',
fontFamily: 'Poppins',
fontWeight: FontWeight.w700,
fontSize:
1.8 * SizeConfig.textMultiplier,
color: Color(0XFF2E303A),
),
),
],
),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -518,11 +532,15 @@ class ReferredPatientDetailScreen extends StatelessWidget {
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
AppText( AppText(
referredPatient referredPatient.referredDoctorRemarks ==
.referredDoctorRemarks == null ?'':referredPatient null
.referredDoctorRemarks.isNotEmpty ? ''
? referredPatient.referredDoctorRemarks : referredPatient.referredDoctorRemarks
: TranslationBase.of(context).notRepliedYet, .isNotEmpty
? referredPatient
.referredDoctorRemarks
: TranslationBase.of(context)
.notRepliedYet,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 1.6 * SizeConfig.textMultiplier, fontSize: 1.6 * SizeConfig.textMultiplier,
@ -538,6 +556,7 @@ class ReferredPatientDetailScreen extends StatelessWidget {
), ),
), ),
), ),
if (patientType == PatientType.IN_PATIENT)
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: AppButton( child: AppButton(
@ -548,9 +567,11 @@ class ReferredPatientDetailScreen extends StatelessWidget {
fontSize: 1.8, fontSize: 1.8,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
disabled: referredPatient.referredDoctorRemarks == null? true: referredPatient.referredDoctorRemarks.isNotEmpty disabled: referredPatient.referredDoctorRemarks == null
? false ? true
: true, : referredPatient.referredDoctorRemarks.isNotEmpty
? false
: true,
onPressed: () async { onPressed: () async {
await model.verifyReferralDoctorRemarks(referredPatient); await model.verifyReferralDoctorRemarks(referredPatient);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "14.0.0" version: "12.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.41.2" version: "0.40.6"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@ -119,7 +119,7 @@ packages:
name: build_web_compilers name: build_web_compilers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.15.3" version: "2.12.2"
built_collection: built_collection:
dependency: transitive dependency: transitive
description: description:
@ -280,7 +280,7 @@ packages:
name: dart_style name: dart_style
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.12" version: "1.3.10"
date_time_picker: date_time_picker:
dependency: "direct main" dependency: "direct main"
description: description:
@ -629,7 +629,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -921,7 +921,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1119,5 +1119,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.11.0-162.0 <=2.11.0-213.1.beta" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save