Merge branch 'referral_in_patient' into 'development'

Add load data in or out patient

See merge request Cloud_Solution/doctor_app_flutter!590
merge-requests/591/merge
Mohammad Aljammal 5 years ago
commit cb61f4a746

@ -28,7 +28,7 @@ class LabsService extends BaseService {
await baseAppClient.postPatient(url, patient: patient,
onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList.clear();
patientLabOrdersList=[];
if (!isInpatient) {
response['ListPLO'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));

@ -39,7 +39,7 @@ class RadiologyService extends BaseService {
await baseAppClient.postPatient(url,
patient: patient,
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear();
finalRadiologyList = [];
String label = "ListRAD";
if(isInPatient) {
label ="List_GetRadOreders";

@ -13,15 +13,12 @@ class DischargedPatientViewModel extends BaseViewModel {
_dischargedPatientService.myDischargedPatients;
List<PatiantInformtion> get filterData => filterData2.isNotEmpty? filterData2:myDischargedPatient;
List<PatiantInformtion> filterData2 = [];
List<PatiantInformtion> filterData = [];
searchData(String str) {
var strExist = str.length > 0 ? true : false;
if (strExist) {
filterData2 = [];
filterData = [];
for (var i = 0; i < myDischargedPatient.length; i++) {
String firstName = myDischargedPatient[i].firstName.toUpperCase();
String lastName = myDischargedPatient[i].lastName.toUpperCase();
@ -32,12 +29,12 @@ class DischargedPatientViewModel extends BaseViewModel {
lastName.contains(str.toUpperCase()) ||
mobile.contains(str) ||
patientID.contains(str)) {
filterData2.add(myDischargedPatient[i]);
filterData.add(myDischargedPatient[i]);
}
}
notifyListeners();
} else {
filterData2 = myDischargedPatient;
filterData = myDischargedPatient;
notifyListeners();
}
}
@ -49,8 +46,9 @@ class DischargedPatientViewModel extends BaseViewModel {
if (_dischargedPatientService.hasError) {
error = _dischargedPatientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
} else{
filterData = myDischargedPatient;
setState(ViewState.Idle);}
}
Future gtMyDischargeReferralPatient() async {

@ -30,7 +30,7 @@ class _DischargedPatientState extends State<DischargedPatient> {
backgroundColor: Colors.grey[200],
isShowAppBar: true,
baseViewModel: model,
body: model.filterData.isEmpty?Center(
body: model.myDischargedPatient.isEmpty?Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [

@ -12,18 +12,30 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class LabsHomePage extends StatelessWidget {
class LabsHomePage extends StatefulWidget {
@override
_LabsHomePageState createState() => _LabsHomePageState();
}
class _LabsHomePageState extends State<LabsHomePage> {
String patientType;
String arrivalType;
PatiantInformtion patient;
bool isInpatient;
@override
Widget build(BuildContext context) {
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
isInpatient = routeArgs['isInpatient'];
print(arrivalType);
}
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getLabs(patient, isInpatient: isInpatient),
builder: (context, ProcedureViewModel model, widget) => AppScaffold(
@ -93,6 +105,42 @@ class LabsHomePage extends StatelessWidget {
)),
);
},label: 'Apply for New Lab Order',),
if(!isInpatient)
Container(
margin: EdgeInsets.only(right: 8),
width: double.maxFinite,
child: InkWell(
onTap: (){
setState(() {
isInpatient= true;
});
model.getLabs(patient, isInpatient: true);
},
child: Align(
alignment: Alignment.centerRight,
child: AppText('View Inpatient Lab Result',
textDecoration:TextDecoration.underline,color: Colors.red,),
),
),
),
if(isInpatient)
Container(
width: double.maxFinite,
margin: EdgeInsets.only(right: 8),
child: InkWell(
onTap: (){
setState(() {
isInpatient= false;
});
model.getLabs(patient, isInpatient: false);
},
child: Align(
alignment: Alignment.centerRight,
child: AppText('View Outpatient Lab Result',
textDecoration:TextDecoration.underline,color: Colors.red,),
),
),
),
...List.generate(
model.patientLabOrdersList.length,
(index) => Column(
@ -120,6 +168,7 @@ class LabsHomePage extends StatelessWidget {
clinic: labOrder.clinicDescription,
appointmentDate: labOrder.orderDate,
orderNo: labOrder.orderNo,
isShowTime: false,
);
}).toList(),
),

@ -14,16 +14,29 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class RadiologyHomePage extends StatelessWidget {
class RadiologyHomePage extends StatefulWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
_RadiologyHomePageState createState() => _RadiologyHomePageState();
}
class _RadiologyHomePageState extends State<RadiologyHomePage> {
String patientType;
PatiantInformtion patient;
String arrivalType;
bool isInpatient;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
patient = routeArgs['patient'];
patientType = routeArgs['patientType'];
arrivalType = routeArgs['arrivalType'];
isInpatient = routeArgs['isInpatient'];
print(arrivalType);
}
@override
Widget build(BuildContext context) {
return BaseView<ProcedureViewModel>(
onModelReady: (model) =>
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient),
@ -99,6 +112,42 @@ class RadiologyHomePage extends StatelessWidget {
},
label: 'Apply for Radiology Order',
),
if(!isInpatient)
Container(
width: double.maxFinite,
margin: EdgeInsets.only(right: 8),
child: InkWell(
onTap: (){
setState(() {
isInpatient = true;
});
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: true);
},
child: Align(
alignment: Alignment.centerRight,
child: AppText('View Inpatient Lab Result',
textDecoration:TextDecoration.underline,color: Colors.red,),
),
),
),
if(isInpatient)
Container(
margin: EdgeInsets.only(right: 8),
width: double.maxFinite,
child: InkWell(
onTap: (){
setState(() {
isInpatient = false;
});
model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false);
},
child: Align(
alignment: Alignment.centerRight,
child: AppText('View Outpatient Lab Result',
textDecoration:TextDecoration.underline,color: Colors.red,),
),
),
),
...List.generate(
model.radiologyList.length,
(index) => InkWell(

@ -121,16 +121,14 @@ class _AppTextState extends State<AppText> {
style: widget.style != null
? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : null,
color: widget.color ,
fontWeight: widget.fontWeight ?? _getFontWeight(),
)
: TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.textDecoration == null
? widget.color != null
? widget.color
: Colors.black
: null,
color: widget.color != null
? widget.color
: Colors.black,
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing:
widget.variant == "overline" ? 1.5 : null,

@ -19,6 +19,7 @@ class DoctorCard extends StatelessWidget {
final bool isPrescriptions;
final String clinic;
final bool isShowEye;
final bool isShowTime;
DoctorCard(
{this.doctorName,
@ -30,7 +31,7 @@ class DoctorCard extends StatelessWidget {
this.orderNo,
this.isPrescriptions = false,
this.clinic,
this.isShowEye = true});
this.isShowEye = true, this.isShowTime= true});
@override
Widget build(BuildContext context) {
@ -71,7 +72,7 @@ class DoctorCard extends StatelessWidget {
fontWeight: FontWeight.w600,
fontSize: 14,
),
if (!isPrescriptions)
if (!isPrescriptions&& isShowTime)
AppText(
'${DateUtils.getHour(appointmentDate)}',
fontWeight: FontWeight.w600,

Loading…
Cancel
Save