add new screens
parent
1ee2655e63
commit
7d1cfb7b4e
@ -0,0 +1,151 @@
|
||||
import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../config/shared_pref_kay.dart';
|
||||
import '../../../config/size_config.dart';
|
||||
import '../../../models/patient/patiant_info_model.dart';
|
||||
import '../../../providers/patients_provider.dart';
|
||||
import '../../../util/dr_app_shared_pref.dart';
|
||||
import '../../../widgets/shared/app_scaffold_widget.dart';
|
||||
import '../../../widgets/shared/app_texts_widget.dart';
|
||||
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
||||
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
|
||||
/*
|
||||
*@author: ibrahim albitar
|
||||
*@Date:21/5/2020
|
||||
*@param:
|
||||
*@return:
|
||||
*@desc:
|
||||
*/
|
||||
|
||||
class InsuranceApprovalsScreen extends StatefulWidget {
|
||||
@override
|
||||
_InsuranceApprovalsState createState() => _InsuranceApprovalsState();
|
||||
}
|
||||
|
||||
class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
|
||||
PatientsProvider patientsProv;
|
||||
var _isInit = true;
|
||||
|
||||
/*
|
||||
*@author: ibrahim al bitar
|
||||
*@Date:21/5/2020
|
||||
*@param:
|
||||
*@return:
|
||||
*@desc:
|
||||
*/
|
||||
getInsuranceApprovalsList(context) async {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
String token = await sharedPref.getString(TOKEN);
|
||||
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
|
||||
|
||||
print(type);
|
||||
InsuranceAprovalsRequest insuranceApprovalsRequest = InsuranceAprovalsRequest(
|
||||
patientID: patient.patientId,
|
||||
projectID: patient.projectId,
|
||||
tokenID: token,
|
||||
patientTypeID: patient.patientType,
|
||||
languageID: 2);
|
||||
patientsProv.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson());
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
if (_isInit) {
|
||||
patientsProv = Provider.of<PatientsProvider>(context);
|
||||
getInsuranceApprovalsList(context);
|
||||
}
|
||||
_isInit = false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "Insurance Approvals",
|
||||
showAppDrawer: false,
|
||||
showBottomBar: false,
|
||||
body: patientsProv.isLoading
|
||||
? DrAppCircularProgressIndeicator()
|
||||
: patientsProv.isError
|
||||
? DrAppEmbeddedError(error: patientsProv.error)
|
||||
: patientsProv.insuranceApporvalsList.length == 0
|
||||
? DrAppEmbeddedError(
|
||||
error: 'You don\'t have any Insurance Approvals')
|
||||
: Container(
|
||||
margin: EdgeInsets.fromLTRB(
|
||||
SizeConfig.realScreenWidth * 0.05,
|
||||
0,
|
||||
SizeConfig.realScreenWidth * 0.05,
|
||||
0),
|
||||
child: ListView.builder(
|
||||
itemCount:
|
||||
patientsProv.insuranceApporvalsList.length,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return RoundedContainer(
|
||||
backgroundColor: Colors.yellow[200],
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
patientsProv
|
||||
.insuranceApporvalsList[index]
|
||||
["ClinicName"]+"-"+patientsProv
|
||||
.insuranceApporvalsList[index]
|
||||
["DoctorName"],
|
||||
marginTop: 10,
|
||||
marginLeft: 10,
|
||||
marginBottom: 5,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
AppText(
|
||||
convertDateFormat(patientsProv
|
||||
.insuranceApporvalsList[index]
|
||||
["ApprovalDate"]),
|
||||
marginLeft: 10,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 20,
|
||||
thickness: 1,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
AppText(
|
||||
patientsProv
|
||||
.insuranceApporvalsList[index]
|
||||
["CompanyName"],
|
||||
margin: 10,
|
||||
)
|
||||
],
|
||||
));
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
convertDateFormat(String str) {
|
||||
const start = "/Date(";
|
||||
const end = "+0300)";
|
||||
|
||||
final startIndex = str.indexOf(start);
|
||||
final endIndex = str.indexOf(end, startIndex + start.length);
|
||||
|
||||
var date = new DateTime.fromMillisecondsSinceEpoch(
|
||||
int.parse(str.substring(startIndex + start.length, endIndex)));
|
||||
String newDate = date.year.toString() +
|
||||
"-" +
|
||||
date.month.toString().padLeft(2, '0') +
|
||||
"-" +
|
||||
date.day.toString().padLeft(2, '0');
|
||||
|
||||
return newDate.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,150 @@
|
||||
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../config/shared_pref_kay.dart';
|
||||
import '../../../config/size_config.dart';
|
||||
import '../../../models/patient/patiant_info_model.dart';
|
||||
import '../../../providers/patients_provider.dart';
|
||||
import '../../../util/dr_app_shared_pref.dart';
|
||||
import '../../../widgets/shared/app_scaffold_widget.dart';
|
||||
import '../../../widgets/shared/app_texts_widget.dart';
|
||||
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
||||
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
|
||||
/*
|
||||
*@author: ibrahim albitar
|
||||
*@Date:21/5/2020
|
||||
*@param:
|
||||
*@return:
|
||||
*@desc:
|
||||
*/
|
||||
|
||||
class PatientsOrdersScreen extends StatefulWidget {
|
||||
@override
|
||||
_PatientsOrdersState createState() => _PatientsOrdersState();
|
||||
}
|
||||
|
||||
class _PatientsOrdersState extends State<PatientsOrdersScreen> {
|
||||
PatientsProvider patientsProv;
|
||||
var _isInit = true;
|
||||
|
||||
/*
|
||||
*@author: ibrahim al bitar
|
||||
*@Date:21/5/2020
|
||||
*@param:
|
||||
*@return:
|
||||
*@desc:
|
||||
*/
|
||||
getProgressNoteList(context) async {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
PatiantInformtion patient = routeArgs['patient'];
|
||||
String token = await sharedPref.getString(TOKEN);
|
||||
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
|
||||
|
||||
print(type);
|
||||
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
|
||||
visitType: 3, // if equal 3 then this will return orders
|
||||
admissionNo: int.parse(patient.admissionNo),
|
||||
projectID: patient.projectId,
|
||||
tokenID: token,
|
||||
patientTypeID: patient.patientType,
|
||||
languageID: 2);
|
||||
patientsProv.getPatientProgressNote(progressNoteRequest.toJson());
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
if (_isInit) {
|
||||
patientsProv = Provider.of<PatientsProvider>(context);
|
||||
getProgressNoteList(context);
|
||||
}
|
||||
_isInit = false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "Orders",
|
||||
showAppDrawer: false,
|
||||
showBottomBar: false,
|
||||
body: patientsProv.isLoading
|
||||
? DrAppCircularProgressIndeicator()
|
||||
: patientsProv.isError
|
||||
? DrAppEmbeddedError(error: patientsProv.error)
|
||||
: patientsProv.patientProgressNoteList.length == 0
|
||||
? DrAppEmbeddedError(
|
||||
error: 'You don\'t have any Orders')
|
||||
: Container(
|
||||
margin: EdgeInsets.fromLTRB(
|
||||
SizeConfig.realScreenWidth * 0.05,
|
||||
0,
|
||||
SizeConfig.realScreenWidth * 0.05,
|
||||
0),
|
||||
child: ListView.builder(
|
||||
itemCount:
|
||||
patientsProv.patientProgressNoteList.length,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return RoundedContainer(
|
||||
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
AppText(
|
||||
patientsProv
|
||||
.patientProgressNoteList[index]
|
||||
["DoctorName"],
|
||||
marginTop: 10,
|
||||
marginLeft: 10,
|
||||
marginBottom: 5,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
AppText(
|
||||
convertDateFormat(patientsProv
|
||||
.patientProgressNoteList[index]
|
||||
["AssessmentDate"]),
|
||||
marginLeft: 10,
|
||||
color: Colors.grey[600],
|
||||
),
|
||||
Divider(
|
||||
color: Colors.black,
|
||||
height: 20,
|
||||
thickness: 1,
|
||||
indent: 0,
|
||||
endIndent: 0,
|
||||
),
|
||||
AppText(
|
||||
patientsProv
|
||||
.patientProgressNoteList[index]
|
||||
["Notes"],
|
||||
margin: 10,
|
||||
)
|
||||
],
|
||||
));
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
convertDateFormat(String str) {
|
||||
const start = "/Date(";
|
||||
const end = "+0300)";
|
||||
|
||||
final startIndex = str.indexOf(start);
|
||||
final endIndex = str.indexOf(end, startIndex + start.length);
|
||||
|
||||
var date = new DateTime.fromMillisecondsSinceEpoch(
|
||||
int.parse(str.substring(startIndex + start.length, endIndex)));
|
||||
String newDate = date.year.toString() +
|
||||
"-" +
|
||||
date.month.toString().padLeft(2, '0') +
|
||||
"-" +
|
||||
date.day.toString().padLeft(2, '0');
|
||||
|
||||
return newDate.toString();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue