Quantity will not be required while store health care sheet consultation
This commit is contained in:
parent
7bf22610d6
commit
9e15c3b39b
|
@ -6,5 +6,5 @@ abstract class ActBillingType
|
|||
{
|
||||
const UNIT_PRICE = 'UNIT_PRICE';
|
||||
const PACKAGE = 'PACKAGE';
|
||||
|
||||
const FREE = 'FREE';
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ class AuthorizationCareRequestController extends Controller
|
|||
/**
|
||||
* @OA\Post(
|
||||
* path="/authorizations-care-requests",
|
||||
* summary="Demander une autorisation de soin",
|
||||
* tags={"Demandes d'autorisation de soins"},
|
||||
* summary="Demander une autorisation de prise en charge",
|
||||
* tags={"Demandes d'autorisation de prise en charge"},
|
||||
* security={{"api_key":{}}},
|
||||
* @OA\RequestBody(
|
||||
* description="Corps de la requete",
|
||||
|
@ -53,7 +53,7 @@ class AuthorizationCareRequestController extends Controller
|
|||
* mediaType="application/json",
|
||||
* @OA\Schema(
|
||||
* schema="request_for_authorizations_of_care",
|
||||
* title = "Demande autorisation de soins",
|
||||
* title = "Demande autorisation de prise en charge",
|
||||
* required={"health_care_sheet_id", "network_agent_id", "password", "practitioner_lastname", "practitioner_provider_class_id",
|
||||
* "prescriptions" , "exams"},
|
||||
* @OA\Property(
|
||||
|
@ -244,8 +244,8 @@ class AuthorizationCareRequestController extends Controller
|
|||
/**
|
||||
* @OA\Get(
|
||||
* path="/authorizations-care-requests",
|
||||
* summary="Lister toutes les demandes autorisation de soin",
|
||||
* tags={"Demandes d'autorisation de soins"},
|
||||
* summary="Lister toutes les demandes autorisation de prise en charge",
|
||||
* tags={"Demandes d'autorisation de prise en charge"},
|
||||
* security={{"api_key":{}}},
|
||||
* @OA\Parameter(
|
||||
* parameter="issuer_network_agent_id",
|
||||
|
|
|
@ -620,7 +620,7 @@ class HealthCareSheetController extends Controller
|
|||
'exams' => 'nullable|array',
|
||||
'exams.*.act_id' => 'required|integer|exists:nh_acts,id',
|
||||
'exams.*.description' => 'required|string',
|
||||
'exams.*.quantity' => 'nullable|integer',
|
||||
'exams.*.quantity' => 'nullable|integer', // Obselete, la quantité n'est plu demandé lors de la saisie de la consultation
|
||||
]);
|
||||
|
||||
$performances = $request->input('performances', []);
|
||||
|
@ -653,7 +653,7 @@ class HealthCareSheetController extends Controller
|
|||
return $this->errorResponse(trans('errors.act_quantity_required', ['act_name' => $act->name]));
|
||||
}
|
||||
|
||||
if (empty($act->amount)) {
|
||||
if ($act->billing_type == ActBillingType::FREE) {
|
||||
if (empty($p['amount'])) {
|
||||
return $this->errorResponse(trans('errors.act_amount_required', ['act_name' => $act->name]));
|
||||
}
|
||||
|
@ -739,7 +739,7 @@ class HealthCareSheetController extends Controller
|
|||
$exam = NhExam::create([
|
||||
'act_id' => $e['act_id'],
|
||||
'description' => $e['description'],
|
||||
'quantity' => $e['quantity'] ?? 1,
|
||||
'quantity' => $e['quantity'] ?? null,
|
||||
'created_at' => $datetime, 'updated_at' => $datetime,
|
||||
]);
|
||||
|
||||
|
@ -920,6 +920,7 @@ class HealthCareSheetController extends Controller
|
|||
'prescriptions.*.unit_price' => 'required|numeric',
|
||||
'exams' => 'required_without:prescriptions|array',
|
||||
'exams.*.id' => 'required|integer|exists:nh_exams,id',
|
||||
'exams.*.quantity' => 'required|numeric|min:1',
|
||||
'exams.*.unit_price' => 'nullable|numeric',
|
||||
]);
|
||||
|
||||
|
@ -1010,7 +1011,7 @@ class HealthCareSheetController extends Controller
|
|||
return $this->errorResponse(__('errors.exam_already_invoiced', ['id' => $itemIndex + 1]));
|
||||
}
|
||||
// Fetch exam unit price
|
||||
if (empty($i->act->amount)) {
|
||||
if ($i->act->billing_type == ActBillingType::FREE) {
|
||||
if (empty($exams[$itemIndex]['unit_price'])) {
|
||||
DB::rollBack();
|
||||
return $this->errorResponse(trans('errors.act_unit_price_required', ['act_name' => $i->act->name]));
|
||||
|
@ -1019,6 +1020,7 @@ class HealthCareSheetController extends Controller
|
|||
} else {
|
||||
$item->unit_price = $i->act->amount;
|
||||
}
|
||||
$item->quantity = $exams[$itemIndex]['quantity'];
|
||||
}
|
||||
|
||||
|
||||
|
@ -1894,8 +1896,8 @@ class HealthCareSheetController extends Controller
|
|||
if ($sheet->type == HealthCareSheetType::CONSULTATION) {
|
||||
$exam->act_id = !empty($p['act_id']) ? $p['act_id'] : $exam->act_id;
|
||||
$exam->description = !empty($p['description']) ? $p['description'] : $exam->description;
|
||||
$exam->quantity = !empty($p['quantity']) ? $p['quantity'] : $exam->quantity;
|
||||
} else {
|
||||
$exam->quantity = !empty($p['quantity']) ? $p['quantity'] : $exam->quantity;
|
||||
if (!empty($p['unit_price'])) {
|
||||
$exam->unit_price = $p['unit_price'];
|
||||
$exam->insured_paid_amount = $parts->insured_part * $exam->unit_price * ($exam->quantity ?? 1);
|
||||
|
|
|
@ -18,7 +18,8 @@ class AddAmountToNhActsAndUpdateNhInsurancesState extends Migration
|
|||
DB::statement("alter table nh_insurances modify state enum ('PAID', 'UNDER_STOPPING',
|
||||
'STOPPED', 'EXPIRED', 'UNDER_ACTIVATION', 'UNDER_RENEW','UNDER_ADDING_BENEFICIARY', 'PARTIALLY_PAID', 'SUSPENDED') default 'PAID' not null;");
|
||||
|
||||
$table->enum('type', ['CONSULTATION', 'EXAM'])->default('CONSULTATION')->after('name');
|
||||
DB::statement("alter table nh_acts modify billing_type enum ('PACKAGE', 'UNIT_PRICE', 'FREE') default 'FREE' not null;");
|
||||
$table->enum('type', ['CONSULTATION', 'EXAM_OR_OTHER'])->default('CONSULTATION')->after('name');
|
||||
$table->string('unit_value')->nullable()->after('billing_type');
|
||||
$table->decimal('amount', 10)->nullable()->after('unit_value');
|
||||
});
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddNullableToNhExamsQuantity extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('nh_exams', function (Blueprint $table) {
|
||||
$table->unsignedInteger('quantity')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('nh_exams', function (Blueprint $table) {
|
||||
$table->unsignedInteger('quantity')->change();
|
||||
});
|
||||
}
|
||||
}
|
|
@ -252,5 +252,6 @@ Your insurance has expired.
|
|||
",
|
||||
'insurance_invoice_generated_mail_title' => "Your :deadline insurance invoice has been issued",
|
||||
'the_invoice' => "the invoice",
|
||||
'the_payment' => "the payment"
|
||||
'the_payment' => "the payment",
|
||||
'care_request_already_been_processed' => "The care request has already been processed"
|
||||
];
|
||||
|
|
|
@ -146,13 +146,13 @@ Une nouvelle execution de prescription vient d'etre effectuée sur votre assuran
|
|||
'phone' => "Téléphone",
|
||||
'transmitter' => "Émetteur",
|
||||
'recipient' => "Destinataire",
|
||||
'new_care_authorisation' => "Nouvelle autorisation de soin",
|
||||
'new_care_authorisation_email' => "L'assuré :insured demande une nouvelle autorisation de soin pour l'acte :act",
|
||||
'new_care_authorisation' => "Nouvelle autorisation de prise en charge",
|
||||
'new_care_authorisation_email' => "L'assuré :insured demande une nouvelle autorisation de prise en charge pour l'acte :act",
|
||||
'new_care_authorisation_sent' => "Nouvelle demande autorisation soin envoyée",
|
||||
'care_request_accepted' => "Demande de soins acceptée",
|
||||
'care_request_rejected' => "Demande de soins refusée",
|
||||
'care_request_rejected_notification' => "Votre demande d'autorisation de soins :request_id a été refusée",
|
||||
'care_request_accepted_notification' => "Votre demande d'autorisation de soins :request_id a été acceptée",
|
||||
'care_request_accepted' => "Demande de prise en charges acceptée",
|
||||
'care_request_rejected' => "Demande de prise en charges refusée",
|
||||
'care_request_rejected_notification' => "Votre demande d'autorisation de prise en charge :request_id a été refusée",
|
||||
'care_request_accepted_notification' => "Votre demande d'autorisation de prise en charge :request_id a été acceptée",
|
||||
'generated_invoice_mail' => "Facture émise par :agent pour la période :period",
|
||||
'insurance_deletion_beneficiary_successful' => "Suppression d'ayant droit à votre assurance réussie",
|
||||
'insurance_stop_successful' => "Demande d'arrêt de votre assurance réussie",
|
||||
|
@ -269,5 +269,6 @@ Votre assurance est arrivée à échéance.
|
|||
",
|
||||
'insurance_invoice_generated_mail_title' => "La facture de votre assurance d'échéance :deadline a été émise.",
|
||||
'the_invoice' => "la facture",
|
||||
'the_payment' => "le paiement"
|
||||
'the_payment' => "le paiement",
|
||||
'care_request_already_been_processed' => "La demande de prise en charge a deja ete traitée"
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue