InPatient Discharge Medications

merge-update-with-lab-changes
haroon amjad 3 years ago
parent 72ee34f9a7
commit 6f20f1b871

@ -625,6 +625,8 @@ var GET_INPATIENT_ADVANCE_PAYMENT_LINK = 'Services/PayFort_Serv.svc/REST/InsertI
var INSERT_INPATIENT_ORDER = 'Services/INPs.svc/REST/Inpcp_insertOrder'; var INSERT_INPATIENT_ORDER = 'Services/INPs.svc/REST/Inpcp_insertOrder';
var INPATIENT_DISCHARGE_MEDICATIONS = 'Services/INPs.svc/REST/chekPatientHasDischargeMedicine';
var GET_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/getBirthNotification_bymothermrn'; var GET_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/getBirthNotification_bymothermrn';
var SAVE_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/SaveBirthNotification'; var SAVE_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/SaveBirthNotification';

@ -147,12 +147,12 @@ class BaseAppClient {
} }
} }
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1000340586;
// body['MobileNo'] = "531940021"; // body['PatientID'] = 395978; //3844083
// body['PatientID'] = 3681708; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// body['MobileNo'] = "531940021";
// body['PatientID'] = 4767347; //3844083 // body['PatientID'] = 869588; //3844083
// body['AdmissionNo'] = 2023000040; //3844083 // body['AdmissionNo'] = 2023000040; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";

@ -137,7 +137,7 @@ class ReportsService extends BaseService {
body['ProjectID'] = projectID; body['ProjectID'] = projectID;
body['Remarks'] = ""; body['Remarks'] = "";
body['ProcedureId'] = ""; body['ProcedureId'] = "";
body['RequestType'] = 2; body['RequestType'] = 1;
body['Source'] = 2; body['Source'] = 2;
body['Status'] = 1; body['Status'] = 1;
body['CreatedBy'] = 102; body['CreatedBy'] = 102;

@ -23,9 +23,23 @@ import 'package:url_launcher/url_launcher.dart';
import '../../models/InPatientServices/get_inpatient_advance_requests_response_model.dart'; import '../../models/InPatientServices/get_inpatient_advance_requests_response_model.dart';
import '../../models/InPatientServices/get_medical_instructions_response_model.dart'; import '../../models/InPatientServices/get_medical_instructions_response_model.dart';
class InPatientServicesHome extends StatelessWidget { class InPatientServicesHome extends StatefulWidget {
@override
State<InPatientServicesHome> createState() => _InPatientServicesHomeState();
}
class _InPatientServicesHomeState extends State<InPatientServicesHome> {
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
InPatientAdvanceResponseModel inPatientAdvanceResponseModel; InPatientAdvanceResponseModel inPatientAdvanceResponseModel;
bool isReceivePrescriptionEnabled = false;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
checkDischargeMedications(context);
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -170,16 +184,16 @@ class InPatientServicesHome extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
// Navigator.push(context, FadePage(page: AdvancePaymentPage())); // Navigator.push(context, FadePage(page: AdvancePaymentPage()));
receivePrescriptionAPI(context); if (isReceivePrescriptionEnabled) receivePrescriptionAPI(context);
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: "Receive", title: "Receive",
imagePath: 'receive_prescription.svg', imagePath: 'receive_prescription.svg',
subTitle: TranslationBase.of(context).prescriptions, subTitle: TranslationBase.of(context).prescriptions,
width: 50.0, width: 50.0,
height: 40.0, height: 40.0,
isInPatient: true, isInPatient: true,
), isEnable: isReceivePrescriptionEnabled),
), ),
); );
@ -203,16 +217,42 @@ class InPatientServicesHome extends StatelessWidget {
} }
void receivePrescriptionAPI(BuildContext context) { void receivePrescriptionAPI(BuildContext context) {
ConfirmDialog dialog = new ConfirmDialog( AlertDialogBox(
context: context, context: context,
confirmMessage: TranslationBase.of(context).successSendReport, confirmMessage: TranslationBase.of(context).successSendReport,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () { okFunction: () {
Navigator.of(context).pop(); AlertDialogBox.closeAlertDialog(context);
}, callReceivePrescriptionAPI(context);
cancelFunction: () => {}); }).showAlertDialog(context);
dialog.showAlertDialog(context);
// ConfirmDialog dialog = new ConfirmDialog(
// context: context,
// confirmMessage: TranslationBase.of(context).successSendReport,
// okText: TranslationBase.of(context).ok,
// cancelText: TranslationBase.of(context).cancel_nocaps,
// okFunction: () {
// Navigator.of(context).pop();
// },
// cancelFunction: () => {});
// dialog.showAlertDialog(context);
}
void checkDischargeMedications(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getDischargeMedicationOrder(projectViewModel.getAdmissionInfoResponseModel).then((res) {
print(res["PatientHasDischargeMedicineList"].length);
setState(() {
if (res["PatientHasDischargeMedicineList"].length != 0) {
isReceivePrescriptionEnabled = true;
}
});
GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
} }
void callReceivePrescriptionAPI(BuildContext context) { void callReceivePrescriptionAPI(BuildContext context) {

@ -270,8 +270,8 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertInPatientOrder(GetAdmissionInfoResponseModel getAdmissionInfoResponseModel, int typeID, String patientName, String patientNameAR, String patientMobileNo, String comments, Future<Map> insertInPatientOrder(
context) async { GetAdmissionInfoResponseModel getAdmissionInfoResponseModel, int typeID, String patientName, String patientNameAR, String patientMobileNo, String comments, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"ProjectID": getAdmissionInfoResponseModel.projectID, "ProjectID": getAdmissionInfoResponseModel.projectID,
@ -444,4 +444,42 @@ class ClinicListService extends BaseService {
}, body: request, isAllowAny: true); }, body: request, isAllowAny: true);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDischargeMedicationOrder(GetAdmissionInfoResponseModel getAdmissionInfoResponseModel) async {
Map<String, dynamic> request;
request = {
"ProjectID": getAdmissionInfoResponseModel.projectID,
"ClinicID": getAdmissionInfoResponseModel.clinicID,
"DoctorID": getAdmissionInfoResponseModel.doctorID,
"AdmissionNo": getAdmissionInfoResponseModel.admissionNo
};
// request = {
// "ProjectID": 12,
// "VersionID": 10.8,
// "Channel": 3,
// "LanguageID": 2,
// "IPAdress": "10.20.10.20",
// "generalid": "Cs2020@2016\$2958",
// "DeviceTypeID": 2,
// "PatientType": 1,
// "PatientTypeID": 1,
// "TokenID": "@dm!n",
// "PatientID": 869588,
// "PatientOutSA": 0,
// "SessionID": "rVuK3nzN4UKN0SW95un0jQ==",
// "ClinicID": 2,
// "DoctorID": "7600",
// "AdmissionNo": 2011001258
// };
dynamic localRes;
await baseAppClient.post(INPATIENT_DISCHARGE_MEDICATIONS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
} }

@ -736,6 +736,7 @@ class Utils {
SizedBox(height: 6), SizedBox(height: 6),
Text( Text(
text, text,
maxLines: 1,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
SizedBox(height: 5), SizedBox(height: 5),
@ -810,10 +811,7 @@ class Utils {
return crypto.md5.convert(utf8.encode(input)).toString(); return crypto.md5.convert(utf8.encode(input)).toString();
} }
static String generateSignature() { static String generateSignature() {}
}
} }
Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) {

Loading…
Cancel
Save