Merge branch 'in-patient-changes' into 'development'

In patient changes

See merge request Cloud_Solution/doctor_app_flutter!536
merge-requests/537/merge
Mohammad Aljammal 5 years ago
commit e4aae762cc

@ -47,10 +47,10 @@ class LabResult {
lineItemNo = json['LineItemNo'];
maleInterpretativeData = json['MaleInterpretativeData'];
notes = json['Notes'];
packageID = json['PackageID'];
packageID = json['PackageID'].toString();
patientID = json['PatientID'];
projectID = json['ProjectID'];
referanceRange = json['ReferanceRange'];
projectID = json['ProjectID'].toString();
referanceRange = json['ReferenceRange'] ?? json['ReferanceRange'];
resultValue = json['ResultValue'];
sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn'];

@ -85,7 +85,7 @@ class PatientLabOrders {
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
invoiceNo = json['InvoiceNo'];
invoiceNo = json['InvoiceNo'].toString();
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
@ -96,9 +96,9 @@ class PatientLabOrders {
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
orderDate = DateUtils.convertStringToDate(json['OrderDate']);
orderNo = json['OrderNo'];
patientID = json['PatientID'];
projectID = json['ProjectID'];
orderNo = json['OrderNo'].toString();
patientID = json['PatientID'].toString();
projectID = json['ProjectID'].toString();
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
qR = json['QR'];

@ -65,7 +65,7 @@ class RequestPatientLabSpecialResult {
data['OrderNo'] = this.orderNo;
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ClinicID'] = this.clinicID;
data['ClinicID'] = this.clinicID ?? 0;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;

@ -12,16 +12,30 @@ import 'base/base_service.dart';
class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List();
Future getPatientLabOrdersList(PatiantInformtion patient) async {
Future getPatientLabOrdersList(
PatiantInformtion patient, bool isArrived) async {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.postPatient(GET_Patient_LAB_ORDERS, patient: patient,
String url = "";
if (isArrived) {
body['isDentalAllowedBackend'] = false;
url = GET_Patient_LAB_ORDERS;
} else {
url = GET_PATIENT_LAB_OREDERS;
}
await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList.clear();
response['ListPLO'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
});
if (isArrived) {
response['ListPLO'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
});
} else {
response['List_GetLabOreders'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -40,42 +54,65 @@ class LabsService extends BaseService {
int clinicID,
String invoiceNo,
String orderNo,
PatiantInformtion patient}) async {
PatiantInformtion patient,
bool isInpatient = false}) async {
hasError = false;
Map<String, dynamic> body = Map();
_requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo;
_requestPatientLabSpecialResult.orderNo = orderNo;
body = _requestPatientLabSpecialResult.toJson();
await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT,
patient: patient, onSuccess: (dynamic response, int statusCode) {
await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, patient: patient,
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear();
response['ListPLSR'].forEach((hospital) {
patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPatientLabSpecialResult.toJson());
}, body: body);
}
Future getPatientLabResult(
{PatientLabOrders patientLabOrder, PatiantInformtion patient}) async {
{PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async {
hasError = false;
String url = "";
if (isInpatient) {
url = GET_PATIENT_LAB_RESULTS;
} else {
url = GET_Patient_LAB_RESULT;
}
Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID;
await baseAppClient.postPatient(GET_Patient_LAB_RESULT, patient: patient,
body['ClinicID'] = patientLabOrder.clinicID ?? 0;
await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear();
labResultList.clear();
response['ListPLR'].forEach((lab) {
labResultList.add(LabResult.fromJson(lab));
});
if(isInpatient){
response['List_GetLabNormal'].forEach((hospital) {
labResultList.add(LabResult.fromJson(hospital));
});
}else {
response['ListPLR'].forEach((lab) {
labResultList.add(LabResult.fromJson(lab));
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -28,7 +28,7 @@ class LabsViewModel extends BaseViewModel {
void getLabs(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersList(patient);
await _labsService.getPatientLabOrdersList(patient, true);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -89,7 +89,6 @@ class LabsViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List();
List<LabResultList> get labResultListsCoustom {
return labResultLists;
}
@ -98,14 +97,16 @@ class LabsViewModel extends BaseViewModel {
int clinicID,
String invoiceNo,
String orderNo,
PatiantInformtion patient}) async {
PatiantInformtion patient,
bool isInpatient}) async {
setState(ViewState.Busy);
await _labsService.getLaboratoryResult(
invoiceNo: invoiceNo,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID,
patient: patient);
patient: patient,
isInpatient: isInpatient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -114,9 +115,11 @@ class LabsViewModel extends BaseViewModel {
}
}
getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async {
getPatientLabResult(
{PatientLabOrders patientLabOrder, PatiantInformtion patient, bool isInpatient}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder,patient: patient);
await _labsService.getPatientLabResult(
patientLabOrder: patientLabOrder, patient: patient, isInpatient: isInpatient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -149,10 +152,14 @@ class LabsViewModel extends BaseViewModel {
}
getPatientLabOrdersResults(
{PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async {
{PatientLabOrders patientLabOrder,
String procedure,
PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResults(
patientLabOrder: patientLabOrder, procedure: procedure,patient: patient);
patientLabOrder: patientLabOrder,
procedure: procedure,
patient: patient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);

@ -228,7 +228,7 @@ class ProcedureViewModel extends BaseViewModel {
void getLabs(PatiantInformtion patient,{bool isArrived}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersList(patient);
await _labsService.getPatientLabOrdersList(patient, isArrived);
if (_labsService.hasError) {
error = _labsService.error;
if(isArrived)

@ -11,15 +11,23 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class LabResultWidget extends StatelessWidget {
final String filterName;
final List<LabResult> patientLabResultList;
final PatientLabOrders patientLabOrder;
final PatiantInformtion patient;
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key);
final bool isInpatient;
LabResultWidget(
{Key key,
this.filterName,
this.patientLabResultList,
this.patientLabOrder,
this.patient,
this.isInpatient})
: super(key: key);
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
@ -29,31 +37,32 @@ class LabResultWidget extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(filterName),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
patient: patient,
if (!isInpatient)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(filterName),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
patient: patient,
),
),
),
);
},
child: AppText(
TranslationBase.of(context).showMoreBtn,
textDecoration: TextDecoration.underline,
color: Colors.blue,
);
},
child: AppText(
TranslationBase.of(context).showMoreBtn,
textDecoration: TextDecoration.underline,
color: Colors.blue,
),
),
),
],
),
],
),
Row(
children: [
Expanded(
@ -61,7 +70,8 @@ class LabResultWidget extends StatelessWidget {
child: Center(
child: AppText(
TranslationBase.of(context).description,
color: Colors.black,bold: true,
color: Colors.black,
bold: true,
),
),
),
@ -69,68 +79,87 @@ class LabResultWidget extends StatelessWidget {
Expanded(
child: Container(
child: Center(
child: AppText(TranslationBase.of(context).value, color: Colors.black,bold: true,),
child: AppText(
TranslationBase.of(context).value,
color: Colors.black,
bold: true,
),
),
),
),
Expanded(
child: Container(
child: Center(
child: AppText(TranslationBase.of(context).range, color: Colors.black,bold: true,),
child: AppText(
TranslationBase.of(context).range,
color: Colors.black,
bold: true,
),
),
),
)
],
),
SizedBox(height: 7,),
Divider(color: Colors.black,thickness: 1,),
SizedBox(height: 12,),
...List.generate(patientLabResultList.length, (index) => Column(
children: [
Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
'${patientLabResultList[index].testCode}\n'+
patientLabResultList[index].description,
textAlign: TextAlign.center,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
patientLabResultList[index].resultValue+" "+patientLabResultList[index].uOM,
textAlign: TextAlign.center,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
patientLabResultList[index].referanceRange,
textAlign: TextAlign.center,
),
SizedBox(
height: 7,
),
Divider(
color: Colors.black,
thickness: 1,
),
SizedBox(
height: 12,
),
...List.generate(
patientLabResultList.length,
(index) => Column(
children: [
Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
'${patientLabResultList[index].testCode}\n' +
patientLabResultList[index].description,
textAlign: TextAlign.center,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
patientLabResultList[index].resultValue +
" " +
"${patientLabResultList[index].uOM ?? ""}",
textAlign: TextAlign.center,
),
),
),
),
Expanded(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: AppText(
patientLabResultList[index].referanceRange,
textAlign: TextAlign.center,
),
),
),
),
],
),
),
),
],
),
Divider(),
],
))
Divider(),
],
))
// Table(
// border: TableBorder.symmetric(
// inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid),
@ -141,7 +170,8 @@ class LabResultWidget extends StatelessWidget {
),
);
}
List<TableRow> fullData(List<LabResult> labResultList,context) {
List<TableRow> fullData(List<LabResult> labResultList, context) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
@ -150,18 +180,27 @@ class LabResultWidget extends StatelessWidget {
child: Center(
child: AppText(
TranslationBase.of(context).description,
color: Colors.black,bold: true,
color: Colors.black,
bold: true,
),
),
),
Container(
child: Center(
child: AppText(TranslationBase.of(context).value, color: Colors.black,bold: true,),
child: AppText(
TranslationBase.of(context).value,
color: Colors.black,
bold: true,
),
),
),
Container(
child: Center(
child: AppText(TranslationBase.of(context).range, color: Colors.black,bold: true,),
child: AppText(
TranslationBase.of(context).range,
color: Colors.black,
bold: true,
),
),
),
],
@ -189,7 +228,7 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white,
child: Center(
child: AppText(
lab.resultValue+" "+lab.uOM,
lab.resultValue + " " + lab.uOM,
textAlign: TextAlign.center,
),
),
@ -213,7 +252,4 @@ class LabResultWidget extends StatelessWidget {
});
return tableRow;
}
}

@ -18,7 +18,13 @@ class LaboratoryResultPage extends StatefulWidget {
final PatiantInformtion patient;
final String patientType;
final String arrivalType;
LaboratoryResultPage({Key key, this.patientLabOrders, this.patient, this.patientType, this.arrivalType});
LaboratoryResultPage(
{Key key,
this.patientLabOrders,
this.patient,
this.patientType,
this.arrivalType});
@override
_LaboratoryResultPageState createState() => _LaboratoryResultPageState();
@ -33,15 +39,16 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
clinicID: widget.patientLabOrders.clinicID,
projectID: widget.patientLabOrders.projectID,
orderNo: widget.patientLabOrders.orderNo,
patient: widget.patient),
patient: widget.patient,
isInpatient: widget.patientType == "1"),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: widget.patient,
patientType: widget.patientType??"0",
arrivalType: widget.arrivalType??"0",
patientType: widget.patientType ?? "0",
arrivalType: widget.arrivalType ?? "0",
orderNo: widget.patientLabOrders.orderNo,
appointmentDate:widget.patientLabOrders.orderDate,
appointmentDate: widget.patientLabOrders.orderDate,
doctorName: widget.patientLabOrders.doctorName,
branch: widget.patientLabOrders.projectName,
clinic: widget.patientLabOrders.clinicDescription,
@ -53,17 +60,18 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
body: SingleChildScrollView(
child: Column(
children: [
...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget(
onTap: () async {
},
billNo: widget.patientLabOrders.invoiceNo,
details: model.patientLabSpecialResult[index].resultDataHTML,
orderNo: widget.patientLabOrders.orderNo,
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
)),
...List.generate(
model.patientLabSpecialResult.length,
(index) => LaboratoryResultWidget(
onTap: () async {},
billNo: widget.patientLabOrders.invoiceNo,
details: model
.patientLabSpecialResult[index].resultDataHTML,
orderNo: widget.patientLabOrders.orderNo,
patientLabOrder: widget.patientLabOrders,
patient: widget.patient,
isInpatient: widget.patientType == "1",
)),
],
),
),

@ -20,13 +20,17 @@ class LaboratoryResultWidget extends StatefulWidget {
final String orderNo;
final PatientLabOrders patientLabOrder;
final PatiantInformtion patient;
final bool isInpatient;
const LaboratoryResultWidget(
{Key key,
this.onTap,
this.billNo,
this.details,
this.orderNo,
this.patientLabOrder, this.patient})
this.patientLabOrder,
this.patient,
this.isInpatient})
: super(key: key);
@override
@ -41,7 +45,10 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient),
onModelReady: (model) => model.getPatientLabResult(
patientLabOrder: widget.patientLabOrder,
patient: widget.patient,
isInpatient: widget.isInpatient),
builder: (_, model, w) => NetworkBaseView(
baseViewModel: model,
child: Container(
@ -77,9 +84,15 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
)),
child: Row(
children: <Widget>[
Expanded(child: Container(
margin: EdgeInsets.only(left: 10, right: 10),
child: AppText(TranslationBase.of(context).generalResult,bold: true,))),
Expanded(
child: Container(
margin: EdgeInsets.only(
left: 10, right: 10),
child: AppText(
TranslationBase.of(context)
.generalResult,
bold: true,
))),
Container(
width: 25,
height: 25,
@ -115,14 +128,15 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
children: <Widget>[
...List.generate(
model.labResultLists.length,
(index) => LabResultWidget(
(index) => LabResultWidget(
patientLabOrder: widget.patientLabOrder,
filterName: model
.labResultLists[index].filterName,
patientLabResultList: model
.labResultLists[index]
.patientLabResultList,
patient:widget.patient,
patient: widget.patient,
isInpatient: widget.isInpatient,
),
)
],
@ -135,7 +149,6 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
SizedBox(
height: 10,
),
],
),
],

@ -13,14 +13,11 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.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/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class LabsHomePage extends StatelessWidget {
String patientType;

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
final PatiantInformtion patient;
@ -77,7 +78,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: () {
// should call patient or show mobile number : patient.mobileNumber
launch("tel://" + patient.mobileNumber);
},
child: Icon(
Icons.phone,

@ -124,7 +124,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: null,
route: MEDICAL_FILE,
nameLine1: "Health",
//TranslationBase.of(context).medicalReport,
nameLine2: "Summery",
@ -135,7 +135,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: null,
route: REFER_PATIENT_TO_DOCTOR,
nameLine1: TranslationBase.of(context).referral,
nameLine2: TranslationBase.of(context).patient,
icon: 'patient/refer_patient.png'),
@ -144,7 +144,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: null,
route: PATIENT_INSURANCE_APPROVALS_NEW,
nameLine1: TranslationBase.of(context).insurance,
nameLine2: TranslationBase.of(context).approvals,
icon: 'patient/vital_signs.png'),
@ -153,6 +153,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
isDisable: true,
route: null,
nameLine1: "Discharge",
nameLine2: "Summery",

Loading…
Cancel
Save