Merge branch 'development' into admission-request

merge-requests/299/head
mosazaid 5 years ago
commit 1207339b01

@ -598,6 +598,7 @@ const Map<String, Map<String, String>> localizedValues = {
'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"}, 'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"},
'normal': {'en': "Normal", 'ar': "عادي"}, 'normal': {'en': "Normal", 'ar': "عادي"},
'abnormal': {'en': "Abnormal", 'ar': " غير عادي"}, 'abnormal': {'en': "Abnormal", 'ar': " غير عادي"},
'notExamined': {'en': "Not Examined", 'ar': "لم يتم الفحص"},
"systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"},
"diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"},
"mass": {"en": "Mass", "ar": "كتلة"}, "mass": {"en": "Mass", "ar": "كتلة"},
@ -709,4 +710,5 @@ const Map<String, Map<String, String>> localizedValues = {
'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"}, 'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"},
'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"}, 'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"},
// 'icd': {'en': "ICD", 'ar': " "}, // 'icd': {'en': "ICD", 'ar': " "},
'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"},
}; };

@ -57,6 +57,8 @@ class EntityList {
dynamic status; dynamic status;
dynamic stopDate; dynamic stopDate;
dynamic uom; dynamic uom;
dynamic pharmacistRemarks;
dynamic refill;
EntityList( EntityList(
{this.appointmentNo, {this.appointmentNo,
@ -87,7 +89,9 @@ class EntityList {
this.startDate, this.startDate,
this.status, this.status,
this.stopDate, this.stopDate,
this.uom}); this.uom,
this.pharmacistRemarks,
this.refill});
EntityList.fromJson(Map<String, dynamic> json) { EntityList.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
@ -119,6 +123,8 @@ class EntityList {
status = json['status']; status = json['status'];
stopDate = json['stopDate']; stopDate = json['stopDate'];
uom = json['uom']; uom = json['uom'];
pharmacistRemarks = json['pharmacistRemarks'];
refill = json['refill'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -152,6 +158,8 @@ class EntityList {
data['status'] = this.status; data['status'] = this.status;
data['stopDate'] = this.stopDate; data['stopDate'] = this.stopDate;
data['uom'] = this.uom; data['uom'] = this.uom;
data['pharmacistRemarks'] = this.pharmacistRemarks;
data['refill'] = this.refill;
return data; return data;
} }
} }

@ -1,13 +1,19 @@
class GetPhysicalExamResModel { class GetPhysicalExamResModel {
int appointmentNo; int appointmentNo;
int createdBy; int createdBy;
String createdByName;
String createdOn; String createdOn;
int editedBy; Null editedBy;
String editedByName;
String editedOn; String editedOn;
int episodeId; int episodeId;
int examId; int examId;
String examName;
int examType; int examType;
int examinationType;
String examinationTypeName;
bool isAbnormal; bool isAbnormal;
bool isNew;
bool isNormal; bool isNormal;
bool notExamined; bool notExamined;
int patientMRN; int patientMRN;
@ -16,13 +22,19 @@ class GetPhysicalExamResModel {
GetPhysicalExamResModel( GetPhysicalExamResModel(
{this.appointmentNo, {this.appointmentNo,
this.createdBy, this.createdBy,
this.createdByName,
this.createdOn, this.createdOn,
this.editedBy, this.editedBy,
this.editedByName,
this.editedOn, this.editedOn,
this.episodeId, this.episodeId,
this.examId, this.examId,
this.examName,
this.examType, this.examType,
this.examinationType,
this.examinationTypeName,
this.isAbnormal, this.isAbnormal,
this.isNew,
this.isNormal, this.isNormal,
this.notExamined, this.notExamined,
this.patientMRN, this.patientMRN,
@ -31,13 +43,19 @@ class GetPhysicalExamResModel {
GetPhysicalExamResModel.fromJson(Map<String, dynamic> json) { GetPhysicalExamResModel.fromJson(Map<String, dynamic> json) {
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
createdByName = json['createdByName'];
createdOn = json['createdOn']; createdOn = json['createdOn'];
editedBy = json['editedBy']; editedBy = json['editedBy'];
editedByName = json['editedByName'];
editedOn = json['editedOn']; editedOn = json['editedOn'];
episodeId = json['episodeId']; episodeId = json['episodeId'];
examId = json['examId']; examId = json['examId'];
examName = json['examName'];
examType = json['examType']; examType = json['examType'];
examinationType = json['examinationType'];
examinationTypeName = json['examinationTypeName'];
isAbnormal = json['isAbnormal']; isAbnormal = json['isAbnormal'];
isNew = json['isNew'];
isNormal = json['isNormal']; isNormal = json['isNormal'];
notExamined = json['notExamined']; notExamined = json['notExamined'];
patientMRN = json['patientMRN']; patientMRN = json['patientMRN'];
@ -48,13 +66,19 @@ class GetPhysicalExamResModel {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['appointmentNo'] = this.appointmentNo; data['appointmentNo'] = this.appointmentNo;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
data['createdByName'] = this.createdByName;
data['createdOn'] = this.createdOn; data['createdOn'] = this.createdOn;
data['editedBy'] = this.editedBy; data['editedBy'] = this.editedBy;
data['editedByName'] = this.editedByName;
data['editedOn'] = this.editedOn; data['editedOn'] = this.editedOn;
data['episodeId'] = this.episodeId; data['episodeId'] = this.episodeId;
data['examId'] = this.examId; data['examId'] = this.examId;
data['examName'] = this.examName;
data['examType'] = this.examType; data['examType'] = this.examType;
data['examinationType'] = this.examinationType;
data['examinationTypeName'] = this.examinationTypeName;
data['isAbnormal'] = this.isAbnormal; data['isAbnormal'] = this.isAbnormal;
data['isNew'] = this.isNew;
data['isNormal'] = this.isNormal; data['isNormal'] = this.isNormal;
data['notExamined'] = this.notExamined; data['notExamined'] = this.notExamined;
data['patientMRN'] = this.patientMRN; data['patientMRN'] = this.patientMRN;

@ -5,13 +5,17 @@ class MySelectedExamination {
String remark; String remark;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
bool notExamined;
bool isNew;
int createdBy; int createdBy;
MySelectedExamination( MySelectedExamination(
{this.selectedExamination, {this.selectedExamination,
this.remark, this.remark,
this.isNormal = true, this.isNormal = false,
this.isAbnormal = false, this.isAbnormal = false,
this.notExamined = true,
this.isNew = true,
this.createdBy}); this.createdBy});
MySelectedExamination.fromJson(Map<String, dynamic> json) { MySelectedExamination.fromJson(Map<String, dynamic> json) {
@ -19,8 +23,10 @@ class MySelectedExamination {
? new MasterKeyModel.fromJson(json['selectedExamination']) ? new MasterKeyModel.fromJson(json['selectedExamination'])
: null; : null;
remark = json['remark']; remark = json['remark'];
remark = json['isNormal']; isNormal = json['isNormal'];
remark = json['isAbnormal']; isAbnormal = json['isAbnormal'];
notExamined = json['notExamined'];
isNew = json['isNew'];
createdBy = json['createdBy']; createdBy = json['createdBy'];
} }
@ -33,6 +39,8 @@ class MySelectedExamination {
data['remark'] = this.remark; data['remark'] = this.remark;
data['isNormal'] = this.isNormal; data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal; data['isAbnormal'] = this.isAbnormal;
data['notExamined'] = this.notExamined;
data['isNew'] = this.isNew;
data['createdBy'] = this.createdBy; data['createdBy'] = this.createdBy;
return data; return data;
} }

@ -25,75 +25,91 @@ class PostPhysicalExamRequestModel {
} }
} }
class ListHisProgNotePhysicalExaminationVM { class ListHisProgNotePhysicalExaminationVM {
int episodeId; int episodeId;
int appointmentNo; int appointmentNo;
int examType; int examType;
int examId; int examId;
int patientMRN; int patientMRN;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
String remarks; bool notExamined;
int createdBy; String examName;
String createdOn; String examinationTypeName;
int editedBy; int examinationType;
String editedOn; String remarks;
bool notExamined; bool isNew;
MasterKeyModel masterDescription; int createdBy;
String createdOn;
String createdByName;
int editedBy;
String editedOn;
String editedByName;
ListHisProgNotePhysicalExaminationVM( ListHisProgNotePhysicalExaminationVM(
{this.episodeId, {this.episodeId,
this.appointmentNo, this.appointmentNo,
this.examType, this.examType,
this.examId, this.examId,
this.patientMRN, this.patientMRN,
this.isNormal, this.isNormal,
this.isAbnormal, this.isAbnormal,
this.remarks, this.notExamined,
this.createdBy, this.examName,
this.createdOn, this.examinationTypeName,
this.editedBy, this.examinationType,
this.editedOn, this.remarks,
this.notExamined, this.isNew,
this.masterDescription}); this.createdBy,
this.createdOn,
this.createdByName,
this.editedBy,
this.editedOn,
this.editedByName});
ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) { ListHisProgNotePhysicalExaminationVM.fromJson(Map<String, dynamic> json) {
episodeId = json['episodeId']; episodeId = json['episodeId'];
appointmentNo = json['appointmentNo']; appointmentNo = json['appointmentNo'];
examType = json['examType']; examType = json['examType'];
examId = json['examId']; examId = json['examId'];
patientMRN = json['patientMRN']; patientMRN = json['patientMRN'];
isNormal = json['isNormal']; isNormal = json['isNormal'];
isAbnormal = json['isAbnormal']; isAbnormal = json['isAbnormal'];
remarks = json['remarks']; notExamined = json['notExamined'];
createdBy = json['createdBy']; examName = json['examName'];
createdOn = json['createdOn']; examinationTypeName = json['examinationTypeName'];
editedBy = json['editedBy']; examinationType = json['examinationType'];
editedOn = json['editedOn']; remarks = json['remarks'];
notExamined = json['notExamined']; isNew = json['isNew'];
masterDescription = json['masterDescription'] != null createdBy = json['createdBy'];
? new MasterKeyModel.fromJson(json['masterDescription']) createdOn = json['createdOn'];
: null; createdByName = json['createdByName'];
} editedBy = json['editedBy'];
editedOn = json['editedOn'];
editedByName = json['editedByName'];
}
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['episodeId'] = this.episodeId; data['episodeId'] = this.episodeId;
data['appointmentNo'] = this.appointmentNo; data['appointmentNo'] = this.appointmentNo;
data['examType'] = this.examType; data['examType'] = this.examType;
data['examId'] = this.examId; data['examId'] = this.examId;
data['patientMRN'] = this.patientMRN; data['patientMRN'] = this.patientMRN;
data['isNormal'] = this.isNormal; data['isNormal'] = this.isNormal;
data['isAbnormal'] = this.isAbnormal; data['isAbnormal'] = this.isAbnormal;
data['remarks'] = this.remarks; data['notExamined'] = this.notExamined;
data['createdBy'] = this.createdBy; data['examName'] = this.examName;
data['createdOn'] = this.createdOn; data['examinationTypeName'] = this.examinationTypeName;
data['editedBy'] = this.editedBy; data['examinationType'] = this.examinationType;
data['editedOn'] = this.editedOn; data['remarks'] = this.remarks;
data['notExamined'] = this.notExamined; data['isNew'] = this.isNew;
if (this.masterDescription != null) { data['createdBy'] = this.createdBy;
data['masterDescription'] = this.masterDescription.toJson(); data['createdOn'] = this.createdOn;
data['createdByName'] = this.createdByName;
data['editedBy'] = this.editedBy;
data['editedOn'] = this.editedOn;
data['editedByName'] = this.editedByName;
return data;
} }
return data;
} }
}

@ -143,6 +143,9 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if(model
.patientLabResultOrdersList[index]
.doctorName != null )
AppText( AppText(
'${model '${model
.patientLabResultOrdersList[index] .patientLabResultOrdersList[index]
@ -171,7 +174,7 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
MainAxisAlignment.start, MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
' Invoice No :', TranslationBase.of(context).invoiceNo,
fontSize: 2 * fontSize: 2 *
SizeConfig SizeConfig
.textMultiplier, .textMultiplier,
@ -187,6 +190,30 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
color: Colors.grey[800], color: Colors.grey[800],
), ),
], ],
),SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context).orderNo,
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.orderNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
) )
], ],
), ),

@ -37,19 +37,39 @@ class _LabResultState extends State<LabResult> {
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
CardWithBgWidgetNew( CardWithBgWidgetNew(
widget: Row( widget: Column(
mainAxisAlignment: MainAxisAlignment.start, children: [
children: <Widget>[ Row(
AppText( mainAxisAlignment: MainAxisAlignment.start,
TranslationBase.of(context).invoiceNo, children: <Widget>[
fontSize: 2 * SizeConfig.textMultiplier, AppText(
color: Colors.grey[800], TranslationBase.of(context).orderNo,
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${widget.labOrders.orderNo}',
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
],
), ),
AppText( Row(
' ${widget.labOrders.invoiceNo}', mainAxisAlignment: MainAxisAlignment.start,
fontSize: 2 * SizeConfig.textMultiplier, children: <Widget>[
color: Colors.grey[800], AppText(
TranslationBase.of(context).invoiceNo,
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${widget.labOrders.invoiceNo}',
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
],
), ),
], ],
), ),
), ),

@ -48,6 +48,7 @@ postProcedure(
PrescriptionViewModel model, PrescriptionViewModel model,
DateTime doseTime, DateTime doseTime,
String doseUnit, String doseUnit,
String icdCode,
PatiantInformtion patient}) async { PatiantInformtion patient}) async {
PostPrescriptionReqModel postProcedureReqModel = PostPrescriptionReqModel postProcedureReqModel =
new PostPrescriptionReqModel(); new PostPrescriptionReqModel();
@ -67,7 +68,7 @@ postProcedure(
frequency: frequency.isEmpty ? 1 : int.parse(frequency), frequency: frequency.isEmpty ? 1 : int.parse(frequency),
remarks: instruction, remarks: instruction,
approvalRequired: true, approvalRequired: true,
icdcode10Id: "test2", icdcode10Id: icdCode.toString(),
doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn),
duration: duration.isEmpty ? 1 : int.parse(duration), duration: duration.isEmpty ? 1 : int.parse(duration),
doseStartDate: doseTime.toIso8601String())); doseStartDate: doseTime.toIso8601String()));
@ -127,6 +128,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
dynamic doseTime; dynamic doseTime;
dynamic indication; dynamic indication;
dynamic units; dynamic units;
dynamic x;
List<dynamic> indicationList; List<dynamic> indicationList;
String routeInatial = 'By Mouth'; String routeInatial = 'By Mouth';
@ -176,11 +178,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ListSelectDialog drugDialog; ListSelectDialog drugDialog;
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
// final routeArgs = ModalRoute.of(context).settings.arguments as Map; // final routeArgs = ModalRoute.of(context).settings.arguments as Map;
// patient = routeArgs['patient']; // patient = routeArgs['patient'];
return BaseView<MedicineViewModel>( return BaseView<MedicineViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
x = model.patientAssessmentList.map((element) {
return element.icdCode10ID;
});
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: widget.patient.patientMRN, patientMRN: widget.patient.patientMRN,
episodeID: widget.patient.episodeNo.toString(), episodeID: widget.patient.episodeNo.toString(),
@ -193,7 +199,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
await model.getMedicationRoute(); await model.getMedicationRoute();
await model.getMedicationFrequency(); await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
await model.getMedicationIndications(); //await model.getMedicationIndications();
await model.getPatientAssessment(getAssessmentReqModel); await model.getPatientAssessment(getAssessmentReqModel);
}, },
builder: ( builder: (
@ -210,7 +216,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
builder: (BuildContext context, ScrollController scrollController) { builder: (BuildContext context, ScrollController scrollController) {
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
height: 980, height: 1010,
child: Padding( child: Padding(
padding: padding:
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
@ -691,7 +697,6 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
// openDrugToDrug(); // openDrugToDrug();
if (route == null || if (route == null ||
frequency == null || frequency == null ||
indication == null ||
doseTime == null || doseTime == null ||
duration == null || duration == null ||
selectedDate == null || selectedDate == null ||
@ -704,30 +709,54 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
if (formKey.currentState.validate()) { if (formKey.currentState.validate()) {
Navigator.pop(context); Navigator.pop(context);
{ {
// var x = model
// .patientAssessmentList
// .map((value) =>
// value.icdCode10ID)
// .toList()
// .join(',');
postProcedure( postProcedure(
dose: strengthController.text, icdCode: model
doseUnit: .patientAssessmentList[
units['id'].toString(), 0]
patient: widget.patient, .icdCode10ID
doseTimeIn: .isEmpty
doseTime['id'].toString(), ? "test"
model: widget.model, : model
duration: .patientAssessmentList[
duration['id'].toString(), 0]
frequency: frequency['id'] .icdCode10ID
.toString(), .toString(),
route: route['id'].toString(), // icdCode: model
drugId: _selectedMedication // .patientAssessmentList
.itemId // .map((value) => value
.toString(), // .icdCode10ID
strength: // .trim())
strengthController.text, // .toList()
indication: // .join(' '),
indicationController.text, dose: strengthController.text,
instruction: doseUnit:
instructionController units['id'].toString(),
.text, patient: widget.patient,
doseTime: selectedDate); doseTimeIn:
doseTime['id'].toString(),
model: widget.model,
duration:
duration['id'].toString(),
frequency:
frequency['id'].toString(),
route: route['id'].toString(),
drugId: _selectedMedication
.itemId
.toString(),
strength:
strengthController.text,
indication:
indicationController.text,
instruction:
instructionController.text,
doseTime: selectedDate,
);
} }
} }
{ {

@ -200,7 +200,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.24, 0.33,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -239,7 +239,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.3499, 0.3899,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -357,6 +357,28 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
) )
], ],
), ),
SizedBox(
height:
5.0),
Row(
children: [
AppText(
'pharmacist Remarks : ',
fontWeight:
FontWeight
.w700,
fontSize:
17.0,
),
Expanded(
child: AppText(
model.prescriptionList[0].entityList[index].pharmacistRemarks == null
? ""
: model.prescriptionList[0].entityList[index].pharmacistRemarks,
fontSize: 15.0),
)
],
),
SizedBox( SizedBox(
height: 20.0, height: 20.0,
), ),
@ -383,20 +405,23 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
) )
], ],
), ),
SizedBox(
height: 8.0,
),
Row( Row(
children: [ children: [
Expanded( Expanded(
child: child:
Container( Container(
height: height:
30, 25,
child: child:
AppText( AppText(
model.prescriptionList[0].entityList[index].remarks == null model.prescriptionList[0].entityList[index].remarks == null
? "" ? ""
: model.prescriptionList[0].entityList[index].remarks, : model.prescriptionList[0].entityList[index].remarks,
fontSize: fontSize:
11.5, 12.5,
), ),
), ),
), ),
@ -417,7 +442,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
context) context)
.size .size
.height * .height *
0.08, 0.16,
width: MediaQuery.of( width: MediaQuery.of(
context) context)
.size .size
@ -431,32 +456,31 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.edit), .edit),
onTap: () { onTap: () {
updatePrescriptionForm( updatePrescriptionForm(
doseUnit: drugNameGeneric: model
model.prescriptionList[0].entityList[index].doseDailyUnitID
.toString(),
doseStreangth:
model.prescriptionList[0].entityList[index].doseDailyQuantity
.toString(),
duration:
model.prescriptionList[0].entityList[index].doseDurationDays
.toString(),
startDate:
model.prescriptionList[0].entityList[index].startDate
.toString(),
dose: model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.doseTimingID .medicationName,
doseUnit: model.prescriptionList[0].entityList[index].doseDailyUnitID
.toString(), .toString(),
frequency: model doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity
.toString(),
duration: model.prescriptionList[0].entityList[index].doseDurationDays
.toString(),
startDate:
model.prescriptionList[0].entityList[index].startDate
.toString(),
dose: model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
index] index]
.frequencyID .doseTimingID
.toString(), .toString(),
frequency:
model.prescriptionList[0].entityList[index].frequencyID
.toString(),
rouat: model rouat: model
.prescriptionList[ .prescriptionList[
0] 0]

@ -1,6 +1,8 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_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_view_model.dart';
@ -8,6 +10,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -31,6 +34,7 @@ class UpdatePrescriptionForm extends StatefulWidget {
final String enteredRemarks; final String enteredRemarks;
final String startDate; final String startDate;
final String frequency; final String frequency;
final String drugNameGeneric;
final PrescriptionViewModel model; final PrescriptionViewModel model;
UpdatePrescriptionForm( UpdatePrescriptionForm(
@ -46,7 +50,8 @@ class UpdatePrescriptionForm extends StatefulWidget {
this.doseUnit, this.doseUnit,
this.enteredRemarks, this.enteredRemarks,
this.frequency, this.frequency,
this.model}); this.model,
this.drugNameGeneric});
@override @override
_UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState();
} }
@ -62,6 +67,9 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
dynamic frequencyUpdate; dynamic frequencyUpdate;
dynamic updatedDuration; dynamic updatedDuration;
dynamic units; dynamic units;
GetMedicationResponseModel newSelectedMedication;
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
@override @override
void initState() { void initState() {
@ -80,7 +88,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
await model.getMedicationRoute(); await model.getMedicationRoute();
await model.getMedicationFrequency(); await model.getMedicationFrequency();
await model.getMedicationDoseTime(); await model.getMedicationDoseTime();
await model.getMedicationIndications(); //await model.getMedicationIndications();
route = model.getLookupById(model.medicationRouteList, widget.route); route = model.getLookupById(model.medicationRouteList, widget.route);
doseTime = doseTime =
model.getLookupById(model.medicationDoseTimeList, widget.dose); model.getLookupById(model.medicationDoseTimeList, widget.dose);
@ -96,13 +104,13 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
NetworkBaseView( NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: DraggableScrollableSheet( child: DraggableScrollableSheet(
initialChildSize: 0.90, initialChildSize: 0.95,
maxChildSize: 0.90, maxChildSize: 0.99,
minChildSize: 0.6, minChildSize: 0.6,
builder: builder:
(BuildContext context, ScrollController scrollController) { (BuildContext context, ScrollController scrollController) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 1.0, height: MediaQuery.of(context).size.height * 1.3,
child: Form( child: Form(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@ -119,6 +127,78 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
), ),
Column( Column(
children: [ children: [
// Container(
// height: MediaQuery.of(context).size.height *
// 0.070,
// child: InkWell(
// onTap: model.allMedicationList != null
// ? () {
// setState(() {
// newSelectedMedication = null;
// });
// }
// : null,
// child: newSelectedMedication == null
// ? AutoCompleteTextField<
// GetMedicationResponseModel>(
// decoration:
// textFieldSelectorDecoration(
// widget.drugNameGeneric,
// newSelectedMedication != null
// ? newSelectedMedication
// .genericName
// : null,
// true,
// ),
// itemSubmitted: (item) => setState(
// () => newSelectedMedication =
// item),
// key: key,
// suggestions:
// model.allMedicationList,
// itemBuilder: (context,
// suggestion) =>
// new Padding(
// child: Texts(suggestion
// .description +
// '/' +
// suggestion.genericName),
// padding:
// EdgeInsets.all(8.0)),
// itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// suggestion.genericName
// .toLowerCase()
// .startsWith(
// input.toLowerCase()) ||
// suggestion.description
// .toLowerCase()
// .startsWith(
// input.toLowerCase()) ||
// suggestion.keywords
// .toLowerCase()
// .startsWith(
// input.toLowerCase()),
// )
// : TextField(
// decoration:
// textFieldSelectorDecoration(
// TranslationBase.of(context)
// .searchMedicineNameHere,
// newSelectedMedication != null
// ? newSelectedMedication
// .description +
// ('${newSelectedMedication.genericName}')
// : null,
// true,
// ),
// enabled: false,
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
Container( Container(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height *
0.060, 0.060,
@ -524,6 +604,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
updatePrescription( updatePrescription(
{PrescriptionViewModel model, {PrescriptionViewModel model,
int drugId, int drugId,
String newDrugId,
String frequencyId, String frequencyId,
String remarks, String remarks,
String dose, String dose,
@ -588,6 +669,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
void updatePrescriptionForm( void updatePrescriptionForm(
{context, {context,
String drugName, String drugName,
String drugNameGeneric,
int drugId, int drugId,
String remarks, String remarks,
PrescriptionViewModel model, PrescriptionViewModel model,
@ -622,6 +704,7 @@ void updatePrescriptionForm(
route: rouat, route: rouat,
startDate: startDate, startDate: startDate,
model: model, model: model,
drugNameGeneric: drugNameGeneric,
); );
}); });
} }

@ -639,68 +639,153 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
model2.coveringDoctors.length > 0 model2.coveringDoctors.length > 0
? Expanded( ? Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: child: DropdownSearch(
DropdownButtonHideUnderline( mode: Mode.BOTTOM_SHEET,
child: DropdownButton(
focusColor: Colors.grey, dropdownSearchDecoration:
isExpanded: true, InputDecoration(
value: doctorID == null contentPadding:
? model2 EdgeInsets.all(
.coveringDoctors[0] 0),
['doctorID'] border: InputBorder
.toString() .none),
: doctorID, //maxHeight: 300,
iconSize: 40,
elevation: 16,
selectedItemBuilder:
(BuildContext context) {
return model2
.coveringDoctors
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
projectsProvider
.isArabic
? item[
'doctorNameN']
: item[
'doctorName'],
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
);
}).toList();
},
onChanged: (newValue) => {
setState(() {
doctorID = newValue;
})
},
items: model2 items: model2
.coveringDoctors .coveringDoctors
.map((item) { .map((item) {
return DropdownMenuItem< return projectsProvider
String>( .isArabic
value: item['doctorID'] ? item['doctorNameN']
.toString(), : item['doctorName'];
}).toList(),
// label: "Doctor List",
onChanged: (item) {
model2.coveringDoctors
.forEach((newVal) => {
if (newVal['doctorName'] ==
item ||
newVal['doctorName'] ==
item)
{
doctorID =
newVal[
'DoctorID']
}
});
},
selectedItem:
getSelectedDoctor(
model2),
showSearchBox: true,
searchBoxDecoration:
InputDecoration(
border:
OutlineInputBorder(),
contentPadding:
EdgeInsets.fromLTRB(
12, 12, 8, 0),
labelText:
"Search Doctor",
),
popupTitle: Container(
height: 50,
decoration: BoxDecoration(
color: Theme.of(context)
.primaryColorDark,
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(
20),
topRight:
Radius.circular(
20),
),
),
child: Center(
child: Text( child: Text(
projectsProvider '',
.isArabic style: TextStyle(
? item[ fontSize: 24,
'doctorNameN'] fontWeight:
: item[ FontWeight.bold,
'doctorName'], color: Colors.white,
textAlign: ),
TextAlign.start,
), ),
); ),
}).toList(), ),
)), popupShape:
RoundedRectangleBorder(
borderRadius:
BorderRadius.only(
topLeft:
Radius.circular(24),
topRight:
Radius.circular(24),
),
),
),
// DropdownButtonHideUnderline(
// child: DropdownButton(
// focusColor: Colors.grey,
// isExpanded: true,
// value: doctorID == null
// ? model2
// .coveringDoctors[0]
// ['doctorID']
// .toString()
// : doctorID,
// iconSize: 40,
// elevation: 16,
// selectedItemBuilder:
// (BuildContext context) {
// return model2
// .coveringDoctors
// .map((item) {
// return Row(
// mainAxisSize:
// MainAxisSize.max,
// children: <Widget>[
// AppText(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// fontSize: SizeConfig
// .textMultiplier *
// 2.1,
// ),
// ],
// );
// }).toList();
// },
// onChanged: (newValue) => {
// setState(() {
// doctorID = newValue;
// })
// },
// items: model2
// .coveringDoctors
// .map((item) {
// return DropdownMenuItem<
// String>(
// value: item['doctorID']
// .toString(),
// child: Text(
// projectsProvider
// .isArabic
// ? item[
// 'doctorNameN']
// : item[
// 'doctorName'],
// textAlign:
// TextAlign.start,
// ),
// );
// }).toList(),
// )),
) )
: SizedBox(), : SizedBox(),
], ],
@ -775,6 +860,7 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
toDate = _toDateController2.text; toDate = _toDateController2.text;
fromDate = _toDateController.text; fromDate = _toDateController.text;
this.reason = widget.updateData.reasonId.toString(); this.reason = widget.updateData.reasonId.toString();
doctorID = widget.updateData.coveringDoctorId;
} }
}); });
} }
@ -910,4 +996,19 @@ class _RescheduleLeaveScreen extends State<RescheduleLeaveScreen> {
} }
}); });
} }
getSelectedDoctor(model2) {
var doctorName;
if (doctorID == null)
return projectsProvider.isArabic
? model2.coveringDoctors[0]['doctorNameN']
: model2.coveringDoctors[0]['doctorName'];
else {
model2.coveringDoctors.forEach((newVal) => {
if (newVal['doctorID'].toString() == doctorID)
{doctorName = newVal['doctorName']}
});
return doctorName;
}
}
} }

@ -248,6 +248,7 @@ class TranslationBase {
localizedValues['errorNoProgressNote'][locale.languageCode]; localizedValues['errorNoProgressNote'][locale.languageCode];
String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode];
String get orderNo => localizedValues['orderNo'][locale.languageCode];
String get generalResult => String get generalResult =>
localizedValues['generalResult'][locale.languageCode]; localizedValues['generalResult'][locale.languageCode];
@ -946,6 +947,7 @@ class TranslationBase {
String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; String get allergicTO => localizedValues['allergicTO'][locale.languageCode];
String get normal => localizedValues['normal'][locale.languageCode]; String get normal => localizedValues['normal'][locale.languageCode];
String get notExamined => localizedValues['notExamined'][locale.languageCode];
String get abnormal => localizedValues['abnormal'][locale.languageCode]; String get abnormal => localizedValues['abnormal'][locale.languageCode];

@ -27,7 +27,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,16 +25,20 @@ class LargeAvatar extends StatelessWidget {
Widget _getAvatar() { Widget _getAvatar() {
if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) {
return Center( return CircleAvatar(
radius:
SizeConfig.imageSizeMultiplier * 12,
// radius: (52)
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(radius)), borderRadius:BorderRadius.circular(50),
child: Image.network( child: Image.network(
url.trim(), url,
fit: BoxFit.cover, fit: BoxFit.fill,
width: width, width: 700,
height: height,
), ),
), ),
backgroundColor: Colors.transparent,
); );
} else if (name == null || name.isEmpty) { } else if (name == null || name.isEmpty) {
return Center( return Center(

@ -85,6 +85,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
remark: element.remarks, remark: element.remarks,
isNormal: element.isNormal, isNormal: element.isNormal,
createdBy: element.createdBy, createdBy: element.createdBy,
notExamined: element.notExamined,
isNew: element.isNew,
isAbnormal: element.isAbnormal); isAbnormal: element.isAbnormal);
widget.mySelectedExamination.add(tempEam); widget.mySelectedExamination.add(tempEam);
}); });
@ -243,9 +245,10 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
onTap: () { onTap: () {
setState(() { setState(() {
examination.isAbnormal = examination.isAbnormal =
!examination.isAbnormal; false;
examination.isNormal = examination.isNormal =
!examination.isNormal; true;
examination.notExamined = false;
}); });
}), }),
SizedBox( SizedBox(
@ -290,12 +293,63 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
), ),
)), )),
), ),
onTap: () {
setState(() {
examination.isNormal =
false;
examination.isAbnormal =
true;
examination.notExamined = false;
});
}),SizedBox(
width: 12,
),
InkWell(
child: Center(
child: Container(
height:
screenSize.height *
0.070,
decoration:
containerBorderDecoration(
examination
.notExamined
? Color(
0xFF515A5D)
: Colors
.white,
Colors.black),
child: Center(
child: Padding(
padding:
const EdgeInsets
.all(8.0),
child: Text(
"Not Examined",
style: TextStyle(
fontSize: 12,
color:
examination
.notExamined
? Colors.white
: Colors
.black,
//Colors.black,
fontWeight:
FontWeight
.bold,
),
),
),
)),
),
onTap: () { onTap: () {
setState(() { setState(() {
examination.isAbnormal = examination.isAbnormal =
!examination.isAbnormal; false;
examination.isNormal = examination.isNormal =
!examination.isNormal; false;
examination.notExamined = true;
}); });
}), }),
], ],
@ -394,13 +448,17 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
examType: exam.selectedExamination.typeId, examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal, isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal, isNormal: exam.isNormal,
masterDescription: exam.selectedExamination, // masterDescription: exam.selectedExamination,
notExamined: false notExamined: exam.notExamined,
examinationType: exam.isNormal?1:exam.isAbnormal?2:3,
examinationTypeName: exam.isNormal?"Normal":exam.isAbnormal?'AbNormal':"Not Examined",
isNew:exam.isNew
)); ));
}); });
if(model.patientPhysicalExamList.isEmpty) { if(model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel); await model.postPhysicalExam(postPhysicalExamRequestModel);
} else { } else {
await model.patchPhysicalExam(postPhysicalExamRequestModel); await model.patchPhysicalExam(postPhysicalExamRequestModel);

Loading…
Cancel
Save