You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
3.3 KiB
Dart
98 lines
3.3 KiB
Dart
|
6 years ago
|
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
|
||
|
|
import 'package:doctor_app_flutter/routes.dart';
|
||
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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/card_with_bg_widget.dart';
|
||
|
|
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
||
|
|
import '../../../widgets/shared/profile_image_widget.dart';
|
||
|
|
|
||
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||
|
|
|
||
|
|
/*
|
||
|
|
*@author: ibrahim albitar
|
||
|
|
*@Date:15/5/2020
|
||
|
|
*@param:
|
||
|
|
*@return:
|
||
|
|
*@desc:
|
||
|
|
*/
|
||
|
|
|
||
|
|
class ProgressNoteScreen extends StatefulWidget {
|
||
|
|
@override
|
||
|
|
_ProgressNoteState createState() => _ProgressNoteState();
|
||
|
|
}
|
||
|
|
|
||
|
|
class _ProgressNoteState extends State<ProgressNoteScreen> {
|
||
|
|
PatientsProvider patientsProv;
|
||
|
|
var _isInit = true;
|
||
|
|
|
||
|
|
/*
|
||
|
|
*@author: ibrahim al bitar
|
||
|
|
*@Date:16/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: 5,
|
||
|
|
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: "Progress Note",
|
||
|
|
showAppDrawer: false,
|
||
|
|
showBottomBar: false,
|
||
|
|
body: patientsProv.isLoading
|
||
|
|
? DrAppCircularProgressIndeicator()
|
||
|
|
: patientsProv.isError
|
||
|
|
? DrAppEmbeddedError(error: patientsProv.error)
|
||
|
|
: patientsProv.patientVitalSignList.length == 0
|
||
|
|
? DrAppEmbeddedError(error: 'You don\'t have any Progress Note')
|
||
|
|
: 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 AppText(patientsProv.patientProgressNoteList[index]["DoctorName"].toString());
|
||
|
|
}),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|