updates & fixes

development-3.3_voipCall
haroon amjad 2 years ago
parent 4741a7b66d
commit fc21961807

Binary file not shown.

@ -0,0 +1,4 @@
storePassword=HmGsa123
keyPassword=HmGsa123
keyAlias=hmgdoctor
storeFile=doctor_app_key

@ -115,8 +115,8 @@ class BaseAppClient {
// print("ProjectID :");
// print(body['ProjectID']);
print("URL : $url");
print("Body : ${json.encode(body)}");
debugPrint("URL : $url");
debugPrint("Body : ${json.encode(body)}");
var asd = json.encode(body);
var asd2;
if (await Utils.checkConnection()) {

@ -446,7 +446,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 8.6;
const VERSION_ID = 8.7;
const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -18,19 +18,15 @@ import '../../locator.dart';
class UcafViewModel extends BaseViewModel {
UcafService _ucafService = locator<UcafService>();
List<GetChiefComplaintResModel> get patientChiefComplaintList =>
_ucafService.patientChiefComplaintList;
List<GetChiefComplaintResModel> get patientChiefComplaintList => _ucafService.patientChiefComplaintList;
List<VitalSignHistory> get patientVitalSignsHistory =>
_ucafService.patientVitalSignsHistory;
List<VitalSignHistory> get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory;
List<GetAssessmentResModel> get patientAssessmentList =>
_ucafService.patientAssessmentList;
List<GetAssessmentResModel> get patientAssessmentList => _ucafService.patientAssessmentList;
List<MasterKeyModel> get diagnosisTypes => _ucafService.listOfDiagnosisType;
List<MasterKeyModel> get diagnosisConditions =>
_ucafService.listOfDiagnosisCondition;
List<MasterKeyModel> get diagnosisConditions => _ucafService.listOfDiagnosisCondition;
PrescriptionModel get prescriptionList => _ucafService.prescriptionList;
@ -75,7 +71,7 @@ class UcafViewModel extends BaseViewModel {
// await _ucafService.getPatientVitalSignsHistory(patient, from, to);
await _ucafService.getInPatientVitalSignHistory(patient, false);
await _ucafService.getPatientChiefComplaint(patient);
// await _ucafService.getPatientChiefComplaint(patient);
if (_ucafService.hasError) {
error = _ucafService.error;
@ -91,23 +87,16 @@ class UcafViewModel extends BaseViewModel {
if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') {
bodyMax = element.bodyMassIndex.toString();
}
if (temperatureCelcius == "0" ||
temperatureCelcius == null ||
temperatureCelcius == 'null') {
if (temperatureCelcius == "0" || temperatureCelcius == null || temperatureCelcius == 'null') {
temperatureCelcius = element.temperatureCelcius.toString();
}
if (hartRat == "0" || hartRat == null || hartRat == 'null') {
hartRat = element.pulseBeatPerMinute.toString();
}
if (respirationBeatPerMinute == "0" ||
respirationBeatPerMinute == null ||
respirationBeatPerMinute == 'null') {
respirationBeatPerMinute =
element.respirationBeatPerMinute.toString();
if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') {
respirationBeatPerMinute = element.respirationBeatPerMinute.toString();
}
if (bloodPressure == "0 / 0" ||
bloodPressure == null ||
bloodPressure == 'null') {
if (bloodPressure == "0/0" || bloodPressure == null || bloodPressure == 'null') {
bloodPressure = element.bloodPressure.toString();
}
});
@ -126,8 +115,7 @@ class UcafViewModel extends BaseViewModel {
} else {
if (patientAssessmentList.isNotEmpty) {
if (diagnosisConditions.length == 0) {
await _ucafService
.getMasterLookup(MasterKeysService.DiagnosisCondition);
await _ucafService.getMasterLookup(MasterKeysService.DiagnosisCondition);
}
if (diagnosisTypes.length == 0) {
await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType);
@ -169,13 +157,11 @@ class UcafViewModel extends BaseViewModel {
}
}
MasterKeyModel findMasterDataById(
{@required MasterKeysService masterKeys, dynamic id}) {
MasterKeyModel findMasterDataById({@required MasterKeysService masterKeys, dynamic id}) {
switch (masterKeys) {
case MasterKeysService.DiagnosisCondition:
List<MasterKeyModel> result = diagnosisConditions.where((element) {
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;
@ -183,8 +169,7 @@ class UcafViewModel extends BaseViewModel {
return null;
case MasterKeysService.DiagnosisType:
List<MasterKeyModel> result = diagnosisTypes.where((element) {
return element.id == id &&
element.typeId == masterKeys.getMasterKeyService();
return element.id == id && element.typeId == masterKeys.getMasterKeyService();
}).toList();
if (result.isNotEmpty) {
return result.first;

@ -7,8 +7,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.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;
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart';
@ -36,14 +35,11 @@ class ProcedureViewModel extends BaseViewModel {
bool hasError = false;
ProcedureService _procedureService = locator<ProcedureService>();
List<GetOrderedProcedureModel> get procedureList =>
_procedureService.procedureList;
List<GetOrderedProcedureModel> get procedureList => _procedureService.procedureList;
List<ProcedureValadteModel> get valadteProcedureList =>
_procedureService.valadteProcedureList;
List<ProcedureValadteModel> get valadteProcedureList => _procedureService.valadteProcedureList;
List<CategoriseProcedureModel> get categoriesList =>
_procedureService.categoriesList;
List<CategoriseProcedureModel> get categoriesList => _procedureService.categoriesList;
List<dynamic> get categoryList => _procedureService.categoryList;
RadiologyService _radiologyService = locator<RadiologyService>();
@ -51,44 +47,31 @@ class ProcedureViewModel extends BaseViewModel {
List<FinalRadiologyList> _finalRadiologyListClinic = List();
List<FinalRadiologyList> _finalRadiologyListHospital = List();
List<FinalRadiologyList> get finalRadiologyList =>
filterType == FilterType.Clinic
? _finalRadiologyListClinic
: _finalRadiologyListHospital;
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
List<FinalRadiology> get radiologyList =>
_radiologyService.finalRadiologyList;
List<FinalRadiology> get radiologyList => _radiologyService.finalRadiologyList;
List<PatientLabOrders> get patientLabOrdersList =>
_labsService.patientLabOrdersList;
List<PatientLabOrders> get patientLabOrdersList => _labsService.patientLabOrdersList;
List<LabOrderResult> get labOrdersResultsList =>
_labsService.labOrdersResultsList;
List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<ProcedureTempleteDetailsModel> get procedureTemplate =>
_procedureService.templateList;
List<ProcedureTempleteDetailsModel> get procedureTemplate => _procedureService.templateList;
List<ProcedureTempleteDetailsModelList> templateList = List();
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails =>
_procedureService.templateDetailsList;
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => _procedureService.templateDetailsList;
bool _isRadiologyVIDAPlus = false;
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
Future getProcedure(
{int mrn,
String patientType,
int appointmentNo,
bool isLocalBusy = false}) async {
Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async {
hasError = false;
await getDoctorProfile();
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _procedureService.getProcedure(
mrn: mrn, appointmentNo: appointmentNo);
await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo);
if (_procedureService.hasError) {
error = _procedureService.error;
if (patientType == "7")
@ -99,21 +82,14 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProcedureCategory(
{String categoryName,
String categoryID,
patientId,
bool isLocalBusy = false}) async {
Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async {
if (categoryName == null) return;
hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _procedureService.getProcedureCategory(
categoryName: categoryName,
categoryID: categoryID,
patientId: patientId);
await _procedureService.getProcedureCategory(categoryName: categoryName, categoryID: categoryID, patientId: patientId);
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
@ -133,17 +109,13 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getProcedureTemplate(
{String categoryID,
bool isLocalBusy = false,
BuildContext context}) async {
Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
await _procedureService.getProcedureTemplate(
categoryID: categoryID, isLocalBusy: false);
await _procedureService.getProcedureTemplate(categoryID: categoryID, isLocalBusy: false);
if (_procedureService.hasError) {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
@ -154,20 +126,12 @@ class ProcedureViewModel extends BaseViewModel {
setTemplateListDependOnId() {
procedureTemplate.forEach((element) {
List<ProcedureTempleteDetailsModelList> templateListData = templateList
.where((elementTemplate) =>
elementTemplate.templateId == element.templateID)
.toList();
List<ProcedureTempleteDetailsModelList> templateListData = templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList();
if (templateListData.length != 0) {
templateList[templateList.indexOf(templateListData[0])]
.procedureTemplate
.add(element);
templateList[templateList.indexOf(templateListData[0])].procedureTemplate.add(element);
} else {
var template = ProcedureTempleteDetailsModelList(
templateName: element.templateName,
templateId: element.templateID,
template: element);
var template = ProcedureTempleteDetailsModelList(templateName: element.templateName, templateId: element.templateID, template: element);
if (!templateList.contains(template)) templateList.add(template);
}
});
@ -189,8 +153,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn,
{bool isLocalBusy = false}) async {
Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn, {bool isLocalBusy = false}) async {
hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
@ -201,14 +164,12 @@ class ProcedureViewModel extends BaseViewModel {
error = _procedureService.error;
setState(ViewState.ErrorLocal);
} else {
await getProcedure(mrn: mrn, isLocalBusy:isLocalBusy);
await getProcedure(mrn: mrn, isLocalBusy: isLocalBusy);
setState(ViewState.Idle);
}
}
Future validationProcedure(
ProcedureValidationRequestModel procedureValidateRequestModel,
{bool isLocalBusy = false}) async {
Future validationProcedure(ProcedureValidationRequestModel procedureValidateRequestModel, {bool isLocalBusy = false}) async {
hasError = false;
if (isLocalBusy) {
setState(ViewState.BusyLocal);
@ -224,12 +185,12 @@ class ProcedureViewModel extends BaseViewModel {
}
}
Future updateProcedure(
{UpdateProcedureRequestModel updateProcedureRequestModel,
int mrn, bool isLocalBusy = false}) async {
Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async {
hasError = false;
if(isLocalBusy)setState(ViewState.BusyLocal); else
setState(ViewState.Busy);
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy);
await _procedureService.updateProcedure(updateProcedureRequestModel);
if (_procedureService.hasError) {
error = _procedureService.error;
@ -239,11 +200,9 @@ class ProcedureViewModel extends BaseViewModel {
//await getProcedure(mrn: mrn);
}
void getPatientRadOrders(PatiantInformtion patient,
{String patientType, bool isInPatient = false}) async {
void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async {
setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(patient,
isInPatient: isInPatient);
await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient);
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
if (_radiologyService.hasError) {
error = _radiologyService.error;
@ -253,39 +212,25 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.ErrorLocal);
} else {
_radiologyService.finalRadiologyList.forEach((element) {
List<FinalRadiologyList> finalRadiologyListClinic =
_finalRadiologyListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
List<FinalRadiologyList> finalRadiologyListClinic = _finalRadiologyListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList();
if (finalRadiologyListClinic.length != 0) {
_finalRadiologyListClinic[
finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])]
.finalRadiologyList
.add(element);
_finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])].finalRadiologyList.add(element);
} else {
_finalRadiologyListClinic.add(FinalRadiologyList(
filterName: element.clinicDescription, finalRadiology: element));
_finalRadiologyListClinic.add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element));
}
// FinalRadiologyList list sort via project
List<FinalRadiologyList> finalRadiologyListHospital =
_finalRadiologyListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
List<FinalRadiologyList> finalRadiologyListHospital = _finalRadiologyListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (finalRadiologyListHospital.length != 0) {
_finalRadiologyListHospital[finalRadiologyListHospital
.indexOf(finalRadiologyListHospital[0])]
.finalRadiologyList
.add(element);
_finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])].finalRadiologyList.add(element);
} else {
_finalRadiologyListHospital.add(FinalRadiologyList(
filterName: element.projectName, finalRadiology: element));
_finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element));
}
});
@ -295,17 +240,9 @@ class ProcedureViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url;
getRadImageURL(
{int invoiceNo,
int lineItem,
int projectId,
@required PatiantInformtion patient}) async {
getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _radiologyService.getRadImageURL(
invoiceNo: invoiceNo,
lineItem: lineItem,
projectId: projectId,
patient: patient);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient);
if (_radiologyService.hasError) {
error = _radiologyService.error;
setState(ViewState.Error);
@ -318,8 +255,7 @@ class ProcedureViewModel extends BaseViewModel {
notifyListeners();
}
List<PatientLabSpecialResult> get patientLabSpecialResult =>
_labsService.patientLabSpecialResult;
List<PatientLabSpecialResult> get patientLabSpecialResult => _labsService.patientLabSpecialResult;
List<LabResult> get labResultList => _labsService.labResultList;
@ -340,19 +276,9 @@ class ProcedureViewModel extends BaseViewModel {
}
}
getLaboratoryResult(
{String projectID,
int clinicID,
String invoiceNo,
String orderNo,
PatiantInformtion patient}) async {
getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getLaboratoryResult(
invoiceNo: invoiceNo,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID,
patient: patient);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -361,15 +287,9 @@ class ProcedureViewModel extends BaseViewModel {
}
}
getPatientLabOrdersResults(
{PatientLabOrders patientLabOrder,
String procedure,
PatiantInformtion patient}) async {
getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResults(
patientLabOrder: patientLabOrder,
procedure: procedure,
patient: patient);
await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient);
if (_labsService.hasError) {
error = _labsService.error;
setState(ViewState.Error);
@ -377,9 +297,7 @@ class ProcedureViewModel extends BaseViewModel {
bool isShouldClear = false;
if (_labsService.labOrdersResultsList.length == 1) {
labOrdersResultsList.forEach((element) {
if (element.resultValue.contains('/') ||
element.resultValue.contains('*') ||
element.resultValue.isEmpty) isShouldClear = true;
if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true;
});
}
if (isShouldClear) _labsService.labOrdersResultsList.clear();
@ -410,8 +328,7 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Busy);
}
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValidationRequestModel procedureValadteRequestModel =
new ProcedureValidationRequestModel();
ProcedureValidationRequestModel procedureValadteRequestModel = new ProcedureValidationRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
@ -426,48 +343,34 @@ 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;
await validationProcedure(procedureValadteRequestModel,
isLocalBusy: isLocalBusy);
await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy);
if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN,
isLocalBusy: isLocalBusy);
await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy);
if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy);
} else if (state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added');
if (Navigator.canPop(AppGlobal.CONTEX))
Navigator.pop(AppGlobal.CONTEX);
if (Navigator.canPop(AppGlobal.CONTEX))
Navigator.pop(AppGlobal.CONTEX);
if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX);
if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX);
}
} else {
if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) {
Utils.showErrorToast(
valadteProcedureList[0].entityList[0].warringMessages);
Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages);
}
}
} else {
@ -475,34 +378,23 @@ class ProcedureViewModel extends BaseViewModel {
}
}
bool isEntityListSelected(
cpe.EntityList masterKey, List<cpe.EntityList> entityList) {
Iterable<cpe.EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
bool isEntityListSelected(cpe.EntityList masterKey, List<cpe.EntityList> entityList) {
Iterable<cpe.EntityList> history = entityList.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) {
return true;
}
return false;
}
bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey,
List<ProcedureTempleteDetailsModel> entityList) {
Iterable<ProcedureTempleteDetailsModel> history = entityList.where(
(element) =>
masterKey.templateID == element.templateID &&
masterKey.procedureName == element.procedureName);
bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, List<ProcedureTempleteDetailsModel> entityList) {
Iterable<ProcedureTempleteDetailsModel> history = entityList.where((element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName);
if (history.length > 0) {
return true;
}
return false;
}
Future addProcedures(
ProcedureViewModel model,
List<ProcedureTempleteDetailsModel> items,
PatiantInformtion patient,
TextEditingController remarksController,
{bool isLocalBusy = false}) async {
Future addProcedures(ProcedureViewModel model, List<ProcedureTempleteDetailsModel> items, PatiantInformtion patient, TextEditingController remarksController, {bool isLocalBusy = false}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
@ -523,15 +415,10 @@ class ProcedureViewModel extends BaseViewModel {
eventCategory: "Procedure Checkout Screen",
eventAction: "Add New Procedure",
);
await model.preparePostProcedure(
entityList: entityList,
patient: patient,
remarks: remarksController.text,
isLocalBusy: isLocalBusy);
await model.preparePostProcedure(entityList: entityList, patient: patient, remarks: remarksController.text, isLocalBusy: isLocalBusy);
}
Future filterSearchResults(String query, List<cpe.EntityList> masterList,
List<cpe.EntityList> items) async {
Future filterSearchResults(String query, List<cpe.EntityList> masterList, List<cpe.EntityList> items) async {
List<cpe.EntityList> dummySearchList = List();
dummySearchList.addAll(masterList);
if (query.isNotEmpty) {
@ -549,13 +436,9 @@ class ProcedureViewModel extends BaseViewModel {
}
}
void filterProcedureSearchResults(
String query,
List<ProcedureTempleteModel> masterList,
List<ProcedureTempleteModel> items) {
void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) {
List<ProcedureTempleteModel> dummySearchList = List();
if(masterList!= null)
dummySearchList.addAll(masterList);
if (masterList != null) dummySearchList.addAll(masterList);
if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = List();
dummySearchList.forEach((item) {

@ -31,24 +31,17 @@ class UpdateObjectivePage extends StatefulWidget {
final int currentIndex;
final PatiantInformtion patientInfo;
UpdateObjectivePage(
{Key key,
this.changePageViewIndex,
this.patientInfo,
this.changeLoadingState,
this.currentIndex});
UpdateObjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex});
@override
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
}
class _UpdateObjectivePageState extends State<UpdateObjectivePage>
implements ObjectiveCallBack {
class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack {
bool isSysExaminationExpand = false;
List<MySelectedExamination> mySelectedExamination = List();
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor) {
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
@ -77,8 +70,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId,
);
MySelectedExamination tempEam =
SoapUtils.generateMySelectedExamination(
MySelectedExamination tempEam = SoapUtils.generateMySelectedExamination(
examination: examMaster,
remark: element.remarks,
isNormal: element.isNormal,
@ -113,8 +105,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
patientInfo: widget.patientInfo,
),
ExpandableSOAPWidget(
headerTitle:
TranslationBase.of(context).physicalSystemExamination,
headerTitle: TranslationBase.of(context).physicalSystemExamination,
onTap: () {
setState(() {
isSysExaminationExpand = !isSysExaminationExpand;
@ -123,14 +114,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
child: Column(
children: [
SOAPOpenItems(
label:
"${TranslationBase.of(context).addExamination}",
label: "${TranslationBase.of(context).addExamination}",
onTap: () {
openExaminationList(context);
},
),
if (mySelectedExamination.isNotEmpty &&
mySelectedExamination.first.isLocal)
if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal)
Row(
children: [
AppText(
@ -143,25 +132,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
),
Column(
children: mySelectedExamination
.sublist(
0,
model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
removeExamination(examination.selectedExamination);
});
}).toList(),
),
if (mySelectedExamination.isNotEmpty &&
model.getFirstIndexForOldExamination(
mySelectedExamination) >
-1)
if (mySelectedExamination.isNotEmpty && model.getFirstIndexForOldExamination(mySelectedExamination) > -1)
Row(
children: [
AppText(
@ -174,16 +152,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
),
Column(
children: mySelectedExamination
.sublist(model.getFirstIndexForOldExamination(
mySelectedExamination) ==
-1
? 0
: model.getFirstIndexForOldExamination(
mySelectedExamination))
.sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination))
.map((examination) {
return ExaminationItemCard(examination, () {
removeExamination(
examination.selectedExamination);
removeExamination(examination.selectedExamination);
});
}).toList(),
)
@ -192,8 +164,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
isExpanded: isSysExaminationExpand,
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 14 : 12),
height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 14 : 12),
)
],
),
@ -206,33 +177,20 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) {
if (!model.isAddExamInProgress &&
widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
Navigator.of(context).pop();
} else {
widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel
.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
ListHisProgNotePhysicalExaminationVM
listHisProgNotePhysicalExaminationVM =
ListHisProgNotePhysicalExaminationVM(
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
ListHisProgNotePhysicalExaminationVM listHisProgNotePhysicalExaminationVM = ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo == null
? 0
: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo == null
? 0
: widget.patientInfo.appointmentNo,
episodeId: widget.patientInfo.episodeNo == null ? 0 : widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo == null ? 0 : widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
@ -255,15 +213,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
: "Not Examined",
isNew: exam.isNew,
);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo);
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo);
} else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0;
}
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(listHisProgNotePhysicalExaminationVM);
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(listHisProgNotePhysicalExaminationVM);
});
if (model.patientPhysicalExamList.isEmpty) {
@ -275,14 +230,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
if (model.state == ViewState.ErrorLocal) {
widget.changeLoadingState(false);
Utils.showErrorToast(model.error);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
// Navigator.of(context).pop();
model.isAddExamInProgress = false;
}
} else {
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) {
// Navigator.of(context).pop();
widget.changeLoadingState(false);
model.isAddExamInProgress = false;
@ -298,10 +251,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
}
removeExamination(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> history = mySelectedExamination.where(
(element) =>
masterKey.id == element.selectedExamination.id &&
masterKey.typeId == element.selectedExamination.typeId);
Iterable<MySelectedExamination> history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId);
if (history.length > 0) {
setState(() {
@ -322,17 +272,11 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
FadePage(
page: AddExaminationPage(
mySelectedExamination: mySelectedExamination,
addSelectedExamination:
(List<MySelectedExamination> mySelectedExaminationLocal) {
addSelectedExamination: (List<MySelectedExamination> mySelectedExaminationLocal) {
setState(() {
{
mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
if ((mySelectedExamination.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) {
mySelectedExamination.insert(0, element);
}
});
@ -340,12 +284,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
/// remove items.
List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere(
(it) =>
it.selectedExamination.id ==
element.selectedExamination.id,
orElse: () => null)) ==
null) {
if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) {
removedList.add(element);
}
});

@ -4,48 +4,19 @@ import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_ex
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart';
class SoapUtils {
static MySelectedHistory generateMySelectedHistory(
{history, isChecked = false, remark, isLocal = true}) {
MySelectedHistory mySelectedHistory = MySelectedHistory(
selectedHistory: history,
isChecked: isChecked,
remark: remark,
isLocal: isLocal);
static MySelectedHistory generateMySelectedHistory({history, isChecked = false, remark, isLocal = true}) {
MySelectedHistory mySelectedHistory = MySelectedHistory(selectedHistory: history, isChecked: isChecked, remark: remark, isLocal: isLocal);
return mySelectedHistory;
}
static MySelectedAllergy generateMySelectedAllergy(
{allergy,
allergySeverity,
isChecked = false,
remark,
isLocal = true,
int createdBy,
bool isExpanded = false}) {
MySelectedAllergy mySelectedAllergy = MySelectedAllergy(
selectedAllergy: allergy,
selectedAllergySeverity: allergySeverity,
isChecked: isChecked,
remark: remark,
isLocal: isLocal,
createdBy: createdBy,
isExpanded: isExpanded);
static MySelectedAllergy generateMySelectedAllergy({allergy, allergySeverity, isChecked = false, remark, isLocal = true, int createdBy, bool isExpanded = false}) {
MySelectedAllergy mySelectedAllergy =
MySelectedAllergy(selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, isChecked: isChecked, remark: remark, isLocal: isLocal, createdBy: createdBy, isExpanded: isExpanded);
return mySelectedAllergy;
}
static MySelectedExamination generateMySelectedExamination(
{examination,
allergySeverity,
isChecked = false,
remark,
isLocal = true,
isNormal,
createdBy,
createdOn,
editedOn,
notExamined,
isNew,
isAbnormal}) {
{examination, allergySeverity, isChecked = false, remark, isLocal = true, isNormal, createdBy, createdOn, editedOn, notExamined, isNew, isAbnormal}) {
MySelectedExamination mySelectedExamination = MySelectedExamination(
selectedExamination: examination,
remark: remark,
@ -61,17 +32,7 @@ class SoapUtils {
return mySelectedExamination;
}
static MySelectedAssessment generateMySelectedAssessment(
{appointmentNo,
remark,
diagnosisType,
diagnosisCondition,
selectedICD,
doctorID,
doctorName,
createdBy,
createdOn,
icdCode10ID}) {
static MySelectedAssessment generateMySelectedAssessment({appointmentNo, remark, diagnosisType, diagnosisCondition, selectedICD, doctorID, doctorName, createdBy, createdOn, icdCode10ID}) {
MySelectedAssessment mySelectedAssessment = MySelectedAssessment(
appointmentId: appointmentNo,
remark: remark,

@ -11,7 +11,7 @@ description: A new Flutter project.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 4.3.5+1
version: 1.3.97+1
environment:

Loading…
Cancel
Save