Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into clinic_list
Conflicts: lib/screens/patients/patients_screen.dartmerge-requests/354/head
commit
e7d1a6c805
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,64 @@
|
|||||||
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||||
|
|
||||||
|
class PatientMuseResultsModel {
|
||||||
|
int rowID;
|
||||||
|
String setupID;
|
||||||
|
int projectID;
|
||||||
|
String orderNo;
|
||||||
|
int lineItemNo;
|
||||||
|
int patientType;
|
||||||
|
int patientID;
|
||||||
|
String procedureID;
|
||||||
|
dynamic reportData;
|
||||||
|
String imageURL;
|
||||||
|
String createdBy;
|
||||||
|
String createdOn;
|
||||||
|
DateTime createdOnDateTime;
|
||||||
|
|
||||||
|
PatientMuseResultsModel(
|
||||||
|
{this.rowID,
|
||||||
|
this.setupID,
|
||||||
|
this.projectID,
|
||||||
|
this.orderNo,
|
||||||
|
this.lineItemNo,
|
||||||
|
this.patientType,
|
||||||
|
this.patientID,
|
||||||
|
this.procedureID,
|
||||||
|
this.reportData,
|
||||||
|
this.imageURL,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdOn});
|
||||||
|
|
||||||
|
PatientMuseResultsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
rowID = json['RowID'];
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
orderNo = json['OrderNo'];
|
||||||
|
lineItemNo = json['LineItemNo'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
procedureID = json['ProcedureID'];
|
||||||
|
reportData = json['ReportData'];
|
||||||
|
imageURL = json['ImageURL'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
createdOnDateTime = DateUtils.getDateTimeFromServerFormat(json['CreatedOn']);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['RowID'] = this.rowID;
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['OrderNo'] = this.orderNo;
|
||||||
|
data['LineItemNo'] = this.lineItemNo;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['ProcedureID'] = this.procedureID;
|
||||||
|
data['ReportData'] = this.reportData;
|
||||||
|
data['ImageURL'] = this.imageURL;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||||
|
|
||||||
|
class PatientMuseService extends BaseService {
|
||||||
|
List<PatientMuseResultsModel> patientMuseResultsModelList = List();
|
||||||
|
|
||||||
|
getECGPatient({int patientType, int patientOutSA,int patientID}) async {
|
||||||
|
Map<String,dynamic> body = Map();
|
||||||
|
body['PatientType'] = patientType;
|
||||||
|
body['PatientOutSA'] = patientOutSA;
|
||||||
|
body['PatientID'] = patientID;
|
||||||
|
await baseAppClient.post(
|
||||||
|
GET_ECG,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
patientMuseResultsModelList.clear();
|
||||||
|
response['HIS_GetPatientMuseResultsList'].forEach((v) {
|
||||||
|
patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
body: body,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/service/PatientMuseService.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||||
|
|
||||||
|
import '../../locator.dart';
|
||||||
|
|
||||||
|
class PatientMuseViewModel extends BaseViewModel {
|
||||||
|
|
||||||
|
PatientMuseService _patientMuseService = locator<PatientMuseService>();
|
||||||
|
|
||||||
|
List<PatientMuseResultsModel> get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList;
|
||||||
|
|
||||||
|
getECGPatient({int patientType, int patientOutSA, int patientID}) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _patientMuseService.getECGPatient(
|
||||||
|
patientID: patientID,
|
||||||
|
patientOutSA: patientOutSA,
|
||||||
|
patientType: patientType);
|
||||||
|
if (_patientMuseService.hasError) {
|
||||||
|
error = _patientMuseService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.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/date-utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
class ECGPage extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||||
|
PatiantInformtion patient = routeArgs['patient'];
|
||||||
|
|
||||||
|
return BaseView<PatientMuseViewModel>(
|
||||||
|
onModelReady: (model) => model.getECGPatient(
|
||||||
|
patientType: patient.patientType,
|
||||||
|
patientOutSA: 0,
|
||||||
|
patientID: patient.patientId),
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: true,
|
||||||
|
appBarTitle: 'ECG',
|
||||||
|
body: ListView.builder(
|
||||||
|
itemCount: model.patientMuseResultsModelList.length,
|
||||||
|
itemBuilder: (context, index) => InkWell(
|
||||||
|
onTap: () async {
|
||||||
|
await launch(
|
||||||
|
model.patientMuseResultsModelList[index].imageURL);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.grey,width: 2)
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
"${model.patientMuseResultsModelList[index].createdOnDateTime}"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,133 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
||||||
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
|
||||||
|
class ShowSickLeaveScreen extends StatelessWidget {
|
||||||
|
PatiantInformtion patient;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||||
|
patient = routeArgs['patient'];
|
||||||
|
return BaseView<SickLeaveViewModel>(
|
||||||
|
onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId),
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
appBarTitle: TranslationBase.of(context).sickleave,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
PatientPageHeaderWidget(patient),
|
||||||
|
Column(
|
||||||
|
children: model.getAllSIckLeave
|
||||||
|
.map<Widget>((GetAllSickLeaveResponse item) {
|
||||||
|
return CardWithBgWidgetNew(
|
||||||
|
widget: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left: 10, right: 10),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Wrap(
|
||||||
|
// mainAxisAlignment:
|
||||||
|
// MainAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(3),
|
||||||
|
child: AppText(
|
||||||
|
item.status == 1
|
||||||
|
? TranslationBase.of(context)
|
||||||
|
.hold
|
||||||
|
: item.status == 2
|
||||||
|
? TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.active
|
||||||
|
: TranslationBase.of(
|
||||||
|
context)
|
||||||
|
.all,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
color: item.status == 1
|
||||||
|
? Colors.yellow[800]
|
||||||
|
: item.status == 2
|
||||||
|
? Colors.green
|
||||||
|
: Colors.black,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AppText(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.leaveStartDate +
|
||||||
|
' ',
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
item.startDate,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
AppText(
|
||||||
|
item.noOfDays.toString() +
|
||||||
|
' ' +
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.daysSickleave,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
Row(children: [
|
||||||
|
AppText(
|
||||||
|
item.remarks ?? "",
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 1,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}).toList(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue