merge-requests/250/head
Sultan Khan 5 years ago
commit 722e1a5c41

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

@ -71,6 +71,10 @@ const CREATE_REFERRAL_PATIENT =
const RESPONSE_PENDING_REFERRAL_PATIENT = const RESPONSE_PENDING_REFERRAL_PATIENT =
'Services/DoctorApplication.svc/REST/CreateReferral'; 'Services/DoctorApplication.svc/REST/CreateReferral';
const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal';
const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF';
const GET_DOCTOR_WORKING_HOURS_TABLE = const GET_DOCTOR_WORKING_HOURS_TABLE =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
@ -127,7 +131,8 @@ const GET_PRESCRIPTION_LIST =
const POST_PRESCRIPTION_LIST = const POST_PRESCRIPTION_LIST =
'Services/DoctorApplication.svc/REST/PostPrescription'; 'Services/DoctorApplication.svc/REST/PostPrescription';
const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetProcedure'; const GET_PROCEDURE_LIST =
'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure';
const GET_PATIENT_ARRIVAL_LIST = const GET_PATIENT_ARRIVAL_LIST =
@ -172,6 +177,9 @@ const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment';
const GET_ORDER_PROCEDURE = const GET_ORDER_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; 'Services/DoctorApplication.svc/REST/GetOrderedProcedure';
const GET_LIST_CATEGORISE =
'Services/DoctorApplication.svc/REST/GetProcedureCategories';
const GET_CATEGORISE_PROCEDURE = const GET_CATEGORISE_PROCEDURE =
'Services/DoctorApplication.svc/REST/GetProcedure'; 'Services/DoctorApplication.svc/REST/GetProcedure';
const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure';

@ -0,0 +1,138 @@
class GetOrderedProcedureModel {
List<EntityList> entityList;
int rowcount;
dynamic statusMessage;
GetOrderedProcedureModel(
{this.entityList, this.rowcount, this.statusMessage});
GetOrderedProcedureModel.fromJson(Map<String, dynamic> json) {
if (json['entityList'] != null) {
entityList = new List<EntityList>();
json['entityList'].forEach((v) {
entityList.add(new EntityList.fromJson(v));
});
}
rowcount = json['rowcount'];
statusMessage = json['statusMessage'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.entityList != null) {
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
}
data['rowcount'] = this.rowcount;
data['statusMessage'] = this.statusMessage;
return data;
}
}
class EntityList {
String achiCode;
String appointmentDate;
int appointmentNo;
int categoryID;
String clinicDescription;
String cptCode;
int createdBy;
String createdOn;
String doctorName;
bool isApprovalCreated;
bool isApprovalRequired;
bool isCovered;
bool isInvoiced;
bool isReferralInvoiced;
bool isUncoveredByDoctor;
int lineItemNo;
String orderDate;
int orderNo;
int orderType;
String procedureId;
String procedureName;
String remarks;
String status;
String template;
EntityList(
{this.achiCode,
this.appointmentDate,
this.appointmentNo,
this.categoryID,
this.clinicDescription,
this.cptCode,
this.createdBy,
this.createdOn,
this.doctorName,
this.isApprovalCreated,
this.isApprovalRequired,
this.isCovered,
this.isInvoiced,
this.isReferralInvoiced,
this.isUncoveredByDoctor,
this.lineItemNo,
this.orderDate,
this.orderNo,
this.orderType,
this.procedureId,
this.procedureName,
this.remarks,
this.status,
this.template});
EntityList.fromJson(Map<String, dynamic> json) {
achiCode = json['achiCode'];
appointmentDate = json['appointmentDate'];
appointmentNo = json['appointmentNo'];
categoryID = json['categoryID'];
clinicDescription = json['clinicDescription'];
cptCode = json['cptCode'];
createdBy = json['createdBy'];
createdOn = json['createdOn'];
doctorName = json['doctorName'];
isApprovalCreated = json['isApprovalCreated'];
isApprovalRequired = json['isApprovalRequired'];
isCovered = json['isCovered'];
isInvoiced = json['isInvoiced'];
isReferralInvoiced = json['isReferralInvoiced'];
isUncoveredByDoctor = json['isUncoveredByDoctor'];
lineItemNo = json['lineItemNo'];
orderDate = json['orderDate'];
orderNo = json['orderNo'];
orderType = json['orderType'];
procedureId = json['procedureId'];
procedureName = json['procedureName'];
remarks = json['remarks'];
status = json['status'];
template = json['template'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['achiCode'] = this.achiCode;
data['appointmentDate'] = this.appointmentDate;
data['appointmentNo'] = this.appointmentNo;
data['categoryID'] = this.categoryID;
data['clinicDescription'] = this.clinicDescription;
data['cptCode'] = this.cptCode;
data['createdBy'] = this.createdBy;
data['createdOn'] = this.createdOn;
data['doctorName'] = this.doctorName;
data['isApprovalCreated'] = this.isApprovalCreated;
data['isApprovalRequired'] = this.isApprovalRequired;
data['isCovered'] = this.isCovered;
data['isInvoiced'] = this.isInvoiced;
data['isReferralInvoiced'] = this.isReferralInvoiced;
data['isUncoveredByDoctor'] = this.isUncoveredByDoctor;
data['lineItemNo'] = this.lineItemNo;
data['orderDate'] = this.orderDate;
data['orderNo'] = this.orderNo;
data['orderType'] = this.orderType;
data['procedureId'] = this.procedureId;
data['procedureName'] = this.procedureName;
data['remarks'] = this.remarks;
data['status'] = this.status;
data['template'] = this.template;
return data;
}
}

@ -0,0 +1,18 @@
class GetOrderedProcedureRequestModel {
String vidaAuthTokenID;
int patientMRN;
GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN});
GetOrderedProcedureRequestModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN;
return data;
}
}

@ -0,0 +1,48 @@
class ProcedureCategoryListModel {
List<EntityList> entityList;
int rowcount;
dynamic statusMessage;
ProcedureCategoryListModel(
{this.entityList, this.rowcount, this.statusMessage});
ProcedureCategoryListModel.fromJson(Map<String, dynamic> json) {
if (json['entityList'] != null) {
entityList = new List<EntityList>();
json['entityList'].forEach((v) {
entityList.add(new EntityList.fromJson(v));
});
}
rowcount = json['rowcount'];
statusMessage = json['statusMessage'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.entityList != null) {
data['entityList'] = this.entityList.map((v) => v.toJson()).toList();
}
data['rowcount'] = this.rowcount;
data['statusMessage'] = this.statusMessage;
return data;
}
}
class EntityList {
int categoryId;
String categoryName;
EntityList({this.categoryId, this.categoryName});
EntityList.fromJson(Map<String, dynamic> json) {
categoryId = json['categoryId'];
categoryName = json['categoryName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['categoryId'] = this.categoryId;
data['categoryName'] = this.categoryName;
return data;
}
}

@ -18,6 +18,7 @@ class PatientReferralService extends LookupService {
List<dynamic> doctorsList = []; List<dynamic> doctorsList = [];
List<MyReferredPatientModel> listMyReferredPatientModel = []; List<MyReferredPatientModel> listMyReferredPatientModel = [];
List<PendingReferral> pendingReferralList = []; List<PendingReferral> pendingReferralList = [];
List<PendingReferral> patientReferralList = [];
String setupID = "0"; String setupID = "0";
Future getProjectsList() async { Future getProjectsList() async {
@ -163,6 +164,33 @@ class PatientReferralService extends LookupService {
); );
} }
Future getPatientReferral(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PatientMRN'] = patient.patientMRN;
body['AppointmentNo'] = patient.appointmentNo;
await baseAppClient.post(
GET_PATIENT_REFERRAL,
onSuccess: (dynamic response, int statusCode) {
patientReferralList.clear();
response['ReferralList']['entityList'].forEach((v) {
PendingReferral item = PendingReferral.fromJson(v);
item.isReferralDoctorSameBranch =
item.targetProjectId == item.sourceProjectId;
patientReferralList.add(item);
});
},
onFailure: (String error, int statusCode) {
patientReferralList.clear();
hasError = true;
super.error = error;
},
body: body,
);
}
Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async {
hasError = false; hasError = false;
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
@ -221,6 +249,7 @@ class PatientReferralService extends LookupService {
CREATE_REFERRAL_PATIENT, CREATE_REFERRAL_PATIENT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
print(response.toString()); print(response.toString());
print("create referral status code = ${statusCode}");
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -18,14 +18,14 @@ class PrescriptionService extends BaseService {
List<dynamic> specialityList = []; List<dynamic> specialityList = [];
List<dynamic> drugToDrug = []; List<dynamic> drugToDrug = [];
PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel();
//patientMRN: 3120877,
);
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
search: ["Acetaminophen"], //search: ["Acetaminophen"],
// vidaAuthTokenID: // vidaAuthTokenID:
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcn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VSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio",
); );
PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel _postPrescriptionReqModel =

@ -1,29 +1,37 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
class ProcedureService extends BaseService { class ProcedureService extends BaseService {
List<GetProcedureModel> _procedureList = List(); List<GetOrderedProcedureModel> _procedureList = List();
List<GetProcedureModel> get procedureList => _procedureList; List<GetOrderedProcedureModel> get procedureList => _procedureList;
List<CategoriseProcedureModel> _categoriesList = List(); List<CategoriseProcedureModel> _categoriesList = List();
List<CategoriseProcedureModel> get categoriesList => _categoriesList; List<CategoriseProcedureModel> get categoriesList => _categoriesList;
List<Procedures> procedureslist = List(); List<Procedures> procedureslist = List();
List<dynamic> categoryList = [];
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel =
GetOrderedProcedureRequestModel();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
clinicId: 17, // clinicId: 17,
pageSize: 10, // pageSize: 10,
pageIndex: 1, // pageIndex: 1,
patientMRN: 3120725, // //patientMRN: 3120725,
//categoryId: null, // //categoryId: null,
vidaAuthTokenID: // vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",
//
// search: ["lab"],
);
search: ["lab"],
);
GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel( GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel(
clinicId: 0, clinicId: 0,
pageSize: 100, pageSize: 100,
@ -33,22 +41,45 @@ class ProcedureService extends BaseService {
vidaAuthTokenID: vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI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VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",
search: ["lab"], //search: ["DENTAL"],
); );
Future getProcedure() async { Future getProcedure({int mrn}) async {
_getOrderedProcedureRequestModel =
GetOrderedProcedureRequestModel(patientMRN: mrn);
hasError = false; hasError = false;
_procedureList.clear(); _procedureList.clear();
await baseAppClient.post(GET_PROCEDURE_LIST, await baseAppClient.post(GET_PROCEDURE_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_procedureList.add(GetProcedureModel.fromJson(response['ProcedureList'])); _procedureList.add(
GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _getOrderedProcedureRequestModel.toJson());
}
Future getCategory() async {
hasError = false;
await baseAppClient.post(GET_LIST_CATEGORISE,
onSuccess: (dynamic response, int statusCode) {
categoryList = [];
categoryList = response['listProcedureCategories']['entityList'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _getProcedureReqModel.toJson()); }, body: Map());
} }
Future getCategories() async { Future getProcedureCategory({String categoryName}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel(
search: [categoryName],
patientMRN: 0,
pageIndex: 1,
clinicId: 0,
pageSize: 100,
);
hasError = false; hasError = false;
_categoriesList.clear(); _categoriesList.clear();
await baseAppClient.post(GET_CATEGORISE_PROCEDURE, await baseAppClient.post(GET_CATEGORISE_PROCEDURE,

@ -27,9 +27,27 @@ class PatientReferralViewModel extends BaseViewModel {
List<PendingReferral> get pendingReferral => List<PendingReferral> get pendingReferral =>
_referralPatientService.pendingReferralList; _referralPatientService.pendingReferralList;
List<PendingReferral> get patientReferral =>
_referralPatientService.patientReferralList;
List<PatiantInformtion> get patientArrivalList => List<PatiantInformtion> get patientArrivalList =>
_referralPatientService.patientArrivalList; _referralPatientService.patientArrivalList;
Future getPatientReferral(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _referralPatientService.getPatientReferral(patient);
if (_referralPatientService.hasError) {
error = _referralPatientService.error;
setState(ViewState.Error);
} else {
if(patientReferral.length == 0){
await getMasterLookup(MasterKeysService.physiotherapyGoals);
} else {
setState(ViewState.Idle);
}
}
}
Future getMasterLookup(MasterKeysService masterKeys) async { Future getMasterLookup(MasterKeysService masterKeys) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.getMasterLookup(masterKeys); await _referralPatientService.getMasterLookup(masterKeys);
@ -37,7 +55,7 @@ class PatientReferralViewModel extends BaseViewModel {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
await getBranches(); await getBranches();
} }
Future getBranches() async { Future getBranches() async {

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart';
@ -9,15 +10,17 @@ import 'package:doctor_app_flutter/locator.dart';
class ProcedureViewModel extends BaseViewModel { class ProcedureViewModel extends BaseViewModel {
bool hasError = false; bool hasError = false;
ProcedureService _procedureService = locator<ProcedureService>(); ProcedureService _procedureService = locator<ProcedureService>();
List<GetProcedureModel> get procedureList => _procedureService.procedureList; List<GetOrderedProcedureModel> get procedureList =>
_procedureService.procedureList;
List<CategoriseProcedureModel> get categoriesList => List<CategoriseProcedureModel> get categoriesList =>
_procedureService.categoriesList; _procedureService.categoriesList;
List<dynamic> get categoryList => _procedureService.categoryList;
Future getProcedure() async { Future getProcedure({int mrn}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure(); await _procedureService.getProcedure(mrn: mrn);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -25,11 +28,11 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getCategories() async { Future getProcedureCategory({String categoryName}) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getCategories(); await _procedureService.getProcedureCategory(categoryName: categoryName);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -37,7 +40,20 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { Future getCategory() async {
hasError = false;
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getCategory();
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future postProcedure(
PostProcedureReqModel postProcedureReqModel, int mrn) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
@ -46,12 +62,13 @@ class ProcedureViewModel extends BaseViewModel {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await getProcedure(); await getProcedure(mrn: mrn);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async { Future updateProcedure(
PostProcedureReqModel postProcedureReqModel, int mrn) async {
hasError = false; hasError = false;
//_insuranceCardService.clearInsuranceCard(); //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
@ -61,5 +78,6 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
await getProcedure(mrn: mrn);
} }
} }

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
@ -50,16 +51,21 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
patient = routeArgs['patient']; patient = routeArgs['patient'];
referToList = List(); referToList = List();
dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; dynamic sameBranch = {
dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; "id": 1,
"name": TranslationBase.of(context).sameBranch
};
dynamic otherBranch = {
"id": 2,
"name": TranslationBase.of(context).otherBranch
};
referToList.add(sameBranch); referToList.add(sameBranch);
referToList.add(otherBranch); referToList.add(otherBranch);
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<PatientReferralViewModel>( return BaseView<PatientReferralViewModel>(
onModelReady: (model) => onModelReady: (model) => model.getPatientReferral(patient),
model.getMasterLookup(MasterKeysService.physiotherapyGoals),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).referPatient, appBarTitle: TranslationBase.of(context).referPatient,
@ -86,279 +92,50 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
Container( model.patientReferral.length == 0
margin: ? ReferralForm(model, screenSize)
EdgeInsets.symmetric(vertical: 16, horizontal: 16), : PatientReferralItemWidget(
child: Column( patientName: model.patientReferral[0].patientName,
crossAxisAlignment: CrossAxisAlignment.start, referralStatus: "${model.patientReferral[0].referralStatus}",
children: [ isReferredTo: true,
SizedBox( isSameBranch: model.patientReferral[0]
height: 16, .isReferralDoctorSameBranch,
), referralDoctorName:
AppText( model.patientReferral[0].referredByDoctorInfo,
TranslationBase.of(context).referPatient, clinicDescription: null,
fontWeight: FontWeight.bold, remark:
fontSize: 16, model.patientReferral[0].remarksFromSource
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: referToList != null
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: referToList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model
.getDoctorBranch()
.then((value) {
_selectedBranch = value;
if (_referTo['id'] == 1) {
model.getClinics(
_selectedBranch['ID']);
}
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).referTo,
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.branchesList,
attributeName: 'Desciption',
attributeValueId: 'ID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
model.getClinics(
_selectedBranch['ID']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).branch,
_selectedBranch != null
? _selectedBranch['Desciption']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = null;
_selectedClinic = selectedValue;
model.getClinicDoctors(
_selectedClinic['ClinicID']
.toString());
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinic,
_selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog =
ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctor,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () => _selectDate(context, model),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context)
.chooseAppointment,
appointmentDate != null
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).remarks,
null,
false),
enabled: true,
controller: _remarksController,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_LETTERS))
],
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
],
),
), ),
], ],
), ),
Container( if (model.patientReferral.length == 0)
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), Container(
child: AppButton( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
title: TranslationBase.of(context).refer, child: AppButton(
color: HexColor("#B8382B"), title: TranslationBase.of(context).refer,
onPressed: () { color: HexColor("#B8382B"),
if (appointmentDate == null || onPressed: () {
_selectedBranch == null || if (appointmentDate == null ||
_selectedClinic == null || _selectedBranch == null ||
_selectedDoctor == null || _selectedClinic == null ||
_remarksController.text == null) return; _selectedDoctor == null ||
model _remarksController.text == null) return;
.makeReferral( model
patient, .makeReferral(
appointmentDate.toIso8601String(), patient,
_selectedBranch['ID'], appointmentDate.toIso8601String(),
_selectedClinic['ClinicID'], _selectedBranch['ID'],
_selectedDoctor['DoctorID'], _selectedClinic['ClinicID'],
_remarksController.text) _selectedDoctor['DoctorID'],
.then((_) { _remarksController.text)
DrAppToastMsg.showSuccesToast( .then((_) {
TranslationBase.of(context).referralSuccessMsg); DrAppToastMsg.showSuccesToast(
Navigator.pop(context); TranslationBase.of(context).referralSuccessMsg);
}); Navigator.pop(context);
}, });
), },
) ),
)
], ],
), ),
), ),
@ -367,6 +144,239 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
); );
} }
Widget ReferralForm(PatientReferralViewModel model, Size screenSize) {
return Container(
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 16,
),
AppText(
TranslationBase.of(context).referPatient,
fontWeight: FontWeight.bold,
fontSize: 16,
),
SizedBox(
height: 16,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: referToList != null
? () {
ListSelectDialog dialog = ListSelectDialog(
list: referToList,
attributeName: 'name',
attributeValueId: 'id',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_referTo = selectedValue;
_selectedBranch = null;
_selectedClinic = null;
_selectedDoctor = null;
model.getDoctorBranch().then((value) {
_selectedBranch = value;
if (_referTo['id'] == 1) {
model.getClinics(_selectedBranch['ID']);
}
});
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).referTo,
_referTo != null ? _referTo['name'] : null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
attributeName: 'Desciption',
attributeValueId: 'ID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
model.getClinics(_selectedBranch['ID']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).branch,
_selectedBranch != null
? _selectedBranch['Desciption']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = null;
_selectedClinic = selectedValue;
model.getClinicDoctors(
_selectedClinic['ClinicID'].toString());
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).clinic,
_selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
attributeName: 'DoctorName',
attributeValueId: 'DoctorID',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() {
_selectedDoctor = selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doctor,
_selectedDoctor != null
? _selectedDoctor['DoctorName']
: null,
true),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: () => _selectDate(context, model),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).chooseAppointment,
appointmentDate != null
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(
height: 10,
),
Container(
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).remarks, null, false),
enabled: true,
controller: _remarksController,
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS))
],
keyboardType: TextInputType.text,
minLines: 4,
maxLines: 6,
)),
],
),
);
}
_selectDate(BuildContext context, PatientReferralViewModel model) async { _selectDate(BuildContext context, PatientReferralViewModel model) async {
// https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference
// https://stackoverflow.com/a/63147062/6246772 to customize a date picker // https://stackoverflow.com/a/63147062/6246772 to customize a date picker

@ -301,7 +301,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model.drugsList, list: model.drugsList,
attributeName: 'GenericName', attributeName: 'Description',
attributeValueId: 'ItemId', attributeValueId: 'ItemId',
okText: okText:
TranslationBase.of(context) TranslationBase.of(context)

@ -19,6 +19,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
@ -40,7 +41,7 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure(), onModelReady: (model) => model.getProcedure(mrn: patient.patientMRN),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -122,8 +123,11 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
model.getCategories().then((value) { model
addSelectedProcedure(context, model); .getProcedureCategory()
.then((value) {
addSelectedProcedure(
context, model, patient);
}); });
//model.postPrescription(); //model.postPrescription();
@ -208,9 +212,11 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
), ),
), ),
onTap: () { onTap: () {
model.getCategories().then((value) { model
.getProcedureCategory()
.then((value) {
addSelectedProcedure( addSelectedProcedure(
context, model); context, model, patient);
}); });
//model.postPrescription(); //model.postPrescription();
@ -299,7 +305,11 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
15.0, 15.0,
), ),
AppText( AppText(
'Urgent', model.procedureList[0].entityList[index]
.orderType ==
1
? 'Regular'
: 'Urgent',
fontSize: fontSize:
13.0, 13.0,
color: Colors color: Colors
@ -337,18 +347,18 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
FontWeight FontWeight
.w700, .w700,
), ),
Expanded( // Expanded(
child: AppText( // child: AppText(
model // model
.procedureList[ // .procedureList[
0] // 0]
.entityList[ // .entityList[
index] // index]
.price // .price
.toString(), // .toString(),
fontSize: // fontSize:
13.0), // 13.0),
) // )
], ],
), ),
SizedBox( SizedBox(
@ -357,10 +367,19 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
Row( Row(
children: [ children: [
AppText( Expanded(
'Some short remark about the procedure', child:
fontSize: AppText(
13.5, model
.procedureList[
0]
.entityList[
index]
.remarks
.toString(),
fontSize:
13.5,
),
), ),
], ],
), ),
@ -395,7 +414,22 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
0] 0]
.entityList[ .entityList[
index] index]
.procedureName); .procedureName,
patient:
patient,
procedureId: model
.procedureList[
0]
.entityList[
index]
.procedureId,
categoreId: model
.procedureList[
0]
.entityList[
index]
.categoryID
.toString());
}, },
) )
], ],
@ -420,26 +454,36 @@ class _ProcedureScreenState extends State<ProcedureScreen> {
} }
} }
postProcedure({ProcedureViewModel model, String remarks}) async { postProcedure(
{ProcedureViewModel model,
String remarks,
PatiantInformtion patient,
List<EntityList> entityList}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = List();
postProcedureReqModel.appointmentNo = 2016054575; postProcedureReqModel.appointmentNo = patient.appointmentNo;
postProcedureReqModel.episodeID = 200012166; postProcedureReqModel.episodeID = patient.episodeNo;
postProcedureReqModel.patientMRN = 3120725; postProcedureReqModel.patientMRN = patient.patientMRN;
postProcedureReqModel.vidaAuthTokenID = postProcedureReqModel.vidaAuthTokenID =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZj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CI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI';
controls.add( controls.add(
Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'sssssssss'), Controls(
code: remarks.isEmpty ? 'ssss' : remarks, controlValue: 'sssssssss'),
); );
controlsProcedure.add(
Procedures(category: "02", procedure: "02011009", controls: controls)); entityList.forEach((element) {
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
await model.postProcedure(postProcedureReqModel); await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
@ -449,15 +493,19 @@ postProcedure({ProcedureViewModel model, String remarks}) async {
} }
updateProcedure( updateProcedure(
{ProcedureViewModel model, String remarks, String procedureId}) async { {ProcedureViewModel model,
String remarks,
String procedureId,
PatiantInformtion patient,
String categorieId}) async {
PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel();
List<Controls> controls = List(); List<Controls> controls = List();
List<Procedures> controlsProcedure = List(); List<Procedures> controlsProcedure = List();
updateProcedureReqModel.appointmentNo = 2016054575; updateProcedureReqModel.appointmentNo = patient.appointmentNo;
updateProcedureReqModel.episodeID = 200012166; updateProcedureReqModel.episodeID = patient.episodeNo;
updateProcedureReqModel.patientMRN = 3120725; updateProcedureReqModel.patientMRN = patient.patientMRN;
updateProcedureReqModel.vidaAuthTokenID = updateProcedureReqModel.vidaAuthTokenID =
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ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I6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI';
@ -467,11 +515,11 @@ updateProcedure(
controlValue: 'Testing', controlValue: 'Testing',
), ),
); );
controlsProcedure.add( controlsProcedure.add(Procedures(
Procedures(category: "02", procedure: "02011002", controls: controls)); category: categorieId, procedure: procedureId, controls: controls));
updateProcedureReqModel.procedures = controlsProcedure; updateProcedureReqModel.procedures = controlsProcedure;
await model.updateProcedure(updateProcedureReqModel); await model.updateProcedure(updateProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); helpers.showErrorToast(model.error);
@ -480,114 +528,176 @@ updateProcedure(
} }
} }
void addSelectedProcedure(context, ProcedureViewModel model) { void addSelectedProcedure(
context, ProcedureViewModel model, PatiantInformtion patient) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
builder: (BuildContext bc) { builder: (BuildContext bc) {
return AddSelectedProcedure( return AddSelectedProcedure(
model: model, model: model,
patient: patient,
); );
}); });
} }
class AddSelectedProcedure extends StatefulWidget { class AddSelectedProcedure extends StatefulWidget {
final ProcedureViewModel model; final ProcedureViewModel model;
final PatiantInformtion patient;
const AddSelectedProcedure({Key key, this.model}) : super(key: key); const AddSelectedProcedure({Key key, this.model, this.patient})
: super(key: key);
@override @override
_AddSelectedProcedureState createState() => _AddSelectedProcedureState(); _AddSelectedProcedureState createState() =>
_AddSelectedProcedureState(patient: patient, model: model);
} }
class _AddSelectedProcedureState extends State<AddSelectedProcedure> { class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
ProcedureViewModel model;
PatiantInformtion patient;
_AddSelectedProcedureState({this.patient, this.model});
TextEditingController procedureController = TextEditingController(); TextEditingController procedureController = TextEditingController();
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
List<EntityList> entityList = List(); List<EntityList> entityList = List();
dynamic selectedCategory;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return NetworkBaseView( final screenSize = MediaQuery.of(context).size;
baseViewModel: widget.model, return BaseView<ProcedureViewModel>(
child: SingleChildScrollView( onModelReady: (model) => model.getCategory(),
child: Container( builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
height: 810, NetworkBaseView(
child: Padding( baseViewModel: model,
padding: EdgeInsets.all(12.0), child: SingleChildScrollView(
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, height: 810,
children: [ child: Padding(
AppText( padding: EdgeInsets.all(12.0),
'Select Procedure'.toUpperCase(), child: Column(
fontWeight: FontWeight.w900, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
if (widget.model.categoriesList.length != 0) AppText(
EntityListCheckboxSearchWidget( 'Select Procedure'.toUpperCase(),
model: widget.model, fontWeight: FontWeight.w900,
masterList: widget.model.categoriesList[0].entityList,
removeHistory: (item) {
setState(() {
entityList.remove(item);
});
},
addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
), ),
SizedBox( Container(
height: 15.0, height: screenSize.height * 0.070,
), child: InkWell(
Column( onTap: model.categoryList != null &&
mainAxisAlignment: MainAxisAlignment.spaceBetween, model.categoryList.length > 0
children: [ ? () {
Container( ListSelectDialog dialog = ListSelectDialog(
decoration: BoxDecoration( list: model.categoryList,
borderRadius: BorderRadius.all(Radius.circular(6.0)), attributeName: 'categoryName',
border: Border.all( attributeValueId: 'categoryId',
width: 1.0, color: HexColor("#CCCCCC"))), okText: TranslationBase.of(context).ok,
child: TextFields( okFunction: (selectedValue) {
hintText: 'Order Type'.toUpperCase(), setState(() {
controller: procedureController, selectedCategory = selectedValue;
model.getProcedureCategory(
categoryName:
selectedCategory['categoryName']);
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
//model.getProcedureCategory();
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
'Procedure Categorey',
selectedCategory != null
? selectedCategory['categoryName']
: null,
true,
suffixIcon: Icon(
Icons.search,
color: Colors.black,
)),
enabled: false,
), ),
), ),
SizedBox( ),
height: 15.0, if (widget.model.categoriesList.length != 0)
), EntityListCheckboxSearchWidget(
TextFields( model: widget.model,
hintText: 'Remarks', masterList: widget.model.categoriesList[0].entityList,
controller: remarksController, removeHistory: (item) {
minLines: 3, setState(() {
maxLines: 5, entityList.remove(item);
), });
SizedBox( },
height: 50.0, addHistory: (history) {
setState(() {
entityList.add(history);
});
},
addSelectedHistories: () {
//TODO build your fun herr
// widget.addSelectedHistories();
},
isEntityListSelected: (master) =>
isEntityListSelected(master),
), ),
Container( SizedBox(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), height: 15.0,
child: Wrap( ),
alignment: WrapAlignment.center, Column(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
AppButton( children: [
title: 'add Selected Procedures'.toUpperCase(), Container(
onPressed: () { decoration: BoxDecoration(
Navigator.pop(context); borderRadius:
postProcedure( BorderRadius.all(Radius.circular(6.0)),
model: widget.model, border: Border.all(
remarks: remarksController.text); width: 1.0, color: HexColor("#CCCCCC"))),
}, child: TextFields(
), hintText: 'Order Type'.toUpperCase(),
], controller: procedureController,
),
), ),
), SizedBox(
], height: 15.0,
) ),
], TextFields(
hintText: 'Remarks',
controller: remarksController,
minLines: 3,
maxLines: 5,
),
SizedBox(
height: 50.0,
),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
title: 'add Selected Procedures'.toUpperCase(),
onPressed: () {
Navigator.pop(context);
postProcedure(
entityList: entityList,
patient: patient,
model: widget.model,
remarks: remarksController.text);
},
),
],
),
),
],
)
],
),
), ),
), ),
), ),
@ -603,10 +713,46 @@ class _AddSelectedProcedureState extends State<AddSelectedProcedure> {
} }
return false; return false;
} }
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: Colors.black,
)
: null,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
} }
void updateProcedureForm(context, {String procedureName}) { void updateProcedureForm(context,
ProcedureViewModel procedureViewModel = ProcedureViewModel(); {String procedureName,
PatiantInformtion patient,
String procedureId,
String categoreId}) {
ProcedureViewModel model = ProcedureViewModel();
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
TextEditingController orderController = TextEditingController(); TextEditingController orderController = TextEditingController();
showModalBottomSheet( showModalBottomSheet(
@ -666,7 +812,10 @@ void updateProcedureForm(context, {String procedureName}) {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
updateProcedure( updateProcedure(
model: procedureViewModel, categorieId: categoreId,
procedureId: procedureId,
patient: patient,
model: model,
remarks: remarksController.text); remarks: remarksController.text);
// authorizationForm(context); // authorizationForm(context);
}, },

@ -37,7 +37,7 @@ class PatientReferralItemWidget extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Center( Center(
child: AppText( child: AppText(
patientName, "${patientName}",
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
@ -48,9 +48,10 @@ class PatientReferralItemWidget extends StatelessWidget {
color: Color(0xFF4BA821), color: Color(0xFF4BA821),
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
child: AppText( child: AppText(
referralStatus == "46" referralStatus
/*referralStatus == "46"
? TranslationBase.of(context).approved ? TranslationBase.of(context).approved
: TranslationBase.of(context).rejected, : TranslationBase.of(context).rejected*/,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 12, fontSize: 12,

@ -1,6 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:progress_hud_v2/progress_hud.dart'; import 'package:progress_hud_v2/progress_hud.dart';
import 'loader/gif_loader_container.dart';
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:19/4/2020 *@Date:19/4/2020
@ -41,6 +43,18 @@ class _AppLoaderWidgetState extends State<AppLoaderWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Positioned(child: _progressHUD); return Container(
height: MediaQuery.of(context).size.height,
child: Stack(
children: [
Container(
color: Colors.grey.withOpacity(0.6),
),
Container(child: GifLoaderContainer(), margin: EdgeInsets.only(
bottom: MediaQuery.of(context).size.height * 0.09))
],
),
);
} }
} }

@ -0,0 +1,43 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_gifimage/flutter_gifimage.dart';
class GifLoaderContainer extends StatefulWidget {
@override
_GifLoaderContainerState createState() => _GifLoaderContainerState();
}
class _GifLoaderContainerState extends State<GifLoaderContainer>
with TickerProviderStateMixin {
GifController controller1;
@override
void initState() {
controller1 = GifController(vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) {
controller1.repeat(
min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
});
super.initState();
}
@override
void dispose() {
controller1.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
//progress-loading.gif
child: Container(
// margin: EdgeInsets.only(bottom: 40),
child: GifImage(
controller: controller1,
image: AssetImage(
"assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
),
));
}
}

@ -0,0 +1,14 @@
import 'package:flutter/material.dart';
import 'gif_loader_container.dart';
class GifLoaderDialogUtils {
static showMyDialog(BuildContext context) {
showDialog(context: context, child: GifLoaderContainer());
}
static hideDialog(BuildContext context) {
Navigator.of(context).pop();
}
}

@ -370,6 +370,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.4" version: "0.1.4"
flutter_gifimage:
dependency: "direct main"
description:
name: flutter_gifimage
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
flutter_localizations: flutter_localizations:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter

@ -61,6 +61,8 @@ dependencies:
#firebase #firebase
firebase_messaging: ^7.0.0 firebase_messaging: ^7.0.0
#GIF image
flutter_gifimage: ^1.0.1
#Autocomplete TextField #Autocomplete TextField
autocomplete_textfield: ^1.7.3 autocomplete_textfield: ^1.7.3

Loading…
Cancel
Save