|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/client/base_app_client.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/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/model/get_medication_response_model.dart';
|
|
|
|
|
@ -15,11 +16,14 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.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/app_buttons_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
@ -49,7 +53,8 @@ postProcedure(
|
|
|
|
|
DateTime doseTime,
|
|
|
|
|
String doseUnit,
|
|
|
|
|
String icdCode,
|
|
|
|
|
PatiantInformtion patient,String patientType}) async {
|
|
|
|
|
PatiantInformtion patient,
|
|
|
|
|
String patientType}) async {
|
|
|
|
|
PostPrescriptionReqModel postProcedureReqModel =
|
|
|
|
|
new PostPrescriptionReqModel();
|
|
|
|
|
List<PrescriptionRequestModel> sss = List();
|
|
|
|
|
@ -103,6 +108,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
TextEditingController frequencyController = TextEditingController();
|
|
|
|
|
TextEditingController indicationController = TextEditingController();
|
|
|
|
|
TextEditingController instructionController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
bool visbiltyPrescriptionForm = false;
|
|
|
|
|
bool visbiltySearch = true;
|
|
|
|
|
|
|
|
|
|
final myController = TextEditingController();
|
|
|
|
|
DateTime selectedDate;
|
|
|
|
|
dynamic selectedDrug;
|
|
|
|
|
int strengthChar;
|
|
|
|
|
@ -198,9 +208,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
appointmentNo: widget.patient.appointmentNo);
|
|
|
|
|
await model.getMedicationList();
|
|
|
|
|
await model.getMedicationStrength();
|
|
|
|
|
await model.getPrescription(mrn: widget.patient.patientMRN);
|
|
|
|
|
await model.getMedicationDuration();
|
|
|
|
|
await model.getMedicationRoute();
|
|
|
|
|
await model.getMedicationFrequency();
|
|
|
|
|
//await model.getMedicationRoute();
|
|
|
|
|
//await model.getMedicationFrequency();
|
|
|
|
|
await model.getMedicationDoseTime();
|
|
|
|
|
//await model.getMedicationIndications();
|
|
|
|
|
await model.getPatientAssessment(getAssessmentReqModel);
|
|
|
|
|
@ -231,14 +242,17 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 12.0, vertical: 10.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(height: 15,),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
'New Prescription Order',
|
|
|
|
|
@ -267,125 +281,233 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
child: Column(
|
|
|
|
|
//mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height *
|
|
|
|
|
0.070,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: model.allMedicationList != null
|
|
|
|
|
? () {
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedMedication = null;
|
|
|
|
|
model.getItem(
|
|
|
|
|
itemID: _selectedMedication
|
|
|
|
|
.itemId);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: _selectedMedication == null
|
|
|
|
|
? AutoCompleteTextField<
|
|
|
|
|
GetMedicationResponseModel>(
|
|
|
|
|
onFocusChanged: (__) {
|
|
|
|
|
if (_selectedMedication !=
|
|
|
|
|
null) {
|
|
|
|
|
model.getItem(
|
|
|
|
|
itemID:
|
|
|
|
|
_selectedMedication
|
|
|
|
|
.itemId);
|
|
|
|
|
uom = _selectedMedication.uom;
|
|
|
|
|
} else {
|
|
|
|
|
null;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedMedication !=
|
|
|
|
|
null &&
|
|
|
|
|
duration != null &&
|
|
|
|
|
frequency != null &&
|
|
|
|
|
strengthController.text !=
|
|
|
|
|
null) {
|
|
|
|
|
model.getBoxQuantity(
|
|
|
|
|
freq: frequency[
|
|
|
|
|
'parameterCode'],
|
|
|
|
|
duration: duration['id'],
|
|
|
|
|
itemCode:
|
|
|
|
|
_selectedMedication
|
|
|
|
|
.itemId,
|
|
|
|
|
strength: double.parse(
|
|
|
|
|
strengthController
|
|
|
|
|
.text));
|
|
|
|
|
box = model.boxQuintity;
|
|
|
|
|
// Container(
|
|
|
|
|
// height: MediaQuery.of(context).size.height *
|
|
|
|
|
// 0.070,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// onTap: model.allMedicationList != null
|
|
|
|
|
// ? () {
|
|
|
|
|
// Helpers.hideKeyboard(context);
|
|
|
|
|
// setState(() {
|
|
|
|
|
// _selectedMedication = null;
|
|
|
|
|
// model.getItem(
|
|
|
|
|
// itemID: _selectedMedication
|
|
|
|
|
// .itemId);
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// : null,
|
|
|
|
|
// child: _selectedMedication == null
|
|
|
|
|
// ? AutoCompleteTextField<
|
|
|
|
|
// GetMedicationResponseModel>(
|
|
|
|
|
// onFocusChanged: (__) {
|
|
|
|
|
// if (_selectedMedication !=
|
|
|
|
|
// null) {
|
|
|
|
|
// model.getItem(
|
|
|
|
|
// itemID:
|
|
|
|
|
// _selectedMedication
|
|
|
|
|
// .itemId);
|
|
|
|
|
// uom = _selectedMedication.uom;
|
|
|
|
|
// } else {
|
|
|
|
|
// null;
|
|
|
|
|
// }
|
|
|
|
|
// if (_selectedMedication !=
|
|
|
|
|
// null &&
|
|
|
|
|
// duration != null &&
|
|
|
|
|
// frequency != null &&
|
|
|
|
|
// strengthController.text !=
|
|
|
|
|
// null) {
|
|
|
|
|
// model.getBoxQuantity(
|
|
|
|
|
// freq: frequency[
|
|
|
|
|
// 'parameterCode'],
|
|
|
|
|
// duration: duration['id'],
|
|
|
|
|
// itemCode:
|
|
|
|
|
// _selectedMedication
|
|
|
|
|
// .itemId,
|
|
|
|
|
// strength: double.parse(
|
|
|
|
|
// strengthController
|
|
|
|
|
// .text));
|
|
|
|
|
// box = model.boxQuintity;
|
|
|
|
|
//
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// decoration:
|
|
|
|
|
// textFieldSelectorDecoration(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .searchMedicineNameHere,
|
|
|
|
|
// _selectedMedication != null
|
|
|
|
|
// ? _selectedMedication
|
|
|
|
|
// .genericName
|
|
|
|
|
// : null,
|
|
|
|
|
// true,
|
|
|
|
|
// ),
|
|
|
|
|
// itemSubmitted: (item) => setState(
|
|
|
|
|
// () => _selectedMedication =
|
|
|
|
|
// item),
|
|
|
|
|
// key: key,
|
|
|
|
|
// suggestions:
|
|
|
|
|
// model.allMedicationList,
|
|
|
|
|
// itemBuilder: (context,
|
|
|
|
|
// suggestion) =>
|
|
|
|
|
// new Padding(
|
|
|
|
|
// child: Texts(suggestion
|
|
|
|
|
// .description +
|
|
|
|
|
// '/' +
|
|
|
|
|
// suggestion
|
|
|
|
|
// .genericName),
|
|
|
|
|
// padding:
|
|
|
|
|
// EdgeInsets.all(15.0)),
|
|
|
|
|
// itemSorter: (a, b) => 1,
|
|
|
|
|
// suggestionsAmount: 7,
|
|
|
|
|
// itemFilter: (suggestion, input) =>
|
|
|
|
|
// suggestion.genericName.toLowerCase().startsWith(
|
|
|
|
|
// input.toLowerCase()) ||
|
|
|
|
|
// suggestion.description
|
|
|
|
|
// .toLowerCase()
|
|
|
|
|
// .startsWith(input
|
|
|
|
|
// .toLowerCase()) ||
|
|
|
|
|
// suggestion.keywords
|
|
|
|
|
// .toLowerCase()
|
|
|
|
|
// .startsWith(
|
|
|
|
|
// input.toLowerCase()),
|
|
|
|
|
// )
|
|
|
|
|
// : TextField(
|
|
|
|
|
// onEditingComplete: () {
|
|
|
|
|
// model.getItem(
|
|
|
|
|
// itemID: _selectedMedication
|
|
|
|
|
// .itemId);
|
|
|
|
|
// },
|
|
|
|
|
// decoration: textFieldSelectorDecoration(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .searchMedicineNameHere,
|
|
|
|
|
// _selectedMedication != null
|
|
|
|
|
// ? _selectedMedication
|
|
|
|
|
// .description +
|
|
|
|
|
// ('${_selectedMedication.genericName}')
|
|
|
|
|
// : null,
|
|
|
|
|
// false,
|
|
|
|
|
// suffixIcon:
|
|
|
|
|
// Icon(Icons.search)),
|
|
|
|
|
// enabled: false,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.9,
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
Radius.circular(6.0)),
|
|
|
|
|
border: Border.all(
|
|
|
|
|
width: 1.0,
|
|
|
|
|
color: HexColor("#CCCCCC"))),
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child: AppTextFormField(
|
|
|
|
|
onTap: () {
|
|
|
|
|
visbiltyPrescriptionForm = false;
|
|
|
|
|
visbiltySearch = true;
|
|
|
|
|
},
|
|
|
|
|
borderColor: Colors.white,
|
|
|
|
|
hintText: TranslationBase.of(context)
|
|
|
|
|
.searchMedicineNameHere,
|
|
|
|
|
controller: myController,
|
|
|
|
|
onSaved: (value) {},
|
|
|
|
|
onFieldSubmitted: (value) {
|
|
|
|
|
searchMedicine(context, model);
|
|
|
|
|
},
|
|
|
|
|
inputFormatter: ONLY_LETTERS,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15.0,
|
|
|
|
|
),
|
|
|
|
|
Visibility(
|
|
|
|
|
visible: visbiltySearch,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.8,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// TODO change it secondary button and add loading
|
|
|
|
|
AppButton(
|
|
|
|
|
title: TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.search,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
await searchMedicine(
|
|
|
|
|
context, model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (myController.text != '')
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height *
|
|
|
|
|
0.5,
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
top: 20),
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
decoration:
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.searchMedicineNameHere,
|
|
|
|
|
_selectedMedication != null
|
|
|
|
|
? _selectedMedication
|
|
|
|
|
.genericName
|
|
|
|
|
: null,
|
|
|
|
|
true,
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
itemCount:
|
|
|
|
|
model.allMedicationList ==
|
|
|
|
|
null
|
|
|
|
|
? 0
|
|
|
|
|
: model
|
|
|
|
|
.allMedicationList
|
|
|
|
|
.length,
|
|
|
|
|
itemBuilder:
|
|
|
|
|
(BuildContext context,
|
|
|
|
|
int index) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
child: MedicineItemWidget(
|
|
|
|
|
label: model
|
|
|
|
|
.allMedicationList[
|
|
|
|
|
index]
|
|
|
|
|
.description
|
|
|
|
|
// url: model
|
|
|
|
|
// .pharmacyItemsList[
|
|
|
|
|
// index]["ImageSRCUrl"],
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
model.getItem(
|
|
|
|
|
itemID: model
|
|
|
|
|
.allMedicationList[
|
|
|
|
|
index]
|
|
|
|
|
.itemId);
|
|
|
|
|
visbiltyPrescriptionForm =
|
|
|
|
|
true;
|
|
|
|
|
visbiltySearch = false;
|
|
|
|
|
_selectedMedication =
|
|
|
|
|
model.allMedicationList[
|
|
|
|
|
index];
|
|
|
|
|
uom = _selectedMedication
|
|
|
|
|
.uom;
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
itemSubmitted: (item) => setState(
|
|
|
|
|
() => _selectedMedication =
|
|
|
|
|
item),
|
|
|
|
|
key: key,
|
|
|
|
|
suggestions:
|
|
|
|
|
model.allMedicationList,
|
|
|
|
|
itemBuilder: (context,
|
|
|
|
|
suggestion) =>
|
|
|
|
|
new Padding(
|
|
|
|
|
child: Texts(suggestion
|
|
|
|
|
.description +
|
|
|
|
|
'/' +
|
|
|
|
|
suggestion
|
|
|
|
|
.genericName),
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.all(15.0)),
|
|
|
|
|
itemSorter: (a, b) => 1,
|
|
|
|
|
suggestionsAmount: 7,
|
|
|
|
|
itemFilter: (suggestion, input) =>
|
|
|
|
|
suggestion.genericName.toLowerCase().startsWith(
|
|
|
|
|
input.toLowerCase()) ||
|
|
|
|
|
suggestion.description
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(input
|
|
|
|
|
.toLowerCase()) ||
|
|
|
|
|
suggestion.keywords
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
.startsWith(
|
|
|
|
|
input.toLowerCase()),
|
|
|
|
|
)
|
|
|
|
|
: TextField(
|
|
|
|
|
onEditingComplete: () {
|
|
|
|
|
model.getItem(
|
|
|
|
|
itemID: _selectedMedication
|
|
|
|
|
.itemId);
|
|
|
|
|
},
|
|
|
|
|
decoration: textFieldSelectorDecoration(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.searchMedicineNameHere,
|
|
|
|
|
_selectedMedication != null
|
|
|
|
|
? _selectedMedication
|
|
|
|
|
.description +
|
|
|
|
|
('${_selectedMedication.genericName}')
|
|
|
|
|
: null,
|
|
|
|
|
false,
|
|
|
|
|
suffixIcon:
|
|
|
|
|
Icon(Icons.search)),
|
|
|
|
|
enabled: false,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: spaceBetweenTextFileds,
|
|
|
|
|
),
|
|
|
|
|
Visibility(
|
|
|
|
|
visible: _selectedMedication == null
|
|
|
|
|
? false
|
|
|
|
|
: true,
|
|
|
|
|
visible: visbiltyPrescriptionForm,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
@ -1142,66 +1264,75 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
if (formKey.currentState
|
|
|
|
|
.validate()) {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
openDrugToDrug(model);
|
|
|
|
|
//openDrugToDrug(model);
|
|
|
|
|
{
|
|
|
|
|
/*// var x = model
|
|
|
|
|
// .patientAssessmentList
|
|
|
|
|
// .map((value) =>
|
|
|
|
|
// value.icdCode10ID)
|
|
|
|
|
// .toList()
|
|
|
|
|
// .join(',');
|
|
|
|
|
// var x = model
|
|
|
|
|
// .patientAssessmentList
|
|
|
|
|
// .map((value) =>
|
|
|
|
|
// value.icdCode10ID)
|
|
|
|
|
// .toList()
|
|
|
|
|
// .join(',');
|
|
|
|
|
|
|
|
|
|
postProcedure(
|
|
|
|
|
icdCode: model
|
|
|
|
|
.patientAssessmentList
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? model
|
|
|
|
|
.patientAssessmentList[
|
|
|
|
|
0]
|
|
|
|
|
.icdCode10ID
|
|
|
|
|
.isEmpty
|
|
|
|
|
? "test"
|
|
|
|
|
: model
|
|
|
|
|
.patientAssessmentList[
|
|
|
|
|
0]
|
|
|
|
|
.icdCode10ID
|
|
|
|
|
.toString()
|
|
|
|
|
: "TEST",
|
|
|
|
|
// icdCode: model
|
|
|
|
|
// .patientAssessmentList
|
|
|
|
|
// .map((value) => value
|
|
|
|
|
// .icdCode10ID
|
|
|
|
|
// .trim())
|
|
|
|
|
// .toList()
|
|
|
|
|
// .join(' '),
|
|
|
|
|
dose: strengthController.text,
|
|
|
|
|
doseUnit:
|
|
|
|
|
units['parameterCode']
|
|
|
|
|
.toString(),
|
|
|
|
|
patient: widget.patient,
|
|
|
|
|
doseTimeIn:
|
|
|
|
|
doseTime['id'].toString(),
|
|
|
|
|
model: widget.model,
|
|
|
|
|
duration:
|
|
|
|
|
duration['id'].toString(),
|
|
|
|
|
frequency:
|
|
|
|
|
frequency['parameterCode']
|
|
|
|
|
.toString(),
|
|
|
|
|
route: route['parameterCode']
|
|
|
|
|
.toString(),
|
|
|
|
|
drugId: _selectedMedication
|
|
|
|
|
.itemId
|
|
|
|
|
.toString(),
|
|
|
|
|
strength:
|
|
|
|
|
strengthController.text,
|
|
|
|
|
indication:
|
|
|
|
|
indicationController.text,
|
|
|
|
|
instruction:
|
|
|
|
|
instructionController
|
|
|
|
|
.text,
|
|
|
|
|
doseTime: selectedDate,
|
|
|
|
|
);
|
|
|
|
|
*/
|
|
|
|
|
postProcedure(
|
|
|
|
|
icdCode: model
|
|
|
|
|
.patientAssessmentList
|
|
|
|
|
.isNotEmpty
|
|
|
|
|
? model
|
|
|
|
|
.patientAssessmentList[
|
|
|
|
|
0]
|
|
|
|
|
.icdCode10ID
|
|
|
|
|
.isEmpty
|
|
|
|
|
? "test"
|
|
|
|
|
: model
|
|
|
|
|
.patientAssessmentList[
|
|
|
|
|
0]
|
|
|
|
|
.icdCode10ID
|
|
|
|
|
.toString()
|
|
|
|
|
: "test",
|
|
|
|
|
// icdCode: model
|
|
|
|
|
// .patientAssessmentList
|
|
|
|
|
// .map((value) => value
|
|
|
|
|
// .icdCode10ID
|
|
|
|
|
// .trim())
|
|
|
|
|
// .toList()
|
|
|
|
|
// .join(' '),
|
|
|
|
|
dose:
|
|
|
|
|
strengthController
|
|
|
|
|
.text,
|
|
|
|
|
doseUnit: units[
|
|
|
|
|
'parameterCode']
|
|
|
|
|
.toString(),
|
|
|
|
|
patient:
|
|
|
|
|
widget.patient,
|
|
|
|
|
doseTimeIn:
|
|
|
|
|
doseTime['id']
|
|
|
|
|
.toString(),
|
|
|
|
|
model: widget.model,
|
|
|
|
|
duration:
|
|
|
|
|
duration['id']
|
|
|
|
|
.toString(),
|
|
|
|
|
frequency: frequency[
|
|
|
|
|
'parameterCode']
|
|
|
|
|
.toString(),
|
|
|
|
|
route: route[
|
|
|
|
|
'parameterCode']
|
|
|
|
|
.toString(),
|
|
|
|
|
drugId:
|
|
|
|
|
_selectedMedication
|
|
|
|
|
.itemId
|
|
|
|
|
.toString(),
|
|
|
|
|
strength:
|
|
|
|
|
strengthController
|
|
|
|
|
.text,
|
|
|
|
|
indication:
|
|
|
|
|
indicationController
|
|
|
|
|
.text,
|
|
|
|
|
instruction:
|
|
|
|
|
instructionController
|
|
|
|
|
.text,
|
|
|
|
|
doseTime:
|
|
|
|
|
selectedDate,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1389,4 +1520,22 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
}
|
|
|
|
|
return prescriptionDetails;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchMedicine(context, MedicineViewModel model) async {
|
|
|
|
|
FocusScope.of(context).unfocus();
|
|
|
|
|
// if (myController.text.isEmpty()) {
|
|
|
|
|
// helpers.showErrorToast(TranslationBase.of(context).typeMedicineName);
|
|
|
|
|
// //"Type Medicine Name")
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if (myController.text.length < 3) {
|
|
|
|
|
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
await model.getMedicationList(drug: myController.text);
|
|
|
|
|
//GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|