merge-requests/70/head
unknown 6 years ago
commit ef4cb2f0cb

@ -18,18 +18,20 @@ import '../util/helpers.dart';
const GET_PATIENT_VITAL_SIGN = const GET_PATIENT_VITAL_SIGN =
BASE_URL + 'Doctors.svc/REST/Doctor_GetPatientVitalSign'; BASE_URL + 'Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_LAB_OREDERS =BASE_URL + 'DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PATIENT_LAB_OREDERS =
const GET_PRESCRIPTION =BASE_URL+'Patients.svc/REST/GetPrescriptionApptList'; BASE_URL + 'DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_RADIOLOGY = BASE_URL+'DoctorApplication.svc/REST/GetPatientRadResult'; const GET_PRESCRIPTION = BASE_URL + 'Patients.svc/REST/GetPrescriptionApptList';
const GET_RADIOLOGY =
BASE_URL + 'DoctorApplication.svc/REST/GetPatientRadResult';
class PatientsProvider with ChangeNotifier { class PatientsProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = false;
bool isError = false; bool isError = false;
String error = ''; String error = '';
List<VitalSignResModel> patientVitalSignList = []; List<VitalSignResModel> patientVitalSignList = [];
List <LabOrdersResModel>patientLabResultOrdersList = []; List<LabOrdersResModel> patientLabResultOrdersList = [];
List <PrescriptionResModel>patientPrescriptionsList = []; List<PrescriptionResModel> patientPrescriptionsList = [];
List <RadiologyResModel >patientRadiologyList = []; List<RadiologyResModel> patientRadiologyList = [];
Client client = Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
@ -79,6 +81,13 @@ class PatientsProvider with ChangeNotifier {
} }
} }
setBasicData() {
isLoading = true;
isError = false;
error = '';
notifyListeners();
}
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:27/4/2020 *@Date:27/4/2020
@ -87,6 +96,8 @@ class PatientsProvider with ChangeNotifier {
*@desc: getPatientVitalSign *@desc: getPatientVitalSign
*/ */
getPatientVitalSign(patient) async { getPatientVitalSign(patient) async {
setBasicData();
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(GET_PATIENT_VITAL_SIGN, final response = await client.post(GET_PATIENT_VITAL_SIGN,
@ -138,6 +149,10 @@ class PatientsProvider with ChangeNotifier {
*@desc: getLabResult Orders *@desc: getLabResult Orders
*/ */
getLabResultOrders(patient) async { getLabResultOrders(patient) async {
// isLoading = true;
// notifyListeners();
setBasicData();
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(GET_PATIENT_LAB_OREDERS, final response = await client.post(GET_PATIENT_LAB_OREDERS,
@ -179,11 +194,15 @@ class PatientsProvider with ChangeNotifier {
*@return: *@return:
*@desc: getPatientPrescriptions *@desc: getPatientPrescriptions
*/ */
getPatientPrescriptions(patient) async { getPatientPrescriptions(patient) async {
// isLoading = true;
// notifyListeners();
setBasicData();
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(GET_PRESCRIPTION, final response =
body: json.encode(patient)); await client.post(GET_PRESCRIPTION, body: json.encode(patient));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
isLoading = false; isLoading = false;
@ -197,7 +216,8 @@ getPatientPrescriptions(patient) async {
patientPrescriptionsList = []; patientPrescriptionsList = [];
print("res['PatientPrescriptionList']"); print("res['PatientPrescriptionList']");
res['PatientPrescriptionList'].forEach((v) { res['PatientPrescriptionList'].forEach((v) {
patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v)); patientPrescriptionsList
.add(new PrescriptionResModel.fromJson(v));
}); });
} else { } else {
isError = true; isError = true;
@ -221,11 +241,14 @@ getPatientPrescriptions(patient) async {
*@return: *@return:
*@desc: getPatientRadiology *@desc: getPatientRadiology
*/ */
getPatientRadiology(patient) async { getPatientRadiology(patient) async {
// isLoading = true;
// notifyListeners();
setBasicData();
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(GET_RADIOLOGY, final response =
body: json.encode(patient)); await client.post(GET_RADIOLOGY, body: json.encode(patient));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
isLoading = false; isLoading = false;
@ -239,7 +262,7 @@ getPatientRadiology(patient) async {
patientRadiologyList = []; patientRadiologyList = [];
print("res['List_GetRadOreders']"); print("res['List_GetRadOreders']");
res['List_GetRadOreders'].forEach((v) { res['List_GetRadOreders'].forEach((v) {
patientRadiologyList.add(new RadiologyResModel .fromJson(v)); patientRadiologyList.add(new RadiologyResModel.fromJson(v));
}); });
} else { } else {
isError = true; isError = true;
@ -256,6 +279,4 @@ getPatientRadiology(patient) async {
throw error; throw error;
} }
} }
} }

@ -11,6 +11,7 @@ import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart'; import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/card_with_bg_widget.dart'; import '../../../../widgets/shared/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -107,17 +108,9 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
CircleAvatar( ProfileImageWidget(url:patientsProv
radius: .patientLabResultOrdersList[index]
SizeConfig.imageSizeMultiplier *
12,
backgroundImage: NetworkImage(
patientsProv
.patientLabResultOrdersList[
index]
.doctorImageURL), .doctorImageURL),
backgroundColor: Colors.transparent,
),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(

@ -1,18 +1,17 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription_req_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
import '../../../../models/patient/vital_sign_req_model.dart'; import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/prescription_req_model.dart';
import '../../../../providers/patients_provider.dart'; import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart'; import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.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/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -109,16 +108,9 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
CircleAvatar( ProfileImageWidget(url:patientsProv
radius:
SizeConfig.imageSizeMultiplier *
12,
backgroundImage: NetworkImage(
patientsProv
.patientPrescriptionsList[index] .patientPrescriptionsList[index]
.doctorImageURL), .doctorImageURL),
backgroundColor: Colors.transparent,
),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(

@ -1,18 +1,17 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology_req_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
import '../../../../models/patient/vital_sign_req_model.dart'; import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/radiology_req_model.dart';
import '../../../../providers/patients_provider.dart'; import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart'; import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.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/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -51,12 +50,12 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
} }
print(type); print(type);
RadiologyReqModel radiologyReqModel = RadiologyReqModel( RadiologyReqModel radiologyReqModel = RadiologyReqModel(
patientID: patient.patientId, patientID: patient.patientId,
projectID: patient.projectId, projectID: patient.projectId,
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2, languageID: 2,
); );
patientsProv.getPatientRadiology(radiologyReqModel.toJson()); patientsProv.getPatientRadiology(radiologyReqModel.toJson());
} }
@ -108,16 +107,10 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
CircleAvatar( ProfileImageWidget(
radius: url: patientsProv
SizeConfig.imageSizeMultiplier * .patientRadiologyList[index]
12, .doctorImageURL),
backgroundImage: NetworkImage(
patientsProv
.patientRadiologyList[index]
.doctorImageURL),
backgroundColor: Colors.transparent,
),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(

@ -1,17 +1,17 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/vital_sign_req_model.dart'; import '../../../../models/patient/vital_sign_req_model.dart';
import '../../../../providers/patients_provider.dart'; import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart'; import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.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/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -109,16 +109,9 @@ class _VitalSignScreenState extends State<VitalSignScreen> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
CircleAvatar( ProfileImageWidget(url:patientsProv
radius:
SizeConfig.imageSizeMultiplier *
12,
backgroundImage: NetworkImage(
patientsProv
.patientVitalSignList[index] .patientVitalSignList[index]
.doctorImageURL), .doctorImageURL),
backgroundColor: Colors.transparent,
),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.fromLTRB( padding: const EdgeInsets.fromLTRB(

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -60,7 +61,13 @@ class AppScaffold extends StatelessWidget {
}), }),
centerTitle: true, centerTitle: true,
actions: <Widget>[ actions: <Widget>[
IconButton(icon: Icon(Icons.person), onPressed: null) // IconButton(icon: Icon(Icons.person), onPressed: null)
ProfileImageWidget(
height: 50,
width: 50,
url:
"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png",
)
], ],
), ),
drawer: (pageOnly == true || showAppDrawer == false) drawer: (pageOnly == true || showAppDrawer == false)

@ -40,15 +40,14 @@ class ProfileImageWidget extends StatelessWidget {
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
), ),
), ),
Padding( name==null || des == null?SizedBox():SizedBox(height: 10,),
padding: EdgeInsets.only(top: 10), name==null?SizedBox():AppText(
child: AppText( name,
name, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 4,
fontSize: SizeConfig.textMultiplier * 4, color: color,
color: color, ),
)), des==null?SizedBox():AppText(
AppText(
des, des,
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
) )

Loading…
Cancel
Save