finish assessment screen

merge-requests/950/head
Elham Rababh 4 years ago
parent 406165c348
commit af1217dd67

@ -1119,4 +1119,7 @@ const Map<String, Map<String, String>> localizedValues = {
},
"planedProcedure": {"en": "Planed Procedure", "ar": "الإجراء المخطط"},
"moreDetails": {"en": "More Details", "ar": "المزيد من التفاصيل"},
"VTE_Type": {"en": "VTE Type", "ar": "VTE Type"},
"pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"},
"reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"},
};

@ -7,19 +7,19 @@ import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryR
class VteAssessmentService extends BaseService {
List<VteAssessmentResponseModel> _allDischargeSummaryList = [];
List<VteAssessmentResponseModel> _allVteHistoryList = [];
List<VteAssessmentResponseModel> get allDischargeSummaryList =>
_allDischargeSummaryList;
List<VteAssessmentResponseModel> get allVteHistoryList =>
_allVteHistoryList;
Future getVteAssessment(
{VteAssessmentRequestModel vteAssessmentRequestModel}) async {
hasError = false;
await baseAppClient.post(VTE_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
_allDischargeSummaryList.clear();
_allVteHistoryList.clear();
response['INP_VTEHistoryByTransactionNo_List'].forEach(
(v) {
_allDischargeSummaryList.add(VteAssessmentResponseModel.fromJson(v));
_allVteHistoryList.add(VteAssessmentResponseModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {

@ -2,7 +2,7 @@ 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_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';
@ -10,11 +10,11 @@ import 'package:doctor_app_flutter/models/discharge_summary/GetDischargeSummaryR
class VteAssessmentViewModel extends BaseViewModel {
bool hasError = false;
VteAssessmentService _dischargeSummaryService =
VteAssessmentService _VteAssessmentService =
locator<VteAssessmentService>();
List<VteAssessmentResponseModel> get allVteHistoryList =>
_dischargeSummaryService.allDischargeSummaryList;
_VteAssessmentService.allVteHistoryList;
Future getVteAssessment({
int patientId,
@ -25,10 +25,10 @@ class VteAssessmentViewModel extends BaseViewModel {
transactionNo: admissionNo);
hasError = false;
setState(ViewState.Busy);
await _dischargeSummaryService.getVteAssessment(
await _VteAssessmentService.getVteAssessment(
vteAssessmentRequestModel: vteAssessmentRequestModel);
if (_dischargeSummaryService.hasError) {
error = _dischargeSummaryService.error;
if (_VteAssessmentService.hasError) {
error = _VteAssessmentService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);

@ -33,7 +33,7 @@ import 'core/service/patient/patient-doctor-referral-service.dart';
import 'core/service/patient/patientInPatientService.dart';
import 'core/service/patient/patient_service.dart';
import 'core/service/patient/profile/operation_report_servive.dart';
import 'core/service/patient/profile/vte_assessment_servive.dart';
import 'core/service/patient/profile/vte_assessment_service.dart';
import 'core/service/patient/referral_patient_service.dart';
import 'core/service/patient_medical_file/admission_request/patient-admission-request-service.dart';
import 'core/service/patient_medical_file/insurance/InsuranceCardService.dart';

@ -40,9 +40,10 @@ class _ProgressNoteState extends State<VteAssessmentScreen> {
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<VteAssessmentViewModel>(
onModelReady: (model) => model.getVteAssessment(patientId: patient.patientId, admissionNo: 2016023498
onModelReady: (model) => model.getVteAssessment(patientId: patient.patientId,
admissionNo: 2016023498
//int.parse(patient.admissionNo)
// admissionNo:int.parse(patient.admissionNo)
),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
@ -51,8 +52,8 @@ class _ProgressNoteState extends State<VteAssessmentScreen> {
patient,
isInpatient: true,
),
body: model.allDisChargeSummaryList == null ||
model.allDisChargeSummaryList.length == 0
body: model.allVteHistoryList == null ||
model.allVteHistoryList.length == 0
? Center(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable,
@ -65,7 +66,7 @@ class _ProgressNoteState extends State<VteAssessmentScreen> {
Expanded(
child: Container(
child: ListView.builder(
itemCount: model.allDisChargeSummaryList.length,
itemCount: model.allVteHistoryList.length,
itemBuilder: (BuildContext ctxt, int index) {
return FractionallySizedBox(
widthFactor: 0.95,
@ -102,10 +103,11 @@ class _ProgressNoteState extends State<VteAssessmentScreen> {
.start,
children: [
AppText(
TranslationBase.of(
context)
.createdBy,
fontSize: 12,
model
.allVteHistoryList[
index].riskScore,
fontWeight: FontWeight.w600,
fontSize: 14,
),
],
@ -117,14 +119,14 @@ class _ProgressNoteState extends State<VteAssessmentScreen> {
children: [
AppText(
model
.allDisChargeSummaryList[
.allVteHistoryList[
index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.allDisChargeSummaryList[
.getDateTimeFromString(model
.allVteHistoryList[
index]
.createdOn),
isArabic:
@ -143,14 +145,14 @@ class _ProgressNoteState extends State<VteAssessmentScreen> {
),
AppText(
model
.allDisChargeSummaryList[
.allVteHistoryList[
index]
.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.getDateTimeFromServerFormat(model
.allDisChargeSummaryList[
.getDateTimeFromString(model
.allVteHistoryList[
index]
.createdOn))
: AppDateUtils.getHour(
@ -174,14 +176,62 @@ class _ProgressNoteState extends State<VteAssessmentScreen> {
children: [
AppText(
TranslationBase.of(context)
.icd +
.VTE_Type +
" : ",
fontSize: 12,
),
Expanded(
child: AppText(
model
.allDisChargeSummaryList[
.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,
@ -197,15 +247,15 @@ class _ProgressNoteState extends State<VteAssessmentScreen> {
MainAxisAlignment.start,
children: [
AppText(
"Ascii Desc : ",
"Ambulation Protocol : ",
fontSize: 12,
),
Expanded(
child: AppText(
model
.allDisChargeSummaryList[
.allVteHistoryList[
index]
.riskScore,
.ambulationProtocol,
fontSize: 12,
isCopyable: true,
),

@ -1737,6 +1737,9 @@ class TranslationBase {
localizedValues['planedProcedure'][locale.languageCode];
String get moreDetails => localizedValues['moreDetails'][locale.languageCode];
String get VTE_Type => localizedValues['VTE_Type'][locale.languageCode];
String get pharmacology => localizedValues['pharmacology'][locale.languageCode];
String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -763,13 +763,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
meta:
dependency: transitive
description:
@ -1173,7 +1166,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.3"
timing:
dependency: transitive
description:

Loading…
Cancel
Save