|
@@ -284,6 +284,12 @@ class ChildrenFollowUpRecordController extends FControllerBase {
|
|
|
} else {
|
|
|
_followUpController.state.followUpPhoto = "";
|
|
|
}
|
|
|
+ PatientDTO? currentPatient = Store.user.currentSelectPatientInfo;
|
|
|
+ List<PrescriptionDTO>? prescriptionDTOs =
|
|
|
+ await Get.find<IPrescriptionManager>().getPrescriptionPage(
|
|
|
+ patientCode: currentPatient?.code ?? '',
|
|
|
+ followUpCode: recordCode,
|
|
|
+ );
|
|
|
String followCode = "";
|
|
|
await Get.to(
|
|
|
ConfigurableCard(
|
|
@@ -306,12 +312,23 @@ class ChildrenFollowUpRecordController extends FControllerBase {
|
|
|
if (followCode.isNotEmpty) {
|
|
|
await updateFollowUp(key, followCode, data);
|
|
|
} else {
|
|
|
- await createFollowUpFromOldDto(
|
|
|
+ bool result = await createFollowUpFromOldDto(
|
|
|
key,
|
|
|
dataDTO.code,
|
|
|
data,
|
|
|
prescriptionKey,
|
|
|
);
|
|
|
+ if (result) {
|
|
|
+ String recordCode = _followUpController.recordCode;
|
|
|
+ for (PrescriptionDTO p in prescriptionDTOs ?? []) {
|
|
|
+ Get.find<IPrescriptionManager>().createPrescription(
|
|
|
+ patientCode: p.patientCode ?? '',
|
|
|
+ prescriptionKey: p.prescriptionTemplateKey ?? '',
|
|
|
+ followUpCode: recordCode,
|
|
|
+ prescriptionData: p.prescriptionData,
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
await updateFollowUp(key, dataDTO.code, data);
|
|
@@ -322,7 +339,7 @@ class ChildrenFollowUpRecordController extends FControllerBase {
|
|
|
},
|
|
|
onClickPrescribe: (key, code, data) async {
|
|
|
var result = await Get.to(PrescriptionCollection(
|
|
|
- followCode.isEmpty ? recordCode: followCode,
|
|
|
+ followCode.isEmpty ? recordCode : followCode,
|
|
|
isCreateFromOldDto: followCode.isEmpty ? isCreateFromOldDto : false,
|
|
|
createFollowUpOnly: () async {
|
|
|
var code = await followUpController.createFollowUpOnly(
|