2021-10-26 18:19:13 +00:00
|
|
|
/**
|
|
|
|
* Project YooLearn
|
|
|
|
* File skills.actions
|
|
|
|
* Path app/redux/skills
|
|
|
|
* Created by BRICE ZELE
|
|
|
|
* Date: 13/09/2021
|
|
|
|
*/
|
|
|
|
import InsuranceActions from './insurance.type';
|
|
|
|
import {
|
2022-03-18 10:58:47 +00:00
|
|
|
autorisationCareRequestUrl,
|
2022-04-04 17:47:36 +00:00
|
|
|
buyInsuranceUrl,
|
2022-03-18 10:58:47 +00:00
|
|
|
checkInsuranceCoverageAmountUrl,
|
2021-12-07 05:25:01 +00:00
|
|
|
consultationUrl,
|
2021-11-29 11:30:04 +00:00
|
|
|
createConsultationUrl,
|
2021-12-16 14:28:24 +00:00
|
|
|
executionPrescriptionUrl,
|
2021-11-30 15:33:51 +00:00
|
|
|
getAmountConsultationUrl,
|
2021-11-29 11:30:04 +00:00
|
|
|
getDrugAndDevicesUrl,
|
2021-10-26 18:19:13 +00:00
|
|
|
getInsuranceListUrl,
|
|
|
|
getInsurancePrimeAmountUrl,
|
2021-11-29 11:30:04 +00:00
|
|
|
getNetworkActsUrl,
|
|
|
|
getProviderClassUrl,
|
2021-11-22 18:20:54 +00:00
|
|
|
getUserByIdQRCodeUrl,
|
2022-03-18 10:58:47 +00:00
|
|
|
getUserByNameOrNumberUrl,
|
|
|
|
invoiceUrl,
|
2021-10-26 18:19:13 +00:00
|
|
|
subscribeInsuranceUrl,
|
|
|
|
uploadInsuranceImagetUrl
|
|
|
|
} from "../../webservice/IlinkConstants";
|
|
|
|
import {ApiAction} from "../reducers";
|
|
|
|
|
|
|
|
export const fetchGetListInsurancePending = () => ({
|
|
|
|
type: InsuranceActions.GET_INSURANCE_LIST_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetListInsuranceReset = () => ({
|
|
|
|
type: InsuranceActions.GET_INSURANCE_LIST_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetListInsuranceSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_INSURANCE_LIST_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetListInsuranceError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_INSURANCE_LIST_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
2022-02-01 12:18:02 +00:00
|
|
|
export const fetchGetListInsurance = (idCountry, otherParam = '') => {
|
2021-10-26 18:19:13 +00:00
|
|
|
return ApiAction({
|
2022-02-01 12:18:02 +00:00
|
|
|
url: `${getInsuranceListUrl}/networks?country_id=${idCountry}${otherParam}`,
|
2021-10-26 18:19:13 +00:00
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetListInsurancePending,
|
|
|
|
onSuccess: fetchGetListInsuranceSuccess,
|
|
|
|
onError: fetchGetListInsuranceError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-02-09 10:12:27 +00:00
|
|
|
export const fetchGetListInsuranceWithBeneficiaries = (param = '') => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getInsuranceListUrl}${param}`,
|
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetListInsurancePending,
|
|
|
|
onSuccess: fetchGetListInsuranceSuccess,
|
|
|
|
onError: fetchGetListInsuranceError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2021-10-26 18:19:13 +00:00
|
|
|
/************************************************************/
|
|
|
|
export const fetchSubscribeInsurancePending = () => ({
|
|
|
|
type: InsuranceActions.SUBSCRIBE_INSURANCE_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchSubscribeInsuranceReset = () => ({
|
|
|
|
type: InsuranceActions.SUBSCRIBE_INSURANCE_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchSubscribeInsuranceSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.SUBSCRIBE_INSURANCE_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchSubscribeInsuranceError = (error: any) => ({
|
|
|
|
type: InsuranceActions.SUBSCRIBE_INSURANCE_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchSubscribeInsurance = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: subscribeInsuranceUrl,
|
|
|
|
data,
|
|
|
|
method: 'POST',
|
|
|
|
onLoading: fetchSubscribeInsurancePending,
|
|
|
|
onSuccess: fetchSubscribeInsuranceSuccess,
|
|
|
|
onError: fetchSubscribeInsuranceError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetInsurancePrimeAmountPending = () => ({
|
|
|
|
type: InsuranceActions.GET_INSURANCE_PRIME_AMOUNT_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetInsurancePrimeAmountReset = () => ({
|
|
|
|
type: InsuranceActions.GET_INSURANCE_PRIME_AMOUNT_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetInsurancePrimeAmountSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_INSURANCE_PRIME_AMOUNT_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetInsurancePrimeAmountError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_INSURANCE_PRIME_AMOUNT_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetInsurancePrimeAmount = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: getInsurancePrimeAmountUrl,
|
|
|
|
data,
|
|
|
|
method: 'POST',
|
|
|
|
onLoading: fetchGetInsurancePrimeAmountPending,
|
|
|
|
onSuccess: fetchGetInsurancePrimeAmountSuccess,
|
|
|
|
onError: fetchGetInsurancePrimeAmountError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchUploadInsurancePending = () => ({
|
|
|
|
type: InsuranceActions.UPLOAD_INSURANCE_IMAGES_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchUploadInsuranceReset = () => ({
|
|
|
|
type: InsuranceActions.UPLOAD_INSURANCE_IMAGES_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchUploadInsuranceSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.UPLOAD_INSURANCE_IMAGES_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchUploadInsuranceError = (error: any) => ({
|
|
|
|
type: InsuranceActions.UPLOAD_INSURANCE_IMAGES_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchUploadInsurance = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: uploadInsuranceImagetUrl,
|
|
|
|
data,
|
|
|
|
accessToken: 'gZ7KibrSvFNLxrGz49usnRiKBZ4OlX99',
|
|
|
|
method: 'POST',
|
|
|
|
onLoading: fetchUploadInsurancePending,
|
|
|
|
onSuccess: fetchUploadInsuranceSuccess,
|
|
|
|
onError: fetchUploadInsuranceError,
|
|
|
|
});
|
|
|
|
};
|
2021-11-11 11:43:33 +00:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetSubscriptionListPending = () => ({
|
|
|
|
type: InsuranceActions.GET_SUBSCRIPTION_LIST_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetSubscriptionListReset = () => ({
|
|
|
|
type: InsuranceActions.GET_SUBSCRIPTION_LIST_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetSubscriptionListSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_SUBSCRIPTION_LIST_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetSubscriptionListError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_SUBSCRIPTION_LIST_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetSubscriptionList = (idUser, type, includeSubscription = true) => {
|
|
|
|
return ApiAction({
|
2022-04-04 17:47:36 +00:00
|
|
|
url: includeSubscription ? `${buyInsuranceUrl}?user_id=${idUser}&state=${type}` : `${getInsuranceListUrl}?user_id=${idUser}&type=${type}`,
|
2021-11-11 11:43:33 +00:00
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetSubscriptionListPending,
|
|
|
|
onSuccess: fetchGetSubscriptionListSuccess,
|
|
|
|
onError: fetchGetSubscriptionListError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchActivePaySubscriptionPending = () => ({
|
|
|
|
type: InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchActivePaySubscriptionReset = () => ({
|
|
|
|
type: InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchActivePaySubscriptionSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchActivePaySubscriptionError = (error: any) => ({
|
|
|
|
type: InsuranceActions.ACTIVATE_PAY_SUBSCRIPTION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchActivePaySubscription = (id, data) => {
|
|
|
|
return ApiAction({
|
2022-04-04 17:47:36 +00:00
|
|
|
url: `${buyInsuranceUrl}/${id}/pay`,
|
2021-11-11 11:43:33 +00:00
|
|
|
data,
|
|
|
|
method: 'PUT',
|
|
|
|
onLoading: fetchActivePaySubscriptionPending,
|
|
|
|
onSuccess: fetchActivePaySubscriptionSuccess,
|
|
|
|
onError: fetchActivePaySubscriptionError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-02-09 10:12:27 +00:00
|
|
|
/************************************************************/
|
|
|
|
export const fetchStopSubscriptionPending = () => ({
|
|
|
|
type: InsuranceActions.STOP_SUBSCRIPTION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchStopSubscriptionReset = () => ({
|
|
|
|
type: InsuranceActions.STOP_SUBSCRIPTION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchStopSubscriptionSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.STOP_SUBSCRIPTION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchStopSubscriptionError = (error: any) => ({
|
|
|
|
type: InsuranceActions.STOP_SUBSCRIPTION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchStopSubscription = (id, data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getInsuranceListUrl}/${id}/stop`,
|
|
|
|
data,
|
|
|
|
method: 'PUT',
|
|
|
|
onLoading: fetchStopSubscriptionPending,
|
|
|
|
onSuccess: fetchStopSubscriptionSuccess,
|
|
|
|
onError: fetchStopSubscriptionError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-02-09 17:43:48 +00:00
|
|
|
export const fetchRenewSubscription = (id, data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getInsuranceListUrl}/${id}/renew`,
|
|
|
|
data,
|
|
|
|
method: 'PUT',
|
|
|
|
onLoading: fetchStopSubscriptionPending,
|
|
|
|
onSuccess: fetchStopSubscriptionSuccess,
|
|
|
|
onError: fetchStopSubscriptionError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2021-11-11 11:43:33 +00:00
|
|
|
/************************************************************/
|
|
|
|
export const fetchAddBeneficiaryToSubscriptionPending = () => ({
|
|
|
|
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAddBeneficiaryToSubscriptionReset = () => ({
|
|
|
|
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAddBeneficiaryToSubscriptionSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAddBeneficiaryToSubscriptionError = (error: any) => ({
|
|
|
|
type: InsuranceActions.ADD_BENEFICIARY_TO_SUBSCRIPTION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAddBeneficiaryToSubscription = (id, data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getInsuranceListUrl}/${id}/add-beneficiaries`,
|
|
|
|
data,
|
|
|
|
method: 'PUT',
|
|
|
|
onLoading: fetchAddBeneficiaryToSubscriptionPending,
|
|
|
|
onSuccess: fetchAddBeneficiaryToSubscriptionSuccess,
|
|
|
|
onError: fetchAddBeneficiaryToSubscriptionError,
|
|
|
|
});
|
|
|
|
};
|
2021-11-22 18:20:54 +00:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetUserByIdQRCodePending = () => ({
|
|
|
|
type: InsuranceActions.GET_USER_BY_ID_QR_CODE_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetUserByIdQRCodeReset = () => ({
|
|
|
|
type: InsuranceActions.GET_USER_BY_ID_QR_CODE_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetUserByIdQRCodeSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_USER_BY_ID_QR_CODE_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetUserByIdQRCodeError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_USER_BY_ID_QR_CODE_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
2022-03-18 10:58:47 +00:00
|
|
|
export const fetchGetUserByIdQRCode = (id) => {
|
2021-11-22 18:20:54 +00:00
|
|
|
return ApiAction({
|
2022-03-18 10:58:47 +00:00
|
|
|
url: `${getUserByIdQRCodeUrl}?${id}`,
|
2021-11-22 18:20:54 +00:00
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetUserByIdQRCodePending,
|
|
|
|
onSuccess: fetchGetUserByIdQRCodeSuccess,
|
|
|
|
onError: fetchGetUserByIdQRCodeError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetUserByNameOrNumberPending = () => ({
|
|
|
|
type: InsuranceActions.GET_USER_BY_NAME_OR_NUMBER_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetUserByNameOrNumberReset = () => ({
|
|
|
|
type: InsuranceActions.GET_USER_BY_NAME_OR_NUMBER_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetUserByNameOrNumberSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_USER_BY_NAME_OR_NUMBER_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetUserByNameOrNumberError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_USER_BY_NAME_OR_NUMBER_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetUserByNameOrNumber = (network_id, id) => {
|
|
|
|
return ApiAction({
|
2022-01-20 03:51:20 +00:00
|
|
|
url: `${getUserByNameOrNumberUrl}?network_id=${network_id}${id}`,
|
2021-11-22 18:20:54 +00:00
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetUserByNameOrNumberPending,
|
|
|
|
onSuccess: fetchGetUserByNameOrNumberSuccess,
|
|
|
|
onError: fetchGetUserByNameOrNumberError,
|
|
|
|
});
|
|
|
|
};
|
2021-11-29 11:30:04 +00:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetDrugAppareilPending = () => ({
|
|
|
|
type: InsuranceActions.GET_DRUG_APPAREIL_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetDrugAppareilReset = () => ({
|
|
|
|
type: InsuranceActions.GET_DRUG_APPAREIL_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetDrugAppareilSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_DRUG_APPAREIL_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetDrugAppareilError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_DRUG_APPAREIL_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetDrugAppareil = (network_id, name) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getDrugAndDevicesUrl}?network_id=${network_id}&name=${name}`,
|
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetDrugAppareilPending,
|
|
|
|
onSuccess: fetchGetDrugAppareilSuccess,
|
|
|
|
onError: fetchGetDrugAppareilError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchAddDrugPending = () => ({
|
|
|
|
type: InsuranceActions.ADD_DRUG_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAddDrugReset = () => ({
|
|
|
|
type: InsuranceActions.ADD_DRUG_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAddDrugSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.ADD_DRUG_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAddDrugError = (error: any) => ({
|
|
|
|
type: InsuranceActions.ADD_DRUG_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAddDrug = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getDrugAndDevicesUrl}`,
|
|
|
|
method: 'POST',
|
|
|
|
data,
|
|
|
|
onLoading: fetchAddDrugPending,
|
|
|
|
onSuccess: fetchAddDrugSuccess,
|
|
|
|
onError: fetchAddDrugError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetProviderClassPending = () => ({
|
|
|
|
type: InsuranceActions.GET_PROVIDER_CLASS_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetProviderClassReset = () => ({
|
|
|
|
type: InsuranceActions.GET_PROVIDER_CLASS_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetProviderClassSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_PROVIDER_CLASS_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetProviderClassError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_PROVIDER_CLASS_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetProviderClass = (network_id) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getProviderClassUrl}?network_id=${network_id}`,
|
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetProviderClassPending,
|
|
|
|
onSuccess: fetchGetProviderClassSuccess,
|
|
|
|
onError: fetchGetProviderClassError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetNetworkActsPending = () => ({
|
|
|
|
type: InsuranceActions.GET_NETWORK_ACT_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetNetworkActsReset = () => ({
|
|
|
|
type: InsuranceActions.GET_NETWORK_ACT_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetNetworkActsSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_NETWORK_ACT_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetNetworkActsError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_NETWORK_ACT_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
2022-02-01 12:18:02 +00:00
|
|
|
export const fetchGetNetworkActs = (network_id, code = '', otherParam = '') => {
|
2021-11-29 11:30:04 +00:00
|
|
|
return ApiAction({
|
2022-02-01 12:18:02 +00:00
|
|
|
url: `${getNetworkActsUrl}?network_id=${network_id}&code=${code}${otherParam}`,
|
2021-11-29 11:30:04 +00:00
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetNetworkActsPending,
|
|
|
|
onSuccess: fetchGetNetworkActsSuccess,
|
|
|
|
onError: fetchGetNetworkActsError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchCreateConsultationPending = () => ({
|
|
|
|
type: InsuranceActions.CREATE_CONSULTATION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchCreateConsultationReset = () => ({
|
|
|
|
type: InsuranceActions.CREATE_CONSULTATION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchCreateConsultationSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.CREATE_CONSULTATION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchCreateConsultationError = (error: any) => ({
|
|
|
|
type: InsuranceActions.CREATE_CONSULTATION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchCreateConsultation = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${createConsultationUrl}`,
|
|
|
|
method: 'POST',
|
|
|
|
data,
|
|
|
|
onLoading: fetchCreateConsultationPending,
|
|
|
|
onSuccess: fetchCreateConsultationSuccess,
|
|
|
|
onError: fetchCreateConsultationError,
|
|
|
|
});
|
|
|
|
};
|
2021-11-30 15:33:51 +00:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetAmountConsultationPending = () => ({
|
|
|
|
type: InsuranceActions.GET_AMOUNT_CONSULTATION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetAmountConsultationReset = () => ({
|
|
|
|
type: InsuranceActions.GET_AMOUNT_CONSULTATION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetAmountConsultationSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_AMOUNT_CONSULTATION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetAmountConsultationError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_AMOUNT_CONSULTATION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetAmountConsultation = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getAmountConsultationUrl}`,
|
|
|
|
method: 'POST',
|
|
|
|
data,
|
|
|
|
onLoading: fetchGetAmountConsultationPending,
|
|
|
|
onSuccess: fetchGetAmountConsultationSuccess,
|
|
|
|
onError: fetchGetAmountConsultationError,
|
|
|
|
});
|
|
|
|
};
|
2021-12-07 05:25:01 +00:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchGetConsultationPending = () => ({
|
|
|
|
type: InsuranceActions.GET_USER_CONSULTATION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetConsultationReset = () => ({
|
|
|
|
type: InsuranceActions.GET_USER_CONSULTATION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetConsultationSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.GET_USER_CONSULTATION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchGetConsultationError = (error: any) => ({
|
|
|
|
type: InsuranceActions.GET_USER_CONSULTATION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
2022-01-04 11:42:58 +00:00
|
|
|
export const fetchGetConsultation = (user_id, state = 'UNTREATED', typeParam = 'CONSULTATION', otherParam = '') => {
|
|
|
|
console.log("user_id", user_id);
|
2021-12-07 05:25:01 +00:00
|
|
|
return ApiAction({
|
2022-02-28 09:41:54 +00:00
|
|
|
url: `${consultationUrl}?state=${state}&type=${typeParam}${user_id !== '' ? '&user_id=' + user_id : ''}${otherParam}`,
|
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetConsultationPending,
|
|
|
|
onSuccess: fetchGetConsultationSuccess,
|
|
|
|
onError: fetchGetConsultationError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const fetchGetInvoiceHistory = (otherParam) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${invoiceUrl}${otherParam}`,
|
2022-01-28 13:48:55 +00:00
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetConsultationPending,
|
|
|
|
onSuccess: fetchGetConsultationSuccess,
|
|
|
|
onError: fetchGetConsultationError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const fetchGetSubscription = (user_id, typeParam = 'ALL', otherParam = '') => {
|
|
|
|
console.log("user_id", user_id);
|
|
|
|
return ApiAction({
|
|
|
|
url: `${subscribeInsuranceUrl}?user_id=${user_id}&type=${typeParam}${otherParam}`,
|
2021-12-07 05:25:01 +00:00
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetConsultationPending,
|
|
|
|
onSuccess: fetchGetConsultationSuccess,
|
|
|
|
onError: fetchGetConsultationError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchAcceptRejectConsultationPending = () => ({
|
|
|
|
type: InsuranceActions.ACCEPT_REJECT_CONSULTATION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAcceptRejectConsultationReset = () => ({
|
|
|
|
type: InsuranceActions.ACCEPT_REJECT_CONSULTATION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAcceptRejectConsultationSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.ACCEPT_REJECT_CONSULTATION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAcceptRejectConsultationError = (error: any) => ({
|
|
|
|
type: InsuranceActions.ACCEPT_REJECT_CONSULTATION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchAcceptRejectConsultation = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${consultationUrl}`,
|
|
|
|
method: 'PUT',
|
|
|
|
data,
|
|
|
|
onLoading: fetchAcceptRejectConsultationPending,
|
|
|
|
onSuccess: fetchAcceptRejectConsultationSuccess,
|
|
|
|
onError: fetchAcceptRejectConsultationError,
|
|
|
|
});
|
|
|
|
};
|
2021-12-16 14:28:24 +00:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchExecutionPrescriptionPending = () => ({
|
|
|
|
type: InsuranceActions.EXECUTION_PRESCRIPTION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchExecutionPrescriptionReset = () => ({
|
|
|
|
type: InsuranceActions.EXECUTION_PRESCRIPTION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchExecutionPrescriptionSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.EXECUTION_PRESCRIPTION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchExecutionPrescriptionError = (error: any) => ({
|
|
|
|
type: InsuranceActions.EXECUTION_PRESCRIPTION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchExecutionPrescription = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${executionPrescriptionUrl}`,
|
|
|
|
method: 'POST',
|
|
|
|
data,
|
|
|
|
onLoading: fetchExecutionPrescriptionPending,
|
|
|
|
onSuccess: fetchExecutionPrescriptionSuccess,
|
|
|
|
onError: fetchExecutionPrescriptionError,
|
|
|
|
});
|
|
|
|
};
|
2022-01-04 11:42:58 +00:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchModifyPrescriptionPending = () => ({
|
|
|
|
type: InsuranceActions.MODIFY_PRESCRIPTION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchModifyPrescriptionReset = () => ({
|
|
|
|
type: InsuranceActions.MODIFY_PRESCRIPTION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchModifyPrescriptionSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.MODIFY_PRESCRIPTION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchModifyPrescriptionError = (error: any) => ({
|
|
|
|
type: InsuranceActions.MODIFY_PRESCRIPTION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchModifyPrescription = (id, data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${consultationUrl}/${id}`,
|
|
|
|
method: 'PUT',
|
|
|
|
data,
|
|
|
|
onLoading: fetchModifyPrescriptionPending,
|
|
|
|
onSuccess: fetchModifyPrescriptionSuccess,
|
|
|
|
onError: fetchModifyPrescriptionError,
|
|
|
|
});
|
|
|
|
};
|
2022-02-01 12:18:02 +00:00
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchDemaneAutorisationSoinPending = () => ({
|
|
|
|
type: InsuranceActions.DEMAND_AUTORISATION_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchDemaneAutorisationSoinReset = () => ({
|
|
|
|
type: InsuranceActions.DEMAND_AUTORISATION_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchDemaneAutorisationSoinSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.DEMAND_AUTORISATION_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchDemaneAutorisationSoinError = (error: any) => ({
|
|
|
|
type: InsuranceActions.DEMAND_AUTORISATION_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchDemaneAutorisationSoin = (data) => {
|
|
|
|
return ApiAction({
|
2022-02-09 10:12:27 +00:00
|
|
|
url: `${autorisationCareRequestUrl}`,
|
2022-02-01 12:18:02 +00:00
|
|
|
method: 'POST',
|
|
|
|
data,
|
|
|
|
onLoading: fetchDemaneAutorisationSoinPending,
|
|
|
|
onSuccess: fetchDemaneAutorisationSoinSuccess,
|
|
|
|
onError: fetchDemaneAutorisationSoinError,
|
|
|
|
});
|
|
|
|
};
|
2022-02-04 09:54:28 +00:00
|
|
|
|
|
|
|
export const fetchGetDemandeAutorisationSoin = (param = '') => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${autorisationCareRequestUrl}${param}`,
|
|
|
|
method: 'GET',
|
|
|
|
onLoading: fetchGetConsultationPending,
|
|
|
|
onSuccess: fetchGetConsultationSuccess,
|
|
|
|
onError: fetchGetConsultationError
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************/
|
|
|
|
export const fetchDeleteBeneficiaryPending = () => ({
|
|
|
|
type: InsuranceActions.DELETE_BENEFICIARY_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchDeleteBeneficiaryReset = () => ({
|
|
|
|
type: InsuranceActions.DELETE_BENEFICIARY_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchDeleteBeneficiarySuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.DELETE_BENEFICIARY_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchDeleteBeneficiaryError = (error: any) => ({
|
|
|
|
type: InsuranceActions.DELETE_BENEFICIARY_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchDeleteBeneficiary = (id, data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: `${getInsuranceListUrl}/${id}/delete-beneficiaries`,
|
|
|
|
method: 'PUT',
|
|
|
|
data,
|
|
|
|
onLoading: fetchDeleteBeneficiaryPending,
|
|
|
|
onSuccess: fetchDeleteBeneficiarySuccess,
|
|
|
|
onError: fetchDeleteBeneficiaryError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-02-28 09:41:54 +00:00
|
|
|
/************************************************************/
|
|
|
|
export const fetchCheckInsuranceCoverageAmountPending = () => ({
|
|
|
|
type: InsuranceActions.CHECK_HEALTH_CARE_SHEET_PENDING,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchCheckInsuranceCoverageAmountReset = () => ({
|
|
|
|
type: InsuranceActions.CHECK_HEALTH_CARE_SHEET_RESET,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchCheckInsuranceCoverageAmountSuccess = (authkey: any) => ({
|
|
|
|
type: InsuranceActions.CHECK_HEALTH_CARE_SHEET_SUCCESS,
|
|
|
|
payload: authkey,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchCheckInsuranceCoverageAmountError = (error: any) => ({
|
|
|
|
type: InsuranceActions.CHECK_HEALTH_CARE_SHEET_ERROR,
|
|
|
|
payload: error,
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fetchCheckInsuranceCoverageAmount = (data) => {
|
|
|
|
return ApiAction({
|
|
|
|
url: checkInsuranceCoverageAmountUrl,
|
|
|
|
method: 'POST',
|
|
|
|
data,
|
|
|
|
onLoading: fetchCheckInsuranceCoverageAmountPending,
|
|
|
|
onSuccess: fetchCheckInsuranceCoverageAmountSuccess,
|
|
|
|
onError: fetchCheckInsuranceCoverageAmountError,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|