merge-requests/72/head
Amjad Amireh 4 years ago
commit 8f860ab4cf

2
.gitignore vendored

@ -39,3 +39,5 @@ lib/generated_plugin_registrant.dart
.vscode/settings.json
.vscode/settings.json
.vscode/settings.json
.vscode/settings.json
.vscode/settings.json

@ -1,7 +1,7 @@
{
"commentBox.styles": {
"defaultStyle": {
"commentStartToken": "/* \n *@author: ibrahim albitar \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ",
"commentStartToken": "/* \n *@author: Amjad Amireh \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ",
"commentEndToken": "\n */",
"leftEdgeToken": " * ",
"rightEdgeToken": "",

@ -6,12 +6,19 @@ const ONLY_DATE = "[0-9/]";
const BASE_URL = 'https://uat.hmgwebservices.com/Services/';
const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems";
const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const PATIENT_INSURANCE_APPROVALS_URL = "DoctorApplication.svc/REST/GetApprovalStatusForInpatient";
const PATIENT_ORDERS_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient";
const GET_PROJECTS = 'Lists.svc/REST/GetProjectForDoctorAPP';
const GET_PATIENT_VITAL_SIGN = 'Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_LAB_OREDERS =
'DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PRESCRIPTION = 'Patients.svc/REST/GetPrescriptionApptList';
const GET_RADIOLOGY = 'DoctorApplication.svc/REST/GetPatientRadResult';
var selectedPatientType = 0;
//*********change value to decode json from Dropdown ************
var SERVICES_PATIANT = [
"GetMyOutPatient",

@ -0,0 +1,87 @@
/*
*@author: Ibrahim Albitar
*@Date:15/5/2020
*@param:
{"PatientID":1089227,
"PatientTypeID":1,
"EXuldAPPNO":0,
"ProjectID":12,
"LanguageID":2,
"stamp":"2020-04-01T09:47:19.643Z",
"IPAdress":"11.11.11.11",
"VersionID":1.2,
"Channel":9,
"TokenID":"yIwh6wNyUkOeQlJRohWjyw==",
"SessionID":"LlBk8lUEJY",
"IsLoginForDoctorApp":true,
"PatientOutSA":false}
*@return:
*@desc:
*/
class InsuranceAprovalsRequest {
int exuldAppNO;
int patientID;
int channel;
int projectID;
int languageID;
String stamp;
String ipAdress;
double versionID;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
bool patientOutSA;
int patientTypeID;
InsuranceAprovalsRequest(
{
this.exuldAppNO,
this.patientID,
this.channel = 9,
this.projectID = 12,
this.patientTypeID = 1,
this.languageID = 2,
this.stamp = '2020-04-23T21:01:21.492Z',
this.ipAdress = '11.11.11.11',
this.versionID = 1.2,
this.tokenID = '@dm!n',
this.sessionID = 'e29zoooEJ4',
this.isLoginForDoctorApp = true,
this.patientOutSA = false});
InsuranceAprovalsRequest.fromJson(Map<String, dynamic> json) {
exuldAppNO = json['EXuldAPPNO'];
patientID = json['PatientID'];
channel = json['Channel'];
projectID = json['ProjectID'];
patientTypeID = json['PatientTypeID'];
languageID = json['LanguageID'];
stamp = json['stamp'];
ipAdress = json['IPAdress'];
versionID = json['VersionID'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['EXuldAPPNO'] = this.exuldAppNO;
data['PatientID'] = this.patientID;
data['Channel'] = this.channel;
data['ProjectID'] = this.projectID;
data['PatientTypeID'] = this.patientTypeID;
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.ipAdress;
data['VersionID'] = this.versionID;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
return data;
}
}

@ -0,0 +1,88 @@
/*
*@author: Ibrahim Albitar
*@Date:15/5/2020
*@param:
{"VisitType":3,
"AdmissionNo":2020004683,
"ProjectID":12,
"LanguageID":2,
"stamp":"2020-04-01T09:53:50.410Z",
"IPAdress":"11.11.11.11",
"VersionID":1.2,
"Channel":9,
"TokenID":"yIwh6wNyUkOeQlJRohWjyw==",
"SessionID":"LlBk8lUEJY",
"IsLoginForDoctorApp":true,
"PatientOutSA":false,
"PatientTypeID":1}
*@return:
*@desc:
*/
class OrdersRequest {
int visitType;
int admissionNo;
int projectID;
int languageID;
String stamp;
String iPAdress;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
bool patientOutSA;
int patientTypeID;
double versionID;
OrdersRequest(
{this.visitType ,
this.admissionNo,
this.projectID = 12,
this.stamp = '2020-04-23T21:01:21.492Z',
this.languageID = 2,
this.iPAdress = '11.11.11.11',
this.channel = 9,
this.tokenID = '@dm!n',
this.sessionID = "LlBk8lUEJY",
this.isLoginForDoctorApp = true,
this.patientTypeID = 1,
this.versionID = 1.2,
this.patientOutSA = false});
OrdersRequest.fromJson(Map<String, dynamic> json) {
visitType = json['VisitType'];
admissionNo = json['AdmissionNo'];
projectID = json['ProjectID'];
stamp = json['stamp'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
patientTypeID = json['PatientTypeID'];
versionID = json['VersionID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VisitType'] = this.visitType;
data['AdmissionNo'] = this.admissionNo;
data['ProjectID'] = this.projectID;
data['stamp'] = this.stamp;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['Channel'] = this.channel;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
data['PatientTypeID'] = this.patientTypeID;
data['VersionID'] = this.versionID;
return data;
}
}

@ -0,0 +1,88 @@
/*
*@author: Ibrahim Albitar
*@Date:15/5/2020
*@param:
{"VisitType":5,
"AdmissionNo":2020004683,
"ProjectID":12,
"LanguageID":2,
"stamp":"2020-04-01T09:41:59.089Z",
"IPAdress":"11.11.11.11",
"VersionID":1.2,
"Channel":9,
"TokenID":"yIwh6wNyUkOeQlJRohWjyw==",
"SessionID":"LlBk8lUEJY",
"IsLoginForDoctorApp":true,
"PatientOutSA":false,
"PatientTypeID":1}
*@return:
*@desc:
*/
class ProgressNoteRequest {
int visitType;
int admissionNo;
int projectID;
int languageID;
String stamp;
String iPAdress;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
bool patientOutSA;
int patientTypeID;
double versionID;
ProgressNoteRequest(
{this.visitType ,
this.admissionNo,
this.projectID = 12,
this.stamp = '2020-04-23T21:01:21.492Z',
this.languageID = 2,
this.iPAdress = '11.11.11.11',
this.channel = 9,
this.tokenID = '@dm!n',
this.sessionID = "LlBk8lUEJY",
this.isLoginForDoctorApp = true,
this.patientTypeID = 1,
this.versionID = 1.2,
this.patientOutSA = false});
ProgressNoteRequest.fromJson(Map<String, dynamic> json) {
visitType = json['VisitType'];
admissionNo = json['AdmissionNo'];
projectID = json['ProjectID'];
stamp = json['stamp'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
patientTypeID = json['PatientTypeID'];
versionID = json['VersionID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VisitType'] = this.visitType;
data['AdmissionNo'] = this.admissionNo;
data['ProjectID'] = this.projectID;
data['stamp'] = this.stamp;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['Channel'] = this.channel;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
data['PatientOutSA'] = this.patientOutSA;
data['PatientTypeID'] = this.patientTypeID;
data['VersionID'] = this.versionID;
return data;
}
}

@ -1,5 +1,10 @@
import 'dart:convert';
import 'package:doctor_app_flutter/client/app_client.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart';
import 'package:http_interceptor/http_client_with_interceptor.dart';
@ -25,6 +30,8 @@ class PatientsProvider with ChangeNotifier {
List<LabOrdersResModel> patientLabResultOrdersList = [];
List<PrescriptionResModel> patientPrescriptionsList = [];
List<RadiologyResModel> patientRadiologyList = [];
var patientProgressNoteList = [];
var insuranceApporvalsList = [];
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
@ -275,4 +282,72 @@ class PatientsProvider with ChangeNotifier {
handelCatchErrorCase(err);
}
}
getPatientProgressNote(patient) async{
setBasicData();
try {
if (await Helpers.checkConnection()) {
final response =await AppClient.post(PATIENT_PROGRESS_NOTE_URL, body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isError = true;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
patientProgressNoteList = res['List_GetPregressNoteForInPatient'];
} else {
isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage'];
}
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
getPatientInsuranceApprovals(patient) async{
//setBasicData();
try {
if (await Helpers.checkConnection()) {
final response =await AppClient.post(PATIENT_INSURANCE_APPROVALS_URL, body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isError = true;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
//patientRadiologyList = [];
insuranceApporvalsList = res['List_ApprovalMain_InPatient'];
} else {
isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage'];
}
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
}

@ -1,4 +1,11 @@
<<<<<<< HEAD
=======
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart';
>>>>>>> 7f5831335b1fac9625ba368a5bca916aaa9b9d74
import './screens/patients/profile/vital_sign/body_measurements_screen.dart';
@ -51,6 +58,9 @@ const String VITAL_SIGN = 'patients/vital-sign';
const String LAB_ORDERS = 'patients/lab_orders';
const String PRESCRIPTIONS = 'patients/prescription';
const String RADIOLOGY = 'patients/radiology';
const String PROGRESS_NOTE = 'patients/progress-note';
const String PATIENT_ORDERS = 'patients/patient_orders';
const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals';
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String BODY_MEASUREMENTS = 'patients/body-measurements';
@ -80,6 +90,9 @@ var routes = {
LAB_ORDERS: (_) => LabOrdersScreen(),
PRESCRIPTIONS: (_) => PrescriptionScreen(),
RADIOLOGY: (_) => RadiologyScreen(),
PROGRESS_NOTE: (_) => ProgressNoteScreen(),
PATIENT_ORDERS: (_) => PatientsOrdersScreen(),
PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(),
VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
BODY_MEASUREMENTS: (_) => BodyMeasurementsScreen()
};

@ -252,9 +252,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"In Patient",
"Search Medicine",
showBorder: false,
backgroundColor: Colors.blueGrey[900],
backgroundColor: Colors.teal,
),
onTap: () {
Navigator.push(

@ -187,6 +187,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
onChanged: (String newValue) => {
setState(() {
_selectedType = newValue;
selectedPatientType = int.parse(_selectedType);
})
},
items: PATIENT_TYPE.map((item) {

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

@ -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: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, // if equal 5 then this will return progress note
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.patientProgressNoteList.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 RoundedContainer(
backgroundColor: Colors.yellow[200],
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();
}
}

@ -36,7 +36,7 @@ class BodyMeasurementsScreen extends StatelessWidget {
barGroupingType: charts.BarGroupingType.grouped,
// behaviors: [new charts.SeriesLegend()],
// primaryMeasureAxis: ,
animationDuration: Duration(seconds: 5),
animationDuration: Duration(seconds: 1),
),
),
],

@ -16,6 +16,7 @@ DrAppToastMsg toastMsg = DrAppToastMsg();
*@desc: This class will contian some Function will help developer
*/
class Helpers {
int cupertinoPickerIndex = 0;
/*
*@author: Elham Rababah
*@Date:12/4/2020
@ -25,14 +26,58 @@ class Helpers {
*/
showCupertinoPicker(context, items, decKey, onSelectFun) {
showModalBottomSheet(
isDismissible: false,
context: context,
builder: (BuildContext builder) {
return Container(
height: SizeConfig.realScreenHeight * .3,
child: buildPickerItems(context, items, decKey, onSelectFun));
// height: 500,
height: SizeConfig.realScreenHeight * 0.4,
color: Color(0xfff7f7f7),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
color: Color(0xfff7f7f7),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
CupertinoButton(
child: Text('Cancel'.toUpperCase(), style: textStyle(context)),
onPressed: () {
Navigator.pop(context);
},
// padding: const EdgeInsets.symmetric(
// horizontal: 16.0,
// vertical: 5.0,
// ),
),
CupertinoButton(
child: Text(
'Done'.toUpperCase(),
style: textStyle(context),
),
onPressed: () {
Navigator.pop(context);
onSelectFun(cupertinoPickerIndex);
},
)
],
),
),
Container(
height: SizeConfig.realScreenHeight * 0.3,
color: Color(0xfff7f7f7),
child:
buildPickerItems(context, items, decKey, onSelectFun))
],
),
);
});
}
TextStyle textStyle(context) =>
TextStyle(color: Theme.of(context).primaryColor);
/*
*@author: Elham Rababah
*@Date:12/4/2020
@ -41,14 +86,15 @@ class Helpers {
*@desc: buildPickerIterm this function will build the items of the cupertino
*/
buildPickerItems(context, List items, decKey, onSelectFun) {
return Container(
child: CupertinoPicker(
return CupertinoPicker(
magnification: 1.5,
scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex),
// backgroundColor: Colors.black87,
children: items.map((item) {
return Text(
'${item["$decKey"]}',
style: TextStyle(fontSize: SizeConfig.textMultiplier *3),
style: TextStyle(fontSize: SizeConfig.textMultiplier * 3),
);
}).toList(),
@ -56,9 +102,8 @@ class Helpers {
looping: true,
onSelectedItemChanged: (int index) {
// selectitem =index;
onSelectFun(index);
cupertinoPickerIndex = index;
},
),
);
}
@ -96,6 +141,7 @@ class Helpers {
return false;
}
}
/*
*@author: Elham Rababah
*@Date:12/5/2020
@ -103,15 +149,11 @@ class Helpers {
*@return: String
*@desc: generate Contact Admin Msg
*/
generateContactAdminMsg([err = null]) {
generateContactAdminMsg([err = null]) {
String localMsg = 'Something wrong happened, please contact the admin';
if (err != null) {
localMsg = localMsg +'\n \n'+ err.toString();
localMsg = localMsg + '\n \n' + err.toString();
}
return localMsg;
}
}
}

@ -53,6 +53,9 @@ class _LoginFormState extends State<LoginForm> {
@override
Widget build(BuildContext context) {
final focusPass = FocusNode();
final focusProject = FocusNode();
if (projectsList.length == 0) {
getProjectsList();
}
@ -68,6 +71,7 @@ class _LoginFormState extends State<LoginForm> {
buildSizedBox(),
TextFormField(
keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
decoration: buildInputDecoration(
context, 'Enter ID', 'assets/images/user_id_icon.png'),
validator: (value) {
@ -79,12 +83,17 @@ class _LoginFormState extends State<LoginForm> {
onSaved: (value) {
userInfo.UserID = value;
},
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(focusPass);
},
),
buildSizedBox(),
TextFormField(
focusNode: focusPass,
obscureText: true,
decoration: buildInputDecoration(context, 'Enter Password',
'assets/images/password_icon.png'),
textInputAction: TextInputAction.next,
decoration: buildInputDecoration(
context, 'Enter Password', 'assets/images/password_icon.png'),
validator: (value) {
if (value.isEmpty) {
return 'Please enter your Password';
@ -93,9 +102,16 @@ class _LoginFormState extends State<LoginForm> {
},
onSaved: (value) {
userInfo.Password = value;
}),
},
onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(focusProject);
helpers.showCupertinoPicker(
context, projectsList, 'Name', onSelectProject);
},
),
buildSizedBox(),
TextFormField(
focusNode: focusProject,
controller: projectIdController,
onTap: () {
helpers.showCupertinoPicker(
@ -312,7 +328,7 @@ class _LoginFormState extends State<LoginForm> {
onSelectProject(index) {
setState(() {
userInfo.ProjectID = projectsList[index]["ID"];
projectIdController.text = projectsList[index]['Desciption'];
projectIdController.text = projectsList[index]['Name'];
});
}
}

@ -51,7 +51,10 @@ class _VerifyAccountState extends State<VerifyAccount> {
@override
Widget build(BuildContext context) {
authProv = Provider.of<AuthProvider>(context);
final focusD1 = FocusNode();
final focusD2 = FocusNode();
final focusD3 = FocusNode();
final focusD4 = FocusNode();
return FutureBuilder(
future: Future.wait([_loggedUserFuture]),
builder: (BuildContext context, AsyncSnapshot snapshot) {
@ -78,6 +81,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
Container(
width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField(
textInputAction: TextInputAction.next,
style: buildTextStyle(),
maxLength: 1,
textAlign: TextAlign.center,
@ -89,10 +93,16 @@ class _VerifyAccountState extends State<VerifyAccount> {
val;
},
validator: validateCodeDigit,
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD2);
},
)),
Container(
width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField(
focusNode: focusD2,
textInputAction: TextInputAction.next,
maxLength: 1,
textAlign: TextAlign.center,
style: buildTextStyle(),
@ -103,10 +113,17 @@ class _VerifyAccountState extends State<VerifyAccount> {
verifyAccountFormValue['digit2'] =
val;
},
validator: validateCodeDigit)),
onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD3);
},
validator: validateCodeDigit),
),
Container(
width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField(
focusNode: focusD3,
textInputAction: TextInputAction.next,
maxLength: 1,
textAlign: TextAlign.center,
style: buildTextStyle(),
@ -116,11 +133,15 @@ class _VerifyAccountState extends State<VerifyAccount> {
onSaved: (val) {
verifyAccountFormValue['digit3'] =
val;
},onFieldSubmitted: (_) {
FocusScope.of(context)
.requestFocus(focusD4);
},
validator: validateCodeDigit)),
Container(
width: SizeConfig.realScreenWidth * 0.20,
child: TextFormField(
focusNode: focusD4,
maxLength: 1,
textAlign: TextAlign.center,
style: buildTextStyle(),
@ -294,7 +315,8 @@ class _VerifyAccountState extends State<VerifyAccount> {
if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
if (res['List_DoctorProfile'] != null) {
loginProcessCompleted(res['List_DoctorProfile'][0],changeLoadingStata);
loginProcessCompleted(
res['List_DoctorProfile'][0], changeLoadingStata);
} else {
_asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName',
'Please Select Clinic')
@ -319,7 +341,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
}
}
/*
*@author: Elham Rababah
*@Date:17/5/2020
@ -327,7 +348,8 @@ class _VerifyAccountState extends State<VerifyAccount> {
*@return:
*@desc: loginProcessCompleted
*/
loginProcessCompleted(Map<String, dynamic> profile, Function changeLoadingStata) {
loginProcessCompleted(
Map<String, dynamic> profile, Function changeLoadingStata) {
changeLoadingStata(false);
sharedPref.setObj(DOCTOR_PROFILE, profile);
Navigator.of(context).pushNamed(HOME);

@ -150,7 +150,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
top: SizeConfig.heightMultiplier * 0.5),
child: Image.asset(
url,
height: SizeConfig.heightMultiplier * 11,
height: SizeConfig.heightMultiplier * 10,
fit: BoxFit.cover,
),
),
@ -182,11 +182,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Map model = {
"LogInTokenID": _loggedUser['LogInTokenID'],
"Channel": 9,
"MobileNumber": 785228065, //_loggedUser['MobileNumber'],
"MobileNumber": _loggedUser['MobileNumber'],
"IPAdress": "11.11.11.11",
"LanguageID": 2,
"ProjectID": 15, //TODO : this should become daynamci
"ZipCode": 962, //_loggedUser['ZipCode'],
"ZipCode": _loggedUser['ZipCode'],
"UserName": _loggedUser['List_MemberInformation'][0]['MemberID'],
"OTP_SendType": oTPSendType
};

@ -28,7 +28,7 @@ class ProfileHeaderWidget extends StatelessWidget {
height: SizeConfig.heightMultiplier * 30,
child: ProfileImageWidget(
url:
"http://images4.fanpop.com/image/photos/16200000/David-Schwimmer-Ross-Geller-ross-geller-16258927-629-779.jpg",
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
name: patient.firstName + ' ' + patient.lastName,
des: patient.patientId.toString(),
height: SizeConfig.heightMultiplier * 17,

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/routes.dart';
@ -51,8 +52,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
child: CircleAvatarWidget(
des: 'Vital Sign',
url: url + 'heartbeat.png',
width: (contWidth) / 3.5,
height: (contWidth) / 3.5,
width: (contWidth) / 4.5,
height: (contWidth) / 4.5,
),
),
InkWell(
@ -62,8 +63,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
child: CircleAvatarWidget(
des: 'Lab Result',
url: url + 'lab.png',
width: (contWidth) / 3.5,
height: (contWidth) / 3.5,
width: (contWidth) / 4.5,
height: (contWidth) / 4.5,
),
),
InkWell(
@ -73,8 +74,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
child: CircleAvatarWidget(
des: 'Prescription',
url: url + 'note.png',
width: (contWidth) / 3.5,
height: (contWidth) / 3.5,
width: (contWidth) / 4.5,
height: (contWidth) / 4.5,
),
),
InkWell(
@ -85,8 +86,69 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
child: CircleAvatarWidget(
des: 'Radiology',
url: url + 'radiology-1.png',
width: (contWidth) / 3.5,
height: (contWidth) / 3.5,
width: (contWidth) / 4.5,
height: (contWidth) / 4.5,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Visibility(
visible: selectedPatientType != 0 && selectedPatientType != 5 ,
child: InkWell(
onTap: () {
navigator(context, PROGRESS_NOTE);
},
child: CircleAvatarWidget(
des: 'Progress Notes',
url: url + 'heartbeat.png',
width: (contWidth) / 4.5,
height: (contWidth) / 4.5,
),
),
),
Visibility(
child: InkWell(
onTap: () {
navigator(context, PATIENT_INSURANCE_APPROVALS);
},
child: CircleAvatarWidget(
des: 'Insurance Aprovals',
url: url + 'lab.png',
width: (contWidth) / 4.5,
height: (contWidth) / 4.5,
),
),
),
Visibility(
visible: selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 2,
child: InkWell(
onTap: () {
navigator(context, PRESCRIPTIONS);
},
child: CircleAvatarWidget(
des: 'Refer Patient ',
url: url + 'note.png',
width: (contWidth) / 4.5,
height: (contWidth) / 4.5,
),
),
),
Visibility(
visible: selectedPatientType != 0 && selectedPatientType != 5,
child: InkWell(
onTap: () {
navigator(context, PATIENT_ORDERS);
},
child: CircleAvatarWidget(
des: 'Orders',
url: url + 'radiology-1.png',
width: (contWidth) / 4.5,
height: (contWidth) / 4.5,
),
),
),
],
@ -146,7 +208,7 @@ class CircleAvatarWidget extends StatelessWidget {
),
AppText(
des,
fontSize: 2 * SizeConfig.textMultiplier,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
)
],

@ -1,13 +1,18 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../config/shared_pref_kay.dart';
import '../../config/size_config.dart';
import '../../providers/schedule_provider.dart';
import '../../routes.dart';
import '../../screens/doctor/my_schedule_screen.dart';
import '../../util/dr_app_shared_pref.dart';
import '../../widgets/shared/drawer_item_widget.dart';
import '../../widgets/shared/rounded_container_widget.dart';
import 'app_texts_widget.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
// OWNER : Ibrahim albitar
// DATE : 06-04-2020
@ -19,8 +24,30 @@ class AppDrawer extends StatefulWidget {
}
class _AppDrawerState extends State<AppDrawer> {
bool _isInit = true;
DoctorProfileModel doctorProfile;
@override
void didChangeDependencies() {
super.didChangeDependencies();
// if (_isInit) {
getDocProfile();// TODO: Refactor this code to prevent errors in the cosole.
// }
_isInit = false;
}
getDocProfile() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// doctorProfile = DoctorProfileModel.fromJson(profile);
setState(() {
doctorProfile = DoctorProfileModel.fromJson(profile);
});
String token = await sharedPref.getString(TOKEN);
}
@override
Widget build(BuildContext context) {
// var x = getDocProfile();
return RoundedContainer(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 9),
@ -35,19 +62,20 @@ class _AppDrawerState extends State<AppDrawer> {
children: <Widget>[
CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
backgroundImage: NetworkImage(
"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png"),
backgroundImage:
NetworkImage(doctorProfile.doctorImageURL),
backgroundColor: Colors.transparent,
),
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
"Dr. Chris evans",
doctorProfile.doctorName,
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier * 2,
)),
AppText("Director of medical records",
AppText("Director of medical records",//TODO: Make The Dr Title Dynamic and check overflow issue.
fontWeight: FontWeight.normal, color: Colors.white)
],
),
@ -83,6 +111,12 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.of(context).pushNamed(QR_READER);
},
),
InkWell(
child: DrawerItem("lOGOUT", Icons.exit_to_app),
onTap: () {
Navigator.of(context).pushNamed(LOGIN);
},
),
])),
),
width: SizeConfig.realScreenWidth * 0.55,

@ -71,7 +71,7 @@ class AppScaffold extends StatelessWidget {
height: 50,
width: 50,
url:
"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png",
"https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
)
],
),

Loading…
Cancel
Save