|
@@ -16,6 +16,7 @@ import 'package:vitalapp/components/dialog_input.dart';
|
|
|
import 'package:vitalapp/components/dialog_number.dart';
|
|
|
import 'package:vitalapp/components/dynamic_drawer.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/cachedRecord.dart';
|
|
|
+import 'package:vitalapp/managers/interfaces/patient.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/registration.dart';
|
|
|
import 'package:vitalapp/managers/interfaces/template.dart';
|
|
|
import 'package:vitalapp/pages/check/models/form.dart';
|
|
@@ -332,15 +333,33 @@ class NewConfigurableFormState extends State<NewConfigurableCard> {
|
|
|
}
|
|
|
|
|
|
Future<void> setExamData() async {
|
|
|
- List<ExamDTO>? examList = await Get.find<IRegistrationManager>()
|
|
|
- .getExamListByPhysicalExamNumberAsync(
|
|
|
- physicalExamNumber: widget.physicalExamNumber,
|
|
|
- );
|
|
|
+ if (widget.physicalExamNumber.isNotEmpty) {
|
|
|
+ List<ExamDTO>? examList = await Get.find<IRegistrationManager>()
|
|
|
+ .getExamListByPhysicalExamNumberAsync(
|
|
|
+ physicalExamNumber: widget.physicalExamNumber,
|
|
|
+ );
|
|
|
|
|
|
- ExamDTO? currentExam = examList?.firstWhereOrNull(
|
|
|
- (element) => element.key == widget.cardKey,
|
|
|
- );
|
|
|
- _currentExam = currentExam;
|
|
|
+ ExamDTO? currentExam = examList?.firstWhereOrNull(
|
|
|
+ (element) => element.key == widget.cardKey,
|
|
|
+ );
|
|
|
+ _currentExam = currentExam;
|
|
|
+ } else if (widget.cardKey == "YZJSZABCXX") {
|
|
|
+ PatientExtensionDTO? patientExtensionDTO =
|
|
|
+ await Get.find<IPatientManager>()
|
|
|
+ .getPatientExtensionDetailByCodeAndKey(
|
|
|
+ widget.cardKey,
|
|
|
+ widget.patientCode ?? '',
|
|
|
+ );
|
|
|
+ if (patientExtensionDTO != null) {
|
|
|
+ String extensionData = patientExtensionDTO.extensionData ?? '';
|
|
|
+ _currentExam = ExamDTO(
|
|
|
+ code: patientExtensionDTO.code,
|
|
|
+ patientCode: patientExtensionDTO.patientCode,
|
|
|
+ examData: extensionData,
|
|
|
+ key: patientExtensionDTO.key,
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
Future<void> fetchTemplateData() async {
|