|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/master_lookup_key.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/master_key_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_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/shared/Text.dart';
|
|
|
|
@ -49,7 +51,9 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
|
// onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
@ -161,7 +165,12 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
0.070,
|
|
|
|
|
decoration:
|
|
|
|
|
containerBorderDecoration(
|
|
|
|
|
Colors.white,
|
|
|
|
|
examination
|
|
|
|
|
.isNormal
|
|
|
|
|
? Color(
|
|
|
|
|
0xFF515A5D)
|
|
|
|
|
: Colors
|
|
|
|
|
.white,
|
|
|
|
|
Colors.grey),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
@ -173,17 +182,28 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color:
|
|
|
|
|
Colors.black,
|
|
|
|
|
examination
|
|
|
|
|
.isNormal
|
|
|
|
|
? Colors.white
|
|
|
|
|
: Colors
|
|
|
|
|
.black,
|
|
|
|
|
//Colors.black,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {}),
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
examination.isAbnormal =
|
|
|
|
|
!examination.isAbnormal;
|
|
|
|
|
examination.isNormal =
|
|
|
|
|
!examination.isNormal;
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 12,
|
|
|
|
|
),
|
|
|
|
@ -191,33 +211,49 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
height:
|
|
|
|
|
screenSize.height *
|
|
|
|
|
0.070,
|
|
|
|
|
screenSize.height *
|
|
|
|
|
0.070,
|
|
|
|
|
decoration:
|
|
|
|
|
containerBorderDecoration(
|
|
|
|
|
Color(0xFF515A5D),
|
|
|
|
|
Colors.black),
|
|
|
|
|
containerBorderDecoration(
|
|
|
|
|
examination
|
|
|
|
|
.isAbnormal
|
|
|
|
|
? Color(
|
|
|
|
|
0xFF515A5D)
|
|
|
|
|
: Colors
|
|
|
|
|
.white,
|
|
|
|
|
Colors.black),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets
|
|
|
|
|
.all(8.0),
|
|
|
|
|
const EdgeInsets
|
|
|
|
|
.all(8.0),
|
|
|
|
|
child: Text(
|
|
|
|
|
"Abnormal",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color:
|
|
|
|
|
Colors.white,
|
|
|
|
|
examination
|
|
|
|
|
.isAbnormal
|
|
|
|
|
? Colors.white
|
|
|
|
|
: Colors
|
|
|
|
|
.black,
|
|
|
|
|
//Colors.black,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {}),
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
examination.isAbnormal =
|
|
|
|
|
!examination.isAbnormal;
|
|
|
|
|
examination.isNormal =
|
|
|
|
|
!examination.isNormal;
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
@ -267,9 +303,11 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
),
|
|
|
|
|
DividerWithSpacesAround(height: 30,),
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(context).next,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
widget.changePageViewIndex(2);
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.next,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
await submitObjectivePage(model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
@ -279,7 +317,43 @@ class _ObjectivePageState extends State<ObjectivePage> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submitObjectivePage(SOAPViewModel model) async {
|
|
|
|
|
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
|
|
|
|
|
widget.mySelectedExamination.forEach((exam) {
|
|
|
|
|
if (postPhysicalExamRequestModel.listHisProgNotePhysicalVM ==
|
|
|
|
|
null)
|
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalVM = [];
|
|
|
|
|
|
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalVM.add(
|
|
|
|
|
ListHisProgNotePhysicalVM(
|
|
|
|
|
patientMRN: 3120690,
|
|
|
|
|
episodeId: 200012117,
|
|
|
|
|
appointmentNo: 2016054573,
|
|
|
|
|
remarks: exam.remark ?? '',
|
|
|
|
|
createdBy: 1485,
|
|
|
|
|
createdOn: DateTime.now().toIso8601String(),
|
|
|
|
|
editedBy: 1485,
|
|
|
|
|
editedOn: DateTime.now().toIso8601String(),
|
|
|
|
|
examId: exam.selectedExamination.id,
|
|
|
|
|
examType: exam.selectedExamination.typeId,
|
|
|
|
|
isAbnormal: exam.isAbnormal,
|
|
|
|
|
isNormal: exam.isNormal,
|
|
|
|
|
masterDescription: exam.selectedExamination,
|
|
|
|
|
));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await model.postPhysicalExam(postPhysicalExamRequestModel);
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
// TODO move it back to else stat when it work.
|
|
|
|
|
widget.changePageViewIndex(2);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
removeExamination(MasterKeyModel masterKey) {
|
|
|
|
|