|
|
|
@ -15,20 +15,20 @@ import 'package:permission_handler/permission_handler.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class AddVerifyMedicalReport extends StatefulWidget {
|
|
|
|
class AddVerifyMedicalReport extends StatefulWidget {
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
final String patientType;
|
|
|
|
final String?patientType;
|
|
|
|
final String arrivalType;
|
|
|
|
final String? arrivalType;
|
|
|
|
final MedicalReportModel medicalReport;
|
|
|
|
final MedicalReportModel? medicalReport;
|
|
|
|
final PatientMedicalReportViewModel model;
|
|
|
|
final PatientMedicalReportViewModel model;
|
|
|
|
final MedicalReportStatus status;
|
|
|
|
final MedicalReportStatus? status;
|
|
|
|
final String medicalNote;
|
|
|
|
final String? medicalNote;
|
|
|
|
|
|
|
|
|
|
|
|
const AddVerifyMedicalReport(
|
|
|
|
const AddVerifyMedicalReport(
|
|
|
|
{Key? key,
|
|
|
|
{Key? key,
|
|
|
|
this.patient,
|
|
|
|
required this.patient,
|
|
|
|
this.patientType,
|
|
|
|
this.patientType,
|
|
|
|
this.arrivalType,
|
|
|
|
this.arrivalType,
|
|
|
|
this.medicalReport,
|
|
|
|
this.medicalReport,
|
|
|
|
this.model,
|
|
|
|
required this.model,
|
|
|
|
this.status,
|
|
|
|
this.status,
|
|
|
|
this.medicalNote})
|
|
|
|
this.medicalNote})
|
|
|
|
: super(key: key);
|
|
|
|
: super(key: key);
|
|
|
|
@ -71,11 +71,11 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
HtmlRichEditor(
|
|
|
|
HtmlRichEditor(
|
|
|
|
initialText: (widget.medicalReport != null
|
|
|
|
initialText: (widget.medicalReport != null
|
|
|
|
? widget.medicalNote
|
|
|
|
? widget.medicalNote
|
|
|
|
: widget.model.medicalReportTemplate[0].templateText.length > 0
|
|
|
|
: widget.model.medicalReportTemplate[0].templateText!.length > 0
|
|
|
|
? widget.model.medicalReportTemplate[0].templateText
|
|
|
|
? widget.model.medicalReportTemplate[0].templateText
|
|
|
|
: ""),
|
|
|
|
: ""),
|
|
|
|
hint: "Write the medical report ",
|
|
|
|
hint: "Write the medical report ",
|
|
|
|
height: MediaQuery.of(context).size.height * 0.75,
|
|
|
|
height: MediaQuery.of(context).size.height * 0.75, controller: _controller,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -101,7 +101,7 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
txtOfMedicalReport = await HtmlEditor.getText();
|
|
|
|
txtOfMedicalReport = await _controller.getText();
|
|
|
|
|
|
|
|
|
|
|
|
if (txtOfMedicalReport.isNotEmpty) {
|
|
|
|
if (txtOfMedicalReport.isNotEmpty) {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
@ -109,8 +109,8 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
?await widget.model.updateMedicalReport(
|
|
|
|
?await widget.model.updateMedicalReport(
|
|
|
|
widget.patient,
|
|
|
|
widget.patient,
|
|
|
|
txtOfMedicalReport,
|
|
|
|
txtOfMedicalReport,
|
|
|
|
widget.medicalReport != null ? widget.medicalReport.lineItemNo : null,
|
|
|
|
widget.medicalReport != null ? widget.medicalReport!.lineItemNo : null,
|
|
|
|
widget.medicalReport != null ? widget.medicalReport.invoiceNo : null)
|
|
|
|
widget.medicalReport != null ? widget.medicalReport!.invoiceNo : null)
|
|
|
|
: await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport);
|
|
|
|
: await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport);
|
|
|
|
//model.getMedicalReportList(patient);
|
|
|
|
//model.getMedicalReportList(patient);
|
|
|
|
|
|
|
|
|
|
|
|
@ -138,10 +138,10 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
|
|
|
|
color: Color(0xff359846),
|
|
|
|
color: Color(0xff359846),
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
txtOfMedicalReport = await HtmlEditor.getText();
|
|
|
|
txtOfMedicalReport = await _controller.getText();
|
|
|
|
if (txtOfMedicalReport.isNotEmpty) {
|
|
|
|
if (txtOfMedicalReport.isNotEmpty) {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport);
|
|
|
|
await widget.model.verifyMedicalReport(widget.patient, widget.medicalReport!);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
Navigator.pop(context);
|
|
|
|
if (widget.model.state == ViewState.ErrorLocal) {
|
|
|
|
if (widget.model.state == ViewState.ErrorLocal) {
|
|
|
|
|