{"version":3,"file":"importPatients-34c9ed4d.js","sources":["../../../app/frontend/javascript/stores/importPatients.js"],"sourcesContent":["import { defineStore } from 'pinia';\n// import { computed, ref } from 'vue';\n\nexport const useImportPatientsStore = defineStore({\n id: 'importPatients',\n state: () => ({\n establishments: [],\n importType: '', // manual, file_one_establishment, file_multiple_establishments\n sendingOption: '',\n sendingMoment: '',\n sendingDate: '',\n redirectionType: '',\n survey: {}, // { id:, type: \"survey or survey_schema\" }\n sendEsatisEmailing: false,\n patient: {}, // { prefix, firstName, lastName, email, phoneNumber, tagId, exitDate }\n file: {}, // { useTagColumn, tagColumn, file, fileUrl }\n }),\n getters: {\n getPatientParams: state => {\n return {\n patient: state.patient,\n sendingOption: state.sendingOption,\n sendingMoment: state.sendingMoment,\n sendingDate: state.sendingDate,\n redirectionType: state.redirectionType,\n survey: state.survey,\n sendEsatisEmailing: state.sendEsatisEmailing,\n };\n },\n getFileParams: state => {\n return {\n file: state.file,\n sendingOption: state.sendingOption,\n sendingMoment: state.sendingMoment,\n sendingDate: state.sendingDate,\n redirectionType: state.redirectionType,\n survey: state.survey,\n sendEsatisEmailing: state.sendEsatisEmailing,\n establishments: state.establishments,\n importType: state.importType,\n };\n },\n },\n actions: {\n udpateSettings({ sendingOption, sendingMoment, sendingDate, redirectionType, survey, sendEsatisEmailing }) {\n this.sendingOption = sendingOption;\n this.sendingMoment = sendingMoment;\n if (sendingMoment === 'later') {\n this.sendingDate = sendingDate;\n }\n this.redirectionType = redirectionType;\n if (redirectionType === 'survey') {\n this.survey = survey;\n }\n this.sendEsatisEmailing = sendEsatisEmailing;\n },\n updateEstablishments({ establishments }) {\n this.establishments = establishments;\n },\n updatePatient({ patient }) {\n this.patient = patient;\n },\n updateFile({ file }) {\n this.file = file;\n if (file.useTagColumn === false) {\n this.file.tagColumn = null;\n }\n if (this.sendEsatisEmailing === false) {\n this.file.exitDateColumn = null;\n }\n },\n updateImportType({ importType }) {\n this.importType = importType;\n },\n },\n});\n"],"names":["useImportPatientsStore","defineStore","state","sendingOption","sendingMoment","sendingDate","redirectionType","survey","sendEsatisEmailing","establishments","patient","file","importType"],"mappings":"8EAGY,MAACA,EAAyBC,EAAY,CAChD,GAAI,iBACJ,MAAO,KAAO,CACZ,eAAgB,CAAE,EAClB,WAAY,GACZ,cAAe,GACf,cAAe,GACf,YAAa,GACb,gBAAiB,GACjB,OAAQ,CAAE,EACV,mBAAoB,GACpB,QAAS,CAAE,EACX,KAAM,CAAE,CACZ,GACE,QAAS,CACP,iBAAkBC,IACT,CACL,QAASA,EAAM,QACf,cAAeA,EAAM,cACrB,cAAeA,EAAM,cACrB,YAAaA,EAAM,YACnB,gBAAiBA,EAAM,gBACvB,OAAQA,EAAM,OACd,mBAAoBA,EAAM,kBAClC,GAEI,cAAeA,IACN,CACL,KAAMA,EAAM,KACZ,cAAeA,EAAM,cACrB,cAAeA,EAAM,cACrB,YAAaA,EAAM,YACnB,gBAAiBA,EAAM,gBACvB,OAAQA,EAAM,OACd,mBAAoBA,EAAM,mBAC1B,eAAgBA,EAAM,eACtB,WAAYA,EAAM,UAC1B,EAEG,EACD,QAAS,CACP,eAAe,CAAE,cAAAC,EAAe,cAAAC,EAAe,YAAAC,EAAa,gBAAAC,EAAiB,OAAAC,EAAQ,mBAAAC,GAAsB,CACzG,KAAK,cAAgBL,EACrB,KAAK,cAAgBC,EACjBA,IAAkB,UACpB,KAAK,YAAcC,GAErB,KAAK,gBAAkBC,EACnBA,IAAoB,WACtB,KAAK,OAASC,GAEhB,KAAK,mBAAqBC,CAC3B,EACD,qBAAqB,CAAE,eAAAC,GAAkB,CACvC,KAAK,eAAiBA,CACvB,EACD,cAAc,CAAE,QAAAC,GAAW,CACzB,KAAK,QAAUA,CAChB,EACD,WAAW,CAAE,KAAAC,GAAQ,CACnB,KAAK,KAAOA,EACRA,EAAK,eAAiB,KACxB,KAAK,KAAK,UAAY,MAEpB,KAAK,qBAAuB,KAC9B,KAAK,KAAK,eAAiB,KAE9B,EACD,iBAAiB,CAAE,WAAAC,GAAc,CAC/B,KAAK,WAAaA,CACnB,CACF,CACH,CAAC"}