Inpatient medical instructions implemented

Dev_3.3_InPatient_CR
haroon amjad 2 years ago
parent 786dd76f57
commit d251ca0e1c

@ -20,10 +20,10 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -611,6 +611,8 @@ var CHECK_IF_PATIENT_ADMITTED = 'Services/Inps.svc/REST/chekIsPatientAdmitted';
// Get General Instructions API
var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions';
// Get General Instructions API
var GET_MEDICAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getPatientAdmissionRequest';
var INSERT_INPATIENT_ORDER = 'Services/INPs.svc/REST/Inpcp_insertOrder';

@ -0,0 +1,85 @@
class GetMedicalInstructions {
dynamic propertyChanged;
int admissionRequestNoField;
String clinicNameField;
String doctorNameField;
String expectedAdmissionDateField;
List<MedicaLInstructionsField> medicaLInstructionsField;
dynamic medicalInstructionsXMLField;
String medicalRemarksField;
int projectIdField;
String projectNameField;
String setupIdField;
GetMedicalInstructions(
{this.propertyChanged,
this.admissionRequestNoField,
this.clinicNameField,
this.doctorNameField,
this.expectedAdmissionDateField,
this.medicaLInstructionsField,
this.medicalInstructionsXMLField,
this.medicalRemarksField,
this.projectIdField,
this.projectNameField,
this.setupIdField});
GetMedicalInstructions.fromJson(Map<String, dynamic> json) {
propertyChanged = json['PropertyChanged'];
admissionRequestNoField = json['admissionRequestNoField'];
clinicNameField = json['clinicNameField'];
doctorNameField = json['doctorNameField'];
expectedAdmissionDateField = json['expectedAdmissionDateField'];
if (json['medicaLInstructionsField'] != null) {
medicaLInstructionsField = <MedicaLInstructionsField>[];
json['medicaLInstructionsField'].forEach((v) {
medicaLInstructionsField.add(new MedicaLInstructionsField.fromJson(v));
});
}
medicalInstructionsXMLField = json['medicalInstructionsXMLField'];
medicalRemarksField = json['medicalRemarksField'];
projectIdField = json['projectIdField'];
projectNameField = json['projectNameField'];
setupIdField = json['setupIdField'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PropertyChanged'] = this.propertyChanged;
data['admissionRequestNoField'] = this.admissionRequestNoField;
data['clinicNameField'] = this.clinicNameField;
data['doctorNameField'] = this.doctorNameField;
data['expectedAdmissionDateField'] = this.expectedAdmissionDateField;
if (this.medicaLInstructionsField != null) {
data['medicaLInstructionsField'] = this.medicaLInstructionsField.map((v) => v.toJson()).toList();
}
data['medicalInstructionsXMLField'] = this.medicalInstructionsXMLField;
data['medicalRemarksField'] = this.medicalRemarksField;
data['projectIdField'] = this.projectIdField;
data['projectNameField'] = this.projectNameField;
data['setupIdField'] = this.setupIdField;
return data;
}
}
class MedicaLInstructionsField {
Null propertyChanged;
String descriptionField;
int parameterCodeField;
MedicaLInstructionsField({this.propertyChanged, this.descriptionField, this.parameterCodeField});
MedicaLInstructionsField.fromJson(Map<String, dynamic> json) {
propertyChanged = json['PropertyChanged'];
descriptionField = json['descriptionField'];
parameterCodeField = json['parameterCodeField'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PropertyChanged'] = this.propertyChanged;
data['descriptionField'] = this.descriptionField;
data['parameterCodeField'] = this.parameterCodeField;
return data;
}
}

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/InPatientServices/general_instruction
import 'package:diplomaticquarterapp/pages/InPatientServices/help_PRO.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/inpatient_advance_payment.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/meal_plan.dart';
import 'package:diplomaticquarterapp/pages/InPatientServices/medical_instructions.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -15,6 +16,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../models/InPatientServices/get_medical_instructions_response_model.dart';
class InPatientServicesHome extends StatelessWidget {
ProjectViewModel projectViewModel;
@ -90,7 +93,7 @@ class InPatientServicesHome extends StatelessWidget {
serviceList.add(
InkWell(
onTap: () {
// Navigator.push(context, FadePage(page: AdvancePaymentPage()));
openMedicalInstructions(context);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).medicalInstructionsTitle,
@ -257,4 +260,20 @@ class InPatientServicesHome extends StatelessWidget {
print(err);
});
}
void openMedicalInstructions(BuildContext context) {
ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getMedicalInstructions(projectViewModel.inPatientProjectID, context).then((res) {
List<GetMedicalInstructions> getMedicalInstructionsList = [];
res['MedicalInstruction'].forEach((v) {
getMedicalInstructionsList.add(new GetMedicalInstructions.fromJson(v));
});
GifLoaderDialogUtils.hideDialog(context);
print(res['MedicalInstruction']);
Navigator.push(context, FadePage(page: MedicalInstructionsPage(getMedicalInstructionsList: getMedicalInstructionsList)));
}).catchError((err) {
print(err);
});
}
}

@ -0,0 +1,100 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import '../../models/InPatientServices/get_medical_instructions_response_model.dart';
class MedicalInstructionsPage extends StatefulWidget {
List<GetMedicalInstructions> getMedicalInstructionsList;
MedicalInstructionsPage({@required this.getMedicalInstructionsList});
@override
State<MedicalInstructionsPage> createState() => _MedicalInstructionsPageState();
}
class _MedicalInstructionsPageState extends State<MedicalInstructionsPage> {
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).InPatientServicesHeader,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.all(21.0),
child: Text("Medical Instructions",
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 21.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
)),
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width,
child: Card(
elevation: 0.0,
margin: EdgeInsets.all(16),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.transparent, width: 0.0),
),
child: Padding(
padding: EdgeInsets.all(16.0),
child: Container(
child: ListView.separated(
itemCount: widget.getMedicalInstructionsList[0].medicaLInstructionsField.length,
itemBuilder: (BuildContext context, int index) {
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
child: SvgPicture.asset("assets/images/new-design/ionic-ios-checkmark-circle.svg"),
),
Container(
width: MediaQuery.of(context).size.width * 0.75,
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: Text(widget.getMedicalInstructionsList[0].medicaLInstructionsField[index].descriptionField,
overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
)),
),
],
));
},
separatorBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.only(left: 14, right: 14),
child: mHeight(16.0),
);
},
)),
),
),
),
)
],
));
}
}

@ -43,8 +43,9 @@ import 'package:provider/provider.dart';
class ConfirmLogin extends StatefulWidget {
final Function changePageViewIndex;
final fromRegistration;
final bool isDubai;
const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key);
final bool isDubai;
const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key);
@override
_ConfirmLogin createState() => _ConfirmLogin();
@ -387,9 +388,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null || widget.isDubai) {
if(!widget.isDubai){
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
}
if (!widget.isDubai) {
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
}
request.healthId = healthId;
request.isHijri = isHijri;
await this.authService.sendActivationCodeRegister(request).then((result) {
@ -569,7 +570,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var request = this.getCommonRequest().toJson();
dynamic res;
if (healthId != null || widget.isDubai) {
if(!widget.isDubai) {
if (!widget.isDubai) {
request['DOB'] = dob;
}
request['HealthId'] = healthId;
@ -584,7 +585,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
result = CheckActivationCode.fromJson(result),
if (this.registerd_data != null && this.registerd_data.isRegister == true)
{
// if(widget.isDubai ==false){
// if(widget.isDubai ==false){
widget.changePageViewIndex(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
}
@ -679,11 +680,15 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (res['MessageStatus'] == 1) {
isAdmitted = res['isAdmitted'];
print("IS ADMITTED: $isAdmitted");
if (res['PatientAdmittedInformation'].length != 0) {
if (res['isAdmitted'] == true) {
print("INPATIENT!!!");
getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]);
projectViewModel.setIsPatientAdmitted(true);
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']);
if (res['PatientAdmittedInformation'].length != 0) {
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']);
} else {
projectViewModel.setInPatientProjectID(15);
}
projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
} else {
print("OUTPATIENT!!!");

@ -401,12 +401,16 @@ class _Login extends State<Login> {
if (res['MessageStatus'] == 1) {
isAdmitted = res['isAdmitted'];
print("IS ADMITTED: $isAdmitted");
if (res['PatientAdmittedInformation'].length != 0) {
if (res['isAdmitted'] == true) {
print("INPATIENT!!!");
getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]);
projectViewModel.setIsPatientAdmitted(true);
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']);
projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
if (res['PatientAdmittedInformation'].length != 0) {
getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]);
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']);
projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
} else {
projectViewModel.setInPatientProjectID(15);
}
} else {
print("OUTPATIENT!!!");
projectViewModel.setIsPatientAdmitted(false);

@ -93,6 +93,20 @@ class ClinicListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getMedicalInstructions(int projectID, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID};
dynamic localRes;
await baseAppClient.post(GET_MEDICAL_INSTRUCTIONS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getProjectsList(context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');

Loading…
Cancel
Save