Merge branch 'point10' into 'development'
Point10 See merge request Cloud_Solution/doctor_app_flutter!950merge-requests/951/merge
commit
fec10319bf
@ -0,0 +1,22 @@
|
||||
class VteAssessmentRequestModel {
|
||||
String setupID;
|
||||
int parameterGroup;
|
||||
int transactionNo;
|
||||
|
||||
VteAssessmentRequestModel(
|
||||
{this.setupID = "010266", this.parameterGroup = 7, this.transactionNo});
|
||||
|
||||
VteAssessmentRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
setupID = json['SetupID'];
|
||||
parameterGroup = json['ParameterGroup'];
|
||||
transactionNo = json['TransactionNo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['SetupID'] = this.setupID;
|
||||
data['ParameterGroup'] = this.parameterGroup;
|
||||
data['TransactionNo'] = this.transactionNo;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
class VteAssessmentResponseModel {
|
||||
int lineItemNo;
|
||||
String vTEType;
|
||||
String ambulationProtocol;
|
||||
String pharmacology;
|
||||
String reasonsThrombo;
|
||||
String riskScore;
|
||||
int totalScore;
|
||||
int createdBy;
|
||||
String createdOn;
|
||||
|
||||
VteAssessmentResponseModel(
|
||||
{this.lineItemNo,
|
||||
this.vTEType,
|
||||
this.ambulationProtocol,
|
||||
this.pharmacology,
|
||||
this.reasonsThrombo,
|
||||
this.riskScore,
|
||||
this.totalScore,
|
||||
this.createdBy,
|
||||
this.createdOn});
|
||||
|
||||
VteAssessmentResponseModel.fromJson(Map<String, dynamic> json) {
|
||||
lineItemNo = json['LineItemNo'];
|
||||
vTEType = json['VTE_Type'];
|
||||
ambulationProtocol = json['AmbulationProtocol'];
|
||||
pharmacology = json['Pharmacology'];
|
||||
reasonsThrombo = json['ReasonsThrombo'];
|
||||
riskScore = json['Risk_Score'];
|
||||
totalScore = json['Total_Score'];
|
||||
createdBy = json['Created_By'];
|
||||
createdOn = json['Created_On'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['LineItemNo'] = this.lineItemNo;
|
||||
data['VTE_Type'] = this.vTEType;
|
||||
data['AmbulationProtocol'] = this.ambulationProtocol;
|
||||
data['Pharmacology'] = this.pharmacology;
|
||||
data['ReasonsThrombo'] = this.reasonsThrombo;
|
||||
data['Risk_Score'] = this.riskScore;
|
||||
data['Total_Score'] = this.totalScore;
|
||||
data['Created_By'] = this.createdBy;
|
||||
data['Created_On'] = this.createdOn;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
import 'package:doctor_app_flutter/config/config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart';
|
||||
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
|
||||
|
||||
class VteAssessmentService extends BaseService {
|
||||
|
||||
List<VteAssessmentResponseModel> _allVteHistoryList = [];
|
||||
|
||||
List<VteAssessmentResponseModel> get allVteHistoryList =>
|
||||
_allVteHistoryList;
|
||||
Future getVteAssessment(
|
||||
{VteAssessmentRequestModel vteAssessmentRequestModel}) async {
|
||||
hasError = false;
|
||||
await baseAppClient.post(VTE_ASSESSMENT,
|
||||
onSuccess: (dynamic response, int statusCode) {
|
||||
_allVteHistoryList.clear();
|
||||
response['INP_VTEHistoryByTransactionNo_List'].forEach(
|
||||
(v) {
|
||||
_allVteHistoryList.add(VteAssessmentResponseModel.fromJson(v));
|
||||
},
|
||||
);
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: vteAssessmentRequestModel.toJson());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
||||
import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_req_model.dart';
|
||||
import 'package:doctor_app_flutter/core/model/vte_assessment/vte_assessment_res_model.dart';
|
||||
import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart';
|
||||
import 'package:doctor_app_flutter/core/service/patient/profile/vte_assessment_service.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
|
||||
import 'package:doctor_app_flutter/locator.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryReqModel.dart';
|
||||
import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryResModel.dart';
|
||||
|
||||
class VteAssessmentViewModel extends BaseViewModel {
|
||||
bool hasError = false;
|
||||
VteAssessmentService _VteAssessmentService =
|
||||
locator<VteAssessmentService>();
|
||||
|
||||
List<VteAssessmentResponseModel> get allVteHistoryList =>
|
||||
_VteAssessmentService.allVteHistoryList;
|
||||
|
||||
Future getVteAssessment({
|
||||
int patientId,
|
||||
int admissionNo,
|
||||
}) async {
|
||||
VteAssessmentRequestModel vteAssessmentRequestModel =
|
||||
VteAssessmentRequestModel(
|
||||
transactionNo: admissionNo);
|
||||
hasError = false;
|
||||
setState(ViewState.Busy);
|
||||
await _VteAssessmentService.getVteAssessment(
|
||||
vteAssessmentRequestModel: vteAssessmentRequestModel);
|
||||
if (_VteAssessmentService.hasError) {
|
||||
error = _VteAssessmentService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else {
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,282 @@
|
||||
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
||||
import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/profile/vte_assessment_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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/util/dr_app_shared_pref.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.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_bg_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
|
||||
class VteAssessmentScreen extends StatefulWidget {
|
||||
const VteAssessmentScreen({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ProgressNoteState createState() => _ProgressNoteState();
|
||||
}
|
||||
|
||||
class _ProgressNoteState extends State<VteAssessmentScreen> {
|
||||
bool isDischargedPatient = false;
|
||||
AuthenticationViewModel authenticationViewModel;
|
||||
ProjectViewModel projectViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
authenticationViewModel = Provider.of(context);
|
||||
projectViewModel = Provider.of(context);
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
if (routeArgs.containsKey('isDischargedPatient'))
|
||||
isDischargedPatient = routeArgs['isDischargedPatient'];
|
||||
return BaseView<VteAssessmentViewModel>(
|
||||
onModelReady: (model) => model.getVteAssessment(patientId: patient.patientId,
|
||||
admissionNo: 2016023498
|
||||
|
||||
// admissionNo:int.parse(patient.admissionNo)
|
||||
),
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
isInpatient: true,
|
||||
),
|
||||
body: model.allVteHistoryList == null ||
|
||||
model.allVteHistoryList.length == 0
|
||||
? Center(
|
||||
child: ErrorMessage(
|
||||
error: TranslationBase.of(context).noDataAvailable,
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
color: Colors.grey[200],
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: ListView.builder(
|
||||
itemCount: model.allVteHistoryList.length,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return FractionallySizedBox(
|
||||
widthFactor: 0.95,
|
||||
child: CardWithBgWidget(
|
||||
hasBorder: false,
|
||||
bgColor: Colors.transparent,
|
||||
widget: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.60,
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
children: [
|
||||
AppText(
|
||||
model
|
||||
.allVteHistoryList[
|
||||
index].riskScore,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
AppText(
|
||||
model
|
||||
.allVteHistoryList[
|
||||
index]
|
||||
.createdOn !=
|
||||
null
|
||||
? AppDateUtils.getDayMonthYearDateFormatted(
|
||||
AppDateUtils
|
||||
.getDateTimeFromString(model
|
||||
.allVteHistoryList[
|
||||
index]
|
||||
.createdOn),
|
||||
isArabic:
|
||||
projectViewModel
|
||||
.isArabic,
|
||||
isMonthShort: true)
|
||||
: AppDateUtils
|
||||
.getDayMonthYearDateFormatted(
|
||||
DateTime.now(),
|
||||
isArabic:
|
||||
projectViewModel
|
||||
.isArabic),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
isCopyable: true,
|
||||
),
|
||||
AppText(
|
||||
model
|
||||
.allVteHistoryList[
|
||||
index]
|
||||
.createdOn !=
|
||||
null
|
||||
? AppDateUtils.getHour(
|
||||
AppDateUtils
|
||||
.getDateTimeFromString(model
|
||||
.allVteHistoryList[
|
||||
index]
|
||||
.createdOn))
|
||||
: AppDateUtils.getHour(
|
||||
DateTime.now()),
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 14,
|
||||
isCopyable: true,
|
||||
),
|
||||
],
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
)
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.VTE_Type +
|
||||
" : ",
|
||||
fontSize: 12,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model
|
||||
.allVteHistoryList[
|
||||
index]
|
||||
.vTEType,
|
||||
fontSize: 12,
|
||||
isCopyable: true,
|
||||
),
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.pharmacology +
|
||||
" : ",
|
||||
fontSize: 12,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model
|
||||
.allVteHistoryList[
|
||||
index]
|
||||
.pharmacology,
|
||||
fontSize: 12,
|
||||
isCopyable: true,
|
||||
),
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context)
|
||||
.reasonsThrombo +
|
||||
" : ",
|
||||
fontSize: 12,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model
|
||||
.allVteHistoryList[
|
||||
index]
|
||||
.reasonsThrombo,
|
||||
fontSize: 12,
|
||||
isCopyable: true,
|
||||
),
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"Ambulation Protocol : ",
|
||||
fontSize: 12,
|
||||
),
|
||||
Expanded(
|
||||
child: AppText(
|
||||
model
|
||||
.allVteHistoryList[
|
||||
index]
|
||||
.ambulationProtocol,
|
||||
fontSize: 12,
|
||||
isCopyable: true,
|
||||
),
|
||||
),
|
||||
])
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue