|
@@ -15,6 +15,7 @@ import 'package:vitalapp/components/dropdown_button.dart';
|
|
|
import 'package:vitalapp/components/no_data_view.dart';
|
|
|
import 'package:vitalapp/components/select.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/exam.dart';
|
|
|
+import 'package:vitalapp/managers/interfaces/report.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/report_template.dart';
|
|
|
import 'package:vitalapp/pages/medical/controller.dart';
|
|
|
import 'package:vitalapp/pages/medical/models/worker.dart';
|
|
@@ -31,7 +32,11 @@ import 'ecg_term_selection.dart';
|
|
|
|
|
|
class EcgResultView extends StatefulWidget {
|
|
|
final ElectrocardiogramRecord recordInfo;
|
|
|
- EcgResultView(this.recordInfo);
|
|
|
+ final String reportCode;
|
|
|
+ EcgResultView(
|
|
|
+ this.recordInfo, {
|
|
|
+ this.reportCode = "",
|
|
|
+ });
|
|
|
@override
|
|
|
State<StatefulWidget> createState() {
|
|
|
return EcgResultViewState();
|
|
@@ -163,15 +168,52 @@ class EcgResultViewState extends State<EcgResultView> {
|
|
|
}
|
|
|
}
|
|
|
if (examDatas.containsKey("Analyse12")) {
|
|
|
+ resultConclusion!.advice =
|
|
|
+ _promptWordsController.text;
|
|
|
+ resultConclusion!.QRSAxis = _qRSAxisController.text;
|
|
|
+ resultConclusion!.PR = _pRController.text;
|
|
|
+ resultConclusion!.QTDur = _qTDurController.text;
|
|
|
+ resultConclusion!.QTCDur = _qTCDurController.text;
|
|
|
+ resultConclusion!.PAxis = _pAxisController.text;
|
|
|
+ resultConclusion!.QRSDur = _qRSController.text;
|
|
|
+ resultConclusion!.TAxis = _tAxisController.text;
|
|
|
+ resultConclusion!.PDur = _pDurController.text;
|
|
|
+ resultConclusion!.TDur = _tDurController.text;
|
|
|
+ resultConclusion!.paperSpeed =
|
|
|
+ _paperSpeed.toString();
|
|
|
+ resultConclusion!.gain = _gain.toString();
|
|
|
var newData = resultConclusion?.toJson();
|
|
|
examDatas["Analyse12"] = jsonEncode(newData);
|
|
|
+ examDatas["HEART12"] = _hrController.text;
|
|
|
var exam = jsonEncode(examDatas);
|
|
|
- final bool result = await Get.find<IExamManager>()
|
|
|
- .createExamDatas(
|
|
|
- widget.recordInfo.code ?? '', exam);
|
|
|
- if (result) {
|
|
|
- PromptBox.toast('提交成功');
|
|
|
- Get.back();
|
|
|
+ if (widget.reportCode.isEmpty) {
|
|
|
+ final String result =
|
|
|
+ await Get.find<IReportManager>().addReport(
|
|
|
+ recordCode: widget.recordInfo.code ?? '',
|
|
|
+ reportDatasJson: exam,
|
|
|
+ name: widget.recordInfo.patientName ?? '',
|
|
|
+ reportTemplateCode:
|
|
|
+ _currentSelectedTemplate.reportTemplateCode,
|
|
|
+ );
|
|
|
+ if (result.isNotEmpty) {
|
|
|
+ PromptBox.toast('提交成功');
|
|
|
+ Get.back();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ final bool result =
|
|
|
+ await Get.find<IReportManager>().modifyReport(
|
|
|
+ recordCode: widget.recordInfo.code ?? '',
|
|
|
+ reportInfoJson: exam,
|
|
|
+ name: widget.recordInfo.patientName ?? '',
|
|
|
+ reportTemplateCode: _currentSelectedTemplate
|
|
|
+ .reportTemplateCode ??
|
|
|
+ '',
|
|
|
+ reportCode: widget.reportCode,
|
|
|
+ );
|
|
|
+ if (result) {
|
|
|
+ PromptBox.toast('提交成功');
|
|
|
+ Get.back();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|