Merge branch 'fix_bugs_new' into 'development'

working on lab result new service

See merge request Cloud_Solution/doctor_app_flutter!800
merge-requests/801/merge
Mohammad Aljammal 5 years ago
commit 2210a0445c

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
@ -125,6 +125,7 @@ const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLab
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription';
// SOAP

@ -710,5 +710,6 @@ const Map<String, Map<String, String>> localizedValues = {
"Locked": {"en": "Locked", "ar": "مقفل"},
"textCopiedSuccessfully": {"en": "Text copied successfully", "ar": "تم نسخ النص بنجاح"},
"seeMore": {"en": "See More ...", "ar": "شاهد المزيد..."},
"roomNo": {"en": "Room No", "ar": "رقم الغرفة"},
};

@ -0,0 +1,108 @@
class LabResultHistory {
String description;
String femaleInterpretativeData;
int gender;
bool isCertificateAllowed;
int lineItemNo;
String maleInterpretativeData;
String notes;
int orderLineItemNo;
int orderNo;
String packageID;
int patientID;
String projectID;
String referanceRange;
String resultValue;
int resultValueBasedLineItemNo;
String resultValueFlag;
String sampleCollectedOn;
String sampleReceivedOn;
String setupID;
String superVerifiedOn;
String testCode;
String uOM;
String verifiedOn;
String verifiedOnDateTime;
LabResultHistory(
{this.description,
this.femaleInterpretativeData,
this.gender,
this.isCertificateAllowed,
this.lineItemNo,
this.maleInterpretativeData,
this.notes,
this.orderLineItemNo,
this.orderNo,
this.packageID,
this.patientID,
this.projectID,
this.referanceRange,
this.resultValue,
this.resultValueBasedLineItemNo,
this.resultValueFlag,
this.sampleCollectedOn,
this.sampleReceivedOn,
this.setupID,
this.superVerifiedOn,
this.testCode,
this.uOM,
this.verifiedOn,
this.verifiedOnDateTime});
LabResultHistory.fromJson(Map<String, dynamic> json) {
description = json['Description'];
femaleInterpretativeData = json['FemaleInterpretativeData'];
gender = json['Gender'];
isCertificateAllowed = json['IsCertificateAllowed'];
lineItemNo = json['LineItemNo'];
maleInterpretativeData = json['MaleInterpretativeData'];
notes = json['Notes'];
orderLineItemNo = json['OrderLineItemNo'];
orderNo = json['OrderNo'];
packageID = json['PackageID'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
referanceRange = json['ReferanceRange'];
resultValue = json['ResultValue'];
resultValueBasedLineItemNo = json['ResultValueBasedLineItemNo'];
resultValueFlag = json['ResultValueFlag'];
sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID'];
superVerifiedOn = json['SuperVerifiedOn'];
testCode = json['TestCode'];
uOM = json['UOM'];
verifiedOn = json['VerifiedOn'];
verifiedOnDateTime = json['VerifiedOnDateTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender;
data['IsCertificateAllowed'] = this.isCertificateAllowed;
data['LineItemNo'] = this.lineItemNo;
data['MaleInterpretativeData'] = this.maleInterpretativeData;
data['Notes'] = this.notes;
data['OrderLineItemNo'] = this.orderLineItemNo;
data['OrderNo'] = this.orderNo;
data['PackageID'] = this.packageID;
data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue;
data['ResultValueBasedLineItemNo'] = this.resultValueBasedLineItemNo;
data['ResultValueFlag'] = this.resultValueFlag;
data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID;
data['SuperVerifiedOn'] = this.superVerifiedOn;
data['TestCode'] = this.testCode;
data['UOM'] = this.uOM;
data['VerifiedOn'] = this.verifiedOn;
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
return data;
}
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
@ -52,6 +53,7 @@ class LabsService extends BaseService {
List<PatientLabSpecialResult> patientLabSpecialResult = List();
List<LabResult> labResultList = List();
List<LabOrderResult> labOrdersResultsList = List();
List<LabResultHistory> labOrdersResultHistoryList = List();
Future getLaboratoryResult(
{String projectID,
@ -113,7 +115,8 @@ class LabsService extends BaseService {
labResultList.add(LabResult.fromJson(hospital));
});
response['List_GetLabSpecial'].forEach((hospital) {
patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
patientLabSpecialResult
.add(PatientLabSpecialResult.fromJson(hospital));
});
} else {
response['ListPLR'].forEach((lab) {
@ -179,4 +182,30 @@ class LabsService extends BaseService {
// super.error = error;
// }, body: _requestSendLabReportEmail.toJson());
}
Future getPatientLabOrdersResultHistoryByDescription(
{PatientLabOrders patientLabOrder,
String procedureDescription,
PatiantInformtion patient}) async {
hasError = false;
Map<String, dynamic> body = Map();
if (patientLabOrder != null) {
body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = 0;
body['ClinicID'] = 0;
}
body['isDentalAllowedBackend'] = false;
body['ProcedureDescription'] = procedureDescription;
await baseAppClient.postPatient(
GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION,
patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultHistoryList.clear();
response['ListGeneralResultHistory'].forEach((lab) {
labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
import 'package:doctor_app_flutter/core/model/labs/lab_result.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
@ -26,6 +27,8 @@ class LabsViewModel extends BaseViewModel {
? _patientLabOrdersListClinic
: _patientLabOrdersListHospital;
List<LabResultHistory> get labOrdersResultHistoryList => _labsService.labOrdersResultHistoryList;
void getLabs(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersList(patient, true);
@ -132,7 +135,7 @@ class LabsViewModel extends BaseViewModel {
}
}
void setLabResultDependOnFilterName(){
void setLabResultDependOnFilterName() {
_labsService.labResultList.forEach((element) {
List<LabResultList> patientLabOrdersClinic = labResultLists
.where(
@ -176,6 +179,23 @@ class LabsViewModel extends BaseViewModel {
}
}
getPatientLabResultHistoryByDescription(
{PatientLabOrders patientLabOrder,
String procedureDescription,
PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResultHistoryByDescription(
patientLabOrder: patientLabOrder,
procedureDescription: procedureDescription,
patient: patient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder);
if (_labsService.hasError) {

@ -0,0 +1,132 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/viewModel/labs_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/translations_delegate_base.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/errors/error_message.dart';
import 'package:flutter/material.dart';
class LabResultHistoryPage extends StatelessWidget {
final PatientLabOrders patientLabOrder;
final String filterName;
final PatiantInformtion patient;
LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient});
@override
Widget build(BuildContext context) {
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResultHistoryByDescription(
patientLabOrder: patientLabOrder,
procedureDescription: filterName,
patient: patient),
builder: (context, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: filterName,
baseViewModel: model,
body: model.labOrdersResultHistoryList.length > 0
? SingleChildScrollView(
child: Column(
children: [
...List.generate(model.labOrdersResultHistoryList.length,
(index) {
return Container(
child: Column(
children: [
Row(
children: [
AppText(
TranslationBase.of(context).description,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index].description,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Reference Range",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index].referanceRange,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Result Value",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index].resultValue,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
Row(
children: [
AppText(
"Verified On",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
),
SizedBox(
width: 1,
),
AppText(
model.labOrdersResultHistoryList[index].verifiedOn,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
),
],
),
],
),
);
}),
],
),
)
: ErrorMessage(
error: "No data",
),
),
);
}
}

@ -10,6 +10,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'LabResultHistoryPage.dart';
class LabResultWidget extends StatelessWidget {
final String filterName;
final List<LabResult> patientLabResultList;
@ -18,7 +20,12 @@ class LabResultWidget extends StatelessWidget {
final bool isInpatient;
LabResultWidget(
{Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient, this.isInpatient})
{Key key,
this.filterName,
this.patientLabResultList,
this.patientLabOrder,
this.patient,
this.isInpatient})
: super(key: key);
ProjectViewModel projectViewModel;
@ -35,7 +42,30 @@ class LabResultWidget extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(filterName),
Row(
children: [
AppText(filterName),
InkWell(
onTap: (){
Navigator.push(
context,
FadePage(
page: LabResultHistoryPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
patient: patient,
),
),
);
},
child: AppText(
" (show details)",
color: Colors.blue,
fontSize: 12,
),
),
],
),
InkWell(
onTap: () {
Navigator.push(
@ -117,7 +147,8 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white,
child: Center(
child: AppText(
'${patientLabResultList[index].testCode}\n' + patientLabResultList[index].description,
'${patientLabResultList[index].testCode}\n' +
patientLabResultList[index].description,
textAlign: TextAlign.center,
isCopyable: true,
),
@ -131,7 +162,9 @@ class LabResultWidget extends StatelessWidget {
child: Center(
child: AppText(
patientLabResultList[index].resultValue ??
"" + " " + "${patientLabResultList[index].uOM ?? ""}",
"" +
" " +
"${patientLabResultList[index].uOM ?? ""}",
textAlign: TextAlign.center,
isCopyable: true,
),

@ -1371,6 +1371,7 @@ class TranslationBase {
String get summeryReply => localizedValues['summeryReply'][locale.languageCode];
String get severityValidationError => localizedValues['severityValidationError'][locale.languageCode];
String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode];
String get roomNo => localizedValues['roomNo'][locale.languageCode];
String get seeMore => localizedValues['seeMore'][locale.languageCode];
}

@ -381,14 +381,37 @@ class PatientCard extends StatelessWidget {
value:
"${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}",
),
if (patientInfo.admissionDate != null)
Container(
child: RichText(
text: new TextSpan(
style: new TextStyle(
fontSize:
2.0 * SizeConfig.textMultiplier,
color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: TranslationBase.of(context)
.roomNo +
" : ",
style: TextStyle(fontSize: 12)),
new TextSpan(
text:
"${patientInfo.roomId}",
style: TextStyle(
fontWeight: FontWeight.w700,
fontSize: 13)),
]))),
if (isFromLiveCare)
Column(
children: [
CustomRow(label: TranslationBase.of(context)
.clinic +
" : ",value: patientInfo.clinicName,),
.clinic +
" : ",
value: patientInfo.clinicName,),
],
),
]))

Loading…
Cancel
Save