diff --git a/lib/config/config.dart b/lib/config/config.dart index 2b86c78d..fe7d9b43 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -326,7 +326,7 @@ const FAVORITE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisGetFavo const ADD_TO_FAVORITE_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/DiagnosisAddFavourite'; -const MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/CreateDiagnosis'; +const MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS = 'Services/DoctorApplication.svc/REST/ContinuePreviousEpisode'; const SEARCH_PHYSICAL_EXAMINATION = 'Services/DoctorApplication.svc/REST/SearchPhysicalExam'; diff --git a/lib/core/model/SOAP/physical_exam/CreatePhysicalExamination.dart b/lib/core/model/SOAP/physical_exam/CreatePhysicalExamination.dart index ac77890d..268dfa42 100644 --- a/lib/core/model/SOAP/physical_exam/CreatePhysicalExamination.dart +++ b/lib/core/model/SOAP/physical_exam/CreatePhysicalExamination.dart @@ -6,7 +6,7 @@ class CreatePhysicalExamination { String? pomrid; // paitient int? patientID; // paitint bool? isClinicPhysicalExamination; // it will be told - int? physicalExaminationSystemID; // category id + dynamic? physicalExaminationSystemID; // category id String? physicalExaminationDescription; // name of the category int? specialityID; // id of the specialitiy id dynamic selectedOptions; // it will also be told but it could be sent as null @@ -59,7 +59,7 @@ extension ConvertCategoryToCreatePhysicalExamination on Category { CreatePhysicalExamination createPhysicalExaminationFromCategory() => CreatePhysicalExamination() ..physicalExaminationDescription = this.name - ..physicalExaminationSystemID = this.categoryId + ..physicalExaminationSystemID = this.id ..physicalExaminationCondition = this.selectedCondition ..remark = this.remarksController.text ..selected = false diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index 406eb9e6..a247473b 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -663,10 +663,9 @@ class SOAPService extends LookupService { "pomrId": patient.pomrId, }; hasError = false; + patientChiefComplaintListVidaPlus.clear(); await baseAppClient.post(GET_CHIEF_COMPLAINT_VP, onSuccess: (dynamic response, int statusCode) { - patientChiefComplaintListVidaPlus.clear(); - response['ListChiefComplaintDetails']['resultData'].forEach((v) { patientChiefComplaintListVidaPlus .add(GetChiefComplaintVidaPlus.fromJson(v)); @@ -1068,40 +1067,25 @@ class SOAPService extends LookupService { PatiantInformtion patient, PatientPreviousDiagnosis diagnosis) async { Map? user = await sharedPref.getObj(LOGGED_IN_USER); Map request = { - "pomrId": patient.pomrId, - "appointmentId": patient.appointmentNo, - "clinicGroupId": patient.clinicGroupId, - "clinicId": patient.clinicId, + "patientProblemRevisionId": diagnosis.patientProblemRevisionId, "patientId": patient.patientId, - "hospitalId": patient.projectId, - "hospitalGroupId": await sharedPref.getString(DOCTOR_SETUP_ID), - "diagnosisType": diagnosis.diagnosisType, - "condition": diagnosis.condition, - "remarks": diagnosis.remarks, - "icdType": diagnosis.icdType, - // "icdVersion": searchDiagnosis.icdVersion, - "icdSubVersion": diagnosis.icdSubVersion, - "isNew": false, - "specificationId": diagnosis.problemId, - "selectedDisease": diagnosis.selectedDisease, - // "diseasesCode": diagnosis.visitWisePatientDiagnoses?.last.diseasesCode, - // "diseasesId": searchDiagnosis.diseasesId, - "selectedIcdCode": diagnosis.selectedIcdCode, - "selectedCategoryCode": diagnosis.selectedCategoryCode, - "selectedSectionCode": diagnosis.selectedSectionCode, - "selectedChapterCode": diagnosis.selectedChapterCode, - // "selectedNandaCode": diagnosis.selectedNandaCode, - "isResolved": false, "doctorId": patient.doctorId, - "doctorCode": user?['List_MemberInformation'][0]['MemberID'], - "ProjectID": patient.projectId, - // "codeRange": searchDiagnosis.codeRange + "pomrId": patient.pomrId, + "appointmentId": diagnosis.appointmentId, + "createdBy": patient.doctorId, + "hospitalId": patient.projectId, + "hospitalGroupId": diagnosis.hospitalGroupId, + "clinicGroupId": diagnosis.clinicGroupId ?? patient.clinicGroupId, + "clinicId": diagnosis.clinicId, + "isSelected": true, + "ProjectID": patient.projectId }; hasError = false; var success = false; await baseAppClient.post(MAKE_PREVIOUS_AS_CURRENT_DIAGNOSIS, onSuccess: (dynamic response, int statusCode) async { - DrAppToastMsg.showSuccesToast(response['CreatDiagnosis']['message']); + DrAppToastMsg.showSuccesToast( + response['ContinuePreviousEpisode']['message']); success = true; }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart index 8e04c292..8eb85576 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/current_diagnosis.dart @@ -123,6 +123,7 @@ class _CurrentDiagnosisState extends State { DrAppToastMsg.showErrorToast( TranslationBase.of(context) .diagnosisAlreadyResolved); + return; } bool result = await Navigator.push( @@ -151,6 +152,7 @@ class _CurrentDiagnosisState extends State { DrAppToastMsg.showErrorToast( TranslationBase.of(context) .diagnosisAlreadyResolved); + return; } bool result = await model.resolveDiagnosis( widget.currentDiagnosisItems[index], diff --git a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart index 39b0295c..78376dda 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/assessment/widget/previous_diagnosis.dart @@ -50,7 +50,7 @@ class PreviousDiagnosis extends StatelessWidget { status: diagnosisItems[index].status ?? '', condition: diagnosisItems[index].condition ?? '', remarks: diagnosisItems[index].remarks ?? '', - isPreviousAddedToCurrent:diagnosisItems[index].visitWisePatientDiagnoses == true , + isPreviousAddedToCurrent:diagnosisItems[index].visitWiseSelected == true , onSoapDetailActionClicked: (action) { switch (action) { case SoapDetailItemActions.AUDIT: