dilog list & procedure changes

procedure_changes
hussam al-habibeh 4 years ago
parent 00b7aaf32a
commit c5eac79522

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

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

@ -28,16 +28,12 @@ class ProcedureService extends BaseService {
List<ProcedureTempleteDetailsModel> templateList = List();
List<ProcedureTempleteDetailsModel> _templateDetailsList = List();
List<ProcedureTempleteDetailsModel> get templateDetailsList =>
_templateDetailsList;
List<ProcedureTempleteDetailsModel> get templateDetailsList => _templateDetailsList;
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel =
GetOrderedProcedureRequestModel();
GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel();
ProcedureTempleteRequestModel _procedureTempleteRequestModel =
ProcedureTempleteRequestModel();
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel();
ProcedureTempleteRequestModel _procedureTempleteRequestModel = ProcedureTempleteRequestModel();
ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
// clinicId: 17,
@ -63,8 +59,7 @@ class ProcedureService extends BaseService {
//search: ["DENTAL"],
);
Future getProcedureTemplate(
{int doctorId, int projectId, int clinicId, String categoryID}) async {
Future getProcedureTemplate({int doctorId, int projectId, int clinicId, String categoryID}) async {
_procedureTempleteRequestModel = ProcedureTempleteRequestModel(
// tokenID: "@dm!n",
patientID: 0,
@ -72,19 +67,18 @@ class ProcedureService extends BaseService {
);
hasError = false;
await baseAppClient.post(GET_TEMPLETE_LIST/*GET_PROCEDURE_TEMPLETE*/,
await baseAppClient.post(GET_TEMPLETE_LIST /*GET_PROCEDURE_TEMPLETE*/,
onSuccess: (dynamic response, int statusCode) {
templateList.clear();
templateList.clear();
response['DAPP_TemplateGetList'].forEach((template) {
ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template);
if(categoryID != null){
if(categoryID == templateElement.categoryID){
if (categoryID != null) {
if (categoryID == templateElement.categoryID) {
templateList.add(templateElement);
}
} else {
templateList.add(templateElement);
}
});
// response['HIS_ProcedureTemplateList'].forEach((template) {
// _templateList.add(ProcedureTempleteModel.fromJson(template));
@ -95,21 +89,17 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteRequestModel.toJson());
}
Future getProcedureTemplateDetails(
{int doctorId, int projectId, int clinicId, int templateId}) async {
Future getProcedureTemplateDetails({int doctorId, int projectId, int clinicId, int templateId}) async {
_procedureTempleteDetailsRequestModel =
ProcedureTempleteDetailsRequestModel(
templateID: templateId, searchType: 1, patientID: 0);
ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0);
hasError = false;
//insuranceApprovalInPatient.clear();
_templateDetailsList.clear();
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, onSuccess: (dynamic response, int statusCode) {
//prescriptionsList.clear();
response['HIS_ProcedureTemplateDetailsList'].forEach((template) {
_templateDetailsList
.add(ProcedureTempleteDetailsModel.fromJson(template));
_templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -117,15 +107,12 @@ class ProcedureService extends BaseService {
}, body: _procedureTempleteDetailsRequestModel.toJson());
}
Future getProcedure({int mrn}) async {
_getOrderedProcedureRequestModel =
GetOrderedProcedureRequestModel(patientMRN: mrn);
Future getProcedure({int mrn, int appointmentNo}) async {
_getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(patientMRN: mrn, appointmentNo: appointmentNo);
hasError = false;
_procedureList.clear();
await baseAppClient.post(GET_PROCEDURE_LIST,
onSuccess: (dynamic response, int statusCode) {
_procedureList.add(
GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
_procedureList.add(GetOrderedProcedureModel.fromJson(response['OrderedProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -135,8 +122,7 @@ class ProcedureService extends BaseService {
Future getCategory() async {
hasError = false;
await baseAppClient.post(GET_LIST_CATEGORISE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(GET_LIST_CATEGORISE, onSuccess: (dynamic response, int statusCode) {
categoryList = [];
categoryList = response['listProcedureCategories']['entityList'];
}, onFailure: (String error, int statusCode) {
@ -145,7 +131,7 @@ class ProcedureService extends BaseService {
}, body: Map());
}
Future getProcedureCategory({String categoryName, String categoryID,patientId}) async {
Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
_getProcedureCategoriseReqModel = GetProcedureReqModel(
search: ["$categoryName"],
patientMRN: patientId,
@ -156,10 +142,8 @@ class ProcedureService extends BaseService {
);
hasError = false;
_categoriesList.clear();
await baseAppClient.post(GET_CATEGORISE_PROCEDURE,
onSuccess: (dynamic response, int statusCode) {
_categoriesList
.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
await baseAppClient.post(GET_CATEGORISE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
_categoriesList.add(CategoriseProcedureModel.fromJson(response['ProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -169,8 +153,7 @@ class ProcedureService extends BaseService {
Future postProcedure(PostProcedureReqModel postProcedureReqModel) async {
hasError = false;
_procedureList.clear();
await baseAppClient.post(POST_PROCEDURE_LIST,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -178,12 +161,10 @@ class ProcedureService extends BaseService {
}, body: postProcedureReqModel.toJson());
}
Future updateProcedure(
UpdateProcedureRequestModel updateProcedureRequestModel) async {
Future updateProcedure(UpdateProcedureRequestModel updateProcedureRequestModel) async {
hasError = false;
_procedureList.clear();
await baseAppClient.post(UPDATE_PROCEDURE,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(UPDATE_PROCEDURE, onSuccess: (dynamic response, int statusCode) {
print("ACCEPTED");
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -191,14 +172,11 @@ class ProcedureService extends BaseService {
}, body: updateProcedureRequestModel.toJson());
}
Future valadteProcedure(
ProcedureValadteRequestModel procedureValadteRequestModel) async {
Future valadteProcedure(ProcedureValadteRequestModel procedureValadteRequestModel) async {
hasError = false;
_valadteProcedureList.clear();
await baseAppClient.post(GET_PROCEDURE_VALIDATION,
onSuccess: (dynamic response, int statusCode) {
_valadteProcedureList.add(
ProcedureValadteModel.fromJson(response['ValidateProcedureList']));
await baseAppClient.post(GET_PROCEDURE_VALIDATION, onSuccess: (dynamic response, int statusCode) {
_valadteProcedureList.add(ProcedureValadteModel.fromJson(response['ValidateProcedureList']));
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -23,8 +23,7 @@ import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'
as cpe;
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
class ProcedureViewModel extends BaseViewModel {
//TODO Hussam clean it
@ -61,13 +60,13 @@ class ProcedureViewModel extends BaseViewModel {
List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
Future getProcedure({int mrn, String patientType}) async {
Future getProcedure({int mrn, String patientType, int appointmentNo}) async {
hasError = false;
await getDoctorProfile();
//_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy);
await _procedureService.getProcedure(mrn: mrn);
await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo);
if (_procedureService.hasError) {
error = _procedureService.error;
if (patientType == "7")
@ -78,15 +77,12 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProcedureCategory(
{String categoryName, String categoryID, patientId}) async {
Future getProcedureCategory({String categoryName, String categoryID, patientId}) async {
if (categoryName == null) return;
hasError = false;
setState(ViewState.Busy);
await _procedureService.getProcedureCategory(
categoryName: categoryName,
categoryID: categoryID,
patientId: patientId);
categoryName: categoryName, categoryID: categoryID, patientId: patientId);
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
@ -321,8 +317,7 @@ class ProcedureViewModel extends BaseViewModel {
List<cpe.EntityList> entityList,
ProcedureType procedureType}) async {
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValadteRequestModel();
ProcedureValadteRequestModel procedureValadteRequestModel = new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
@ -337,21 +332,13 @@ class ProcedureViewModel extends BaseViewModel {
procedureValadteRequestModel.procedure = [element.procedureId];
List<Controls> controls = List();
controls.add(
Controls(
code: "remarks",
controlValue: element.remarks != null ? element.remarks : ""),
Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""),
);
controls.add(
Controls(
code: "ordertype",
controlValue: procedureType == ProcedureType.PROCEDURE
? element.type ?? "1"
: "0"),
Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"),
);
controlsProcedure.add(Procedures(
category: element.categoryID,
procedure: element.procedureId,
controls: controls));
controlsProcedure
.add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls));
});
postProcedureReqModel.procedures = controlsProcedure;
@ -371,8 +358,7 @@ class ProcedureViewModel extends BaseViewModel {
Helpers.showErrorToast(error);
getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) {
Helpers.showErrorToast(
valadteProcedureList[0].entityList[0].warringMessages);
Helpers.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {

@ -35,12 +35,9 @@ class ProcedureScreen extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare'];
bool isInpatient = routeArgs['isInpatient'];
return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getProcedure(
mrn: patient.patientId,
patientType: patientType,
),
builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold(
onModelReady: (model) =>
model.getProcedure(mrn: patient.patientId, patientType: patientType, appointmentNo: patient.appointmentNo),
builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold(
isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model,
@ -56,8 +53,7 @@ class ProcedureScreen extends StatelessWidget {
SizedBox(
height: 12,
),
if (model.procedureList.length == 0 &&
patient.patientStatusType != 43)
if (model.procedureList.length == 0 && patient.patientStatusType != 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@ -77,8 +73,7 @@ class ProcedureScreen extends StatelessWidget {
],
),
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43)
if (patient.patientStatusType != null && patient.patientStatusType == 43)
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
@ -98,20 +93,19 @@ class ProcedureScreen extends StatelessWidget {
],
),
),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
model: model,
procedureType: ProcedureType.PROCEDURE,
), settings: RouteSettings(name: 'AddProcedureTabPage')
),
builder: (context) => BaseAddProcedureTabPage(
patient: patient,
model: model,
procedureType: ProcedureType.PROCEDURE,
),
settings: RouteSettings(name: 'AddProcedureTabPage')),
);
},
child: Container(
@ -159,32 +153,21 @@ class ProcedureScreen extends StatelessWidget {
...List.generate(
model.procedureList[0].rowcount,
(index) => ProcedureCard(
categoryID:
model.procedureList[0].entityList[index].categoryID,
categoryID: model.procedureList[0].entityList[index].categoryID,
entityList: model.procedureList[0].entityList[index],
onTap: () {
if (model.procedureList[0].entityList[index].categoryID ==
2 ||
if (model.procedureList[0].entityList[index].categoryID == 2 ||
model.procedureList[0].entityList[index].categoryID == 4)
updateProcedureForm(context,
model: model,
patient: patient,
remarks: model
.procedureList[0].entityList[index].remarks,
orderType: model
.procedureList[0].entityList[index].orderType
.toString(),
orderNo: model
.procedureList[0].entityList[index].orderNo,
procedureName: model.procedureList[0]
.entityList[index].procedureName,
categoreId: model
.procedureList[0].entityList[index].categoryID
.toString(),
procedureId: model.procedureList[0]
.entityList[index].procedureId,
limetNo: model.procedureList[0].entityList[index]
.lineItemNo);
remarks: model.procedureList[0].entityList[index].remarks,
orderType: model.procedureList[0].entityList[index].orderType.toString(),
orderNo: model.procedureList[0].entityList[index].orderNo,
procedureName: model.procedureList[0].entityList[index].procedureName,
categoreId: model.procedureList[0].entityList[index].categoryID.toString(),
procedureId: model.procedureList[0].entityList[index].procedureId,
limetNo: model.procedureList[0].entityList[index].lineItemNo);
// } else
// Helpers.showErrorToast(
// 'You Cant Update This Procedure');
@ -194,8 +177,7 @@ class ProcedureScreen extends StatelessWidget {
),
),
if (model.state == ViewState.ErrorLocal ||
(model.procedureList.isNotEmpty &&
model.procedureList[0].entityList.isEmpty))
(model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty))
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@ -206,9 +188,7 @@ class ProcedureScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(22.0),
child: AppText(model.procedureList.isEmpty
? model.error
: 'No Procedure Found '),
child: AppText(model.procedureList.isEmpty ? model.error : 'No Procedure Found '),
)
],
),

@ -71,43 +71,48 @@ class _ListSelectDialogState extends State<ListSelectDialog> {
Widget createDialogList() {
return Container(
height: MediaQuery.of(context).size.height * 0.5,
child: SingleChildScrollView(
child: Column(
children: [
if (widget.searchWidget != null) widget.searchWidget,
if(widget.usingSearch)
Container(
child: Column(
children: [
if (widget.searchWidget != null) widget.searchWidget,
if (widget.usingSearch)
Container(
height: MediaQuery.of(context).size.height * 0.070,
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
widget.hintSearchText ?? TranslationBase
.of(context)
.search, null, false, suffixIcon: Icon(Icons.search,)),
enabled: true,
keyboardType: TextInputType.text,
onChanged: (value) {
filterSearchResults(value);
},
)),
...items
.map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId]
.toString(),
value: item[widget.attributeValueId].toString(),
activeColor: Colors.blue.shade700,
selected: item[widget.attributeValueId].toString() ==
widget.selectedValue[widget.attributeValueId]
.toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
.toList()
],
),
child: TextField(
decoration: Helpers.textFieldSelectorDecoration(
widget.hintSearchText ?? TranslationBase.of(context).search, null, false,
suffixIcon: Icon(
Icons.search,
)),
enabled: true,
keyboardType: TextInputType.text,
onChanged: (value) {
filterSearchResults(value);
},
)),
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
...items
.map((item) => RadioListTile(
title: Text("${item[widget.attributeName].toString()}"),
groupValue: widget.selectedValue[widget.attributeValueId].toString(),
value: item[widget.attributeValueId].toString(),
activeColor: Colors.blue.shade700,
selected: item[widget.attributeValueId].toString() ==
widget.selectedValue[widget.attributeValueId].toString(),
onChanged: (val) {
setState(() {
widget.selectedValue = item;
});
},
))
.toList()
],
),
),
),
],
),
);
}

Loading…
Cancel
Save