diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js index 98f127b..8678fec 100644 --- a/test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js @@ -243,12 +243,12 @@ export async function edit(datas, id) { } } - export async function search_icd10(prm) { - try { - var resp = await axios.post(URL + 'patient/search_icd10', prm); - if (resp.status != 200) { - return { - status: "ERR", + export async function search_icd10(prm) { + try { + var resp = await axios.post(URL + 'order/search_icd10', prm); + if (resp.status != 200) { + return { + status: "ERR", message: resp.statusText }; } diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue index 270cea4..434d1ce 100644 --- a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue @@ -248,24 +248,24 @@ > - + :loading="loading_icd10" + no-data-text="Ketikkan pencarian ICD-10" + clearable + > + + + @@ -425,4 +425,4 @@ } } - \ No newline at end of file + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js index 654cdc3..0b099b6 100644 --- a/test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js @@ -175,6 +175,18 @@ export default { }, actions: { async save(context) { + let diagnosa = context.state.diagnosa ? context.state.diagnosa.trim() : '' + let selectedIcd10 = context.rootState.patient.selected_icd10 || {} + let icd10Code = selectedIcd10.code ? selectedIcd10.code.toString().trim() : '' + + if (!diagnosa && !icd10Code) { + context.commit('update_in_saving', false) + context.commit('update_loading_process', false) + context.commit('update_dialog_loading', false, { root: true }) + context.commit('update_message_error', 'Diagnosa atau ICD-10 wajib diisi salah satu') + context.commit('update_dialog_pop_up_error', true) + return + } var req = []; var detail = []; @@ -224,9 +236,9 @@ export default { prm.selected_patient = context.rootState.patient.selected_patient prm.patient_age = context.rootState.patient.selected_patient.patient_age prm.patient_note = context.state.patient_note - prm.diagnosa = context.state.diagnosa + prm.diagnosa = diagnosa prm.catatan_fo = context.state.catatan_fo - prm.selected_icd10 = context.rootState.patient.selected_icd10 + prm.selected_icd10 = selectedIcd10 prm.selected_doctor = context.rootState.doctor.selected_doctor prm.selected_language = context.rootState.language.selected_language ? context.rootState.language.selected_language.id : 1 prm.selected_language_2 = context.rootState.language.selected_language_2 ? context.rootState.language.selected_language_2.id : 0 diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js index 5c065c6..b68a54e 100644 --- a/test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js @@ -472,9 +472,10 @@ export default { context.commit("update_loading_icd10",false) context.commit("update_search_error_message",resp.message) } else { + let records = Array.isArray(resp.data) ? resp.data : (resp.data && resp.data.records ? resp.data.records : []) context.commit("update_loading_icd10",false) context.commit("update_search_error_message","") - context.commit("update_icd10", resp.data.records) + context.commit("update_icd10", records) } } catch(e) { context.commit("update_loading_icd10",false)