Birth Notification implemented

Dev_3.3_InPatient_CR
haroon amjad 3 years ago
parent 078482c21d
commit 60d5ba4a9e

@ -602,6 +602,10 @@ var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions';
var INSERT_INPATIENT_ORDER = 'Services/INPs.svc/REST/Inpcp_insertOrder';
var GET_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/getBirthNotification_bymothermrn';
var SAVE_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/SaveBirthNotification';
class AppGlobal {
static var context;

@ -1911,11 +1911,13 @@ const Map localizedValues = {
"birthNotificationSubTitle": {"en": "Notification", "ar": "تبليغ الولادة"},
"admissionNoticeTitle": {"en": "Admission", "ar": "إشعار"},
"admissionNoticeSubTitle": {"en": "Notice", "ar": "تنويم"},
"mothersMRN": {"en": "Mother's MRN", "ar": "رقم ملف الأم"},
"mothersName": {"en": "Mother's Name", "ar": "اسم الأم"},
"fathersName": {"en": "Father's Name", "ar": "اسم الاب"},
"babysName": {"en": "Baby's Name", "ar": "اسم المولود"},
"contactNumber": {"en": "Contact Number", "ar": "رقم الاتصال"},
"mothersMRN": {"en": "Mother's MRN *", "ar": "رقم ملف الأم"},
"mothersName": {"en": "Mother's name *", "ar": "اسم الأم"},
"fathersNameEN": {"en": "Father's name english *", "ar": "اسم الاب انجليزي"},
"fathersNameAR": {"en": "Father's name arabic *", "ar": "اسم الاب عربي"},
"babysNameEN": {"en": "Baby's name english *", "ar": "اسم المولود انجليزي"},
"babysNameAR": {"en": "Baby's name arabic *", "ar": "اسم المولود عربي"},
"contactNumber": {"en": "Contact number *", "ar": "رقم الاتصال"},
"scanID": {"en": "Scan ID", "ar": "معرف المسح"},
"birthNotificationNotes1": {
"en": "For Saudis: Provide copy of the identification card for both couples. If the wife doesn't have identification card, The family card must be provided.",

@ -149,7 +149,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021";
// body['PatientID'] = 2001273; //3844083
// body['PatientID'] = 3649542; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574

@ -2,7 +2,10 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/insurance/AttachInsuranceCardImageDialog.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -21,7 +24,9 @@ class _BirthNotificationState extends State<BirthNotification> {
TextEditingController motherMRN = new TextEditingController();
TextEditingController motherName = new TextEditingController();
TextEditingController fatherName = new TextEditingController();
TextEditingController fatherNameAR = new TextEditingController();
TextEditingController babyName = new TextEditingController();
TextEditingController babyNameAR = new TextEditingController();
TextEditingController contactNumber = new TextEditingController();
ProjectViewModel projectViewModel;
@ -64,9 +69,13 @@ class _BirthNotificationState extends State<BirthNotification> {
mHeight(16),
inputWidget(TranslationBase.of(context).mothersName, "", motherName, isEnable: false),
mHeight(16),
inputWidget(TranslationBase.of(context).fathersName, "", fatherName),
inputWidget(TranslationBase.of(context).fathersNameEN, "", fatherName),
mHeight(16),
inputWidget(TranslationBase.of(context).babysName, "", babyName),
inputWidget(TranslationBase.of(context).fathersNameAR, "", fatherNameAR),
mHeight(16),
inputWidget(TranslationBase.of(context).babysNameEN, "", babyName),
mHeight(16),
inputWidget(TranslationBase.of(context).babysNameAR, "", babyNameAR),
mHeight(16),
inputWidget(TranslationBase.of(context).contactNumber, "", contactNumber),
mHeight(16),
@ -151,9 +160,21 @@ class _BirthNotificationState extends State<BirthNotification> {
),
),
mHeight(16.0),
// DefaultButton(
// TranslationBase.of(context).submit,
// (fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty) ? null : () {
// submitBirthNotification();
// },
// color: CustomColors.accentColor,
// disabledColor: CustomColors.grey2,
// ),
DefaultButton(
TranslationBase.of(context).submit,
() {},
(fatherNameAR.text.isEmpty || fatherName.text.isEmpty || babyNameAR.text.isEmpty || babyName.text.isEmpty || images.isEmpty)
? null
: () {
submitBirthNotification();
},
color: CustomColors.accentColor,
disabledColor: CustomColors.grey2,
),
@ -164,6 +185,21 @@ class _BirthNotificationState extends State<BirthNotification> {
);
}
void submitBirthNotification() {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.submitBirthNotification(
projectViewModel.user.patientID, projectViewModel.inPatientProjectID, fatherNameAR.text, fatherName.text, babyNameAR.text, babyName.text, contactNumber.text, images[0], context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
Navigator.of(context).pop();
}).catchError((err) {
print(err);
});
}
void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo}) {
showDialog(
context: context,

@ -122,7 +122,7 @@ class InPatientServicesHome extends StatelessWidget {
serviceList.add(
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: BirthNotification()));
openBirthNotificationsPage(context);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).birthNotificationTitle,
@ -230,6 +230,18 @@ class InPatientServicesHome extends StatelessWidget {
});
}
void openBirthNotificationsPage(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getBirthNotification(projectViewModel.user.patientID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['birthNotification']);
Navigator.push(context, FadePage(page: BirthNotification()));
}).catchError((err) {
print(err);
});
}
void openGeneralInstructions(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);

@ -235,4 +235,43 @@ class ClinicListService extends BaseService {
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getBirthNotification(num motherMRN, context) async {
Map<String, dynamic> request;
request = {
"mothermrn": motherMRN,
};
dynamic localRes;
await baseAppClient.post(GET_BIRTH_NOTIFICATION, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> submitBirthNotification(num motherMRN, int projectID, String fatherNameAR, String fatherNameEN, String babyNameAR, String babyNameEN, String contactNum, String idImage, context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"mothermrn": motherMRN,
"fatherName": fatherNameEN,
"fatherNameAr": fatherNameAR,
"babyName": babyNameEN,
"babyNameAr": babyNameEN,
"contactNumber": contactNum,
"iDImage": idImage,
};
dynamic localRes;
await baseAppClient.post(SAVE_BIRTH_NOTIFICATION, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
}

@ -2909,8 +2909,10 @@ class TranslationBase {
String get admissionNoticeSubTitle => localizedValues["admissionNoticeSubTitle"][locale.languageCode];
String get mothersMRN => localizedValues["mothersMRN"][locale.languageCode];
String get mothersName => localizedValues["mothersName"][locale.languageCode];
String get fathersName => localizedValues["fathersName"][locale.languageCode];
String get babysName => localizedValues["babysName"][locale.languageCode];
String get fathersNameEN => localizedValues["fathersNameEN"][locale.languageCode];
String get fathersNameAR => localizedValues["fathersNameAR"][locale.languageCode];
String get babysNameEN => localizedValues["babysNameEN"][locale.languageCode];
String get babysNameAR => localizedValues["babysNameAR"][locale.languageCode];
String get contactNumber => localizedValues["contactNumber"][locale.languageCode];
String get scanID => localizedValues["scanID"][locale.languageCode];
String get birthNotificationNotes1 => localizedValues["birthNotificationNotes1"][locale.languageCode];

@ -73,6 +73,7 @@ class DefaultButton extends StatelessWidget {
style: TextButton.styleFrom(
backgroundColor: color ?? const Color(0xffD02127),
disabledForegroundColor: disabledColor,
disabledBackgroundColor: disabledColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),

Loading…
Cancel
Save