|
@@ -753,4 +753,28 @@ class PatientController extends Controller
|
|
|
public function protocolBuilder(Request $request, Client $patient) {
|
|
|
return view('app.patient.rtm.protocol-builder', compact('patient'));
|
|
|
}
|
|
|
+
|
|
|
+ public function checkIfCptCodeIsSubmitted(Request $request){
|
|
|
+ $clientUid = $request->get('clientUid');
|
|
|
+ $cptCode = $request->get('code');
|
|
|
+ if(!$clientUid || !$cptCode) return $this->fail('Error');
|
|
|
+ $client = Client::where('uid', $clientUid)->first();
|
|
|
+ $notes = $client->notes;
|
|
|
+ $isCptSubmitted = false;
|
|
|
+ foreach($notes as $note){
|
|
|
+ $noteClaims = $note->claims;
|
|
|
+ foreach($noteClaims as $noteClaim){
|
|
|
+ foreach($noteClaim->lines as $claimLine){
|
|
|
+ if($claimLine->cpt == $cptCode){
|
|
|
+ if($noteClaim->status == 'SUBMITTED'){
|
|
|
+ $isCptSubmitted = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if($isCptSubmitted) return $this->pass('SUBMITTED');
|
|
|
+ return $this->pass('NOT_SUBMITTED');
|
|
|
+ }
|
|
|
}
|