|
|
|
|
@ -61,7 +61,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
bool visibilityPrescriptionForm = false;
|
|
|
|
|
bool visibilitySearch = true;
|
|
|
|
|
|
|
|
|
|
DateTime selectedDate = DateTime.now();
|
|
|
|
|
DateTime? selectedDate;
|
|
|
|
|
int? strengthChar;
|
|
|
|
|
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
|
|
|
|
|
|
|
|
|
@ -97,10 +97,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getIcdCodeData() async{
|
|
|
|
|
await widget.prescriptionViewModel.getIcd10DISESECode(patient: widget.patient, itemID:widget.selectedMedication.itemId );
|
|
|
|
|
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
|
|
|
|
|
}
|
|
|
|
|
getIcdCodeData() async {
|
|
|
|
|
await widget.prescriptionViewModel.getIcd10DISESECode(patient: widget.patient, itemID: widget.selectedMedication.itemId);
|
|
|
|
|
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onVoiceText() async {
|
|
|
|
|
new SpeechToText(context: context).showAlertDialog(context);
|
|
|
|
|
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
|
|
|
|
|
@ -217,7 +218,7 @@ getIcdCodeData() async{
|
|
|
|
|
),
|
|
|
|
|
PrescriptionTextFiled(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.510,
|
|
|
|
|
element: widget.medicineViewModel.itemMedicineListUnit.length == 1 ? widget.medicineViewModel.itemMedicineListUnit[0] : units,
|
|
|
|
|
element: widget.medicineViewModel.itemMedicineListUnit.length == 1 ? units = widget.medicineViewModel.itemMedicineListUnit[0] : units,
|
|
|
|
|
elementError: unitError,
|
|
|
|
|
keyName: 'description',
|
|
|
|
|
keyId: 'parameterCode',
|
|
|
|
|
@ -252,7 +253,7 @@ getIcdCodeData() async{
|
|
|
|
|
hintText: TranslationBase.of(context).frequency,
|
|
|
|
|
elementError: frequencyError,
|
|
|
|
|
// element: frequency,
|
|
|
|
|
element: widget.medicineViewModel.medicationFrequencyList.length == 1 ? frequency = widget.medicineViewModel.medicationFrequencyList[0] : frequency,
|
|
|
|
|
element: widget.medicineViewModel.itemMedicineList.length == 1 ? frequency = widget.medicineViewModel.itemMedicineList[0] : frequency,
|
|
|
|
|
elementList: widget.medicineViewModel.itemMedicineList,
|
|
|
|
|
keyId: 'parameterCode',
|
|
|
|
|
keyName: 'description',
|
|
|
|
|
@ -282,8 +283,9 @@ getIcdCodeData() async{
|
|
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFields),
|
|
|
|
|
widget.prescriptionViewModel.icd10DeseaseItems.isNotEmpty ?
|
|
|
|
|
// PrescriptionTextFiled(
|
|
|
|
|
widget.prescriptionViewModel.icd10DeseaseItems.isNotEmpty
|
|
|
|
|
?
|
|
|
|
|
// PrescriptionTextFiled(
|
|
|
|
|
// hintText: TranslationBase.of(context).nameOrICD,
|
|
|
|
|
// elementError: icdCodeError,
|
|
|
|
|
// element: icdCode,
|
|
|
|
|
@ -296,98 +298,100 @@ getIcdCodeData() async{
|
|
|
|
|
// });
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
children:[ InkWell(
|
|
|
|
|
onTap: widget.prescriptionViewModel.icd10DeseaseItems != null
|
|
|
|
|
? () {
|
|
|
|
|
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
|
|
|
|
|
setState(() {
|
|
|
|
|
icdCode = null;
|
|
|
|
|
icdNameController.text = '';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
validationError: icdCodeError,
|
|
|
|
|
onChanged: (text){
|
|
|
|
|
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
|
|
|
|
|
setState(() {
|
|
|
|
|
icdNameController.text;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
height: Utils.getTextFieldHeight(),
|
|
|
|
|
onClick: widget.prescriptionViewModel.icd10DeseaseItems != null
|
|
|
|
|
? () {
|
|
|
|
|
setState(() {
|
|
|
|
|
icdCode = null;
|
|
|
|
|
icdNameController.text = '';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
hintText: TranslationBase.of(context).nameOrICD,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: icdNameController,
|
|
|
|
|
enabled:true,
|
|
|
|
|
isTextFieldHasSuffix: true, onFieldSubmitted: () { },
|
|
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
|
|
icdCodeList.isNotEmpty && icdNameController.text.isNotEmpty ? Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
|
|
|
|
|
child:ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount:icdCodeList.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return InkWell(child:ListTile(
|
|
|
|
|
title: AppText( widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc + " / " + widget.prescriptionViewModel.icd10DeseaseItems[index].codeId.toString(), fontSize: 12.0)),
|
|
|
|
|
onTap: (){
|
|
|
|
|
icdCode = widget.prescriptionViewModel.icd10DeseaseItems[index];
|
|
|
|
|
icdNameController.text = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc;
|
|
|
|
|
widget.medicineViewModel.patientAssessmentList[0].icdCode10ID = widget.prescriptionViewModel.icd10DeseaseItems[index].codeId;
|
|
|
|
|
widget.medicineViewModel.patientAssessmentList[0].asciiDesc = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc;
|
|
|
|
|
icdCodeList.clear();
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
)) :SizedBox()
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
: widget.medicineViewModel.patientAssessmentList.isNotEmpty ?
|
|
|
|
|
Container(
|
|
|
|
|
height: screenSize.height * 0.068,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.29,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(),
|
|
|
|
|
enabled: true,
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.57,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(),
|
|
|
|
|
enabled: true,
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
) :SizedBox(),
|
|
|
|
|
Column(children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: widget.prescriptionViewModel.icd10DeseaseItems != null
|
|
|
|
|
? () {
|
|
|
|
|
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
|
|
|
|
|
setState(() {
|
|
|
|
|
icdCode = null;
|
|
|
|
|
icdNameController.text = '';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
validationError: icdCodeError,
|
|
|
|
|
onChanged: (text) {
|
|
|
|
|
icdCodeList = List.from(widget.prescriptionViewModel.icd10DeseaseItems);
|
|
|
|
|
setState(() {
|
|
|
|
|
icdNameController.text;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
height: Utils.getTextFieldHeight(),
|
|
|
|
|
onClick: widget.prescriptionViewModel.icd10DeseaseItems != null
|
|
|
|
|
? () {
|
|
|
|
|
setState(() {
|
|
|
|
|
icdCode = null;
|
|
|
|
|
icdNameController.text = '';
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
hintText: TranslationBase.of(context).nameOrICD,
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
minLines: 1,
|
|
|
|
|
controller: icdNameController,
|
|
|
|
|
enabled: true,
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
|
)),
|
|
|
|
|
icdCodeList.isNotEmpty && icdNameController.text.isNotEmpty
|
|
|
|
|
? Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: icdCodeList.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: AppText(widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc + " / " + widget.prescriptionViewModel.icd10DeseaseItems[index].codeId.toString(),
|
|
|
|
|
fontSize: 12.0)),
|
|
|
|
|
onTap: () {
|
|
|
|
|
icdCode = widget.prescriptionViewModel.icd10DeseaseItems[index];
|
|
|
|
|
icdNameController.text = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc;
|
|
|
|
|
if (widget.medicineViewModel.patientAssessmentList.isNotEmpty) {
|
|
|
|
|
widget.medicineViewModel.patientAssessmentList[0].icdCode10ID = widget.prescriptionViewModel.icd10DeseaseItems[index].codeId;
|
|
|
|
|
widget.medicineViewModel.patientAssessmentList[0].asciiDesc = widget.prescriptionViewModel.icd10DeseaseItems[index].asciiDesc;
|
|
|
|
|
}
|
|
|
|
|
icdCodeList.clear();
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
))
|
|
|
|
|
: SizedBox()
|
|
|
|
|
])
|
|
|
|
|
: widget.medicineViewModel.patientAssessmentList.isNotEmpty
|
|
|
|
|
? Container(
|
|
|
|
|
height: screenSize.height * 0.068,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.29,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(),
|
|
|
|
|
enabled: true,
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.57,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
maxLines: 5,
|
|
|
|
|
hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(),
|
|
|
|
|
enabled: true,
|
|
|
|
|
onChanged: (value) {},
|
|
|
|
|
onFieldSubmitted: () {},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
SizedBox(height: spaceBetweenTextFields),
|
|
|
|
|
SizedBox(height: 10,),
|
|
|
|
|
Container(
|
|
|
|
|
@ -523,6 +527,7 @@ getIcdCodeData() async{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addMedicationButton(MedicineViewModel model) async {
|
|
|
|
|
print("Add");
|
|
|
|
|
await locator<AnalyticsService>().logEvent(
|
|
|
|
|
eventCategory: "Add Prescription Form",
|
|
|
|
|
eventAction: "Add Prescription",
|
|
|
|
|
@ -612,4 +617,4 @@ getIcdCodeData() async{
|
|
|
|
|
}
|
|
|
|
|
formKey.currentState!.save();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|