add new prescription

new_prescreption
Elham Rababh 4 years ago
parent 1f770793fd
commit 9461d3d4a1

@ -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 =

@ -1,13 +1,11 @@
class PrescriptionReqModel {
String vidaAuthTokenID;
dynamic patientMRN;
dynamic appNo;
PrescriptionReqModel(
{this.vidaAuthTokenID, this.patientMRN, this.appNo});
{ this.patientMRN, this.appNo});
PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN'];
appNo = json['AppointmentNo'];
@ -15,7 +13,6 @@ class PrescriptionReqModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appNo;
return data;

@ -9,9 +9,6 @@ class MedicalFileService extends BaseService {
List<MedicalFileModel> get medicalFileList => _medicalFileList;
MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel(
//patientMRN: 1231755,
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU",
);
Future getMedicalFile({int mrn}) async {

@ -1,7 +1,18 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
@ -14,6 +25,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:flutter/cupertino.dart';
class PrescriptionService extends LookupService {
List<PrescriptionModel> _prescriptionList = List();
@ -37,7 +49,6 @@ class PrescriptionService extends LookupService {
ItemByMedicineRequestModel _itemByMedicineRequestModel =
ItemByMedicineRequestModel();
SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel(
//search: ["Acetaminophen"],
search: ["Amoxicillin"],
);
@ -81,9 +92,10 @@ class PrescriptionService extends LookupService {
}, body: getAssessmentReqModel.toJson());
}
Future getPrescription({int mrn}) async {
Future getPrescriptionListNew({int mrn, int appNo }) async {
_prescriptionReqModel = PrescriptionReqModel(
patientMRN: mrn,
appNo:appNo
);
hasError = false;
_prescriptionList.clear();
@ -236,4 +248,186 @@ class PrescriptionService extends LookupService {
});
return lstAssessmentsObj;
}
List<Prescriptions> prescriptionsList = List();
List<GetMedicationForInPatientModel> medicationForInPatient = List();
List<PrescriptionsOrder> prescriptionsOrderList = List();
List<PrescriotionInPatient> prescriptionInPatientList = List();
GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel =
GetMedicationForInPatientRequestModel();
Future getPrescriptions(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient,
onSuccess: (dynamic response, int statusCode) {
prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) {
prescriptionsList.add(Prescriptions.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
RequestPrescriptionReport _requestPrescriptionReport =
RequestPrescriptionReport(
appointmentNo: 0, isDentalAllowedBackend: false);
List<PrescriptionReport> prescriptionReportList = List();
Future getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
hasError = false;
_requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo;
_requestPrescriptionReport.projectID = prescriptions.projectID;
_requestPrescriptionReport.clinicID = prescriptions.clinicID;
_requestPrescriptionReport.setupID = prescriptions.setupID;
_requestPrescriptionReport.episodeID = prescriptions.episodeID;
_requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo;
await baseAppClient.postPatient(
prescriptions.isInOutPatient
? GET_PRESCRIPTION_REPORT_ENH
: GET_PRESCRIPTION_REPORT_NEW,
patient: patient, onSuccess: (dynamic response, int statusCode) {
prescriptionReportList.clear();
prescriptionReportEnhList.clear();
if (prescriptions.isInOutPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportList
.add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
});
} else {
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
prescriptionReportList
.add(PrescriptionReport.fromJson(prescriptions));
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPrescriptionReport.toJson());
}
RequestGetListPharmacyForPrescriptions
requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions(
latitude: 0,
longitude: 0,
isDentalAllowedBackend: false,
);
List<PharmacyPrescriptions> pharmacyPrescriptionsList = List();
RequestPrescriptionReportEnh _requestPrescriptionReportEnh =
RequestPrescriptionReportEnh(
isDentalAllowedBackend: false,
);
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
@required PatiantInformtion patient}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false;
prescriptionsList.forEach((element) {
if (prescriptionsOrder.appointmentNo == "0") {
if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID;
_requestPrescriptionReportEnh.episodeID = element.episodeID;
_requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient;
}
} else {
if (int.parse(prescriptionsOrder.appointmentNo) ==
element.appointmentNo) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID;
_requestPrescriptionReportEnh.episodeID = element.episodeID;
_requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient;
///call inpGetPrescriptionReport
}
}
});
hasError = false;
await baseAppClient.postPatient(
isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW,
patient: patient, onSuccess: (dynamic response, int statusCode) {
prescriptionReportEnhList.clear();
if (isInPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
});
} else {
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
PrescriptionReportEnh reportEnh =
PrescriptionReportEnh.fromJson(prescriptions);
reportEnh.itemDescription = prescriptions['ItemDescriptionN'];
prescriptionReportEnhList.add(reportEnh);
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPrescriptionReportEnh.toJson());
}
Future getPrescriptionsOrders() async {
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS,
onSuccess: (dynamic response, int statusCode) {
prescriptionsOrderList.clear();
response['PatientER_GetPatientAllPresOrdersList']
.forEach((prescriptionsOrder) {
prescriptionsOrderList
.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getMedicationForInPatient(PatiantInformtion patient) async {
hasError = false;
_getMedicationForInPatientRequestModel =
GetMedicationForInPatientRequestModel(
isDentalAllowedBackend: false,
admissionNo: int.parse(patient.admissionNo),
tokenID: "@dm!n",
projectID: patient.projectId,
);
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT,
patient: patient, onSuccess: (dynamic response, int statusCode) {
medicationForInPatient.clear();
response['List_GetMedicationForInpatient'].forEach((prescriptions) {
medicationForInPatient
.add(GetMedicationForInPatientModel.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _getMedicationForInPatientRequestModel.toJson());
}
}

@ -1,238 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/in_patient_prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:flutter/cupertino.dart';
import '../../base/base_service.dart';
class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List();
List<GetMedicationForInPatientModel> medicationForInPatient = List();
List<PrescriptionsOrder> prescriptionsOrderList = List();
List<PrescriotionInPatient> prescriptionInPatientList = List();
InPatientPrescriptionRequestModel _inPatientPrescriptionRequestModel =
InPatientPrescriptionRequestModel();
GetMedicationForInPatientRequestModel _getMedicationForInPatientRequestModel =
GetMedicationForInPatientRequestModel();
Future getPrescriptionInPatient({int mrn, String adn}) async {
_inPatientPrescriptionRequestModel = InPatientPrescriptionRequestModel(
patientMRN: mrn,
admissionNo: adn,
);
hasError = false;
prescriptionInPatientList.clear();
await baseAppClient.post(GET_PRESCRIPTION_IN_PATIENT,
onSuccess: (dynamic response, int statusCode) {
prescriptionsList.clear();
response['List_PrescriptionReportForInPatient'].forEach((prescriptions) {
prescriptionInPatientList
.add(PrescriotionInPatient.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _inPatientPrescriptionRequestModel.toJson());
}
Future getPrescriptions(PatiantInformtion patient) async {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient,
onSuccess: (dynamic response, int statusCode) {
prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) {
prescriptionsList.add(Prescriptions.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
RequestPrescriptionReport _requestPrescriptionReport =
RequestPrescriptionReport(
appointmentNo: 0, isDentalAllowedBackend: false);
List<PrescriptionReport> prescriptionReportList = List();
Future getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
hasError = false;
_requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo;
_requestPrescriptionReport.projectID = prescriptions.projectID;
_requestPrescriptionReport.clinicID = prescriptions.clinicID;
_requestPrescriptionReport.setupID = prescriptions.setupID;
_requestPrescriptionReport.episodeID = prescriptions.episodeID;
_requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo;
await baseAppClient.postPatient(
prescriptions.isInOutPatient
? GET_PRESCRIPTION_REPORT_ENH
: GET_PRESCRIPTION_REPORT_NEW,
patient: patient, onSuccess: (dynamic response, int statusCode) {
prescriptionReportList.clear();
prescriptionReportEnhList.clear();
if (prescriptions.isInOutPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportList
.add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
});
} else {
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
prescriptionReportList
.add(PrescriptionReport.fromJson(prescriptions));
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPrescriptionReport.toJson());
}
RequestGetListPharmacyForPrescriptions
requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions(
latitude: 0,
longitude: 0,
isDentalAllowedBackend: false,
);
List<PharmacyPrescriptions> pharmacyPrescriptionsList = List();
Future getListPharmacyForPrescriptions(
{int itemId, @required PatiantInformtion patient}) async {
hasError = false;
requestGetListPharmacyForPrescriptions.itemID = itemId;
await baseAppClient.postPatient(GET_PHARMACY_LIST, patient: patient,
onSuccess: (dynamic response, int statusCode) {
pharmacyPrescriptionsList.clear();
response['PharmList'].forEach((prescriptions) {
pharmacyPrescriptionsList
.add(PharmacyPrescriptions.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: requestGetListPharmacyForPrescriptions.toJson());
}
RequestPrescriptionReportEnh _requestPrescriptionReportEnh =
RequestPrescriptionReportEnh(
isDentalAllowedBackend: false,
);
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
@required PatiantInformtion patient}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false;
prescriptionsList.forEach((element) {
if (prescriptionsOrder.appointmentNo == "0") {
if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID;
_requestPrescriptionReportEnh.episodeID = element.episodeID;
_requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient;
}
} else {
if (int.parse(prescriptionsOrder.appointmentNo) ==
element.appointmentNo) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID;
_requestPrescriptionReportEnh.episodeID = element.episodeID;
_requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient;
///call inpGetPrescriptionReport
}
}
});
hasError = false;
await baseAppClient.postPatient(
isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW,
patient: patient, onSuccess: (dynamic response, int statusCode) {
prescriptionReportEnhList.clear();
if (isInPatient) {
response['ListPRM'].forEach((prescriptions) {
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
});
} else {
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
PrescriptionReportEnh reportEnh =
PrescriptionReportEnh.fromJson(prescriptions);
reportEnh.itemDescription = prescriptions['ItemDescriptionN'];
prescriptionReportEnhList.add(reportEnh);
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPrescriptionReportEnh.toJson());
}
Future getPrescriptionsOrders() async {
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS,
onSuccess: (dynamic response, int statusCode) {
prescriptionsOrderList.clear();
response['PatientER_GetPatientAllPresOrdersList']
.forEach((prescriptionsOrder) {
prescriptionsOrderList
.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getMedicationForInPatient(PatiantInformtion patient) async {
hasError = false;
_getMedicationForInPatientRequestModel =
GetMedicationForInPatientRequestModel(
isDentalAllowedBackend: false,
admissionNo: int.parse(patient.admissionNo),
tokenID: "@dm!n",
projectID: patient.projectId,
);
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT,
patient: patient, onSuccess: (dynamic response, int statusCode) {
medicationForInPatient.clear();
response['List_GetMedicationForInpatient'].forEach((prescriptions) {
medicationForInPatient
.add(GetMedicationForInPatientModel.fromJson(prescriptions));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _getMedicationForInPatientRequestModel.toJson());
}
}

@ -43,15 +43,6 @@ class ProcedureService extends BaseService {
ProcedureTempleteDetailsRequestModel();
GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel(
// clinicId: 17,
// pageSize: 10,
// pageIndex: 1,
// //patientMRN: 3120725,
// //categoryId: null,
// vidaAuthTokenID:
// "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",
//
// search: ["lab"],
);
GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel(
@ -59,11 +50,6 @@ class ProcedureService extends BaseService {
pageSize: 100,
pageIndex: 1,
patientMRN: 0,
//categoryId: null,
vidaAuthTokenID:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI",
//search: ["DENTAL"],
);
Future getProcedureTemplate(

@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/prescriptio
import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_container.dart';
import 'package:flutter/cupertino.dart';
import '../../locator.dart';

@ -4,106 +4,51 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAllergiesResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:flutter/cupertino.dart';
import '../../widgets/shared/loader/gif_loader_dialog_utils.dart';
import '../service/patient/patient_service.dart';
class PrescriptionViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic;
bool hasError = false;
PatientService _patientService = locator<PatientService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<GetMedicationResponseModel> get allMedicationList =>
_prescriptionService.allMedicationList;
List<GetMedicationForInPatientModel> get medicationForInPatient =>
_prescriptionsService.medicationForInPatient;
_prescriptionService.medicationForInPatient;
List<PrescriptionModel> get prescriptionList =>
_prescriptionService.prescriptionList;
List<dynamic> get drugsList => _prescriptionService.doctorsList;
List<dynamic> get drugToDrug => _prescriptionService.drugToDrugList;
List<dynamic> get itemMedicineList => _prescriptionService.itemMedicineList;
PrescriptionsService _prescriptionsService = locator<PrescriptionsService>();
List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List();
List<PrescriptionReport> get prescriptionReportList =>
_prescriptionsService.prescriptionReportList;
List<Prescriptions> get prescriptionsList =>
_prescriptionsService.prescriptionsList;
_prescriptionService.prescriptionReportList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
_prescriptionsService.pharmacyPrescriptionsList;
_prescriptionService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
_prescriptionsService.prescriptionReportEnhList;
List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic
? _prescriptionsOrderListClinic
: _prescriptionsOrderListHospital;
_prescriptionService.prescriptionReportEnhList;
List<PrescriotionInPatient> get inPatientPrescription =>
_prescriptionsService.prescriptionInPatientList;
Future getOutPatientPrescriptions(patient, {bool isLocalBusy = false, PatiantInformtion patientInformation}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
await _patientService.getOutPatientPrescriptions(patient);
if (_patientService.hasError) {
error = _patientService.error;
if (isLocalBusy) {
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Error);
}
} else
setState(ViewState.Idle);
}
List<dynamic> get drugToDrug => _prescriptionService.drugToDrugList;
List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List();
getPrescriptionsInPatient(PatiantInformtion patient) async {
setState(ViewState.Busy);
error = "";
await _prescriptionsService.getPrescriptionInPatient(
mrn: patient.patientId, adn: patient.admissionNo);
if (_prescriptionsService.hasError) {
error = "No Prescription Found";
setState(ViewState.Error);
} else {
_filterList();
await _getPrescriptionsOrders();
setState(ViewState.Idle);
}
}
List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList;
Future getItem({int itemID}) async {
hasError = false;
@ -116,10 +61,11 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getPrescription({int mrn, BuildContext context}) async {
Future getPrescriptionListNew({int mrn,int appNo, bool isLocalBusy = false}) async {
hasError = false;
setState(ViewState.BusyLocal);
await _prescriptionService.getPrescription(mrn: mrn);
if(isLocalBusy)
setState(ViewState.BusyLocal); else setState(ViewState.Busy);
await _prescriptionService.getPrescriptionListNew(mrn: mrn, appNo:appNo );
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
@ -136,45 +82,11 @@ class PrescriptionViewModel extends BaseViewModel {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
await getPrescription(mrn: mrn);
await getPrescriptionListNew(mrn: mrn);
setState(ViewState.Idle);
}
}
Future getMedicationList({String drug}) async {
setState(ViewState.BusyLocal);
await _prescriptionService.getMedicationList(drug: drug);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future updatePrescription(
PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async {
hasError = false;
setState(ViewState.BusyLocal);
await _prescriptionService.updatePrescription(updatePrescriptionReqModel);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
await getPrescription(mrn: mrn);
setState(ViewState.Idle);
}
}
Future getDrugs({String drugName}) async {
hasError = false;
setState(ViewState.BusyLocal);
await _prescriptionService.getDrugs(drugName: drugName);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future getDrugToDrug(
VitalSignData vital,
@ -193,40 +105,9 @@ class PrescriptionViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
setFilterType(FilterType filterType) {
this.filterType = filterType;
notifyListeners();
}
getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
setState(ViewState.BusyLocal);
await _prescriptionsService.getPrescriptionReport(
prescriptions: prescriptions, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
getListPharmacyForPrescriptions(
{int itemId, @required PatiantInformtion patient}) async {
setState(ViewState.BusyLocal);
await _prescriptionsService.getListPharmacyForPrescriptions(
itemId: itemId, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
void _filterList() {
_prescriptionsService.prescriptionsList.forEach((element) {
_prescriptionService.prescriptionsList.forEach((element) {
/// PrescriptionsList list sort clinic
List<PrescriptionsList> prescriptionsByClinic =
_prescriptionsOrderListClinic
@ -264,24 +145,11 @@ class PrescriptionViewModel extends BaseViewModel {
});
}
getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
@required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(
prescriptionsOrder: prescriptionsOrder, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
_getPrescriptionsOrders() async {
await _prescriptionsService.getPrescriptionsOrders();
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
await _prescriptionService.getPrescriptionsOrders();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
@ -292,9 +160,9 @@ class PrescriptionViewModel extends BaseViewModel {
if(isLocalBusy)
setState(ViewState.BusyLocal);
else setState(ViewState.Busy);
await _prescriptionsService.getPrescriptions(patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
await _prescriptionService.getPrescriptions(patient);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
if (isLocalBusy)
setState(ViewState.ErrorLocal);
else
@ -309,12 +177,26 @@ class PrescriptionViewModel extends BaseViewModel {
getMedicationForInPatient(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _prescriptionsService.getMedicationForInPatient(patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
await _prescriptionService.getMedicationForInPatient(patient);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionService.getPrescriptionReport(
prescriptions: prescriptions, patient: patient);
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -1,163 +0,0 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:flutter/material.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class PrescriptionsViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic;
PrescriptionsService _prescriptionsService = locator<PrescriptionsService>();
List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List();
List<PrescriptionReport> get prescriptionReportList =>
_prescriptionsService.prescriptionReportList;
List<Prescriptions> get prescriptionsList =>
_prescriptionsService.prescriptionsList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
_prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
_prescriptionsService.prescriptionReportEnhList;
List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic
? _prescriptionsOrderListClinic
: _prescriptionsOrderListHospital;
List<GetMedicationForInPatientModel> get medicationForInPatient =>
_prescriptionsService.medicationForInPatient;
List<PrescriptionsList> _medicationForInPatient = List();
getPrescriptions(PatiantInformtion patient) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptions(patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
_filterList();
await _getPrescriptionsOrders();
setState(ViewState.Idle);
}
}
_getPrescriptionsOrders() async {
await _prescriptionsService.getPrescriptionsOrders();
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
void _filterList() {
_prescriptionsService.prescriptionsList.forEach((element) {
/// PrescriptionsList list sort clinic
List<PrescriptionsList> prescriptionsByClinic =
_prescriptionsOrderListClinic
.where((elementClinic) =>
elementClinic.filterName == element.clinicDescription)
.toList();
if (prescriptionsByClinic.length != 0) {
_prescriptionsOrderListClinic[
_prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])]
.prescriptionsList
.add(element);
} else {
_prescriptionsOrderListClinic.add(PrescriptionsList(
filterName: element.clinicDescription, prescriptions: element));
}
/// PrescriptionsList list sort via hospital
List<PrescriptionsList> prescriptionsByHospital =
_prescriptionsOrderListHospital
.where(
(elementClinic) => elementClinic.filterName == element.name,
)
.toList();
if (prescriptionsByHospital.length != 0) {
_prescriptionsOrderListHospital[_prescriptionsOrderListHospital
.indexOf(prescriptionsByHospital[0])]
.prescriptionsList
.add(element);
} else {
_prescriptionsOrderListHospital.add(PrescriptionsList(
filterName: element.name, prescriptions: element));
}
});
}
setFilterType(FilterType filterType) {
this.filterType = filterType;
notifyListeners();
}
getPrescriptionReport(
{Prescriptions prescriptions,
@required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(
prescriptions: prescriptions, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
getListPharmacyForPrescriptions(
{int itemId, @required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getListPharmacyForPrescriptions(
itemId: itemId, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder,
@required PatiantInformtion patient}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(
prescriptionsOrder: prescriptionsOrder, patient: patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
getMedicationForInPatient(PatiantInformtion patient) async {
await _prescriptionsService.getMedicationForInPatient(patient);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/pednding_orders_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/discharge_summary_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart';
@ -42,7 +42,6 @@ import 'core/service/patient_medical_file/medical_report/PatientMedicalReportSer
import 'core/service/patient_medical_file/medical_report/medical_file_service.dart';
import 'core/service/patient_medical_file/prescription/medicine_service.dart';
import 'core/service/patient_medical_file/prescription/prescription_service.dart';
import 'core/service/patient_medical_file/prescription/prescriptions_service.dart';
import 'core/service/patient_medical_file/procedure/procedure_service.dart';
import 'core/service/patient_medical_file/radiology/radiology_service.dart';
import 'core/service/patient_medical_file/sick_leave/sickleave_service.dart';
@ -65,7 +64,6 @@ import 'core/viewModel/patient-admission-request-viewmodel.dart';
import 'core/viewModel/patient-referral-viewmodel.dart';
import 'core/viewModel/patient-ucaf-viewmodel.dart';
import 'core/viewModel/patient-vital-sign-viewmodel.dart';
import 'core/viewModel/prescriptions_view_model.dart';
import 'core/viewModel/profile/intervention_medication_view_model.dart';
import 'core/viewModel/profile/vte_assessment_view_model.dart';
import 'core/viewModel/radiology_view_model.dart';
@ -97,7 +95,6 @@ void setupLocator() {
locator.registerLazySingleton(() => LabsService());
locator.registerLazySingleton(() => InsuranceCardService());
locator.registerLazySingleton(() => RadiologyService());
locator.registerLazySingleton(() => PrescriptionsService());
locator.registerLazySingleton(() => ReferralService());
locator.registerLazySingleton(() => MyReferralInPatientService());
locator.registerLazySingleton(() => DischargedPatientService());
@ -138,7 +135,6 @@ void setupLocator() {
locator.registerFactory(() => LabsViewModel());
locator.registerFactory(() => InsuranceViewModel());
locator.registerFactory(() => RadiologyViewModel());
locator.registerFactory(() => PrescriptionsViewModel());
locator.registerFactory(() => DischargedPatientViewModel());
locator.registerFactory(() => PatientSearchViewModel());
locator.registerFactory(() => HospitalViewModel());

@ -24,6 +24,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_
import 'package:doctor_app_flutter/screens/patients/profile/referral/refer-patient-screen-in-patient.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/update_soap_index.dart';
import 'package:doctor_app_flutter/screens/patients/profile/vte_assessment/vte_assessment_screen.dart';
import 'package:doctor_app_flutter/screens/prescription/new_prescriptions_page.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_page.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart';
@ -71,6 +72,7 @@ const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail';
const String PATIENT_ECG = 'patients/ecg';
const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details';
const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new';
const String ORDER_PRESCRIPTION_NEW_By_Elham = 'prescription/prescription_new_elham';
const String ORDER_PROCEDURE = 'procedure/procedure';
const String ADD_SICKLEAVE = 'add-sickleave';
const String RADIOLOGY_PATIENT = 'radiology-patient';
@ -124,6 +126,7 @@ var routes = {
IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(),
ADD_SICKLEAVE: (_) => PatientSickLeaveScreen(),
ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(),
ORDER_PRESCRIPTION_NEW_By_Elham: (_) => NewPrescriptionsPage(),
ORDER_PROCEDURE: (_) => ProcedureScreen(),
MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(),
PATIENT_UCAF_REQUEST: (_) => UCAFPagerScreen(),

@ -64,6 +64,13 @@ class ProfileGridForInPatient extends StatelessWidget {
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription +"Elham",
ORDER_PRESCRIPTION_NEW_By_Elham,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).progress,
TranslationBase.of(context).note,

@ -62,6 +62,12 @@ class ProfileGridForOther extends StatelessWidget {
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription +"Elham",
ORDER_PRESCRIPTION_NEW_By_Elham,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,

@ -59,6 +59,12 @@ class ProfileGridForSearch extends StatelessWidget {
ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).patient,
TranslationBase.of(context).prescription +"Elham",
ORDER_PRESCRIPTION_NEW_By_Elham,
'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient),
PatientProfileCardModel(
TranslationBase.of(context).health,
TranslationBase.of(context).summary,

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.d
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GeneralGetReqForSOAP.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription/prescription_form_widget.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription/search_preescription_widget.dart';

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/core/model/search_drug/get_medication_respons
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart';

@ -4,7 +4,7 @@ import 'package:hexcolor/hexcolor.dart';
import '../../../config/config.dart';
import '../../../core/model/search_drug/get_medication_response_model.dart';
import '../../../core/viewModel/medicine_view_model.dart';
import '../../../core/viewModel/prescription_view_model.dart';
import '../../../core/viewModel/prescription/prescription_view_model.dart';
import '../../../util/helpers.dart';
import '../../../util/translations_delegate_base.dart';
import '../../../widgets/medicine/medicine_item_widget.dart';

@ -0,0 +1,213 @@
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart';
import 'package:doctor_app_flutter/screens/procedures/ProcedureType.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/in_patient_doctor_card.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../util/helpers.dart';
import '../../widgets/shared/errors/error_message.dart';
class NewPrescriptionsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patientType'];
String arrivalType = routeArgs['arrivalType'];
bool isInpatient = routeArgs['isInpatient'];
bool isFromLiveCare = routeArgs['isFromLiveCare'];
return BaseView<PrescriptionViewModel>(
onModelReady: (model) async {
model.getPrescriptionListNew(
mrn: patient.patientMRN, appNo: patient.appointmentNo);
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
appBar: PatientProfileAppBar(
patient,
isInpatient: isInpatient,
),
body: patient.admissionNo == null
? FractionallySizedBox(
widthFactor: 1.0,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ServiceTitle(
title: TranslationBase.of(context).orders,
subTitle:
TranslationBase.of(context).prescriptions,
),
],
),
),
if ((patient.patientStatusType != null &&
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder(
onTap: () {
Navigator.push(
context,
SlideUpPageRoute(
widget: BaseAddProcedureTabPage(
patient: patient,
prescriptionModel: model,
procedureType:
ProcedureType.PRESCRIPTION,
),
settingRoute: 'AddProcedureTabPage'),
);
},
label: TranslationBase.of(context)
.applyForNewPrescriptionsOrder,
),
ListView.builder(
physics: BouncingScrollPhysics(),
itemCount: model.prescriptionsList.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionItemsPage(
prescriptions: model
.prescriptionsList[index],
patient: patient,
arrivalType: arrivalType,
),
),
),
child: Column(
children: [
DoctorCard(
doctorName:
Helpers.convertToTitleCase(model
.prescriptionsList[index]
.doctorName),
profileUrl: model
.prescriptionsList[index]
.doctorImageURL,
branch: model
.prescriptionsList[index].name,
clinic: model.prescriptionsList[index]
.clinicDescription,
isPrescriptions: true,
appointmentDate: AppDateUtils
.getDateTimeFromServerFormat(
model.prescriptionsList[index]
.appointmentDate,
),
),
],
));
}),
if (model.prescriptionsList.isEmpty &&
patient.patientStatusType != 43)
Center(
child: ErrorMessage(
error: TranslationBase.of(context)
.noPrescriptionsFound,
))
],
),
),
)
: NetworkBaseView(
baseViewModel: model,
child: FractionallySizedBox(
widthFactor: 1.0,
child: ListView(
physics: BouncingScrollPhysics(),
children: <Widget>[
model.medicationForInPatient.length == 0
? Center(
child: ErrorMessage(
error: TranslationBase.of(context)
.noPrescriptionsFound,
))
: ListView.builder(
scrollDirection: Axis.vertical,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount:
model.medicationForInPatient.length,
itemBuilder: (context, index) {
//model.medicationForInPatient.length,
return InkWell(
child: InPatientDoctorCard(
doctorName: Helpers.convertToTitleCase(
model.medicationForInPatient[index]
.pHRItemDescription),
profileUrl: 'sss',
branch: 'hamza',
clinic: 'basheer',
isPrescriptions: true,
appointmentDate: AppDateUtils
.getDateTimeFromServerFormat(
model.medicationForInPatient[index]
.prescriptionDatetime,
),
createdBy: Helpers.convertToTitleCase(
model.medicationForInPatient[index]
.doctorName
.toString()),
),
onTap: () => Navigator.push(
context,
FadePage(
page: PrescriptionItemsInPatientPage(
prescriptionIndex: index,
prescriptions: model
.medicationForInPatient[index],
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
startOn: AppDateUtils
.getDateTimeFromServerFormat(
model
.medicationForInPatient[index]
.startDatetime,
),
stopOn: AppDateUtils
.getDateTimeFromServerFormat(
model
.medicationForInPatient[index]
.stopDatetime,
),
),
),
),
);
}),
],
),
),
)));
}
}

@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/core/model/procedure/procedure_template_detai
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';

@ -1,10 +1,10 @@
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../../core/viewModel/prescriptions_view_model.dart';
import '../../../widgets/shared/dialogs/ShowImageDialog.dart';
@ -16,7 +16,7 @@ class PrescriptionItemsWidget extends StatelessWidget {
final String imageSRCUrl;
final String remarks;
final int days;
final PrescriptionsViewModel prescriptionsViewModel;
final PrescriptionViewModel prescriptionViewModel;
@ -27,8 +27,8 @@ class PrescriptionItemsWidget extends StatelessWidget {
this.dailyDoses,
this.imageSRCUrl,
this.remarks,
this.days,
this.prescriptionsViewModel});
this.days, this.prescriptionViewModel,
});
@override
Widget build(BuildContext context) {
@ -36,7 +36,7 @@ class PrescriptionItemsWidget extends StatelessWidget {
children: [
...List.generate(
// TODO Elham* List.generate to list.builder
prescriptionsViewModel.prescriptionReportEnhList.length,
prescriptionViewModel.prescriptionReportEnhList.length,
(index) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
@ -51,7 +51,7 @@ class PrescriptionItemsWidget extends StatelessWidget {
Container(
margin: EdgeInsets.only(left: 18, right: 18),
child: AppText(
prescriptionsViewModel.prescriptionReportEnhList[index].itemDescription,
prescriptionViewModel.prescriptionReportEnhList[index].itemDescription,
bold: true,
),
),
@ -77,7 +77,7 @@ class PrescriptionItemsWidget extends StatelessWidget {
showDialog(
context: context,
builder: (ctx) => ShowImageDialog(
imageUrl: prescriptionsViewModel.prescriptionReportEnhList[index].imageSRCUrl,
imageUrl: prescriptionViewModel.prescriptionReportEnhList[index].imageSRCUrl,
));
},
child: Stack(
@ -85,7 +85,7 @@ class PrescriptionItemsWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.network(
prescriptionsViewModel.prescriptionReportEnhList[index].imageSRCUrl,
prescriptionViewModel.prescriptionReportEnhList[index].imageSRCUrl,
fit: BoxFit.cover,
),
),
@ -111,25 +111,25 @@ class PrescriptionItemsWidget extends StatelessWidget {
children: [
CustomRow(
label: TranslationBase.of(context).route + ' : ',
value: " " + prescriptionsViewModel.prescriptionReportEnhList[index].route ?? '',
value: " " + prescriptionViewModel.prescriptionReportEnhList[index].route ?? '',
labelSize: 13,
valueSize: 13,
),
CustomRow(
label: TranslationBase.of(context).frequency + ' : ',
value: " " + prescriptionsViewModel.prescriptionReportEnhList[index].frequency ?? '',
value: " " + prescriptionViewModel.prescriptionReportEnhList[index].frequency ?? '',
labelSize: 13,
valueSize: 13,
),
CustomRow(
label: TranslationBase.of(context).dailyDoses + ' : ',
value: " " + prescriptionsViewModel.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? '',
value: " " + prescriptionViewModel.prescriptionReportEnhList[index].doseDailyQuantity.toString() ?? '',
labelSize: 13,
valueSize: 13,
),
CustomRow(
label: TranslationBase.of(context).duration + ' : ',
value: " " + prescriptionsViewModel.prescriptionReportList[index].days.toString() ?? '',
value: " " + prescriptionViewModel.prescriptionReportList[index].days.toString() ?? '',
labelSize: 13,
valueSize: 13,
),
@ -138,7 +138,7 @@ class PrescriptionItemsWidget extends StatelessWidget {
),
CustomRow(
label: '',
value: prescriptionsViewModel.prescriptionReportList[index].remarks ?? '',
value: prescriptionViewModel.prescriptionReportList[index].remarks ?? '',
valueSize: 14,
),
],

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/preacription_items_widget.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
@ -26,7 +26,7 @@ class PrescriptionItemsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>(
return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getPrescriptionReport(
prescriptions: prescriptions, patient: patient),
builder: (_, model, widget) => AppScaffold(
@ -61,7 +61,7 @@ class PrescriptionItemsPage extends StatelessWidget {
dailyDoses: model.prescriptionReportEnhList[index].doseDailyQuantity,
imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl,
remarks: model.prescriptionReportEnhList[index].remarks,
prescriptionsViewModel: model,
prescriptionViewModel: model,
),
),
],

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart';

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';

@ -79,6 +79,15 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget {
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription,
icon: 'assets/images/svgs/profile_screen/order prescription.svg'),
PatientProfileButton(
key: key,
patient: patient,
patientType: patientType,
arrivalType: arrivalType,
route: ORDER_PRESCRIPTION_NEW_By_Elham,
nameLine1: TranslationBase.of(context).patient,
nameLine2: TranslationBase.of(context).prescription +"Elham",
icon: 'assets/images/svgs/profile_screen/order prescription.svg'),
PatientProfileButton(
key: key,
patient: patient,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save