add in lab result get in and out patient

merge-requests/590/head
Mohammad Aljammal 5 years ago
parent 2f01fa1b53
commit c9c18efd72

@ -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));

@ -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(

@ -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,

Loading…
Cancel
Save