Prechádzať zdrojové kódy

FDB Playground - indications and contraindications

Vijayakrishnan 3 rokov pred
rodič
commit
a788a3bf00

+ 34 - 0
app/Http/Controllers/FDBPGController.php

@@ -89,4 +89,38 @@ ORDER BY gm.geri_desc
         );
         return view('app.fdb-pg.fdb-geriatric-precautions', compact('precautions'));
     }
+
+    public function indications(Request $request)
+    {
+        $gcnSeqNo = $request->input('gcn-seq-no') ? trim($request->input('gcn-seq-no')) : '';
+        if (empty($gcnSeqNo)) return '';
+        $indications = DB::connection('pgsql_fdb')->select("
+SELECT r1.indcts, r2.indcts_sn, r2.indcts_lbl, r2.dxid, r2.proxy_ind, r3.dxid_desc56
+FROM rindmgc0_indcts_gcnseqno_link r1 
+    JOIN rindmma2_indcts_mstr r2 ON r1.indcts = r2.indcts
+    JOIN rfmldx0_dxid r3 ON r2.dxid = r3.dxid
+WHERE r1.gcn_seqno = :gcnSeqNo
+ORDER BY r3.dxid_desc56
+            ",
+            ['gcnSeqNo' => $gcnSeqNo]
+        );
+        return view('app.fdb-pg.fdb-indications', compact('indications'));
+    }
+
+    public function contraindications(Request $request)
+    {
+        $routedMedID = $request->input('routed-med-id') ? trim($request->input('routed-med-id')) : '';
+        if (empty($routedMedID)) return '';
+        $contraindications = DB::connection('pgsql_fdb')->select("
+SELECT r1.ddxcn, r2.dxid, r2.ddxcn_sl, r3.dxid_desc56
+FROM rddcmrm0_routed_med_link r1 
+    JOIN rddcmma1_contra_mstr r2 ON r1.ddxcn = r2.ddxcn
+    JOIN rfmldx0_dxid r3 ON r2.dxid = r3.dxid
+WHERE r1.routed_med_id = :routedMedID
+ORDER BY r2.ddxcn_sl
+            ",
+            ['routedMedID' => $routedMedID]
+        );
+        return view('app.fdb-pg.fdb-contraindications', compact('contraindications'));
+    }
 }

+ 22 - 0
resources/views/app/fdb-pg/fdb-contraindications.blade.php

@@ -0,0 +1,22 @@
+@if(!count($contraindications))
+    <span class="d-block no-suggest-items">No contraindications!</span>
+@else
+    <p class="font-weight-bold text-secondary mb-2">Contraindications</p>
+    <table class="table table-sm table-striped table-bordered">
+        <thead>
+        <tr>
+            <th>Severity</th>
+            <th>Contraindication</th>
+        </tr>
+        </thead>
+        <tbody>
+        @foreach($contraindications as $contraindication)
+            <tr>
+                <td class="font-weight-bold">{{$contraindication->ddxcn_sl == 1 ? 'Contraindication' : ($contraindication->ddxcn_sl == 2 ? 'Severe Warning' : 'Moderate Warning')}}</td>
+                <td>{{$contraindication->dxid_desc56}}</td>
+            </tr>
+        @endforeach
+        </tbody>
+    </table>
+@endif
+

+ 1 - 1
resources/views/app/fdb-pg/fdb-geriatric-precautions.blade.php

@@ -14,7 +14,7 @@
         @foreach($precautions as $precaution)
             <tr>
                 <td>{{$precaution->geri_desc}}</td>
-                <td>{{$precaution->geri_sl}}</td>
+                <td>{{$precaution->geri_sl == 1 ? 'Contraindication' : 'Management or Monitoring Precaution'}}</td>
                 <td>{{$precaution->geri_narrative}}</td>
             </tr>
         @endforeach

+ 22 - 0
resources/views/app/fdb-pg/fdb-indications.blade.php

@@ -0,0 +1,22 @@
+@if(!count($indications))
+    <span class="d-block no-suggest-items">No indications!</span>
+@else
+    <p class="font-weight-bold text-secondary mb-2">Indications</p>
+    <table class="table table-sm table-striped table-bordered">
+        <thead>
+        <tr>
+            <th>Indication</th>
+            <th>FDA Approved</th>
+        </tr>
+        </thead>
+        <tbody>
+        @foreach($indications as $indication)
+            <tr>
+                <td class="font-weight-bold">{{$indication->dxid_desc56}}</td>
+                <td>{{$indication->indcts_lbl}}</td>
+            </tr>
+        @endforeach
+        </tbody>
+    </table>
+@endif
+

+ 31 - 7
resources/views/app/fdb-pg/index.blade.php

@@ -12,15 +12,15 @@
             </div>
             <div class="card-body px-3 py-4">
                 <div class="row">
-                    <div class="col-3">
-                        <div class="mb-3 d-flex align-items-center">
+                    <div class="col-2">
+                        <div class="mb-2 d-flex align-items-center">
                             <label class="m-0 width-100px">Search</label>
                             <div class="flex-grow-1">
                                 <input type="text" class="form-control form-control-sm min-width-unset"
                                        fdb-med-suggest-search fdb-suggest-group="1">
                             </div>
                         </div>
-                        <div class="mb-3 d-flex align-items-center">
+                        <div class="mb-2 d-flex align-items-center">
                             <label class="m-0 width-100px">Route</label>
                             <div class="flex-grow-1">
                                 <select class="form-control form-control-sm min-width-unset"
@@ -29,7 +29,7 @@
                                 </select>
                             </div>
                         </div>
-                        <div class="mb-3 d-flex align-items-center">
+                        <div class="mb-2 d-flex align-items-center">
                             <label class="m-0 width-100px">Dosage</label>
                             <div class="flex-grow-1">
                                 <select class="form-control form-control-sm min-width-unset"
@@ -38,7 +38,7 @@
                                 </select>
                             </div>
                         </div>
-                        <div class="mb-3 d-flex align-items-center">
+                        <div class="mb-2 d-flex align-items-center">
                             <label class="m-0 width-100px">Strength</label>
                             <div class="flex-grow-1">
                                 <select class="form-control form-control-sm min-width-unset"
@@ -48,10 +48,16 @@
                             </div>
                         </div>
                     </div>
-                    <div class="col-3 side-effects">
+                    <div class="col-2 side-effects">
 
                     </div>
-                    <div class="col-3 geriatric-precautions">
+                    <div class="col-2 geriatric-precautions">
+
+                    </div>
+                    <div class="col-2 indications">
+
+                    </div>
+                    <div class="col-2 contraindications">
 
                     </div>
                 </div>
@@ -162,6 +168,20 @@
                 });
             }
 
+            function fillIndications(_gcn_seqno) {
+                $('.indications').empty();
+                $.get('/fdb-indications?gcn-seq-no=' + _gcn_seqno, _data => {
+                    $('.indications').html(_data);
+                });
+            }
+
+            function fillContraindications(_gcn_seqno) {
+                $('.contraindications').empty();
+                $.get('/fdb-contraindications?routed-med-id=' + _gcn_seqno, _data => {
+                    $('.contraindications').html(_data);
+                });
+            }
+
             addMCInitializer('fdb-pg', function() {
 
                 $('[fdb-med-suggest-search]:not([fdb-suggest-initialized])').each(function() {
@@ -266,6 +286,10 @@
                 $(document).on('change', '[fdb-med-suggest-strength]', function () {
                     fillSideEffects($(this).val());
                     fillGeriatricPrecautions($(this).val());
+                    fillIndications($(this).val());
+
+                    let routedMedID = $('[fdb-med-suggest-route][fdb-suggest-group='+$(this).attr('fdb-suggest-group')+']').val();
+                    fillContraindications(routedMedID);
                 });
 
             }, '#fdb-pg');

+ 2 - 0
routes/web.php

@@ -330,6 +330,8 @@ Route::middleware('pro.auth')->group(function () {
     Route::get('/fdb-meds', 'FDBPGController@meds');
     Route::get('/fdb-side-effects', 'FDBPGController@sideEffects');
     Route::get('/fdb-geriatric-precautions', 'FDBPGController@geriatricPrecautions');
+    Route::get('/fdb-indications', 'FDBPGController@indications');
+    Route::get('/fdb-contraindications', 'FDBPGController@contraindications');
 });
 
 Route::post("/process_form_submit", 'NoteController@processFormSubmit')->name('process_form_submit');