Improve GET /health-care-sheets v2
This commit is contained in:
parent
f6044c886a
commit
4bcc89ded4
|
@ -1080,7 +1080,7 @@ class HealthCareSheetController extends Controller
|
||||||
* description="Status des feuilles de soins",
|
* description="Status des feuilles de soins",
|
||||||
* @OA\Schema(
|
* @OA\Schema(
|
||||||
* type="string",
|
* type="string",
|
||||||
* enum = {"UNTREATED","TREATED","ACCEPTED","TO_BILL","ALL"},
|
* enum = {"UNTREATED","TREATED","ACCEPTED","TO_BILL","ALL","UNTREATED_ALL"},
|
||||||
* default = "UNTREATED"
|
* default = "UNTREATED"
|
||||||
* ),
|
* ),
|
||||||
* in="query",
|
* in="query",
|
||||||
|
@ -1143,7 +1143,7 @@ class HealthCareSheetController extends Controller
|
||||||
'beneficiary_id' => 'nullable|integer|exists:nh_having_rights,id',
|
'beneficiary_id' => 'nullable|integer|exists:nh_having_rights,id',
|
||||||
'network_agent_id' => 'required_without:user_id|integer|exists:networks_agents,id',
|
'network_agent_id' => 'required_without:user_id|integer|exists:networks_agents,id',
|
||||||
'type' => 'nullable|in:CONSULTATION,EXECUTION',
|
'type' => 'nullable|in:CONSULTATION,EXECUTION',
|
||||||
'state' => 'nullable|in:UNTREATED,TREATED,ACCEPTED,TO_BILL,ALL',
|
'state' => 'nullable|in:UNTREATED,TREATED,ACCEPTED,TO_BILL,ALL,UNTREATED_ALL',
|
||||||
'pagination' => 'nullable|boolean'
|
'pagination' => 'nullable|boolean'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -1159,7 +1159,7 @@ class HealthCareSheetController extends Controller
|
||||||
if (!empty($beneficiary_id)) {
|
if (!empty($beneficiary_id)) {
|
||||||
$query = $query->where('beneficiary_id', $beneficiary_id);
|
$query = $query->where('beneficiary_id', $beneficiary_id);
|
||||||
} else {
|
} else {
|
||||||
if (!in_array($state, ['ALL', 'UNTREATED'])) {
|
if (!in_array($state, ['ALL', 'UNTREATED_ALL'])) {
|
||||||
$query = $query->whereNull('beneficiary_id');
|
$query = $query->whereNull('beneficiary_id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue