|
|
|
@ -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,46 @@ 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)
|
|
|
|
if (int.parse(patientType) == 7)
|
|
|
|
PatientProfileButton(
|
|
|
|
PatientProfileButton(
|
|
|
|
key: key,
|
|
|
|
key: key,
|
|
|
|
patient: patient,
|
|
|
|
patient: patient,
|
|
|
|
|
|
|
|
isDisable: patient.episodeNo != 0 ? true : false,
|
|
|
|
nameLine1: TranslationBase.of(context).createNew,
|
|
|
|
nameLine1: TranslationBase.of(context).createNew,
|
|
|
|
nameLine2: TranslationBase.of(context).episode,
|
|
|
|
nameLine2: TranslationBase.of(context).episode,
|
|
|
|
route: CREATE_EPISODE,
|
|
|
|
route: CREATE_EPISODE,
|
|
|
|
icon: 'create-episod.png'),
|
|
|
|
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)
|
|
|
|
if(int.parse(patientType) ==7)
|
|
|
|
PatientProfileButton(
|
|
|
|
PatientProfileButton(
|
|
|
|
key: key,
|
|
|
|
key: key,
|
|
|
|
patient: patient,
|
|
|
|
patient: patient,
|
|
|
|
nameLine1: TranslationBase.of(context).update,
|
|
|
|
isDisable: patient.episodeNo == 0 ? true : false,
|
|
|
|
nameLine2: TranslationBase.of(context).episode,
|
|
|
|
nameLine1: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.update,
|
|
|
|
|
|
|
|
nameLine2: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.episode,
|
|
|
|
route: UPDATE_EPISODE,
|
|
|
|
route: UPDATE_EPISODE,
|
|
|
|
icon: 'modilfy-episode.png'),
|
|
|
|
icon: 'modilfy-episode.png'),
|
|
|
|
PatientProfileButton(
|
|
|
|
PatientProfileButton(
|
|
|
|
@ -67,7 +93,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
|
|
|
|
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'),
|
|
|
|
if (selectedPatientType != 0 && selectedPatientType != 5)
|
|
|
|
if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7)
|
|
|
|
PatientProfileButton(
|
|
|
|
PatientProfileButton(
|
|
|
|
key: key,
|
|
|
|
key: key,
|
|
|
|
patient: patient,
|
|
|
|
patient: patient,
|
|
|
|
@ -145,7 +171,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
|
|
|
|
.of(context)
|
|
|
|
.of(context)
|
|
|
|
.ucaf,
|
|
|
|
.ucaf,
|
|
|
|
icon: 'lab.png'),
|
|
|
|
icon: 'lab.png'),
|
|
|
|
]);
|
|
|
|
],),);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -205,20 +231,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;
|
|
|
|
|
|
|
|
final Function onTap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PatientProfileButton({Key key,
|
|
|
|
this.patient,
|
|
|
|
this.patient,
|
|
|
|
this.nameLine1,
|
|
|
|
this.nameLine1,
|
|
|
|
this.nameLine2,
|
|
|
|
this.nameLine2,
|
|
|
|
this.icon,
|
|
|
|
this.icon,
|
|
|
|
this.route})
|
|
|
|
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>[
|
|
|
|
@ -242,6 +273,8 @@ class PatientProfileButton extends StatelessWidget {
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
|
|
|
fontSize: SizeConfig.textMultiplier * 2,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
if(isLoading)
|
|
|
|
|
|
|
|
DrAppCircularProgressIndeicator()
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -260,7 +293,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),
|
|
|
|
|