Procházet zdrojové kódy

Merge branch 'master' of rav.triplestart.com:jmudaka/stagfe2 into dev-josh-notes

= před 3 roky
rodič
revize
821f1226ea
45 změnil soubory, kde provedl 4371 přidání a 266 odebrání
  1. 202 188
      app/Http/Controllers/FDBPGController.php
  2. 1 0
      app/Http/Controllers/HomeController.php
  3. 63 0
      app/Http/Controllers/PatientController.php
  4. 99 0
      app/Http/Controllers/PracticeManagementController.php
  5. 67 0
      app/Models/Client.php
  6. 31 0
      app/Models/Erx.php
  7. 5 0
      app/Models/NotePickupForProcessing.php
  8. 4 0
      app/Models/Pro.php
  9. 3 1
      config/app.php
  10. 23 1
      public/css/style.css
  11. 6 1
      public/js/mc.js
  12. 11 0
      resources/views/app/dashboard/measurements.blade.php
  13. 254 0
      resources/views/app/patient/care-month/_matrix.blade.php
  14. 4 3
      resources/views/app/patient/care-month/dashboard.blade.php
  15. 5 0
      resources/views/app/patient/care-month/matrix.blade.php
  16. 9 0
      resources/views/app/patient/care-months.blade.php
  17. 32 0
      resources/views/app/patient/prescriptions/client-status-form.blade.php
  18. 73 0
      resources/views/app/patient/prescriptions/drug-form.blade.php
  19. 23 0
      resources/views/app/patient/prescriptions/hcp-pro-form.blade.php
  20. 30 0
      resources/views/app/patient/prescriptions/imaging-form.blade.php
  21. 772 0
      resources/views/app/patient/prescriptions/index.blade.php
  22. 30 0
      resources/views/app/patient/prescriptions/lab-form.blade.php
  23. 59 0
      resources/views/app/patient/prescriptions/logistics-form.blade.php
  24. 25 0
      resources/views/app/patient/prescriptions/other-form.blade.php
  25. 66 0
      resources/views/app/patient/prescriptions/pdf/DRUG.blade.php
  26. 203 0
      resources/views/app/patient/prescriptions/pdf/IMAGING.blade.php
  27. 203 0
      resources/views/app/patient/prescriptions/pdf/LAB.blade.php
  28. 203 0
      resources/views/app/patient/prescriptions/pdf/OTHER.blade.php
  29. 203 0
      resources/views/app/patient/prescriptions/pdf/REFERRAL.blade.php
  30. 203 0
      resources/views/app/patient/prescriptions/pdf/SUPPLY.blade.php
  31. 13 0
      resources/views/app/patient/prescriptions/pdf/pdf-preview-with-cover-sheet.blade.php
  32. 13 0
      resources/views/app/patient/prescriptions/pdf/pdf-preview.blade.php
  33. 32 0
      resources/views/app/patient/prescriptions/pro-status-form.blade.php
  34. 25 0
      resources/views/app/patient/prescriptions/referral-form.blade.php
  35. 16 0
      resources/views/app/patient/prescriptions/sign-as-hcp-form.blade.php
  36. 34 0
      resources/views/app/patient/prescriptions/supply-form.blade.php
  37. 66 0
      resources/views/app/patient/prescriptions/transmit-form.blade.php
  38. 758 0
      resources/views/app/patient/vitals-settings.blade.php
  39. 2 2
      resources/views/app/practice-management/billing-report.blade.php
  40. 68 0
      resources/views/app/practice-management/care-month-report.blade.php
  41. 290 0
      resources/views/app/practice-management/notes-processing-center.blade.php
  42. 18 0
      resources/views/app/practice-management/process-claims.blade.php
  43. 109 69
      resources/views/layouts/patient.blade.php
  44. 2 0
      resources/views/layouts/template.blade.php
  45. 13 1
      routes/web.php

+ 202 - 188
app/Http/Controllers/FDBPGController.php

@@ -13,6 +13,7 @@ class FDBPGController extends Controller
         return view('app.fdb-pg.fdb-rx');
     }
 
+    // 1. medication suggest
     public function medSuggest(Request $request)
     {
         $term = $request->input('term') ? trim($request->input('term')) : '';
@@ -24,6 +25,7 @@ class FDBPGController extends Controller
         return view('app.fdb-pg.fdb-med-suggest', compact('matches'));
     }
 
+    // 2. routed meds from men name
     public function routedMeds(Request $request)
     {
         $medNameID = $request->input('med-name-id') ? trim($request->input('med-name-id')) : '';
@@ -35,6 +37,7 @@ class FDBPGController extends Controller
         return json_encode($matches);
     }
 
+    // 3. routed dosage from routed med
     public function routedDosages(Request $request)
     {
         $routedMedID = $request->input('routed-med-id') ? trim($request->input('routed-med-id')) : '';
@@ -46,6 +49,7 @@ class FDBPGController extends Controller
         return json_encode($matches);
     }
 
+    // 4. strengths from routed med
     public function meds(Request $request)
     {
         $dosageFormMedId = $request->input('dosage-form-med-id') ? trim($request->input('dosage-form-med-id')) : '';
@@ -57,6 +61,7 @@ class FDBPGController extends Controller
         return json_encode($matches);
     }
 
+    // side effects for a given rx
     public function sideEffects(Request $request)
     {
         $gcnSeqNo = $request->input('gcn-seq-no') ? trim($request->input('gcn-seq-no')) : '';
@@ -74,6 +79,7 @@ ORDER BY sm.side_sev DESC, sm.side_freq ASC
         return view('app.fdb-pg.fdb-side-effects', compact('sides'));
     }
 
+    // ger prec for a given rx
     public function geriatricPrecautions(Request $request)
     {
         $gcnSeqNo = $request->input('gcn-seq-no') ? trim($request->input('gcn-seq-no')) : '';
@@ -90,6 +96,7 @@ ORDER BY gm.geri_desc
         return view('app.fdb-pg.fdb-geriatric-precautions', compact('precautions'));
     }
 
+    // indication of a given rx
     public function indications(Request $request)
     {
         $gcnSeqNo = $request->input('gcn-seq-no') ? trim($request->input('gcn-seq-no')) : '';
@@ -107,6 +114,7 @@ ORDER BY r3.dxid_desc56
         return view('app.fdb-pg.fdb-indications', compact('indications'));
     }
 
+    // contra-indications of a given rx
     public function contraindications(Request $request)
     {
         $routedMedID = $request->input('routed-med-id') ? trim($request->input('routed-med-id')) : '';
@@ -124,6 +132,7 @@ ORDER BY r2.ddxcn_sl
         return view('app.fdb-pg.fdb-contraindications', compact('contraindications'));
     }
 
+    // dx suggest
     public function dxSuggest(Request $request)
     {
         $term = $request->input('term') ? trim($request->input('term')) : '';
@@ -140,6 +149,7 @@ ORDER BY r1.dxid_desc56
         return view('app.fdb-pg.fdb-dx-suggest', compact('matches'));
     }
 
+    // allergy suggest
     public function allergySuggest(Request $request)
     {
         $term = $request->input('term') ? trim($request->input('term')) : '';
@@ -155,6 +165,7 @@ ORDER BY r1.dam_concept_id_desc
         return view('app.fdb-pg.fdb-allergy-suggest', compact('matches'));
     }
 
+    // drug <-> allergy match making
     public function drugAllergies(Request $request) {
 
         // override
@@ -214,88 +225,88 @@ ORDER BY r1.dam_concept_id_desc
 
     }
 
-    private function drugAllergyIngredientAllergenVsSingleRx($_allergen, $_rx) {
+        private function drugAllergyIngredientAllergenVsSingleRx($_allergen, $_rx) {
 
-        $matches = DB::connection('pgsql_fdb')->select("
-(
-    -- ingredients from medication
-    SELECT R1.related_hic_seqn as hic_seqn, R2.hic_desc
-    FROM RHICHCR0_HIC_HIC_LINK R1
-             JOIN RHICD5_HIC_DESC R2 ON R1.related_hic_seqn = R2.hic_seqn
-    WHERE R1.hic_seqn IN (
-        SELECT S2.dam_alrgn_hic_seqn
-        FROM RMEDMHL0_MED_HICLSEQNO_LINK S1
-                 JOIN RDAMHHA0_HIC_HICL_ALG_LINK S2 ON S1.hicl_seqno = S2.hicl_seqno
-        WHERE S1.med_concept_id = :medid
-          AND S1.med_concept_id_typ = 3
-    )
-)
-INTERSECT
-(
-    -- all ingredients directly and related from allergens
+            $matches = DB::connection('pgsql_fdb')->select("
     (
+        -- ingredients from medication
         SELECT R1.related_hic_seqn as hic_seqn, R2.hic_desc
         FROM RHICHCR0_HIC_HIC_LINK R1
                  JOIN RHICD5_HIC_DESC R2 ON R1.related_hic_seqn = R2.hic_seqn
-        WHERE R1.hic_seqn = :allergenConceptID
+        WHERE R1.hic_seqn IN (
+            SELECT S2.dam_alrgn_hic_seqn
+            FROM RMEDMHL0_MED_HICLSEQNO_LINK S1
+                     JOIN RDAMHHA0_HIC_HICL_ALG_LINK S2 ON S1.hicl_seqno = S2.hicl_seqno
+            WHERE S1.med_concept_id = :medid
+              AND S1.med_concept_id_typ = 3
+        )
     )
-    UNION
-    -- all ingredients via related dam allergen groups
+    INTERSECT
     (
-        SELECT r3.hic_seqn, r4.hic_desc
-        FROM RDAMGHC0_HIC_ALRGN_GRP_LINK R1
-                 JOIN rdamagd1_alrgn_grp_desc R2 on R1.dam_alrgn_grp = R2.dam_alrgn_grp
-                 JOIN RDAMGHC0_HIC_ALRGN_GRP_LINK R3 on R1.dam_alrgn_grp = R3.dam_alrgn_grp
-                 JOIN RHICD5_HIC_DESC R4 on r3.hic_seqn = r4.hic_seqn
-        WHERE R1.hic_seqn = :allergenConceptID
-          AND R2.dam_alrgn_grp_status_cd = 0
-        ORDER BY r3.hic_seqn
+        -- all ingredients directly and related from allergens
+        (
+            SELECT R1.related_hic_seqn as hic_seqn, R2.hic_desc
+            FROM RHICHCR0_HIC_HIC_LINK R1
+                     JOIN RHICD5_HIC_DESC R2 ON R1.related_hic_seqn = R2.hic_seqn
+            WHERE R1.hic_seqn = :allergenConceptID
+        )
+        UNION
+        -- all ingredients via related dam allergen groups
+        (
+            SELECT r3.hic_seqn, r4.hic_desc
+            FROM RDAMGHC0_HIC_ALRGN_GRP_LINK R1
+                     JOIN rdamagd1_alrgn_grp_desc R2 on R1.dam_alrgn_grp = R2.dam_alrgn_grp
+                     JOIN RDAMGHC0_HIC_ALRGN_GRP_LINK R3 on R1.dam_alrgn_grp = R3.dam_alrgn_grp
+                     JOIN RHICD5_HIC_DESC R4 on r3.hic_seqn = r4.hic_seqn
+            WHERE R1.hic_seqn = :allergenConceptID
+              AND R2.dam_alrgn_grp_status_cd = 0
+            ORDER BY r3.hic_seqn
+        )
     )
-)
-",
-            ['medid' => $_rx->medid, 'allergenConceptID' => $_allergen->dam_concept_id]
-        );
+    ",
+                ['medid' => $_rx->medid, 'allergenConceptID' => $_allergen->dam_concept_id]
+            );
 
-        return !!count($matches);
-    }
+            return !!count($matches);
+        }
 
-    private function drugAllergyMedicationAllergenVsSingleRx($_allergen, $_rx) {
+        private function drugAllergyMedicationAllergenVsSingleRx($_allergen, $_rx) {
 
-        $matches = DB::connection('pgsql_fdb')->select("
-(
-    -- ingredients from medication
-    SELECT R1.related_hic_seqn as hic_seqn
-    FROM RHICHCR0_HIC_HIC_LINK R1
-             JOIN RHICD5_HIC_DESC R2 ON R1.related_hic_seqn = R2.hic_seqn
-    WHERE R1.hic_seqn IN (
-        SELECT S2.dam_alrgn_hic_seqn
-        FROM RMEDMHL0_MED_HICLSEQNO_LINK S1
-                 JOIN RDAMHHA0_HIC_HICL_ALG_LINK S2 ON S1.hicl_seqno = S2.hicl_seqno
-        WHERE S1.med_concept_id = :medid
-          AND S1.med_concept_id_typ = 3
+            $matches = DB::connection('pgsql_fdb')->select("
+    (
+        -- ingredients from medication
+        SELECT R1.related_hic_seqn as hic_seqn
+        FROM RHICHCR0_HIC_HIC_LINK R1
+                 JOIN RHICD5_HIC_DESC R2 ON R1.related_hic_seqn = R2.hic_seqn
+        WHERE R1.hic_seqn IN (
+            SELECT S2.dam_alrgn_hic_seqn
+            FROM RMEDMHL0_MED_HICLSEQNO_LINK S1
+                     JOIN RDAMHHA0_HIC_HICL_ALG_LINK S2 ON S1.hicl_seqno = S2.hicl_seqno
+            WHERE S1.med_concept_id = :medid
+              AND S1.med_concept_id_typ = 3
+        )
     )
-)
-INTERSECT
-(
-    -- all ingredients directly and related from allergens
-    SELECT R1.dam_alrgn_hic_seqn as hic_seqn
-    FROM RDAMHHA0_HIC_HICL_ALG_LINK R1
-    WHERE R1.hicl_seqno IN (
-        SELECT R1.hicl_seqno
-        FROM RMEDMHL0_MED_HICLSEQNO_LINK R1
-        WHERE R1.med_concept_id_typ = 1
-          AND R1.med_concept_id = :allergenConceptID
-          AND MED_CONCEPT_HICL_SRC_CD = 0
+    INTERSECT
+    (
+        -- all ingredients directly and related from allergens
+        SELECT R1.dam_alrgn_hic_seqn as hic_seqn
+        FROM RDAMHHA0_HIC_HICL_ALG_LINK R1
+        WHERE R1.hicl_seqno IN (
+            SELECT R1.hicl_seqno
+            FROM RMEDMHL0_MED_HICLSEQNO_LINK R1
+            WHERE R1.med_concept_id_typ = 1
+              AND R1.med_concept_id = :allergenConceptID
+              AND MED_CONCEPT_HICL_SRC_CD = 0
+        )
     )
-)
-",
-            ['medid' => $_rx->medid, 'allergenConceptID' => $_allergen->dam_concept_id]
-        );
+    ",
+                ['medid' => $_rx->medid, 'allergenConceptID' => $_allergen->dam_concept_id]
+            );
 
-        return !!count($matches);
-    }
+            return !!count($matches);
+        }
 
-    private function drugAllergyGroupAllergenVsSingleRx($_allergen, $_rx) {
+        private function drugAllergyGroupAllergenVsSingleRx($_allergen, $_rx) {
 
         $matches = DB::connection('pgsql_fdb')->select("
 (
@@ -339,6 +350,7 @@ INTERSECT
         return !!count($matches);
     }
 
+    // drug <-> drug match making
     public function drugDrugInteraction(Request $request) {
 
         if($request->input('test')) {
@@ -386,135 +398,135 @@ INTERSECT
         return implode("<br>", $output);
     }
 
-    private function drugDrugInteractionSinglePair($_rx1, $_rx2) {
+        private function drugDrugInteractionSinglePair($_rx1, $_rx2) {
 
-        $output = [];
+            $output = [];
+
+            // get active ingredient DDI_CODEX values for drug 1 and 2
+            $rx1ActiveDdiCodex = $this->getActiveDdiCodexFromGcnSeqNo($_rx1->gcn_seqno);
+            $rx2ActiveDdiCodex = $this->getActiveDdiCodexFromGcnSeqNo($_rx2->gcn_seqno);
+            if(!$rx1ActiveDdiCodex || !$rx2ActiveDdiCodex || !count($rx1ActiveDdiCodex) || !count($rx2ActiveDdiCodex)) return "";
+
+    //        dump($rx1_DDI_CODEX);
+    //        dump($rx2_DDI_CODEX);
+
+            // get inactive ingredient DDI_CODEX values for drug 1 and 2
+            // to get this we need to first get the NDCs of the drugs
+            $rx1Ndc = $this->getNdcFromMedId($_rx1->medid);
+            $rx2Ndc = $this->getNdcFromMedId($_rx2->medid);
+
+    //        dump($rx1Ndc);
+    //        dump($rx2Ndc);
+
+            $rx1InactiveDdiCodex = $this->getInactiveDdiCodexFromNdc($rx1Ndc);
+            $rx2InactiveDdiCodex = $this->getInactiveDdiCodexFromNdc($rx2Ndc);
+            // if(!$rx1InactiveDdiCodex || !$rx2InactiveDdiCodex || !count($rx1InactiveDdiCodex) || !count($rx2InactiveDdiCodex)) return "";
+
+    //        dump($rx1InactiveDdiCodex);
+    //        dump($rx2InactiveDdiCodex);
+
+            // get ddi codex - monox pairs for drug 1 & 2
+            $rx1ActiveDdiCodexMonoxPairs = $this->getDdiCodexMonoxPairs($rx1ActiveDdiCodex);
+            $rx1InactiveDdiCodexMonoxPairs = $this->getDdiCodexMonoxPairs($rx1InactiveDdiCodex);
+            $rx2ActiveDdiCodexMonoxPairs = $this->getDdiCodexMonoxPairs($rx2ActiveDdiCodex);
+            $rx2InactiveDdiCodexMonoxPairs = $this->getDdiCodexMonoxPairs($rx2InactiveDdiCodex);
 
-        // get active ingredient DDI_CODEX values for drug 1 and 2
-        $rx1ActiveDdiCodex = $this->getActiveDdiCodexFromGcnSeqNo($_rx1->gcn_seqno);
-        $rx2ActiveDdiCodex = $this->getActiveDdiCodexFromGcnSeqNo($_rx2->gcn_seqno);
-        if(!$rx1ActiveDdiCodex || !$rx2ActiveDdiCodex || !count($rx1ActiveDdiCodex) || !count($rx2ActiveDdiCodex)) return "";
-
-//        dump($rx1_DDI_CODEX);
-//        dump($rx2_DDI_CODEX);
-
-        // get inactive ingredient DDI_CODEX values for drug 1 and 2
-        // to get this we need to first get the NDCs of the drugs
-        $rx1Ndc = $this->getNdcFromMedId($_rx1->medid);
-        $rx2Ndc = $this->getNdcFromMedId($_rx2->medid);
-
-//        dump($rx1Ndc);
-//        dump($rx2Ndc);
-
-        $rx1InactiveDdiCodex = $this->getInactiveDdiCodexFromNdc($rx1Ndc);
-        $rx2InactiveDdiCodex = $this->getInactiveDdiCodexFromNdc($rx2Ndc);
-        // if(!$rx1InactiveDdiCodex || !$rx2InactiveDdiCodex || !count($rx1InactiveDdiCodex) || !count($rx2InactiveDdiCodex)) return "";
-
-//        dump($rx1InactiveDdiCodex);
-//        dump($rx2InactiveDdiCodex);
-
-        // get ddi codex - monox pairs for drug 1 & 2
-        $rx1ActiveDdiCodexMonoxPairs = $this->getDdiCodexMonoxPairs($rx1ActiveDdiCodex);
-        $rx1InactiveDdiCodexMonoxPairs = $this->getDdiCodexMonoxPairs($rx1InactiveDdiCodex);
-        $rx2ActiveDdiCodexMonoxPairs = $this->getDdiCodexMonoxPairs($rx2ActiveDdiCodex);
-        $rx2InactiveDdiCodexMonoxPairs = $this->getDdiCodexMonoxPairs($rx2InactiveDdiCodex);
-
-//        dump($rx1ActiveDdiCodexMonoxPairs);
-//        dump($rx1InactiveDdiCodexMonoxPairs);
-//        dump($rx2ActiveDdiCodexMonoxPairs);
-//        dump($rx2InactiveDdiCodexMonoxPairs);
-
-        // compare 1-active to 2-active and 2-inactive
-        $activeCatches = [];
-        foreach ($rx1ActiveDdiCodexMonoxPairs as $compareLeft) {
-            foreach ($rx2ActiveDdiCodexMonoxPairs as $compareRight) {
-                if($compareLeft->ddi_monox == $compareRight->ddi_monox && $compareLeft->ddi_codex != $compareRight->ddi_codex) {
-                    $activeCatches[] = $compareLeft->ddi_codex;
+    //        dump($rx1ActiveDdiCodexMonoxPairs);
+    //        dump($rx1InactiveDdiCodexMonoxPairs);
+    //        dump($rx2ActiveDdiCodexMonoxPairs);
+    //        dump($rx2InactiveDdiCodexMonoxPairs);
+
+            // compare 1-active to 2-active and 2-inactive
+            $activeCatches = [];
+            foreach ($rx1ActiveDdiCodexMonoxPairs as $compareLeft) {
+                foreach ($rx2ActiveDdiCodexMonoxPairs as $compareRight) {
+                    if($compareLeft->ddi_monox == $compareRight->ddi_monox && $compareLeft->ddi_codex != $compareRight->ddi_codex) {
+                        $activeCatches[] = $compareLeft->ddi_codex;
+                    }
                 }
-            }
-            foreach ($rx2InactiveDdiCodexMonoxPairs as $compareRight) {
-                if($compareLeft->ddi_monox == $compareRight->ddi_monox && $compareLeft->ddi_codex != $compareRight->ddi_codex) {
-                    $activeCatches[] = $compareLeft->ddi_codex;
+                foreach ($rx2InactiveDdiCodexMonoxPairs as $compareRight) {
+                    if($compareLeft->ddi_monox == $compareRight->ddi_monox && $compareLeft->ddi_codex != $compareRight->ddi_codex) {
+                        $activeCatches[] = $compareLeft->ddi_codex;
+                    }
                 }
             }
-        }
 
-        // compare 1-inactive to 2-active and 2-inactive
-        $inactiveCatches = [];
-        foreach ($rx1InactiveDdiCodexMonoxPairs as $compareLeft) {
-            foreach ($rx2ActiveDdiCodexMonoxPairs as $compareRight) {
-                if($compareLeft->ddi_monox == $compareRight->ddi_monox && $compareLeft->ddi_codex != $compareRight->ddi_codex) {
-                    $inactiveCatches[] = $compareLeft->ddi_codex;
+            // compare 1-inactive to 2-active and 2-inactive
+            $inactiveCatches = [];
+            foreach ($rx1InactiveDdiCodexMonoxPairs as $compareLeft) {
+                foreach ($rx2ActiveDdiCodexMonoxPairs as $compareRight) {
+                    if($compareLeft->ddi_monox == $compareRight->ddi_monox && $compareLeft->ddi_codex != $compareRight->ddi_codex) {
+                        $inactiveCatches[] = $compareLeft->ddi_codex;
+                    }
                 }
-            }
-            foreach ($rx2InactiveDdiCodexMonoxPairs as $compareRight) {
-                if($compareLeft->ddi_monox == $compareRight->ddi_monox && $compareLeft->ddi_codex != $compareRight->ddi_codex) {
-                    $inactiveCatches[] = $compareLeft->ddi_codex;
+                foreach ($rx2InactiveDdiCodexMonoxPairs as $compareRight) {
+                    if($compareLeft->ddi_monox == $compareRight->ddi_monox && $compareLeft->ddi_codex != $compareRight->ddi_codex) {
+                        $inactiveCatches[] = $compareLeft->ddi_codex;
+                    }
                 }
             }
-        }
 
-        if(count($activeCatches)) {
-            $output[] = "<b>{$_rx2->rx}</b> interacts with one or more active ingredients in <b>{$_rx1->rx}</b>.";
-        }
-        if(count($inactiveCatches)) {
-            $output[] = "<b>{$_rx2->rx}</b> interacts with one or more inactive ingredients in <b>{$_rx1->rx}</b>.";
-        }
+            if(count($activeCatches)) {
+                $output[] = "<b>{$_rx2->rx}</b> interacts with one or more active ingredients in <b>{$_rx1->rx}</b>.";
+            }
+            if(count($inactiveCatches)) {
+                $output[] = "<b>{$_rx2->rx}</b> interacts with one or more inactive ingredients in <b>{$_rx1->rx}</b>.";
+            }
 
-        // TODO: find out and show the names of the actual ingredients causing interaction
+            // TODO: find out and show the names of the actual ingredients causing interaction
 
-        return implode("<br>", $output);
-    }
+            return implode("<br>", $output);
+        }
 
-    private function getActiveDdiCodexFromGcnSeqNo($_gcnSeqNo) {
-        $ddiCodexArray = [];
-        $query = DB::connection('pgsql_fdb')->select("
-SELECT r1.ddi_codex
-FROM RADIMGC4_GCNSEQNO_LINK r1 
-WHERE r1.gcn_seqno = :gcnSeqNo
-            ",
-            ['gcnSeqNo' => $_gcnSeqNo]
-        );
-        if(count($query)) {
-            $ddiCodexArray = array_map(function($_x) {
-                return $_x->ddi_codex;
-            }, $query);
+        private function getActiveDdiCodexFromGcnSeqNo($_gcnSeqNo) {
+            $ddiCodexArray = [];
+            $query = DB::connection('pgsql_fdb')->select("
+    SELECT r1.ddi_codex
+    FROM RADIMGC4_GCNSEQNO_LINK r1 
+    WHERE r1.gcn_seqno = :gcnSeqNo
+                ",
+                ['gcnSeqNo' => $_gcnSeqNo]
+            );
+            if(count($query)) {
+                $ddiCodexArray = array_map(function($_x) {
+                    return $_x->ddi_codex;
+                }, $query);
+            }
+            return $ddiCodexArray;
         }
-        return $ddiCodexArray;
-    }
 
-    private function getNdcFromMedId($_medId) {
-        $ndcArray = [];
-        $query = DB::connection('pgsql_fdb')->select("
-select ndc from rmindc1_ndc_medid where medid = :medId
-            ",
-            ['medId' => $_medId]
-        );
-        if(count($query)) {
-            $ndcArray = array_map(function($_x) {
-                return $_x->ndc;
-            }, $query);
+        private function getNdcFromMedId($_medId) {
+            $ndcArray = [];
+            $query = DB::connection('pgsql_fdb')->select("
+    select ndc from rmindc1_ndc_medid where medid = :medId
+                ",
+                ['medId' => $_medId]
+            );
+            if(count($query)) {
+                $ndcArray = array_map(function($_x) {
+                    return $_x->ndc;
+                }, $query);
+            }
+            return $ndcArray;
         }
-        return $ndcArray;
-    }
 
-    private function getInactiveDdiCodexFromNdc($_ndc) {
-        $ddiCodexArray = [];
-        $query = DB::connection('pgsql_fdb')->select("
-SELECT distinct r1.ddi_codex
-FROM RDDIMIN0_NDC_INACTV_DDIM_LINK r1 
-WHERE r1.ddi_ndc IN (" . implode(',', array_map(function($_x) {return "'" . $_x . "'";}, $_ndc)) . ")
-            "
-        );
-        if(count($query)) {
-            $ddiCodexArray = array_map(function($_x) {
-                return $_x->ddi_codex;
-            }, $query);
+        private function getInactiveDdiCodexFromNdc($_ndc) {
+            $ddiCodexArray = [];
+            $query = DB::connection('pgsql_fdb')->select("
+    SELECT distinct r1.ddi_codex
+    FROM RDDIMIN0_NDC_INACTV_DDIM_LINK r1 
+    WHERE r1.ddi_ndc IN (" . implode(',', array_map(function($_x) {return "'" . $_x . "'";}, $_ndc)) . ")
+                "
+            );
+            if(count($query)) {
+                $ddiCodexArray = array_map(function($_x) {
+                    return $_x->ddi_codex;
+                }, $query);
+            }
+            return $ddiCodexArray;
         }
-        return $ddiCodexArray;
-    }
 
-    private function getDdiCodexMonoxPairs($_ddiCodexArray) {
+        private function getDdiCodexMonoxPairs($_ddiCodexArray) {
         $ddiCodexMonoxPairsArray = [];
         if(count($_ddiCodexArray)) {
             $ddiCodexMonoxPairsArray = DB::connection('pgsql_fdb')->select("
@@ -527,6 +539,7 @@ WHERE r1.ddi_codex IN (" . implode(',', array_map(function($_x) {return "'" . $_
         return $ddiCodexMonoxPairsArray;
     }
 
+    // drug <-> drug coadministration notes
     public function drugCoadministration(Request $request) {
         $gcnSeqnos = $request->input('gcn-seqnos') ? trim($request->input('gcn-seqnos')) : '';
         if (empty($gcnSeqnos)) return '';
@@ -541,6 +554,7 @@ WHERE r1.side_a_gcn_seqno in ($gcnSeqnos) AND r1.side_b_gcn_seqno in ($gcnSeqnos
         return view('app.fdb-pg.fdb-coadministration', compact('coadministration'));
     }
 
+    // duplicate therapy indications
     public function duplicateTherapy(Request $request) {
 
         if($request->input('test')) {
@@ -592,18 +606,18 @@ WHERE r1.side_a_gcn_seqno in ($gcnSeqnos) AND r1.side_b_gcn_seqno in ($gcnSeqnos
             }, $matches)) . "</ol>";
     }
 
-    private function getDptClassFromGcnSeqNo($_gcnSeqNo) {
-        return DB::connection('pgsql_fdb')->select("
-SELECT distinct r1.dpt_class_id, r2.dpt_allowance, r2.dpt_class_desc
-FROM RDPTGC0_GCNSEQNO_LINK r1 
-JOIN RDPTCL0_CLASS_ID r2 on r1.dpt_class_id = r2.dpt_class_id
-WHERE r1.gcn_seqno = :gcnSeqNo
-            ",
-            ['gcnSeqNo' => $_gcnSeqNo]
-        );
-    }
+        private function getDptClassFromGcnSeqNo($_gcnSeqNo) {
+            return DB::connection('pgsql_fdb')->select("
+    SELECT distinct r1.dpt_class_id, r2.dpt_allowance, r2.dpt_class_desc
+    FROM RDPTGC0_GCNSEQNO_LINK r1 
+    JOIN RDPTCL0_CLASS_ID r2 on r1.dpt_class_id = r2.dpt_class_id
+    WHERE r1.gcn_seqno = :gcnSeqNo
+                ",
+                ['gcnSeqNo' => $_gcnSeqNo]
+            );
+        }
 
-    private function compareDPTs($_dptArray1, $_dptArray2) {
+        private function compareDPTs($_dptArray1, $_dptArray2) {
         $output = [];
         for ($i=0; $i<count($_dptArray1); $i++) {
             for ($j=0; $j<count($_dptArray2); $j++) {

+ 1 - 0
app/Http/Controllers/HomeController.php

@@ -616,6 +616,7 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
                 "
 SELECT measurement.uid as uid,
        care_month.uid as care_month_uid,
+       care_month.start_date as care_month_start_date,
        measurement.label,
        measurement.value,
        measurement.sbp_mm_hg,

+ 63 - 0
app/Http/Controllers/PatientController.php

@@ -8,6 +8,7 @@ use App\Models\CareMonth;
 use App\Models\Client;
 use App\Models\ClientBDTDevice;
 use App\Models\ClientInfoLine;
+use App\Models\Erx;
 use App\Models\Facility;
 use App\Models\Handout;
 use App\Models\IncomingReport;
@@ -26,6 +27,9 @@ use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\File;
 
+use Illuminate\Support\Facades\Http;
+use PDF;
+
 class PatientController extends Controller
 {
 
@@ -394,6 +398,10 @@ class PatientController extends Controller
         return view('app.patient.flowsheets', compact('patient', 'pros', 'filter'));
     }
 
+    public function vitalsSettings(Request $request, Client $patient) {
+        return view('app.patient.vitals-settings', compact('patient'));
+    }
+
     public function vitalsGraph(Request $request, Client $patient, $filter = '') {
         $pros = $this->pros;
         return view('app.patient.vitals-graph', compact('patient', 'pros', 'filter'));
@@ -412,6 +420,54 @@ class PatientController extends Controller
         return view('app.patient.tickets', compact('patient', 'pros', 'allPros', 'type', 'currentTicket'));
     }
 
+    public function prescriptions(Request $request, Client $patient, String $type = '', String $currentErx = '') {
+        if(!!$currentErx) {
+            $currentErx = Erx::where('uid', $currentErx)->first();
+        }
+        return view('app.patient.prescriptions.index', compact('patient', 'type', 'currentErx'));
+    }
+
+    public function downloadPrescriptionAsPdf(Request $request, Erx $prescription){
+        if($request->input('html')) {
+            return view('app.patient.prescriptions.pdf.pdf-preview', compact('prescription'));
+        }
+        else {
+            $pdf = PDF::loadView('app.patient.prescriptions.pdf.pdf-preview', compact('prescription'));
+            return $pdf->download($prescription->created_at .'_' . 'erx.pdf');
+        }
+    }
+
+    public function transmitPrescription(Request $request, Erx $prescription){
+
+        // re-generate pdf with cover sheet as first page and save it to FS
+        $filePath = config('app.temp_dir') . "/{$prescription->uid}.pdf";
+        $pdf = PDF::loadView('app.patient.prescriptions.pdf.pdf-preview-with-cover-sheet', compact('prescription'));
+        $pdf->save($filePath);
+
+        // send it along with the rest of the params to /api/erx/transmit [multi-part POST]
+        $url =  config('stag.backendUrl') . '/erx/transmit';
+        $params = [
+            "uid" => $request->input('uid'),
+            "toWho" => $request->input('toWho'),
+            "toEmail" => $request->input('toEmail'),
+            "toFaxNumber" => $request->input('toFaxNumber'),
+            "toFaxNumberAttentionLine" => $request->input('toFaxNumberAttentionLine'),
+            "toFaxNumberCoverSheetMemo" => $request->input('toFaxNumberCoverSheetMemo'),
+        ];
+        if($request->input('copyToPatient')) {
+            $params["copyToPatientFaxNumber"] = $request->input('copyToPatientFaxNumber');
+            $params["copyToPatientEmail"] = $request->input('copyToPatientEmail');
+        }
+        $pdf = fopen($filePath, 'r');
+        $response = Http
+            ::attach('pdfSystemFile', $filePath, "{$prescription->uid}.pdf")
+            ->withHeaders(['sessionKey' => $request->cookie('sessionKey')])
+            ->post($url, $params)
+            ->json();
+        return $response;
+
+    }
+
     public function supplyOrders(Request $request, Client $patient, SupplyOrder $supplyOrder = null)
     {
         $products = Product::where('is_active', true)->orderBy('created_at', 'desc')->get();
@@ -455,4 +511,11 @@ class PatientController extends Controller
     public function accounts(Request $request, Client $patient) {
         return view('app.patient.accounts', compact('patient'));
     }
+
+    public function careMonthMatrix(Request $request, CareMonth $careMonth) {
+        return view('app.patient.care-month.matrix', [
+            'patient' => $careMonth->patient,
+            'careMonth' => $careMonth,
+        ]);
+    }
 }

+ 99 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -1593,6 +1593,66 @@ ORDER BY claim.created_at DESC
         return  view('app.practice-management.process-notes', compact('mode', 'counts'));
     }
 
+    public function notesProcessingCenter(Request  $request) {
+
+        $notes = Note::where('is_cancelled', false);
+
+        // filters
+        $proUid = $request->input('proUid');
+        if($proUid) {
+            $fPro = Pro::where('uid', $proUid)->first();
+            if($fPro) {
+                $notes = $notes->where('hcp_pro_id', $fPro->id);
+            }
+        }
+        $proSigned = $request->input('proSigned');
+        switch($proSigned) {
+            case 'yes': $notes = $notes->where('is_signed_by_hcp', true); break;
+            case 'no': $notes = $notes->where('is_signed_by_hcp', '!=', true); break;
+        }
+        $billingMarkedDone = $request->input('billingMarkedDone');
+        switch($billingMarkedDone) {
+            case 'yes': $notes = $notes->where('is_billing_marked_done', true); break;
+            case 'no': $notes = $notes->where('is_billing_marked_done', '!=', true); break;
+        }
+        $billingClosed = $request->input('billingClosed');
+        switch($billingClosed) {
+            case 'yes': $notes = $notes->where('is_bill_closed', true); break;
+            case 'no': $notes = $notes->where('is_bill_closed', '!=', true); break;
+        }
+        $claimingClosed = $request->input('claimingClosed');
+        switch($claimingClosed) {
+            case 'yes': $notes = $notes->where('is_claim_closed', true); break;
+            case 'no': $notes = $notes->where('is_claim_closed', '!=', true); break;
+        }
+        $allClaimsSubmitted = $request->input('allClaimsSubmitted');
+        if($allClaimsSubmitted) {
+            // TODO
+        }
+        $goodBad = $request->input('goodBad');
+        switch($goodBad) {
+            case 'good': $notes = $notes->whereRaw("(detail_json)::json->>'isBad' = 'false'"); break;
+            case 'bad': $notes = $notes->whereRaw("(detail_json)::json->>'isBad' = 'true'"); break;
+            case 'unclassified': $notes = $notes->whereRaw("(detail_json)::json->>'isBad' is null"); break;
+        }
+        $startDate = $request->input('startDate');
+        if($startDate) {
+            $notes = $notes->where('effective_dateest', '>=', $startDate);
+        }
+        $endDate = $request->input('endDate');
+        if($endDate) {
+            $notes = $notes->where('effective_dateest', '<=', $endDate);
+        }
+        $mcPartB = $request->input('mcPartB');
+        if($mcPartB) {
+            // TODO
+        }
+
+        $notes = $notes->orderBy('effective_dateest')->paginate();
+
+        return  view('app.practice-management.notes-processing-center', compact('notes'));
+    }
+
     public function getNextNote(Request $request, $mode)
     {
         $note = null;
@@ -1829,4 +1889,43 @@ ORDER BY claim.created_at DESC
 
     }
 
+    public function careMonthReport(Request $request) {
+        $m = $request->input('m');
+        $y = $request->input('y');
+        if(!$m || !$y) {
+            $date = date('Y-m-01');
+        }
+        else {
+            $date = date('Y-m-d', strtotime("$m/1/$y"));
+        }
+
+        $pro = $this->pro;
+
+        $records = DB::select("
+SELECT cm.id                                as care_month_id,
+       cm.uid                               as care_month_uid,
+       c.id                                 as client_id,
+       c.uid                                as client_uid,
+       cm.number_of_days_with_remote_measurements,
+       cm.rm_total_time_in_seconds_by_mcp,
+       cm.rm_total_time_in_seconds_by_rme_pro,
+       cm.rm_total_time_in_seconds_by_rmm_pro,
+       cm.mcp_pro_id,
+       cm.rme_pro_id,
+       cm.rmm_pro_id,
+       (c.name_first || ' ' || c.name_last) as client_name
+FROM care_month cm
+         JOIN client c on cm.client_id = c.id
+WHERE cm.start_date = :startDate
+  AND (cm.mcp_pro_id = :proID OR
+       cm.rme_pro_id = :proID OR
+       cm.rmm_pro_id = :proID)
+ORDER BY c.name_last, c.name_first
+            ",
+            ['startDate' => $date, 'proID' => $pro->id]
+        );
+
+        return view('app.practice-management.care-month-report', compact('records', 'date'));
+    }
+
 }

+ 67 - 0
app/Models/Client.php

@@ -69,6 +69,12 @@ class Client extends Model
             ->orderBy('effective_dateest', 'desc');
     }
 
+    public function prescriptions()
+    {
+        return $this->hasMany(Erx::class, 'client_id', 'id')
+            ->orderBy('created_at', 'desc');
+    }
+
     public function notesAscending()
     {
         return $this->hasMany(Note::class, 'client_id', 'id')
@@ -645,4 +651,65 @@ class Client extends Model
         $notes = $notes->orderBy('effective_dateest', 'DESC')->limit(5)->get();
         return $notes;
     }
+
+    public function cmMeasurementsMatrix($_careMonth = null) {
+
+        $days = [];
+
+        $matches = DB::select(
+            "
+SELECT m.id   AS measurement_id,
+       m.uid  AS measurement_uid,
+       cm.id  AS care_month_id,
+       cm.uid AS care_month_uid,
+       m.label,
+       m.value,
+       m.dbp_mm_hg,
+       m.sbp_mm_hg,
+       m.value_pulse,
+       m.value_irregular,
+       m.numeric_value,
+       m.effective_date,
+       m.ts,
+       m.has_been_stamped_by_mcp,
+       m.has_been_stamped_by_non_hcp
+FROM measurement m
+         JOIN care_month cm ON m.care_month_id = cm.id
+WHERE m.care_month_id = :careMonthID
+        AND m.label NOT IN ('SBP', 'DBP')
+        AND m.bdt_measurement_id IS NOT NULL
+        AND m.is_removed IS FALSE
+        AND (m.is_cellular_zero = FALSE or m.is_cellular_zero IS NULL)
+        AND m.ts IS NOT NULL
+        AND m.client_bdt_measurement_id IS NOT NULL
+ORDER BY m.effective_date
+            ",
+            ['careMonthID' => $_careMonth->id]
+        );
+
+        foreach ($matches as $match) {
+            $time = (floor($match->ts / 1000));
+            $realTimezone = resolve_timezone('EASTERN');
+            $date = new \DateTime("@$time");
+            $date->setTimezone(new \DateTimeZone($realTimezone));
+            $match->date = $date->format("m/d/Y");
+            $match->dateYMD = $date->format("Y-m-d");
+            $match->time = $date->format("h:i A");
+
+            // get existing entries for listing
+            $match->entries = CareMonthEntry::where('care_month_id', $match->care_month_id)
+                ->where('is_removed', false)
+                ->where('effective_date', $match->dateYMD)
+                ->orderBy('created_at')
+                ->get();
+
+            if(!isset($days[$match->date])) {
+                $days[$match->date] = [];
+            }
+            $days[$match->date][] = $match;
+        }
+
+        return $days;
+
+    }
 }

+ 31 - 0
app/Models/Erx.php

@@ -0,0 +1,31 @@
+<?php
+
+namespace App\Models;
+
+# use Illuminate\Database\Eloquent\Model;
+
+class Erx extends Model
+{
+    protected $table = "erx";
+
+    public function managerPro(){
+        return $this->hasOne(Pro::class, 'id', 'manager_pro_id');
+    }
+
+    public function hcpPro(){
+        return $this->hasOne(Pro::class, 'id', 'hcp_pro_id');
+    }
+
+    public function patient(){
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
+
+    public function client(){
+        return $this->hasOne(Client::class, 'id', 'client_id');
+    }
+
+    public function note(){
+        return $this->hasOne(Note::class, 'id', 'note_id');
+    }
+
+}

+ 5 - 0
app/Models/NotePickupForProcessing.php

@@ -13,4 +13,9 @@ class NotePickupForProcessing extends Model
         return $this->hasOne(Pro::class, 'id', 'pro_id');
     }
 
+    public function note()
+    {
+        return $this->hasOne(Note::class, 'id', 'note_id');
+    }
+
 }

+ 4 - 0
app/Models/Pro.php

@@ -582,4 +582,8 @@ class Pro extends Model
         return $this->hasOne(CompanyPro::class, 'id', 'default_company_pro_id');
     }
 
+    public function currentNotePickupForProcessing() {
+        return $this->hasOne(NotePickupForProcessing::class, 'id', 'current_note_pickup_for_processing_id');
+    }
+
 }

+ 3 - 1
config/app.php

@@ -65,7 +65,9 @@ return [
 
     'hrm2_url' => env('HRM2_URL'),
 
-    'asset_version' => 6,
+    'asset_version' => 8,
+
+    'temp_dir' => env('TEMP_DIR'),
 
     /*
     |--------------------------------------------------------------------------

+ 23 - 1
public/css/style.css

@@ -292,6 +292,9 @@ body>nav.navbar {
 .mcp-theme-1 .width-50px {
     width: 50px !important;
 }
+.mcp-theme-1 .width-60px {
+    width: 60px !important;
+}
 .mcp-theme-1 .width-70px {
     width: 70px !important;
 }
@@ -1018,6 +1021,9 @@ body .node input[type="number"] {
     padding: 0.75rem;
     min-height: 220px;
 }
+.stag-popup.min-height-unset>form {
+    min-height: unset !important;
+}
 .stag-popup.wide>form, .stag-popup.wide>.stag-popup-content {
     width: calc(100% - 4rem);
 }
@@ -1521,7 +1527,7 @@ button.note-templates-trigger-assessment {
 .collapsible-tbody.collapsed {
     display: none;
 }
-#send-fax-pdf-preview {
+#send-fax-pdf-preview, #transmit-pdf-preview {
     max-height: 350px;
     overflow: auto;
     box-shadow: 0 0 2px #ccc;
@@ -1880,4 +1886,20 @@ table.dashboard-stats-table th {
 }
 .min-height-500px {
     min-height: 500px;
+}
+.inline-html-container p {
+    margin-bottom: 0;
+}
+body.in-iframe>.navbar {
+    display: none !important;
+}
+body.in-iframe .stag-content {
+    padding-top: 0 !important;
+}
+body.in-iframe .main-row > .sidebar {
+    top: 0;
+    height: 100%;
+}
+.stag-popup .hide-inside-popup {
+    display: none !important;
 }

+ 6 - 1
public/js/mc.js

@@ -231,7 +231,7 @@ function fastLoad(_href, _history = true, _useCache = true, _replaceState = fals
     if (_href === '') _href = '/';
 
     // push state
-    if (_history) {
+    if (_history && window.parent === window.top) {
         var target = _href;
         if (target.indexOf('//') !== -1) {
             target = target.split('//')[1];
@@ -248,6 +248,11 @@ function fastLoad(_href, _history = true, _useCache = true, _replaceState = fals
         }
     }
 
+    // dont show top nav if in iframe
+    if(window !== window.top && window.parent !== window.top) {
+        $('body').addClass('in-iframe');
+    }
+
     if (_useCache && !!fastCache[_href]) {
         onFastLoaded(fastCache[_href], _href, _history);
     } else {

+ 11 - 0
resources/views/app/dashboard/measurements.blade.php

@@ -42,6 +42,7 @@
                             0
                         @endif
                     </td>
+                    <?php /*
                     <td colspan="px-2">
                         <?php
                         $stampEndPoint = '';
@@ -104,6 +105,16 @@
                             </div>
                         @endif
                     </td>
+                    */ ?>
+                    <td class="px-2">
+                        <a native target="_blank"
+                           open-in-stag-popup
+                           update-parent
+                           title="Care Month Matrix: {{date('M Y', strtotime($measurement->care_month_start_date))}}"
+                           href="/patient-care-month-matrix/{{$measurement->care_month_uid}}">
+                            View &amp; Stamp
+                        </a>
+                    </td>
                 </tr>
             <?php endforeach ?>
         @else

+ 254 - 0
resources/views/app/patient/care-month/_matrix.blade.php

@@ -0,0 +1,254 @@
+<?php
+$days = $patient->cmMeasurementsMatrix($careMonth);
+
+$performerRole = false;
+if ($pro->pro_type === 'ADMIN') {
+    $performerRole = 'ADMIN';
+} else if ($careMonth->mcp_pro_id === $pro->id) {
+    $performerRole = 'MCP';
+} else if ($careMonth->rme_pro_id === $pro->id || $careMonth->rmm_pro_id === $pro->id) {
+    $performerRole = 'NON-HCP';
+}
+
+$unstampedMCP = [];
+$unstampedNonHCP = [];
+foreach ($days as $k => $day) {
+    $unstampedMCP[$k] = [];
+    $unstampedNonHCP[$k] = [];
+    foreach ($days[$k] as $mIndex => $m) {
+        if(!$m->has_been_stamped_by_mcp) {
+            $unstampedMCP[$k][] = $m->measurement_uid;
+        }
+        if(!$m->has_been_stamped_by_non_hcp) {
+            $unstampedNonHCP[$k][] = $m->measurement_uid;
+        }
+    }
+}
+
+?>
+<p class="font-weight-bold">Care Month Matrix</p>
+<table class="table table-condensed table-sm table-bordered mt-2 mb-3">
+    <thead>
+    <tr>
+        <th class="px-2 text-secondary align-bottom" rowspan="2">Date</th>
+        <th class="px-2 text-secondary border-bottom-0" colspan="4">Measurements</th>
+        <th class="px-2 text-secondary align-bottom" rowspan="2">{{$performerRole === 'ADMIN' ? 'Stamp Status' : 'Stamp + Entry'}}</th>
+        <th class="px-2 text-secondary" rowspan="2">Entries</th>
+    </tr>
+    <tr>
+        <th class="text-secondary text-sm">Time</th>
+        <th class="text-secondary text-sm">Type</th>
+        <th class="text-secondary text-sm">Value</th>
+        <th class="text-secondary text-sm">Stamp</th>
+    </tr>
+    </thead>
+    <tbody>
+    @foreach($days as $k => $day)
+        @foreach($days[$k] as $mIndex => $m)
+        <tr>
+            @if($mIndex === 0)
+                <td rowspan="{{count($days[$k])}}">
+                    {{$k}}
+                </td>
+            @endif
+            <td>{{$m->time}}</td>
+            <td>
+                @if($m->label === 'BP')
+                    BP
+                @elseif($m->label === 'Wt. (lbs.)')
+                    Weight
+                @endif
+            </td>
+            <td>
+                @if($m->label === 'BP')
+                    {{ $m->sbp_mm_hg }}/{{ $m->dbp_mm_hg }}
+                @elseif($m->label === 'Wt. (lbs.)')
+                    {{ round(floatval($m->numeric_value), 2) }} lbs
+                @endif
+            </td>
+            <td>
+                @if($performerRole === 'MCP')
+                    <div class="width-100px">
+                        @if($m->has_been_stamped_by_mcp)
+                            <span class="text-secondary text-sm">
+                                <i class="fa fa-check"></i>
+                                Stamped
+                            </span>
+                        @else
+                            <div moe relative>
+                                <a href="#" start show>Stamp</a>
+                                <form url="/api/measurement/stampAsMcp" right class="width-300px">
+                                    <input type="hidden" name="uid" value="{{$m->measurement_uid}}">
+                                    <p class="mb-1">Stamp this measurement?</p>
+                                    <div class="mt-2 bg-light border p-2">
+                                        <div class="mb-1 text-secondary">{{ $m->label }}</div>
+                                        <div class="font-weight-bold mb-1">
+                                            @if($m->label === 'BP')
+                                                {{ round($m->sbp_mm_hg, 2) }}/{{ round($m->dbp_mm_hg, 2) }} mmHg
+                                                <span class="font-weight-normal d-inline-block pl-2">Pulse:</span>
+                                                {{ $m->value_pulse }} {{ $m->value_irregular === 0?'Irregular':'' }} {{ $m->value_irregular === 1?'Regular':'' }}
+                                            @elseif($m->label === 'Wt. (lbs.)')
+                                                {{ round($m->numeric_value, 2) }} lbs
+                                            @else
+                                                {{ $m->value }}
+                                            @endif
+                                        </div>
+                                        <div class="text-sm">
+                                            {{ $m->date }} {{ $m->time }} EST
+                                        </div>
+                                    </div>
+                                    <div class="mb-2 border border-info p-2 mt-2 bg-light">
+                                        <span>I have had interactive communication with <b>{{$patient->displayName()}}</b> during this care month.</span>
+                                        <div class="d-flex border-top mt-2">
+                                            <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
+                                                <input type="radio" class="mr-2" name="communicatedToPatient" value="true" required>
+                                                <span>Yes</span>
+                                            </label>
+                                            <label class="mt-2 mb-0 d-inline-flex align-items-center">
+                                                <input type="radio" class="mr-2" name="communicatedToPatient" value="false" checked required>
+                                                <span>No</span>
+                                            </label>
+                                        </div>
+                                    </div>
+                                    <div class="mb-2">
+                                        <label class="mb-1 text-secondary text-sm">Memo</label>
+                                        <textarea class="form-control form-control-sm" name="memo"></textarea>
+                                    </div>
+                                    <div class="form-group m-0">
+                                        <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
+                                        <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                                    </div>
+                                </form>
+                            </div>
+                        @endif
+                    </div>
+                @elseif($performerRole === 'NON-MCP')
+                    <div class="width-100px">
+                        @if($m->has_been_stamped_by_non_hcp)
+                            <span class="text-secondary text-sm">
+                                <i class="fa fa-check"></i>
+                                Stamped
+                            </span>
+                        @endif
+                    </div>
+                @endif
+            </td>
+            @if($mIndex === 0)
+                <td rowspan="{{count($days[$k])}}">
+                    @if($performerRole === 'ADMIN')
+                        <div class="my-1">
+                            <span class="text-secondary">MCP Unstamped:</span>
+                            <b class="{{count($unstampedMCP[$k]) ? '' : 'text-secondary font-weight-normal'}}">{{count($unstampedMCP[$k])}}</b>
+                        </div>
+                        <div class="">
+                            <span class="text-secondary">Non-HCP Unstamped:</span>
+                            <b class="{{count($unstampedNonHCP[$k]) ? '' : 'text-secondary font-weight-normal'}}">{{count($unstampedNonHCP[$k])}}</b>
+                        </div>
+                    @elseif($performerRole === 'MCP')
+                        @if(count($unstampedMCP[$k]))
+                            <div moe relative class="btn-stamp-all">
+                                <a href="#" start show class="">
+                                    Stamp All &amp; Create Entry
+                                </a>
+                                <form url="/api/measurement/bulkStampAsMcp">
+                                    <input type="hidden" name="measurementUids" value="{{implode('|', $unstampedMCP[$k])}}">
+                                    <p class="mb-1">Stamp all measurements?</p>
+                                    <div class="mb-2 border border-info p-2 mt-2 bg-light width-300px">
+                                        <span>I have had interactive communication with <b>{{$patient->displayName()}}</b> during this care month.</span>
+                                        <div class="d-flex border-top mt-2">
+                                            <label class="mt-2 mb-0 d-inline-flex align-items-center mr-3">
+                                                <input type="radio" class="mr-2" name="communicatedToPatient" value="true" required>
+                                                <span>Yes</span>
+                                            </label>
+                                            <label class="mt-2 mb-0 d-inline-flex align-items-center">
+                                                <input type="radio" class="mr-2" name="communicatedToPatient" value="false" checked required>
+                                                <span>No</span>
+                                            </label>
+                                        </div>
+                                    </div>
+                                    <div class="mb-2">
+                                        <label class="mb-1 text-secondary text-sm">Memo</label>
+                                        <textarea class="form-control form-control-sm" name="memo"></textarea>
+                                    </div>
+                                    <div class="mb-2">
+                                        <label class="mb-1 text-secondary text-sm">Minutes</label>
+                                        <input type="number" min="1" max="15" class="form-control form-control-sm w-100" name="entryMinutes"
+                                               value="2" placeholder="Time (mins.)" required>
+                                    </div>
+                                    <div class="form-group m-0">
+                                        <button submit class="btn btn-primary btn-sm mr-2">Submit</button>
+                                        <button cancel class="btn btn-default border btn-sm mr-2">Cancel</button>
+                                    </div>
+                                </form>
+                            </div>
+                        @else
+                            <span class="text-secondary text-sm d-flex align-items-center">
+                                <i class="fa fa-check mr-2"></i>
+                                <span>All Stamped</span>
+                            </span>
+                        @endif
+                    @elseif($performerRole === 'NON-MCP')
+                    @endif
+                </td>
+                <td rowspan="{{count($days[$k])}}">
+                    @foreach($m->entries as $entry)
+                        <div class="my-1 d-flex align-items-start flex-nowrap">
+                            <b class="mr-2">{{round($entry->time_in_seconds / 60)}}m</b>
+                            <span class="text-secondary mr-2 text-nowrap text-sm">({{date('h:i a', strtotime($entry->created_at))}})</span>
+                            <span class="text-secondary inline-html-container flex-grow-1">{!! $entry->content_text !!}</span>
+                        </div>
+                    @endforeach
+                    @if($performerRole === 'MCP' || $performerRole === 'NON-HCP')
+                        <div moe large>
+                            <a start show class="py-0 mb-3 text-sm">+ Add</a>
+                            <form url="/api/careMonthEntry/createForRm">
+                                <input type="hidden" name="careMonthUid" value="{{ $careMonth->uid }}">
+                                <div class="mb-2">
+                                    <div class="row">
+                                        <div class="col-4 pr-0">
+                                            <select class="form-control form-control-sm w-100" name="proUid" provider-search data-pro-uid="{{ @$pro->uid }}"
+                                                    required>
+                                                <option value="">-- Select Pro --</option>
+                                            </select>
+                                        </div>
+                                        <div class="col-4 pr-0">
+                                            <?php
+                                            $sD = strtotime($careMonth->start_date);
+                                            $y = date('Y', $sD);
+                                            $m0 = date('m', $sD);
+                                            $d = date('t', $sD);
+                                            $yCurrent = date('Y');
+                                            $mCurrent = date('m');
+                                            ?>
+                                            <input autofocus type="date" min="{{ date($y . '-' . $m0 . '-01') }}" max="{{ date($y . '-' . $m0 . '-' . $d) }}"
+                                                   value="{{$m->dateYMD}}"
+                                                   class="form-control form-control-sm w-100" name="effectiveDate"
+                                                   placeholder="Effective Date" required>
+                                        </div>
+                                        <div class="col-4">
+                                            <input type="number" min="0" max="15" class="form-control form-control-sm w-100 cm-time-value" name="timeInMinutes"
+                                                   value="2" placeholder="Time (mins.)" required>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="mb-2">
+                                    <div class="row">
+                                        <div class="col-12">
+                                            <div cm-rte data-content="Reviewed/managed patient measurements" data-name="contentText"></div>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </div>
+                    @endif
+                </td>
+            @endif
+        </tr>
+        @endforeach
+    @endforeach
+    </tbody>
+</table>

+ 4 - 3
resources/views/app/patient/care-month/dashboard.blade.php

@@ -387,7 +387,9 @@
                         </div>
                     </div>
 
-                    <table class="table table-striped table-sm table-bordered mt-2 mb-0">
+                    @include('app.patient.care-month._matrix')
+
+                    <table class="table table-striped table-sm table-bordered mt-2 mb-0 d-none">
                         <thead>
                         <tr>
                             <th class="px-2 text-secondary">Effective Date</th>
@@ -596,9 +598,8 @@
             </div>
         </div> --}}
 
-        <hr class="m-negator mt-4 mb-3">
-
         @if($pro->pro_type === 'ADMIN')
+            <hr class="m-negator mt-4 mb-3">
             <div class="pb-3 screen-only">
                 <div class="ml-auto d-flex align-items-center">
 

+ 5 - 0
resources/views/app/patient/care-month/matrix.blade.php

@@ -0,0 +1,5 @@
+@extends ('layouts.patient')
+
+@section('inner-content')
+    @include('app.patient.care-month._matrix')
+@endsection

+ 9 - 0
resources/views/app/patient/care-months.blade.php

@@ -112,6 +112,7 @@
                 <th class="px-2 text-secondary border-bottom-0">MCP</th>
                 <th class="px-2 text-secondary border-bottom-0">RMM</th>
                 <th class="px-2 text-secondary border-bottom-0">RME</th>
+                <th class="px-2 text-secondary border-bottom-0">Matrix</th>
             </tr>
             </thead>
             <tbody>
@@ -133,6 +134,14 @@
                     <td class="px-2">{{$careMonth->mcp ? $careMonth->mcp->name_display : '-'}}</td>
                     <td class="px-2">{{$careMonth->rmmPro ? $careMonth->rmmPro->name_display : '-'}}</td>
                     <td class="px-2">{{$careMonth->rmePro ? $careMonth->rmePro->name_display : '-'}}</td>
+                    <td class="px-2">
+                        <a native target="_blank"
+                           open-in-stag-popup
+                           title="Care Month Matrix: {{date('M Y', strtotime($careMonth->start_date))}}"
+                           href="/patient-care-month-matrix/{{$careMonth->uid}}">
+                            View
+                        </a>
+                    </td>
                 </tr>
             @endforeach
             </tbody>

+ 32 - 0
resources/views/app/patient/prescriptions/client-status-form.blade.php

@@ -0,0 +1,32 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1 min-height-unset" stag-popup-key="client-status-popup">
+    <form method="POST" action="" class="overflow-visible">
+        <h3 class="stag-popup-title mb-2">
+            <span>Client Declared Status</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Status</label>
+            <select class="form-control form-control-sm min-width-unset erx-hcp-pro-select"
+                    v-model="currentPrescriptionClientStatus.status">
+                <option value="">-- select --</option>
+                <option value="CREATED">Created</option>
+                <option value="SENT">Sent</option>
+                <option value="RECEIVED_BY_CLIENT">Received by client</option>
+                <option value="RECEIPT_CONFIRMED_BY_FACILITY">Receipt confirmed by facility</option>
+                <option value="CANCELLED">Cancelled</option>
+            </select>
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Memo</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescriptionClientStatus.memo">
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="saveClientStatus()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 73 - 0
resources/views/app/patient/prescriptions/drug-form.blade.php

@@ -0,0 +1,73 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="prescription-popup-DRUG">
+    <form method="POST" action="">
+        <h3 class="stag-popup-title mb-2">
+            <span>Drug Prescription</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Drug</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_DRUG.clinicalDetailJson.medication">
+        </div>
+        <div class="row">
+            <div class="col-6 pr-0">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">Strength</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescription_DRUG.clinicalDetailJson.strength">
+                </div>
+            </div>
+            <div class="col-6">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">Amount</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescription_DRUG.clinicalDetailJson.amount">
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-6 pr-0">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">Route</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescription_DRUG.clinicalDetailJson.route">
+                </div>
+            </div>
+            <div class="col-6">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">Frequency</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescription_DRUG.clinicalDetailJson.frequency">
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-6 pr-0">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">Dispense</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescription_DRUG.clinicalDetailJson.dispense">
+                </div>
+            </div>
+            <div class="col-6">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">Refills</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescription_DRUG.clinicalDetailJson.refills">
+                </div>
+            </div>
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Purpose</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_DRUG.clinicalDetailJson.purpose">
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="savePrescription()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 23 - 0
resources/views/app/patient/prescriptions/hcp-pro-form.blade.php

@@ -0,0 +1,23 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1 min-height-unset" stag-popup-key="hcp-pro-popup">
+    <form method="POST" action="" class="overflow-visible">
+        <h3 class="stag-popup-title mb-2">
+            <span>HCP Pro</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">HCP Pro</label>
+            <select class="form-control form-control-sm min-width-unset erx-hcp-pro-select"
+                    provider-search
+                    :data-pro-uid="currentPrescriptionHcpPro.newHcpProUid ?? ''"
+                    v-model="currentPrescriptionHcpPro.newHcpProUid">
+            </select>
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="saveHcpPro()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 30 - 0
resources/views/app/patient/prescriptions/imaging-form.blade.php

@@ -0,0 +1,30 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="prescription-popup-IMAGING">
+    <form method="POST" action="">
+        <h3 class="stag-popup-title mb-2">
+            <span>Imaging Prescription</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Test</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_IMAGING.clinicalDetailJson.test">
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">ICDS</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_IMAGING.clinicalDetailJson.icds">
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Memo</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_IMAGING.clinicalDetailJson.memo">
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="savePrescription()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 772 - 0
resources/views/app/patient/prescriptions/index.blade.php

@@ -0,0 +1,772 @@
+@extends ('layouts.patient')
+
+@section('inner-content')
+    <div id="prescriptions-{{$patient->id}}">
+        <div class="d-flex align-items-baseline py-2">
+            <h6 class="my-0 font-weight-bold text-secondary font-size-14">Prescriptions</h6>
+            <span class="mx-2 text-secondary on-hover-opaque">|</span>
+            <a href="#" v-on:click.prevent="newPrescription('DRUG')">+ Drug</a>
+            <span class="mx-2 text-secondary on-hover-opaque">|</span>
+            <a href="#" v-on:click.prevent="newPrescription('LAB')">+ Lab</a>
+            <span class="mx-2 text-secondary on-hover-opaque">|</span>
+            <a href="#" v-on:click.prevent="newPrescription('IMAGING')">+ Imaging</a>
+            <span class="mx-2 text-secondary on-hover-opaque">|</span>
+            <a href="#" v-on:click.prevent="newPrescription('REFERRAL')">+ Referral</a>
+            <span class="mx-2 text-secondary on-hover-opaque">|</span>
+            <a href="#" v-on:click.prevent="newPrescription('SUPPLY')">+ Supply</a>
+            <span class="mx-2 text-secondary on-hover-opaque">|</span>
+            <a href="#" v-on:click.prevent="newPrescription('OTHER')">+ Other</a>
+        </div>
+        <div class="d-flex align-items-start">
+            <table class="table table-striped table-sm table-bordered mb-0 flex-grow-1">
+                <thead>
+                <tr>
+                    <th class="px-2 text-secondary border-bottom-0">Created</th>
+                    <th class="px-2 text-secondary border-bottom-0">Type</th>
+                    <th class="px-2 text-secondary border-bottom-0">Clinical</th>
+                    <th class="px-2 text-secondary border-bottom-0">Prescriber</th>
+                    <th class="px-2 text-secondary border-bottom-0">Sign</th>
+                </tr>
+                </thead>
+                <tbody>
+                <tr v-for="(prescription, index) in prescriptions" :class="currentPrescription && currentPrescription.id === prescription.id ? 'bg-aliceblue' : ''">
+                    <td class="px-2">
+                        <a href="#" v-on:click.prevent="currentPrescription=prescription"
+                           :class="currentPrescription && currentPrescription.id === prescription.id ? 'font-weight-bold' : ''">@{{prescription.created_at_friendly_short}}</a>
+                    </td>
+                    <td class="px-2">@{{prescription.erx_category}}</td>
+                    <td class="px-2">
+                        <div class="d-flex align-items-baseline">
+                            {{--
+                            <a v-if="!prescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editClinicalDetails(prescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
+                            <span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
+                            --}}
+                            <div v-if="prescription.clinical_detail_json" class="d-inline-flex align-items-baseline">
+                                <div class="d-flex align-items-baseline" v-if="prescription.erx_category === 'DRUG'">
+                                    <b class="mr-2">@{{prescription.clinical_detail_json.medication ?? '-'}}</b>
+                                    <span class="text-secondary mr-1">@{{prescription.clinical_detail_json.strength ?? '-'}}</span>
+                                    <span class="text-secondary mr-1">@{{prescription.clinical_detail_json.amount ?? '-'}}</span>
+                                    <span class="text-secondary mr-1">@{{prescription.clinical_detail_json.route ?? '-'}}</span>
+                                </div>
+                                <div class="d-flex align-items-baseline" v-if="prescription.erx_category === 'LAB' || prescription.erx_category === 'IMAGING'">
+                                    <b class="mr-2">@{{prescription.clinical_detail_json.test ?? '-'}}</b>
+                                    <span class="text-secondary mr-1">@{{prescription.clinical_detail_json.icds ?? '-'}}</span>
+                                </div>
+                                <div class="d-flex align-items-baseline" v-if="prescription.erx_category === 'REFERRAL'">
+                                    <b class="mr-2">@{{prescription.clinical_detail_json.to ?? '-'}}</b>
+                                    <span class="text-secondary mr-1">@{{prescription.clinical_detail_json.memo ?? '-'}}</span>
+                                </div>
+                                <div class="d-flex align-items-baseline" v-if="prescription.erx_category === 'SUPPLY'">
+                                    <b class="mr-2">@{{prescription.clinical_detail_json.item ?? '-'}}</b>
+                                    <span class="text-secondary mr-1">@{{prescription.clinical_detail_json.quantity ?? '-'}}</span>
+                                </div>
+                                <div class="d-flex align-items-baseline" v-if="prescription.erx_category === 'OTHER'">
+                                    <b class="mr-2">@{{prescription.clinical_detail_json.title ?? '-'}}</b>
+                                    <span class="text-secondary mr-1">@{{prescription.clinical_detail_json.memo ?? '-'}}</span>
+                                </div>
+                            </div>
+                            <div v-else>-</div>
+                        </div>
+                    </td>
+                    <td class="px-2">
+                        <div class="d-flex align-items-baseline">
+                            {{--
+                            <a v-if="!prescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editHcpPro(prescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
+                            <span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
+                            --}}
+                            <div>@{{prescription.hcpProDisplayName}}</div>
+                        </div>
+                    </td>
+                    <td class="px-2">
+                        <div v-if="prescription.has_hcp_pro_signed" class="d-flex align-items-baseline">
+                            <i class="text-secondary fa fa-check mr-1"></i>
+                            <span class="text-secondary">Signed</span>
+                        </div>
+                        {{--
+                        <div v-else>
+                            <a v-if="prescription.hcp_pro_id === {{$pro->id}}"
+                               href="#"
+                               v-on:click.prevent="signAsHcpPro(prescription)">Sign</a>
+                            <span v-else>-</span>
+                        </div>
+                        --}}
+                    </td>
+                </tr>
+                </tbody>
+            </table>
+            <div v-if="currentPrescription" class="min-width-500px ml-2 border align-self-stretch p-3">
+                <div class="d-flex align-items-center">
+                    <h3 class="font-size-16 m-0">
+                        <div v-if="currentPrescription.clinical_detail_json" class="d-inline-flex align-items-baseline">
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'DRUG'">
+                                <b class="mr-2 font-size-16">@{{currentPrescription.clinical_detail_json.medication ?? '-'}}</b>
+                                <span class="text-secondary mr-1 font-size-16">@{{currentPrescription.clinical_detail_json.strength ?? '-'}}</span>
+                                <span class="text-secondary mr-1 font-size-16">@{{currentPrescription.clinical_detail_json.amount ?? '-'}}</span>
+                                <span class="text-secondary mr-1 font-size-16">@{{currentPrescription.clinical_detail_json.route ?? '-'}}</span>
+                            </div>
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'LAB' || currentPrescription.erx_category === 'IMAGING'">
+                                <b class="mr-2 font-size-16">@{{currentPrescription.clinical_detail_json.test ?? '-'}}</b>
+                                <span class="text-secondary mr-1 font-size-16">@{{currentPrescription.clinical_detail_json.icds ?? '-'}}</span>
+                            </div>
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'REFERRAL'">
+                                <b class="mr-2 font-size-16">@{{currentPrescription.clinical_detail_json.to ?? '-'}}</b>
+                                <span class="text-secondary mr-1 font-size-16">@{{currentPrescription.clinical_detail_json.memo ?? '-'}}</span>
+                            </div>
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'SUPPLY'">
+                                <b class="mr-2 font-size-16">@{{currentPrescription.clinical_detail_json.item ?? '-'}}</b>
+                                <span class="text-secondary mr-1 font-size-16">@{{currentPrescription.clinical_detail_json.quantity ?? '-'}}</span>
+                            </div>
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'OTHER'">
+                                <b class="mr-2 font-size-16">@{{currentPrescription.clinical_detail_json.title ?? '-'}}</b>
+                                <span class="text-secondary mr-1 font-size-16">@{{currentPrescription.clinical_detail_json.memo ?? '-'}}</span>
+                            </div>
+                        </div>
+                        <div v-else>-</div>
+                    </h3>
+                    <a class="ml-auto" href="#" v-on:click.prevent="currentPrescription=null">
+                        <i class="fa fa-times-circle on-hover-opaque"></i>
+                    </a>
+                </div>
+                <hr class="my-3">
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">Created</span>
+                    <span>@{{currentPrescription.created_at_friendly}}</span>
+                </div>
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">Type</span>
+                    <span>@{{currentPrescription.erx_category}}</span>
+                </div>
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">Clinical</span>
+                    <div class="d-inline-flex align-items-baseline flex-grow-1">
+                        <a v-if="!currentPrescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editClinicalDetails(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
+                        <span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
+                        <div v-if="currentPrescription.clinical_detail_json" class="d-inline-flex align-items-baseline">
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'DRUG'">
+                                <b class="mr-2">@{{currentPrescription.clinical_detail_json.medication ?? '-'}}</b>
+                                <span class="text-secondary mr-1">@{{currentPrescription.clinical_detail_json.strength ?? '-'}}</span>
+                                <span class="text-secondary mr-1">@{{currentPrescription.clinical_detail_json.amount ?? '-'}}</span>
+                                <span class="text-secondary mr-1">@{{currentPrescription.clinical_detail_json.route ?? '-'}}</span>
+                            </div>
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'LAB' || currentPrescription.erx_category === 'IMAGING'">
+                                <b class="mr-2">@{{currentPrescription.clinical_detail_json.test ?? '-'}}</b>
+                                <span class="text-secondary mr-1">@{{currentPrescription.clinical_detail_json.icds ?? '-'}}</span>
+                            </div>
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'REFERRAL'">
+                                <b class="mr-2">@{{currentPrescription.clinical_detail_json.to ?? '-'}}</b>
+                                <span class="text-secondary mr-1">@{{currentPrescription.clinical_detail_json.memo ?? '-'}}</span>
+                            </div>
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'SUPPLY'">
+                                <b class="mr-2">@{{currentPrescription.clinical_detail_json.item ?? '-'}}</b>
+                                <span class="text-secondary mr-1">@{{currentPrescription.clinical_detail_json.quantity ?? '-'}}</span>
+                            </div>
+                            <div class="d-flex align-items-baseline" v-if="currentPrescription.erx_category === 'OTHER'">
+                                <b class="mr-2">@{{currentPrescription.clinical_detail_json.title ?? '-'}}</b>
+                                <span class="text-secondary mr-1">@{{currentPrescription.clinical_detail_json.memo ?? '-'}}</span>
+                            </div>
+                        </div>
+                        <div v-else>-</div>
+                    </div>
+                </div>
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">Logistics</span>
+                    <div class="d-inline-flex align-items-baseline flex-grow-1">
+                        <a class="mr-2" href="#" v-on:click.prevent="editLogisticsDetails(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
+                        <div v-if="currentPrescription.logistics_detail_json" class="d-flex align-items-baseline">
+                            <div class="d-flex align-items-baseline">
+                                <b class="mr-2">@{{currentPrescription.logistics_detail_json.facilityName ?? '-'}}</b>
+                                <span class="text-secondary mr-1">@{{currentPrescription.logistics_detail_json.facilityCity ?? '-'}}</span>
+                                <span class="text-secondary mr-1">@{{currentPrescription.logistics_detail_json.facilityState ?? '-'}}</span>
+                            </div>
+                        </div>
+                        <div v-else>-</div>
+                    </div>
+                </div>
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">HCP Pro</span>
+                    <div class="d-inline-flex align-items-baseline flex-grow-1">
+                        <a v-if="!currentPrescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editHcpPro(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
+                        <span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
+                        <div>@{{currentPrescription.hcpProDisplayName}}</div>
+                    </div>
+                </div>
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">Sign</span>
+                    <div v-if="currentPrescription.has_hcp_pro_signed" class="d-inline-flex align-items-baseline">
+                        <i class="text-secondary fa fa-check mr-1"></i>
+                        <span class="text-secondary">Signed</span>
+                    </div>
+                    <div v-else>
+                        <a v-if="currentPrescription.hcp_pro_id === {{$pro->id}}"
+                           href="#"
+                           v-on:click.prevent="signAsHcpPro(currentPrescription)">Sign</a>
+                        <span v-else>-</span>
+                    </div>
+                </div>
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">Pro Status</span>
+                    <div class="d-inline-flex align-items-baseline">
+                        <a class="mr-2" href="#" v-on:click.prevent="editProStatus(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
+                        <div v-if="currentPrescription.pro_declared_status" class="d-flex align-items-baseline">
+                            @{{ sanitizeStatus(currentPrescription.pro_declared_status) }}
+                        </div>
+                        <div v-else>-</div>
+                    </div>
+                </div>
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">Client Status</span>
+                    <div class="d-inline-flex align-items-baseline">
+                        <a class="mr-2" href="#" v-on:click.prevent="editClientStatus(currentPrescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
+                        <div v-if="currentPrescription.client_declared_status" class="d-flex align-items-baseline">
+                            @{{ sanitizeStatus(currentPrescription.client_declared_status) }}
+                        </div>
+                        <div v-else>-</div>
+                    </div>
+                </div>
+                <div class="pb-2 d-flex align-items-center">
+                    <span class="min-width-140px text-secondary text-sm">PDF</span>
+                    <div class="d-inline-flex align-items-baseline">
+                        <a class="pdf-viewer-trigger" native target="_blank"
+                           :href="'/prescription-download-as-pdf/' + currentPrescription.uid">View</a>
+                        <span class="mx-2 text-secondary">|</span>
+                        <a native target="_blank"
+                           :href="'/prescription-download-as-pdf/' + currentPrescription.uid">Download</a>
+                        <span class="mx-2 text-secondary">|</span>
+                        <a href="#" v-on:click.prevent="transmit(currentPrescription)">Transmit</a>
+                    </div>
+                </div>
+            </div>
+        </div>
+        @include('app.patient.prescriptions.drug-form')
+        @include('app.patient.prescriptions.lab-form')
+        @include('app.patient.prescriptions.imaging-form')
+        @include('app.patient.prescriptions.referral-form')
+        @include('app.patient.prescriptions.supply-form')
+        @include('app.patient.prescriptions.other-form')
+        @include('app.patient.prescriptions.logistics-form')
+        @include('app.patient.prescriptions.hcp-pro-form')
+        @include('app.patient.prescriptions.sign-as-hcp-form')
+        @include('app.patient.prescriptions.pro-status-form')
+        @include('app.patient.prescriptions.client-status-form')
+        @include('app.patient.prescriptions.transmit-form')
+    </div>
+    <script>
+        (function() {
+
+            <?php
+            $prescriptions = $patient->prescriptions;
+            $currentPrescription = null;
+            foreach ($prescriptions as $prescription) {
+                if($prescription->clinical_detail_json) {
+                    $prescription->clinical_detail_json = json_decode($prescription->clinical_detail_json);
+                }
+                if($prescription->logistics_detail_json) {
+                    $prescription->logistics_detail_json = json_decode($prescription->logistics_detail_json);
+                }
+                $prescription->created_at_friendly = friendlier_date_time($prescription->created_at);
+                $prescription->created_at_friendly_short = friendlier_date_time($prescription->created_at, false);
+                $prescription->hcpProDisplayName = $prescription->hcpPro ? $prescription->hcpPro->displayName() : '-';
+                $prescription->hcpProUid = $prescription->hcpPro ? $prescription->hcpPro->uid : '';
+
+                if(!!@$currentErx && $currentErx->uid === $prescription->uid) {
+                    $currentPrescription = $prescription;
+                }
+            }
+            ?>
+
+            function init() {
+
+                window.booApp = new Vue({
+                    el: '#prescriptions-{{$patient->id}}',
+                    delimiters: ['@{{', '}}'],
+                    data: {
+                        prescriptions: <?= json_encode($prescriptions) ?>,
+
+                        currentPrescriptionAction: '',
+                        currentPrescriptionType: '',
+
+                        // selected
+                        currentPrescription:  <?= $currentPrescription ?>,
+
+                        // for editing clinical details
+                        currentPrescription_DRUG: {
+                            noteUid: null, // TODO: this won't be null if created from a note
+                            clientUid: '{{ $patient->uid }}',
+                            replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                            hcpProUid: '{{$pro->uid}}',
+                            erxCategory: 'DRUG',
+                            clinicalDetailJson: {
+                                medication: '',
+                                strength: '',
+                                amount: '',
+                                route: '',
+                                frequency: '',
+                                dispense: '',
+                                refills: '',
+                                purpose: '',
+                            }
+                        },
+                        currentPrescription_LAB: {
+                            noteUid: null, // TODO: this won't be null if created from a note
+                            clientUid: '{{ $patient->uid }}',
+                            replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                            hcpProUid: '{{$pro->uid}}',
+                            erxCategory: 'LAB',
+                            clinicalDetailJson: {
+                                test: '',
+                                icds: '',
+                                memo: '',
+                            }
+                        },
+                        currentPrescription_IMAGING: {
+                            noteUid: null, // TODO: this won't be null if created from a note
+                            clientUid: '{{ $patient->uid }}',
+                            replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                            hcpProUid: '{{$pro->uid}}',
+                            erxCategory: 'IMAGING',
+                            clinicalDetailJson: {
+                                test: '',
+                                icds: '',
+                                memo: '',
+                            }
+                        },
+                        currentPrescription_REFERRAL: {
+                            noteUid: null, // TODO: this won't be null if created from a note
+                            clientUid: '{{ $patient->uid }}',
+                            replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                            hcpProUid: '{{$pro->uid}}',
+                            erxCategory: 'REFERRAL',
+                            clinicalDetailJson: {
+                                to: '',
+                                memo: '',
+                            }
+                        },
+                        currentPrescription_SUPPLY: {
+                            noteUid: null, // TODO: this won't be null if created from a note
+                            clientUid: '{{ $patient->uid }}',
+                            replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                            hcpProUid: '{{$pro->uid}}',
+                            erxCategory: 'SUPPLY',
+                            clinicalDetailJson: {
+                                item: '',
+                                quantity: '',
+                                memo: '',
+                            }
+                        },
+                        currentPrescription_OTHER: {
+                            noteUid: null, // TODO: this won't be null if created from a note
+                            clientUid: '{{ $patient->uid }}',
+                            replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                            hcpProUid: '{{$pro->uid}}',
+                            erxCategory: 'OTHER',
+                            clinicalDetailJson: {
+                                title: '',
+                                memo: '',
+                            }
+                        },
+
+                        // for editing logistics - common
+                        currentPrescriptionLogistics: {
+                            uid: '',
+                            logisticsDetailJson: {
+                                facilityName: '',
+                                facilityCity: '',
+                                facilityState: '',
+                                facilityAddressMemo: '',
+                                facilityPhone: '',
+                                facilityFax: '',
+                                facilityZip: '',
+                            }
+                        },
+
+                        // for editing hcp, sign, pro status & client status - common
+                        currentPrescriptionHcpPro: {
+                            uid: '',
+                            newHcpProUid: '',
+                        },
+                        currentPrescriptionSign: {
+                            uid: '',
+                            declaredVersionNumber: '',
+                        },
+                        currentPrescriptionProStatus: {
+                            uid: '',
+                            status: '',
+                            memo: '',
+                        },
+                        currentPrescriptionClientStatus: {
+                            uid: '',
+                            status: '',
+                            memo: '',
+                        },
+                        currentPrescriptionTransmit: {
+                            uid: '',
+                            logistics: '',
+                            toWho: '',
+                            toEmail: '',
+                            toFaxNumber: '',
+                            toFaxNumberAttentionLine: '',
+                            toFaxNumberCoverSheetMemo: '',
+                            copyToPatient: false,
+                            copyToPatientFaxNumber: '',
+                            copyToPatientEmail: '',
+                        },
+                    },
+                    methods: {
+
+                        // new/edit/save-clinical
+                        newPrescription: function(_type) {
+                            this.currentPrescriptionAction = 'ADD';
+                            this.currentPrescriptionType = _type;
+                            switch (_type) {
+                                case 'DRUG':
+                                    this.currentPrescription_DRUG = {
+                                        noteUid: null, // TODO: this won't be null if created from a note
+                                        clientUid: '{{ $patient->uid }}',
+                                        replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                                        hcpProUid: '{{$pro->uid}}',
+                                        erxCategory: _type,
+                                        clinicalDetailJson: {
+                                            medication: '',
+                                            strength: '',
+                                            amount: '',
+                                            route: '',
+                                            frequency: '',
+                                            dispense: '',
+                                            refills: '',
+                                            purpose: '',
+                                        }
+                                    };
+                                    break;
+                                case 'LAB':
+                                case 'IMAGING':
+                                    this.currentPrescription_LAB = {
+                                        noteUid: null, // TODO: this won't be null if created from a note
+                                        clientUid: '{{ $patient->uid }}',
+                                        replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                                        hcpProUid: '{{$pro->uid}}',
+                                        erxCategory: _type,
+                                        clinicalDetailJson: {
+                                            test: '',
+                                            icds: '',
+                                            memo: '',
+                                        }
+                                    };
+                                    break;
+                                case 'REFERRAL':
+                                    this.currentPrescription_LAB = {
+                                        noteUid: null, // TODO: this won't be null if created from a note
+                                        clientUid: '{{ $patient->uid }}',
+                                        replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                                        hcpProUid: '{{$pro->uid}}',
+                                        erxCategory: _type,
+                                        clinicalDetailJson: {
+                                            to: '',
+                                            memo: '',
+                                        }
+                                    };
+                                    break;
+                                case 'SUPPLY':
+                                    this.currentPrescription_LAB = {
+                                        noteUid: null, // TODO: this won't be null if created from a note
+                                        clientUid: '{{ $patient->uid }}',
+                                        replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                                        hcpProUid: '{{$pro->uid}}',
+                                        erxCategory: _type,
+                                        clinicalDetailJson: {
+                                            item: '',
+                                            quantity: '',
+                                            memo: '',
+                                        }
+                                    };
+                                    break;
+                                case 'OTHER':
+                                    this.currentPrescription_LAB = {
+                                        noteUid: null, // TODO: this won't be null if created from a note
+                                        clientUid: '{{ $patient->uid }}',
+                                        replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
+                                        hcpProUid: '{{$pro->uid}}',
+                                        erxCategory: _type,
+                                        clinicalDetailJson: {
+                                            title: '',
+                                            memo: '',
+                                        }
+                                    };
+                                    break;
+                            }
+                            Vue.nextTick(() => {
+                                showStagPopup('prescription-popup-' + this.currentPrescriptionType, true);
+                            });
+                        },
+                        editClinicalDetails: function(_prescription) {
+                            this.currentPrescriptionAction = 'EDIT_CLINICAL';
+                            this.currentPrescriptionType = _prescription.erx_category;
+                            this['currentPrescription_' + this.currentPrescriptionType] = {
+                                uid: _prescription.uid,
+                                clinicalDetailJson: JSON.parse(JSON.stringify(_prescription.clinical_detail_json))
+                            };
+                            Vue.nextTick(() => {
+                                showStagPopup('prescription-popup-' + this.currentPrescriptionType, true);
+                            });
+                        },
+                        savePrescription: function() {
+                            let payload = JSON.parse(JSON.stringify(this['currentPrescription_' + this.currentPrescriptionType]));
+                            payload.clinicalDetailJson = JSON.stringify(payload.clinicalDetailJson);
+                            switch (this.currentPrescriptionAction) {
+                                case 'ADD':
+                                    $.post('/api/erx/create', payload, _data => {
+                                        if(!hasResponseError(_data)) {
+                                            toastr.success('Prescription added');
+                                            closeStagPopup();
+                                            fastLoad('/patients/view/{{$patient->uid}}/prescriptions/' + this.currentPrescriptionType.toLowerCase() + '/' + _data.data);
+                                        }
+                                    }, 'json');
+                                    break;
+                                case 'EDIT_CLINICAL':
+                                    $.post('/api/erx/updateClinicalDetail', payload, _data => {
+                                        if(!hasResponseError(_data)) {
+                                            toastr.success('Prescription updated');
+                                            closeStagPopup();
+                                            fastReload();
+                                        }
+                                    }, 'json');
+                                    break;
+                            }
+                        },
+
+                        // edit logistics
+                        editLogisticsDetails: function(_prescription) {
+                            this.currentPrescriptionAction = 'EDIT_LOGISTICS';
+                            this.currentPrescriptionLogistics = {
+                                uid: _prescription.uid,
+                                logisticsDetailJson: _prescription.logistics_detail_json ? JSON.parse(JSON.stringify(_prescription.logistics_detail_json)) : {
+                                    facilityName: '',
+                                    facilityCity: '',
+                                    facilityState: '',
+                                    facilityAddressMemo: '',
+                                    facilityPhone: '',
+                                    facilityFax: '',
+                                    facilityZip: '',
+                                }
+                            }
+                            Vue.nextTick(() => {
+                                showStagPopup('logistics-popup', true);
+                            });
+                        },
+                        saveLogistics: function() {
+                            let payload = JSON.parse(JSON.stringify(this.currentPrescriptionLogistics));
+                            payload.logisticsDetailJson = JSON.stringify(payload.logisticsDetailJson);
+                            $.post('/api/erx/updateLogisticsDetail', payload, _data => {
+                                if(!hasResponseError(_data)) {
+                                    toastr.success('Logistics updated');
+                                    closeStagPopup();
+                                    fastReload();
+                                }
+                            }, 'json');
+                        },
+
+                        // edit hcp (ordering) pro
+                        editHcpPro: function(_prescription) {
+                            this.currentPrescriptionAction = 'EDIT_HCP_PRO';
+                            this.currentPrescriptionType = _prescription.erx_category;
+                            this.currentPrescriptionHcpPro = {
+                                uid: _prescription.uid,
+                                newHcpProUid: _prescription.hcpProUid
+                            };
+                            Vue.nextTick(() => {
+                                showStagPopup('hcp-pro-popup', true);
+                                $('.erx-hcp-pro-select').removeAttr('pro-suggest-initialized');
+                                initProSuggest();
+                            });
+                        },
+                        saveHcpPro: function() {
+                            let payload = JSON.parse(JSON.stringify(this.currentPrescriptionHcpPro));
+                            $.post('/api/erx/updateHcpPro', payload, _data => {
+                                if(!hasResponseError(_data)) {
+                                    toastr.success('HCP Pro updated');
+                                    closeStagPopup();
+                                    fastReload();
+                                }
+                            }, 'json');
+                        },
+
+                        // sign
+                        signAsHcpPro: function(_prescription) {
+                            this.currentPrescriptionAction = 'SIGN_AS_HCP';
+                            this.currentPrescriptionType = _prescription.erx_category;
+                            this.currentPrescriptionSign = {
+                                uid: _prescription.uid,
+                                declaredVersionNumber: _prescription.version_number
+                            };
+                            Vue.nextTick(() => {
+                                showStagPopup('sign-as-hcp-popup', true);
+                            });
+                        },
+                        saveSignAsHcpPro: function() {
+                            let payload = JSON.parse(JSON.stringify(this.currentPrescriptionSign));
+                            $.post('/api/erx/signAsHcp', payload, _data => {
+                                if(!hasResponseError(_data)) {
+                                    toastr.success('Signed');
+                                    closeStagPopup();
+                                    fastReload();
+                                }
+                            }, 'json');
+                        },
+
+                        // edit pro status
+                        editProStatus: function(_prescription) {
+                            this.currentPrescriptionAction = 'EDIT_PRO_DECLARED_STATUS';
+                            this.currentPrescriptionType = _prescription.erx_category;
+                            this.currentPrescriptionProStatus = {
+                                uid: _prescription.uid,
+                                status: _prescription.pro_declared_status,
+                                memo: _prescription.pro_declared_status_memo,
+                            };
+                            Vue.nextTick(() => {
+                                showStagPopup('pro-status-popup', true);
+                            });
+                        },
+                        saveProStatus: function() {
+                            let payload = JSON.parse(JSON.stringify(this.currentPrescriptionProStatus));
+                            $.post('/api/erx/updateProDeclaredStatus', payload, _data => {
+                                if(!hasResponseError(_data)) {
+                                    toastr.success('Pro declared status updated');
+                                    closeStagPopup();
+                                    fastReload();
+                                }
+                            }, 'json');
+                        },
+
+                        // edit client status
+                        editClientStatus: function(_prescription) {
+                            this.currentPrescriptionAction = 'EDIT_CLIENT_DECLARED_STATUS';
+                            this.currentPrescriptionType = _prescription.erx_category;
+                            this.currentPrescriptionClientStatus = {
+                                uid: _prescription.uid,
+                                status: _prescription.client_declared_status,
+                                memo: _prescription.client_declared_status_memo,
+                            };
+                            Vue.nextTick(() => {
+                                showStagPopup('client-status-popup', true);
+                            });
+                        },
+                        saveClientStatus: function() {
+                            let payload = JSON.parse(JSON.stringify(this.currentPrescriptionClientStatus));
+                            $.post('/api/erx/updateClientDeclaredStatus', payload, _data => {
+                                if(!hasResponseError(_data)) {
+                                    toastr.success('Client declared status updated');
+                                    closeStagPopup();
+                                    fastReload();
+                                }
+                            }, 'json');
+                        },
+
+                        // sane display status
+                        sanitizeStatus: function(_s) {
+                            _s = _s.toLowerCase().replaceAll('_', ' ');
+                            _s = _s[0].toUpperCase() + _s.substr(1);
+                            return _s;
+                        },
+
+                        // transmit
+                        transmit: function(_prescription) {
+                            this.currentPrescriptionTransmit = {
+                                uid: _prescription.uid,
+                                toWho: _prescription.logistics_detail_json ? _prescription.logistics_detail_json.facilityName : '',
+                                toEmail: '',
+                                toFaxNumber: _prescription.logistics_detail_json ? _prescription.logistics_detail_json.facilityFax : '',
+                                toFaxNumberAttentionLine: '',
+                                toFaxNumberCoverSheetMemo: '',
+                                copyToPatient: false,
+                                copyToPatientFaxNumber: '{{$patient->cell_number}}',
+                                copyToPatientEmail: '{{$patient->email_address}}',
+                                _token: '{{csrf_token()}}'
+                            };
+                            Vue.nextTick(() => {
+                                showStagPopup('transmit-popup');
+                                this.transmitModalPDFPreview();
+                            });
+                        },
+                        transmitModalPDFPreview: function() {
+
+                            let _loadedPDF = null, _numPages = 1, _page = 1;
+
+                            function _load(_url) {
+
+                                _loadedPDF = null;
+                                _numPages = 1;
+                                _page = 1;
+
+                                $('#transmit-pdf-preview>canvas').remove();
+
+                                let url = _url;
+                                let pdfjsLib = window['pdfjs-dist/build/pdf'];
+                                pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
+                                let loadingTask = pdfjsLib.getDocument(url);
+                                loadingTask.promise.then(function (pdf) {
+                                    _numPages = pdf.numPages;
+                                    _loadedPDF = pdf;
+                                    _page = 1;
+                                    _render();
+                                }, function (reason) {
+                                    // reason.message;
+                                });
+                            }
+                            function _render() {
+
+                                _loadedPDF.getPage(_page).then(function (page) {
+
+                                    // create canvas
+                                    let canvasElement = $('<canvas/>')
+                                        .addClass('pdf-viewer-page pdf-preview-page')
+                                        .appendTo('#transmit-pdf-preview');
+
+                                    let canvas = canvasElement[0];
+                                    let viewport = page.getViewport({scale: 0.75});
+                                    let context = canvas.getContext('2d');
+                                    canvas.height = viewport.height;
+                                    canvas.width = viewport.width;
+                                    const $canvas = $(canvas);
+                                    let renderContext = {
+                                        canvasContext: context,
+                                        viewport: viewport
+                                    };
+                                    let renderTask = page.render(renderContext);
+                                    renderTask.promise.then(function () {
+                                        if(_page < _numPages) {
+                                            _page++;
+                                            _render();
+                                        }
+                                    });
+                                });
+                            }
+
+                            _load('/prescription-download-as-pdf/' + this.currentPrescriptionTransmit.uid);
+                        },
+                        doTransmit: function (_item) {
+                            let payload = JSON.parse(JSON.stringify(this.currentPrescriptionTransmit));
+                            $.post('/prescription-transmit/' + payload.uid, payload, _data => {
+                                if(!hasResponseError(_data)) {
+                                    toastr.success('Transmission initiated');
+                                    closeStagPopup();
+                                    fastReload();
+                                }
+                            }, 'json');
+                            closeStagPopup();
+                        },
+
+                        // cancel, etc.
+
+                    },
+                    mounted: function() {
+                        let self = this;
+                        $(document).on('pro-changed', '.erx-hcp-pro-select', function() {
+                            self.currentPrescriptionHcpPro.newHcpProUid = this.value;
+                        });
+                    }
+                });
+
+            }
+            addMCInitializer('prescriptions-{{$patient->id}}', init, '#prescriptions-{{$patient->id}}')
+        }).call(window);
+    </script>
+@endsection

+ 30 - 0
resources/views/app/patient/prescriptions/lab-form.blade.php

@@ -0,0 +1,30 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="prescription-popup-LAB">
+    <form method="POST" action="">
+        <h3 class="stag-popup-title mb-2">
+            <span>Lab Prescription</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Test</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_LAB.clinicalDetailJson.test">
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">ICDS</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_LAB.clinicalDetailJson.icds">
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Memo</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_LAB.clinicalDetailJson.memo">
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="savePrescription()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 59 - 0
resources/views/app/patient/prescriptions/logistics-form.blade.php

@@ -0,0 +1,59 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="logistics-popup">
+    <form method="POST" action="">
+        <h3 class="stag-popup-title mb-2">
+            <span>Logistics</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Business Name</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescriptionLogistics.logisticsDetailJson.facilityName">
+        </div>
+        <div class="row">
+            <div class="col-4 pr-0">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">City</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescriptionLogistics.logisticsDetailJson.facilityCity">
+                </div>
+            </div>
+            <div class="col-4 pr-0">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">State</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescriptionLogistics.logisticsDetailJson.facilityState">
+                </div>
+            </div>
+            <div class="col-4">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">ZIP</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescriptionLogistics.logisticsDetailJson.facilityZip">
+                </div>
+            </div>
+        </div>
+        <div class="row">
+            <div class="col-6 pr-0">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">Phone</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescriptionLogistics.logisticsDetailJson.facilityPhone">
+                </div>
+            </div>
+            <div class="col-6">
+                <div class="mb-2">
+                    <label class="text-sm text-secondary mb-1">Fax</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescriptionLogistics.logisticsDetailJson.facilityFax">
+                </div>
+            </div>
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="saveLogistics()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 25 - 0
resources/views/app/patient/prescriptions/other-form.blade.php

@@ -0,0 +1,25 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="prescription-popup-OTHER">
+    <form method="POST" action="">
+        <h3 class="stag-popup-title mb-2">
+            <span>Other Prescription</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Title</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_OTHER.clinicalDetailJson.title">
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Memo</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_OTHER.clinicalDetailJson.memo">
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="savePrescription()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 66 - 0
resources/views/app/patient/prescriptions/pdf/DRUG.blade.php

@@ -0,0 +1,66 @@
+<section style="padding-top: 0.1rem;">
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
+        <tr>
+            <td style="width: 70%">
+                <b>Patient Information</b>
+            </td>
+            <td style="">
+                <div style="text-align: right">Date: <b>{{date('Y-m-d')}}</b></div>
+            </td>
+        </tr>
+    </table>
+
+    <div style="font-size: 14px; margin-top: 0.6rem; line-height: 1.4; opacity: 0.6">
+        <span>{{ $patient->displayName() }}, {{$patient->sex}}, {{$patient->age_in_years}} years old</span><br>
+        <?php
+        $addressParts = [];
+        if (!!$patient->mailing_address_line1) $addressParts[] = $patient->mailing_address_line1;
+        if (!!$patient->mailing_address_line2) $addressParts[] = $patient->mailing_address_line2;
+        $addressParts = implode(", ", $addressParts) . ", ";
+        $addressPart2 = [];
+        if (!!$patient->mailing_address_city) $addressPart2[] = $patient->mailing_address_city;
+        if (!!$patient->mailing_address_state) $addressPart2[] = $patient->mailing_address_state;
+        $addressParts .= implode(", ", $addressPart2);
+        ?>
+        <span>{!! $addressParts !!}</span>
+    </div>
+</section>
+
+<?php $clinical = json_decode($prescription->clinical_detail_json); ?>
+<div style="margin: 1.5rem 0 1rem; font-weight: bold; opacity: 0.5"><span style="font-size: 24px">R</span><span style="font-size: 16px">x</span></div>
+<section style="font-size: 15px;">
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
+        <tr>
+            <td style="width: 20px; vertical-align: top; opacity: 0.75; font-size: 14px">
+                <span>1. </span>
+            </td>
+            <td style="vertical-align: top">
+                <div>
+                    <p style="margin: 0 0 0.5rem;">
+                        <b>{{ $clinical->medication }} {{ $clinical->strength }}
+                            @if($clinical->route)
+                                - {{ $clinical->route }}
+                            @endif
+                        </b>
+                    </p>
+                    <div style="">
+                        @if($clinical->frequency)
+                            <p style="margin: 0.5rem 0;">Frequency: {{ $clinical->frequency }}</p>
+                        @endif
+                        @if($clinical->dispense)
+                            <p style="margin: 0.5rem 0;">Dispense: {{ $clinical->dispense }}</p>
+                        @endif
+                        @if($clinical->refills)
+                            <p style="margin: 0.5rem 0;">Refills: {{ $clinical->refills }}</p>
+                        @endif
+                        @if($clinical->purpose)
+                            <p style="margin: 0.5rem 0;">Purpose: <b>{{ $clinical->purpose }}</b></p>
+                        @endif
+                    </div>
+                </div>
+            </td>
+        </tr>
+    </table>
+</section>
+

+ 203 - 0
resources/views/app/patient/prescriptions/pdf/IMAGING.blade.php

@@ -0,0 +1,203 @@
+<section style="padding-top: 0.1rem;">
+
+    <div style="margin: 0 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Specimen/Physician Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Order Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{date('Y-m-d h:i a')}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">NPI:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->hcp_npi}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Test Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Ordering Physician:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Fax:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Patient Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_line1}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">DoB:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->dob}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_city}} {{$patient->home_address_state}} {{$patient->home_address_zip}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Gender:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->sex}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Mobile Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->cell_number ? $patient->cell_number : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient ID:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->chart_number ? $patient->chart_number : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Home Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->phone_home ? $patient->phone_home : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">SSN:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->ssn ? $patient->ssn : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Work Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Billing Information</span>
+        &nbsp;&nbsp;&nbsp;&nbsp;
+        <span style="font-size: 16px; opacity: 0.5;">Bill to: Patient</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Guarantor Information</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Relationship:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Self</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Order Information</span>
+    </div>
+
+    <?php $clinical = json_decode($prescription->clinical_detail_json); ?>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Fasting:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">ICD Codes:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">
+                {{@$clinical->icds ?: ''}}
+            </td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Collect at Draw Site:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+
+</section>
+
+
+<hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+<div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+    <span style="font-size: 16px">Studies/Imaging</span>
+</div>
+
+<section style="font-size: 15px;">
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
+        <?php $testIndex = 1; ?>
+        <tr>
+            <td style="width: 20px; vertical-align: top; opacity: 0.75; font-size: 14px">
+                <span>{{$testIndex++}}. </span>
+            </td>
+            <td style="vertical-align: top">
+                <div style="padding-bottom: 0.3rem;">{{$clinical->test}} <span style="padding-left: 15px; color: #666">{{$clinical->memo}}</span></div>
+            </td>
+        </tr>
+    </table>
+</section>
+

+ 203 - 0
resources/views/app/patient/prescriptions/pdf/LAB.blade.php

@@ -0,0 +1,203 @@
+<section style="padding-top: 0.1rem;">
+
+    <div style="margin: 0 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Specimen/Physician Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Order Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{date('Y-m-d h:i a')}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">NPI:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->hcp_npi}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Test Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Ordering Physician:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Fax:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Patient Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_line1}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">DoB:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->dob}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_city}} {{$patient->home_address_state}} {{$patient->home_address_zip}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Gender:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->sex}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Mobile Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->cell_number ? $patient->cell_number : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient ID:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->chart_number ? $patient->chart_number : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Home Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->phone_home ? $patient->phone_home : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">SSN:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->ssn ? $patient->ssn : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Work Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Billing Information</span>
+        &nbsp;&nbsp;&nbsp;&nbsp;
+        <span style="font-size: 16px; opacity: 0.5;">Bill to: Patient</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Guarantor Information</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Relationship:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Self</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Order Information</span>
+    </div>
+
+    <?php $clinical = json_decode($prescription->clinical_detail_json); ?>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Fasting:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">ICD Codes:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">
+                {{@$clinical->icds ?: ''}}
+            </td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Collect at Draw Site:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+
+</section>
+
+
+<hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+<div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+    <span style="font-size: 16px">Lab</span>
+</div>
+
+<section style="font-size: 15px;">
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
+        <?php $testIndex = 1; ?>
+        <tr>
+            <td style="width: 20px; vertical-align: top; opacity: 0.75; font-size: 14px">
+                <span>{{$testIndex++}}. </span>
+            </td>
+            <td style="vertical-align: top">
+                <div style="padding-bottom: 0.3rem;">{{$clinical->test}} <span style="padding-left: 15px; color: #666">{{$clinical->memo}}</span></div>
+            </td>
+        </tr>
+    </table>
+</section>
+

+ 203 - 0
resources/views/app/patient/prescriptions/pdf/OTHER.blade.php

@@ -0,0 +1,203 @@
+<section style="padding-top: 0.1rem;">
+
+    <div style="margin: 0 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Specimen/Physician Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Order Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{date('Y-m-d h:i a')}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">NPI:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->hcp_npi}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Test Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Ordering Physician:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Fax:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Patient Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_line1}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">DoB:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->dob}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_city}} {{$patient->home_address_state}} {{$patient->home_address_zip}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Gender:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->sex}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Mobile Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->cell_number ? $patient->cell_number : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient ID:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->chart_number ? $patient->chart_number : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Home Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->phone_home ? $patient->phone_home : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">SSN:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->ssn ? $patient->ssn : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Work Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Billing Information</span>
+        &nbsp;&nbsp;&nbsp;&nbsp;
+        <span style="font-size: 16px; opacity: 0.5;">Bill to: Patient</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Guarantor Information</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Relationship:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Self</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Order Information</span>
+    </div>
+
+    <?php $clinical = json_decode($prescription->clinical_detail_json); ?>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Fasting:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">ICD Codes:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">
+                {{@$clinical->icds ?: ''}}
+            </td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Collect at Draw Site:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+
+</section>
+
+
+<hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+<div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+    <span style="font-size: 16px">Details</span>
+</div>
+
+<section style="font-size: 15px;">
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
+        <?php $testIndex = 1; ?>
+        <tr>
+            <td style="width: 20px; vertical-align: top; opacity: 0.75; font-size: 14px">
+                <span>{{$testIndex++}}. </span>
+            </td>
+            <td style="vertical-align: top">
+                <div style="padding-bottom: 0.3rem;">{{$clinical->title}} <span style="padding-left: 15px; color: #666">{{$clinical->memo}}</span></div>
+            </td>
+        </tr>
+    </table>
+</section>
+

+ 203 - 0
resources/views/app/patient/prescriptions/pdf/REFERRAL.blade.php

@@ -0,0 +1,203 @@
+<section style="padding-top: 0.1rem;">
+
+    <div style="margin: 0 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Specimen/Physician Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Order Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{date('Y-m-d h:i a')}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">NPI:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->hcp_npi}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Test Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Ordering Physician:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Fax:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Patient Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_line1}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">DoB:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->dob}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_city}} {{$patient->home_address_state}} {{$patient->home_address_zip}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Gender:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->sex}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Mobile Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->cell_number ? $patient->cell_number : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient ID:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->chart_number ? $patient->chart_number : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Home Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->phone_home ? $patient->phone_home : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">SSN:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->ssn ? $patient->ssn : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Work Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Billing Information</span>
+        &nbsp;&nbsp;&nbsp;&nbsp;
+        <span style="font-size: 16px; opacity: 0.5;">Bill to: Patient</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Guarantor Information</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Relationship:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Self</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Order Information</span>
+    </div>
+
+    <?php $clinical = json_decode($prescription->clinical_detail_json); ?>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Fasting:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">ICD Codes:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">
+                {{@$clinical->icds ?: ''}}
+            </td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Collect at Draw Site:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+
+</section>
+
+
+<hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+<div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+    <span style="font-size: 16px">Referral Details</span>
+</div>
+
+<section style="font-size: 15px;">
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
+        <?php $testIndex = 1; ?>
+        <tr>
+            <td style="width: 20px; vertical-align: top; opacity: 0.75; font-size: 14px">
+                <span>{{$testIndex++}}. </span>
+            </td>
+            <td style="vertical-align: top">
+                <div style="padding-bottom: 0.3rem;">{{$clinical->to}} <span style="padding-left: 15px; color: #666">{{$clinical->memo}}</span></div>
+            </td>
+        </tr>
+    </table>
+</section>
+

+ 203 - 0
resources/views/app/patient/prescriptions/pdf/SUPPLY.blade.php

@@ -0,0 +1,203 @@
+<section style="padding-top: 0.1rem;">
+
+    <div style="margin: 0 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Specimen/Physician Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Order Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{date('Y-m-d h:i a')}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">NPI:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->hcp_npi}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Test Date:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Ordering Physician:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$prescription->hcpPro->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Practice Fax:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">202-935-1033</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75"><span style="font-size: 16px">Patient Information</span></div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_line1}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">DoB:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->dob}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->home_address_city}} {{$patient->home_address_state}} {{$patient->home_address_zip}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Gender:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->sex}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Mobile Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->cell_number ? $patient->cell_number : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Patient ID:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->chart_number ? $patient->chart_number : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Home Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->phone_home ? $patient->phone_home : '-'}}</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">SSN:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->ssn ? $patient->ssn : '-'}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Work Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Billing Information</span>
+        &nbsp;&nbsp;&nbsp;&nbsp;
+        <span style="font-size: 16px; opacity: 0.5;">Bill to: Patient</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Code:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Primary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Secondary Ins. Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Worker's Comp:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Policy #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Group #:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Emp/Group Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75;">Insured:</td>
+            <td style="padding-bottom: 0.25rem; width: 25%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Guarantor Information</span>
+    </div>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Name:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">{{$patient->displayName()}}</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Relationship:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Self</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Address:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Phone:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">City, State, ZIP:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">-</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+    <hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+    <div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+        <span style="font-size: 16px">Order Information</span>
+    </div>
+
+    <?php $clinical = json_decode($prescription->clinical_detail_json); ?>
+
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; font-size: 14px;">
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Fasting:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">ICD Codes:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">
+                {{@$clinical->icds ?: ''}}
+            </td>
+        </tr>
+        <tr>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;">Collect at Draw Site:</td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;">Yes&nbsp;&nbsp;/&nbsp;&nbsp;No</td>
+            <td style="padding-bottom: 0.25rem; width: 20%; opacity: 0.75;"></td>
+            <td style="padding-bottom: 0.25rem; width: 30%; opacity: 0.75; font-weight: bold;"></td>
+        </tr>
+    </table>
+
+
+</section>
+
+
+<hr style="margin: 1rem 0; border-top-width: 0; border-bottom-width: 1px; border-color: #bbb">
+
+<div style="margin: 1.25rem 0 1rem; font-weight: bold; opacity: 0.75">
+    <span style="font-size: 16px">Supply Details</span>
+</div>
+
+<section style="font-size: 15px;">
+    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
+        <?php $testIndex = 1; ?>
+        <tr>
+            <td style="width: 20px; vertical-align: top; opacity: 0.75; font-size: 14px">
+                <span>{{$testIndex++}}. </span>
+            </td>
+            <td style="vertical-align: top">
+                <div style="padding-bottom: 0.3rem;">{{$clinical->item}} <span style="padding-left: 15px;">{{$clinical->quantity}}</span><span style="padding-left: 15px; color: #666">{{$clinical->memo}}</span></div>
+            </td>
+        </tr>
+    </table>
+</section>
+

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 13 - 0
resources/views/app/patient/prescriptions/pdf/pdf-preview-with-cover-sheet.blade.php


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 13 - 0
resources/views/app/patient/prescriptions/pdf/pdf-preview.blade.php


+ 32 - 0
resources/views/app/patient/prescriptions/pro-status-form.blade.php

@@ -0,0 +1,32 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1 min-height-unset" stag-popup-key="pro-status-popup">
+    <form method="POST" action="" class="overflow-visible">
+        <h3 class="stag-popup-title mb-2">
+            <span>Pro Declared Status</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Status</label>
+            <select class="form-control form-control-sm min-width-unset erx-hcp-pro-select"
+                    v-model="currentPrescriptionProStatus.status">
+                <option value="">-- select --</option>
+                <option value="CREATED">Created</option>
+                <option value="SENT">Sent</option>
+                <option value="RECEIVED_BY_CLIENT">Received by client</option>
+                <option value="RECEIPT_CONFIRMED_BY_FACILITY">Receipt confirmed by facility</option>
+                <option value="CANCELLED">Cancelled</option>
+            </select>
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Memo</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescriptionProStatus.memo">
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="saveProStatus()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 25 - 0
resources/views/app/patient/prescriptions/referral-form.blade.php

@@ -0,0 +1,25 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="prescription-popup-REFERRAL">
+    <form method="POST" action="">
+        <h3 class="stag-popup-title mb-2">
+            <span>Referral Prescription</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Refer To</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_REFERRAL.clinicalDetailJson.to">
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Memo</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_REFERRAL.clinicalDetailJson.memo">
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="savePrescription()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 16 - 0
resources/views/app/patient/prescriptions/sign-as-hcp-form.blade.php

@@ -0,0 +1,16 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1 min-height-unset" stag-popup-key="sign-as-hcp-popup">
+    <form method="POST" action="" class="overflow-visible">
+        <h3 class="stag-popup-title mb-2">
+            <span>Sign as HCP Pro</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <p>Sign as HCP Pro?</p>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-success mr-2" v-on:click.prevent="saveSignAsHcpPro()">Sign
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 34 - 0
resources/views/app/patient/prescriptions/supply-form.blade.php

@@ -0,0 +1,34 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="prescription-popup-SUPPLY">
+    <form method="POST" action="">
+        <h3 class="stag-popup-title mb-2">
+            <span>Supply Prescription</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times-circle"></i></a>
+        </h3>
+        <div class="mb-2">
+            <div class="row">
+                <div class="col-8 pr-0">
+                    <label class="text-sm text-secondary mb-1">Item</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescription_SUPPLY.clinicalDetailJson.item">
+                </div>
+                <div class="col-4">
+                    <label class="text-sm text-secondary mb-1">Quanitity</label>
+                    <input type="text" class="form-control form-control-sm min-width-unset"
+                           v-model="currentPrescription_SUPPLY.clinicalDetailJson.quantity">
+                </div>
+            </div>
+        </div>
+        <div class="mb-2">
+            <label class="text-sm text-secondary mb-1">Memo</label>
+            <input type="text" class="form-control form-control-sm min-width-unset"
+                   v-model="currentPrescription_SUPPLY.clinicalDetailJson.memo">
+        </div>
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="savePrescription()">Submit
+            </button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel
+            </button>
+        </div>
+    </form>
+</div>

+ 66 - 0
resources/views/app/patient/prescriptions/transmit-form.blade.php

@@ -0,0 +1,66 @@
+<div class="stag-popup stag-popup-sm mcp-theme-1" stag-popup-key="transmit-popup">
+    <form method="POST" class="overflow-visible">
+        <h3 class="stag-popup-title mb-2">
+            <span><i class="fa fa-fax text-secondary font-size-13"></i> Transmit via Fax or Secure Email</span>
+            <a href="#" class="ml-auto text-secondary"
+               onclick="return closeStagPopup()"><i class="fa fa-times"></i></a>
+        </h3>
+        <div class="mb-3 pb-3 border-bottom">
+            <p class="text-secondary text-sm mb-2 text-center">Document Preview</p>
+            <div id="transmit-pdf-preview">
+
+            </div>
+        </div>
+        <div class="mb-2">
+            <label class=" mb-1">To</label>
+            <input type="text" v-model="currentPrescriptionTransmit.toWho" class="form-control">
+        </div>
+        <div class="row mb-2">
+            <div class="col-6 pr-0">
+                <div class="">
+                    <label class=" mb-1">Email</label>
+                    <input type="text" v-model="currentPrescriptionTransmit.toEmail" class="form-control">
+                </div>
+            </div>
+            <div class="col-6">
+                <div class="">
+                    <label class=" mb-1">Fax Number</label>
+                    <input type="text" v-model="currentPrescriptionTransmit.toFaxNumber" class="form-control">
+                </div>
+            </div>
+        </div>
+        <div class="mb-2">
+            <label class=" mb-1">Fax Attention Line</label>
+            <input type="text" v-model="currentPrescriptionTransmit.toFaxNumberAttentionLine" class="form-control">
+        </div>
+        <div class="mb-2">
+            <label class=" mb-1">Fax Cover Sheet Memo</label>
+            <input type="text" v-model="currentPrescriptionTransmit.toFaxNumberCoverSheetMemo" class="form-control">
+        </div>
+        <div class="mb-2 pt-2">
+            <label class=" mb-1 d-inline-flex align-items-baseline">
+                <input type="checkbox" v-model="currentPrescriptionTransmit.copyToPatient" class="mr-2">
+                Transmit Copy to Patient
+            </label>
+        </div>
+        <div class="row mb-2" v-show="currentPrescriptionTransmit.copyToPatient">
+            <div class="col-6 pr-0">
+                <div class="">
+                    <label class=" mb-1">Patient Email</label>
+                    <input type="text" v-model="currentPrescriptionTransmit.copyToPatientEmail" class="form-control">
+                </div>
+            </div>
+            <div class="col-6">
+                <div class="">
+                    <label class=" mb-1">Patient Fax Number</label>
+                    <input type="text" v-model="currentPrescriptionTransmit.copyToPatientFaxNumber" class="form-control">
+                </div>
+            </div>
+        </div>
+
+        <div class="d-flex align-items-center justify-content-center mt-3">
+            <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="doTransmit()">Submit</button>
+            <button type="button" class="btn btn-sm btn-default border" onclick="return closeStagPopup()">Cancel</button>
+        </div>
+    </form>
+</div>

+ 758 - 0
resources/views/app/patient/vitals-settings.blade.php

@@ -0,0 +1,758 @@
+@extends ('layouts.patient')
+
+@section('inner-content')
+
+    <h4 class="font-weight-bold mb-3 text-secondary font-size-16" id="rm-setup">Vitals Settings</h4>
+
+    <hr class="m-neg-4">
+
+    <div class="row" id="vitals-settings-{{$patient->uid}}">
+        <div class="col-6">
+            <div class="d-flex align-items-baseline">
+                <b>BMI Management</b>
+                <span class="mx-2 text-secondary">|</span>
+                <div moe large>
+                    <a href="#" start show>Update</a>
+                    <form url="/api/client/updateBmiManagementValue">
+                        <input type="hidden" name="uid" value="{{$patient->uid}}">
+                        <p>BMI Management</p>
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Is Weight Monitoring Needed?</label>
+                            <select type="text" class="form-control form-control-sm min-width-unset" condition name="isWeightMonitoringNeeded">
+                                <option value="">-- select --</option>
+                                <option {{$patient->is_weight_monitoring_needed === 'YES' ? 'selected' : '' }} value="YES">Yes</option>
+                                <option {{$patient->is_weight_monitoring_needed === 'NO' ? 'selected' : '' }} value="NO">No</option>
+                                <option {{$patient->is_weight_monitoring_needed === 'UNKNOWN' ? 'selected' : '' }} value="UNKNOWN">Unknown</option>
+                            </select>
+                        </div>
+                        <div condition-key="isWeightMonitoringNeeded" condition-value="YES">
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Why Is Weight Monitoring Needed?</label>
+                                <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeeded" value="{{$patient->why_is_weight_monitoring_needed}}">
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-3 pr-0">
+                                    <label class="text-sm text-secondary mb-1">ICD 1</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeededIcd1" value="{{$patient->why_is_weight_monitoring_needed_icd1}}">
+                                </div>
+                                <div class="col-3 pr-0">
+                                    <label class="text-sm text-secondary mb-1">ICD 2</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeededIcd2" value="{{$patient->why_is_weight_monitoring_needed_icd2}}">
+                                </div>
+                                <div class="col-3 pr-0">
+                                    <label class="text-sm text-secondary mb-1">ICD 3</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeededIcd3" value="{{$patient->why_is_weight_monitoring_needed_icd3}}">
+                                </div>
+                                <div class="col-3">
+                                    <label class="text-sm text-secondary mb-1">ICD 4</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeededIcd4" value="{{$patient->why_is_weight_monitoring_needed_icd4}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-6 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Description 1</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeededDescription1" value="{{$patient->why_is_weight_monitoring_needed_description1}}">
+                                </div>
+                                <div class="col-6">
+                                    <label class="text-sm text-secondary mb-1">Description 2</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeededDescription2" value="{{$patient->why_is_weight_monitoring_needed_description2}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-6 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Description 3</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeededDescription3" value="{{$patient->why_is_weight_monitoring_needed_description3}}">
+                                </div>
+                                <div class="col-6">
+                                    <label class="text-sm text-secondary mb-1">Description 4</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsWeightMonitoringNeededDescription4" value="{{$patient->why_is_weight_monitoring_needed_description4}}">
+                                </div>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Has Heart Failure Dx?</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="hasHeartFailureDx">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->has_heart_failure_dx === 'YES' ? 'selected' : ''}} value="YES">Yes</option>
+                                    <option {{$patient->has_heart_failure_dx === 'NO' ? 'selected' : ''}} value="NO">No</option>
+                                    <option {{$patient->has_heart_failure_dx === 'UNKNOWN' ? 'selected' : ''}} value="UNKNOWN">Unknown</option>
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Weight Management Goal Category</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="weightManagementGoalCategory">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->weight_management_goal_category === 'LOSE' ? 'selected' : ''}} value="LOSE">Lose</option>
+                                    <option {{$patient->weight_management_goal_category === 'GAIN' ? 'selected' : ''}} value="GAIN">Gain</option>
+                                    <option {{$patient->weight_management_goal_category === 'MAINTAIN' ? 'selected' : ''}} value="MAINTAIN">Maintain</option>
+                                </select>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Baseline Weight (lbs)</label>
+                                    <input type="number" class="form-control form-control-sm min-width-unset" name="baselineWeight" value="{{$patient->baseline_weight}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Baseline Min (lbs)</label>
+                                    <input type="number" class="form-control form-control-sm min-width-unset" name="baselineWeightMin" value="{{$patient->baseline_weight_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">Baseline Max (lbs)</label>
+                                    <input type="number" class="form-control form-control-sm min-width-unset" name="baselineWeightMax" value="{{$patient->baseline_weight_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Ideal Weight (lbs)</label>
+                                    <input type="number" class="form-control form-control-sm min-width-unset" name="idealWeight" value="{{$patient->ideal_weight}}">
+                                </div>
+                            </div>
+                        </div>
+                        <div class="pt-2">
+                            <button class="btn btn-success btn-sm" submit>Submit</button>
+                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <table class="table table-sm table-condensed table-bordered table-hover mt-3">
+                <tbody>
+                <tr>
+                    <td>Is Weight Monitoring Needed?</td>
+                    <td class="font-weight-bold">{{$patient->is_weight_monitoring_needed}}</td>
+                </tr>
+                @if($patient->is_weight_monitoring_needed === 'YES')
+                    <tr>
+                        <td>Why Is Weight Monitoring Needed</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed}}</td>
+                    </tr>
+                    <tr>
+                        <td>ICD 1</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed_icd1}}</td>
+                    </tr>
+                    <tr>
+                        <td>ICD 2</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed_icd2}}</td>
+                    </tr>
+                    <tr>
+                        <td>ICD 3</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed_icd3}}</td>
+                    </tr>
+                    <tr>
+                        <td>ICD 4</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed_icd4}}</td>
+                    </tr>
+                    <tr>
+                        <td>Description 1</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed_description1}}</td>
+                    </tr>
+                    <tr>
+                        <td>Description 2</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed_description2}}</td>
+                    </tr>
+                    <tr>
+                        <td>Description 3</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed_description3}}</td>
+                    </tr>
+                    <tr>
+                        <td>Description 4</td>
+                        <td class="font-weight-bold">{{$patient->why_is_weight_monitoring_needed_description4}}</td>
+                    </tr>
+                    <tr>
+                        <td>Has Heart Failure Dx?</td>
+                        <td class="font-weight-bold">{{$patient->has_heart_failure_dx}}</td>
+                    </tr>
+                    <tr>
+                        <td>Weight Management Goal Category</td>
+                        <td class="font-weight-bold">{{$patient->weight_management_goal_category}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline Weight (lbs)</td>
+                        <td class="font-weight-bold">{{$patient->baseline_weight}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline Min (lbs)</td>
+                        <td class="font-weight-bold">{{$patient->baseline_weight_min}}</td>
+                    </tr>
+                    <tr class="col-4">
+                        <td>Baseline Max (lbs)</td>
+                        <td class="font-weight-bold">{{$patient->baseline_weight_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal Weight (lbs)</td>
+                        <td class="font-weight-bold">{{$patient->ideal_weight}}</td>
+                    </tr>
+
+                @endif
+                </tbody>
+            </table>
+        </div>
+        <div class="col-6">
+            <div class="d-flex align-items-baseline">
+                <b>BP Management</b>
+                <span class="mx-2 text-secondary">|</span>
+                <div moe large>
+                    <a href="#" start show>Update</a>
+                    <form url="/api/client/updateBpManagementValue">
+                        <input type="hidden" name="uid" value="{{$patient->uid}}">
+                        <p>BP Management</p>
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Is BP Monitoring Needed?</label>
+                            <select type="text" class="form-control form-control-sm min-width-unset" condition name="isBpMonitoringNeeded">
+                                <option value="">-- select --</option>
+                                <option {{$patient->is_bp_monitoring_needed === 'YES' ? 'selected' : '' }} value="YES">Yes</option>
+                                <option {{$patient->is_bp_monitoring_needed === 'NO' ? 'selected' : '' }} value="NO">No</option>
+                                <option {{$patient->is_bp_monitoring_needed === 'UNKNOWN' ? 'selected' : '' }} value="UNKNOWN">Unknown</option>
+                            </select>
+                        </div>
+                        <div condition-key="isBpMonitoringNeeded" condition-value="YES">
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Why Is BP Monitoring Needed?</label>
+                                <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeeded" value="{{$patient->why_is_bp_monitoring_needed}}">
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-3 pr-0">
+                                    <label class="text-sm text-secondary mb-1">ICD 1</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeededIcd1" value="{{$patient->why_is_bp_monitoring_needed_icd1}}">
+                                </div>
+                                <div class="col-3 pr-0">
+                                    <label class="text-sm text-secondary mb-1">ICD 2</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeededIcd2" value="{{$patient->why_is_bp_monitoring_needed_icd2}}">
+                                </div>
+                                <div class="col-3 pr-0">
+                                    <label class="text-sm text-secondary mb-1">ICD 3</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeededIcd3" value="{{$patient->why_is_bp_monitoring_needed_icd3}}">
+                                </div>
+                                <div class="col-3">
+                                    <label class="text-sm text-secondary mb-1">ICD 4</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeededIcd4" value="{{$patient->why_is_bp_monitoring_needed_icd4}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-6 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Description 1</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeededDescription1" value="{{$patient->why_is_bp_monitoring_needed_description1}}">
+                                </div>
+                                <div class="col-6">
+                                    <label class="text-sm text-secondary mb-1">Description 2</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeededDescription2" value="{{$patient->why_is_bp_monitoring_needed_description2}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-6 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Description 3</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeededDescription3" value="{{$patient->why_is_bp_monitoring_needed_description3}}">
+                                </div>
+                                <div class="col-6">
+                                    <label class="text-sm text-secondary mb-1">Description 4</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="whyIsBpMonitoringNeededDescription4" value="{{$patient->why_is_bp_monitoring_needed_description4}}">
+                                </div>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Has Pre-Hypertension Dx?</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="hasPrehypertensionDx">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->has_prehypertension_dx === 'YES' ? 'selected' : ''}} value="YES">Yes</option>
+                                    <option {{$patient->has_prehypertension_dx === 'NO' ? 'selected' : ''}} value="NO">No</option>
+                                    <option {{$patient->has_prehypertension_dx === 'UNKNOWN' ? 'selected' : ''}} value="UNKNOWN">Unknown</option>
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Has Hypertension Dx?</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="hasHypertensionDx">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->has_hypertension_dx === 'YES' ? 'selected' : ''}} value="YES">Yes</option>
+                                    <option {{$patient->has_hypertension_dx === 'NO' ? 'selected' : ''}} value="NO">No</option>
+                                    <option {{$patient->has_hypertension_dx === 'UNKNOWN' ? 'selected' : ''}} value="UNKNOWN">Unknown</option>
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Is Prescribed Hypertension Medicine?</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="isPrescribedHypertensionMedicine">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->is_prescribed_hypertension_medicine === 'YES' ? 'selected' : ''}} value="YES">Yes</option>
+                                    <option {{$patient->is_prescribed_hypertension_medicine === 'NO' ? 'selected' : ''}} value="NO">No</option>
+                                    <option {{$patient->is_prescribed_hypertension_medicine === 'UNKNOWN' ? 'selected' : ''}} value="UNKNOWN">Unknown</option>
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Is goal to reduce hypertension medicine?</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="isGoalToReduceHypertensionMedicine">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->is_goal_to_reduce_hypertension_medicine === 'YES' ? 'selected' : ''}} value="YES">Yes</option>
+                                    <option {{$patient->is_goal_to_reduce_hypertension_medicine === 'NO' ? 'selected' : ''}} value="NO">No</option>
+                                    <option {{$patient->is_goal_to_reduce_hypertension_medicine === 'UNKNOWN' ? 'selected' : ''}} value="UNKNOWN">Unknown</option>
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Goal to reduce hypertension medicine</label>
+                                <input type="text" class="form-control form-control-sm min-width-unset" name="goalToReduceHypertensionMedicine" value="{{$patient->goal_to_reduce_hypertension_medicine}}">
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">SBP Management Goal Category</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="sbpManagementGoalCategory">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->sbp_management_goal_category === 'LOSE' ? 'selected' : ''}} value="LOSE">Lose</option>
+                                    <option {{$patient->sbp_management_goal_category === 'GAIN' ? 'selected' : ''}} value="GAIN">Gain</option>
+                                    <option {{$patient->sbp_management_goal_category === 'MAINTAIN' ? 'selected' : ''}} value="MAINTAIN">Maintain</option>
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">DBP Management Goal Category</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="dbpManagementGoalCategory">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->dbp_management_goal_category === 'LOSE' ? 'selected' : ''}} value="LOSE">Lose</option>
+                                    <option {{$patient->dbp_management_goal_category === 'GAIN' ? 'selected' : ''}} value="GAIN">Gain</option>
+                                    <option {{$patient->dbp_management_goal_category === 'MAINTAIN' ? 'selected' : ''}} value="MAINTAIN">Maintain</option>
+                                </select>
+                            </div>
+                            <div class="mb-2">
+                                <label class="text-sm text-secondary mb-1">Pulse Management Goal Category</label>
+                                <select type="text" class="form-control form-control-sm min-width-unset" name="pulseManagementGoalCategory">
+                                    <option value="">-- select --</option>
+                                    <option {{$patient->pulse_management_goal_category === 'LOSE' ? 'selected' : ''}} value="LOSE">Lose</option>
+                                    <option {{$patient->pulse_management_goal_category === 'GAIN' ? 'selected' : ''}} value="GAIN">Gain</option>
+                                    <option {{$patient->pulse_management_goal_category === 'MAINTAIN' ? 'selected' : ''}} value="MAINTAIN">Maintain</option>
+                                </select>
+                            </div>
+
+                            <p><b>Baseline AM Resting BP</b></p>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">SBP</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingSbp" value="{{$patient->baseline_am_resting_sbp}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">SBP Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingSbpMin" value="{{$patient->baseline_am_resting_sbp_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">SBP Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingSbpMax" value="{{$patient->baseline_am_resting_sbp_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">DBP</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingDbp" value="{{$patient->baseline_am_resting_dbp}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">DBP Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingDbpMin" value="{{$patient->baseline_am_resting_dbp_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">DBP Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingDbpMax" value="{{$patient->baseline_am_resting_dbp_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Pulse</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingPulse" value="{{$patient->baseline_am_resting_pulse}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Pulse Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingPulseMin" value="{{$patient->baseline_am_resting_pulse_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">Pulse Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselineAmRestingPulseMax" value="{{$patient->baseline_am_resting_pulse_max}}">
+                                </div>
+                            </div>
+
+
+
+                            <p><b>Baseline PM Resting BP</b></p>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">SBP</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingSbp" value="{{$patient->baseline_pm_resting_sbp}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">SBP Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingSbpMin" value="{{$patient->baseline_pm_resting_sbp_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">SBP Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingSbpMax" value="{{$patient->baseline_pm_resting_sbp_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">DBP</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingDbp" value="{{$patient->baseline_pm_resting_dbp}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">DBP Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingDbpMin" value="{{$patient->baseline_pm_resting_dbp_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">DBP Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingDbpMax" value="{{$patient->baseline_pm_resting_dbp_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Pulse</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingPulse" value="{{$patient->baseline_pm_resting_pulse}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Pulse Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingPulseMin" value="{{$patient->baseline_pm_resting_pulse_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">Pulse Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="baselinePmRestingPulseMax" value="{{$patient->baseline_pm_resting_pulse_max}}">
+                                </div>
+                            </div>
+
+
+
+                            <p><b>Ideal AM Resting BP</b></p>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">SBP</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingSbp" value="{{$patient->ideal_am_resting_sbp}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">SBP Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingSbpMin" value="{{$patient->ideal_am_resting_sbp_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">SBP Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingSbpMax" value="{{$patient->ideal_am_resting_sbp_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">DBP</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingDbp" value="{{$patient->ideal_am_resting_dbp}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">DBP Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingDbpMin" value="{{$patient->ideal_am_resting_dbp_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">DBP Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingDbpMax" value="{{$patient->ideal_am_resting_dbp_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Pulse</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingPulse" value="{{$patient->ideal_am_resting_pulse}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Pulse Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingPulseMin" value="{{$patient->ideal_am_resting_pulse_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">Pulse Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealAmRestingPulseMax" value="{{$patient->ideal_am_resting_pulse_max}}">
+                                </div>
+                            </div>
+
+
+
+                            <p><b>Ideal PM Resting BP</b></p>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">SBP</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingSbp" value="{{$patient->ideal_pm_resting_sbp}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">SBP Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingSbpMin" value="{{$patient->ideal_pm_resting_sbp_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">SBP Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingSbpMax" value="{{$patient->ideal_pm_resting_sbp_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">DBP</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingDbp" value="{{$patient->ideal_pm_resting_dbp}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">DBP Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingDbpMin" value="{{$patient->ideal_pm_resting_dbp_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">DBP Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingDbpMax" value="{{$patient->ideal_pm_resting_dbp_max}}">
+                                </div>
+                            </div>
+                            <div class="row mb-2">
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Pulse</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingPulse" value="{{$patient->ideal_pm_resting_pulse}}">
+                                </div>
+                                <div class="col-4 pr-0">
+                                    <label class="text-sm text-secondary mb-1">Pulse Min</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingPulseMin" value="{{$patient->ideal_pm_resting_pulse_min}}">
+                                </div>
+                                <div class="col-4">
+                                    <label class="text-sm text-secondary mb-1">Pulse Max</label>
+                                    <input type="text" class="form-control form-control-sm min-width-unset" name="idealPmRestingPulseMax" value="{{$patient->ideal_pm_resting_pulse_max}}">
+                                </div>
+                            </div>
+
+                        </div>
+                        <div class="pt-2">
+                            <button class="btn btn-success btn-sm" submit>Submit</button>
+                            <button class="btn btn-default border btn-sm" cancel>Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            <table class="table table-sm table-condensed table-bordered table-hover mt-3">
+                <tbody>
+                <tr>
+                    <td>Is BP Monitoring Needed?</td>
+                    <td class="font-weight-bold">{{$patient->is_bp_monitoring_needed}}</td>
+                </tr>
+                @if($patient->is_bp_monitoring_needed === 'YES')
+                    <tr>
+                        <td>Why Is Weight Monitoring Needed</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed}}</td>
+                    </tr>
+                    <tr>
+                        <td>ICD 1</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed_icd1}}</td>
+                    </tr>
+                    <tr>
+                        <td>ICD 2</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed_icd2}}</td>
+                    </tr>
+                    <tr>
+                        <td>ICD 3</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed_icd3}}</td>
+                    </tr>
+                    <tr>
+                        <td>ICD 4</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed_icd4}}</td>
+                    </tr>
+                    <tr>
+                        <td>Description 1</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed_description1}}</td>
+                    </tr>
+                    <tr>
+                        <td>Description 2</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed_description2}}</td>
+                    </tr>
+                    <tr>
+                        <td>Description 3</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed_description3}}</td>
+                    </tr>
+                    <tr>
+                        <td>Description 4</td>
+                        <td class="font-weight-bold">{{$patient->why_is_bp_monitoring_needed_description4}}</td>
+                    </tr>
+                    <tr>
+                        <td>Has Pre-Hypertension Dx?</td>
+                        <td class="font-weight-bold">{{$patient->has_prehypertension_dx}}</td>
+                    </tr>
+                    <tr>
+                        <td>Has Hypertension Dx?</td>
+                        <td class="font-weight-bold">{{$patient->has_hypertension_dx}}</td>
+                    </tr>
+
+                    <tr>
+                        <td>Is prescribed hypertension medicine?</td>
+                        <td class="font-weight-bold">{{$patient->is_prescribed_hypertension_medicine}}</td>
+                    </tr>
+                    <tr>
+                        <td>Is goal to reduce hypertension medicine?</td>
+                        <td class="font-weight-bold">{{$patient->is_goal_to_reduce_hypertension_medicine}}</td>
+                    </tr>
+                    <tr>
+                        <td>Goal to reduce hypertension medicine</td>
+                        <td class="font-weight-bold">{{$patient->goal_to_reduce_hypertension_medicine}}</td>
+                    </tr>
+                    <tr>
+                        <td>SBP management goal category</td>
+                        <td class="font-weight-bold">{{$patient->sbp_management_goal_category}}</td>
+                    </tr>
+                    <tr class="col-4">
+                        <td>DBP management goal category</td>
+                        <td class="font-weight-bold">{{$patient->dbp_management_goal_category}}</td>
+                    </tr>
+                    <tr>
+                        <td>Pulse management goal category</td>
+                        <td class="font-weight-bold">{{$patient->pulse_management_goal_category}}</td>
+                    </tr>
+
+
+
+                    <tr>
+                        <td>Baseline AM resting SBP</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_sbp}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline AM resting SBP min</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_sbp_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline AM resting SBP max</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_sbp_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline AM resting DBP</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_dbp}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline AM resting DBP min</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_dbp_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline AM resting DBP max</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_dbp_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline AM resting pulse</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_pulse}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline AM resting pulse min</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_pulse_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline AM resting pulse max</td>
+                        <td class="font-weight-bold">{{$patient->baseline_am_resting_pulse_max}}</td>
+                    </tr>
+
+                    <tr>
+                        <td>Baseline PM resting SBP</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_sbp}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline PM resting SBP min</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_sbp_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline PM resting SBP max</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_sbp_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline PM resting DBP</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_dbp}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline PM resting DBP min</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_dbp_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline PM resting DBP max</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_dbp_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline PM resting pulse</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_pulse}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline PM resting pulse min</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_pulse_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Baseline PM resting pulse max</td>
+                        <td class="font-weight-bold">{{$patient->baseline_pm_resting_pulse_max}}</td>
+                    </tr>
+
+
+                    <tr>
+                        <td>Ideal AM resting SBP</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_sbp}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal AM resting SBP min</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_sbp_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal AM resting SBP max</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_sbp_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal AM resting DBP</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_dbp}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal AM resting DBP min</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_dbp_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal AM resting DBP max</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_dbp_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal AM resting pulse</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_pulse}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal AM resting pulse min</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_pulse_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal AM resting pulse max</td>
+                        <td class="font-weight-bold">{{$patient->ideal_am_resting_pulse_max}}</td>
+                    </tr>
+
+                    <tr>
+                        <td>Ideal PM resting SBP</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_sbp}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal PM resting SBP min</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_sbp_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal PM resting SBP max</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_sbp_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal PM resting DBP</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_dbp}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal PM resting DBP min</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_dbp_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal PM resting DBP max</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_dbp_max}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal PM resting pulse</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_pulse}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal PM resting pulse min</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_pulse_min}}</td>
+                    </tr>
+                    <tr>
+                        <td>Ideal PM resting pulse max</td>
+                        <td class="font-weight-bold">{{$patient->ideal_pm_resting_pulse_max}}</td>
+                    </tr>
+
+                @endif
+                </tbody>
+            </table>
+        </div>
+    </div>
+
+    <script>
+        (function() {
+            function init() {
+                $('[condition]')
+                    .off('change.condition')
+                    .on('change.condition', function() {
+                        let form = $(this).closest('form');
+                        form.find('[condition-key="' + this.name + '"]').hide();
+                        form.find('[condition-key="' + this.name + '"][condition-value="' + this.value + '"]').show();
+                    })
+                    .trigger('change');
+            }
+            addMCInitializer('vitals-settings-{{$patient->uid}}', init, '#vitals-settings-{{$patient->uid}}')
+        }).call(window);
+    </script>
+
+@endsection

+ 2 - 2
resources/views/app/practice-management/billing-report.blade.php

@@ -72,8 +72,8 @@
                         <td class="text-nowrap border-left-0">
                             @foreach($row->note->claims as $claim)
                                 {{ $claim->status }}<br/>
-				<?php foreach($claim->mbClaims as $mbClaim ): continue; ?>
-                                {{$mbClaim->status}} {{$mbClaim->status_memo}}
+				                <?php foreach($claim->mbClaims as $mbClaim ): continue; ?>
+                                    {{$mbClaim->status}} {{$mbClaim->status_memo}}
                                	<?php endforeach; ?>
                             @endforeach
                         </td>

+ 68 - 0
resources/views/app/practice-management/care-month-report.blade.php

@@ -0,0 +1,68 @@
+@extends ('layouts/template')
+
+@section('content')
+    <div id="care-month-report" class="p-3 mcp-theme-1">
+        <div class="card">
+
+            <div class="card-header px-3 py-2 d-flex align-items-center">
+                <strong class="mr-4">
+                    <i class="fas fa-user-injured"></i>
+                    Care Month Report: {{date('M Y', strtotime($date))}}
+                </strong>
+                <div class="ml-auto">
+                    <input type="month" value="{{substr($date, 0, 7)}}" max="{{substr(date('Y-m-d'), 0, 7)}}" onchange="if(this.value){fastLoad('/pro-care-month-report?m=' + this.value.split('-')[1] + '&y=' + this.value.split('-')[0])}">
+                </div>
+            </div>
+
+            <div class="card-body p-0 border-0">
+                <table class="table table-sm table-condensed p-0 m-0">
+                    <thead class="bg-light">
+                    <tr>
+                        <th>Patient</th>
+                        <th>Role</th>
+                        <th># Days with measurements</th>
+                        <?php /* <th>Last Measurement</th> */ ?>
+                        <th># Minutes</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    @foreach ($records as $record)
+                        <tr>
+                            <td><a href="/patients/view/{{$record->client_uid}}/care-months/view/{{$record->care_month_uid}}">{{$record->client_name}}</a></td>
+                            <td>{{$record->mcp_pro_id === $pro->id ? 'MCP' : ($record->rme_pro_id === $pro->id ? 'RME' : ($record->rmm_pro_id === $pro->id ? 'RMM' : '-'))}}</td>
+                            <td>{{$record->number_of_days_with_remote_measurements}}</td>
+                            <?php /* <td>
+                                <?php
+                                $lastMeasurement = \App\Models\Measurement::where('care_month_id', $record->care_month_id)
+                                    ->whereNotNull('client_bdt_measurement_id')
+                                    ->where('is_cellular_zero', FALSE)
+                                    ->where('is_removed', FALSE)
+                                    ->where('label', '!=', 'SBP')
+                                    ->where('label', '!=', 'DBP')
+                                    ->whereNotNull('ts')
+                                    ->orderBy('ts', 'DESC')
+                                    ->first();
+                                ?>
+                                @if(!!$lastMeasurement)
+                                        @if($lastMeasurement->is_cellular_zero)
+                                            <i class="font-size-11 fa fa-rss"></i>
+                                        @elseif($lastMeasurement->label === 'BP')
+                                            Wt. {{ $lastMeasurement->sbp_mm_hg }}/{{ $lastMeasurement->dbp_mm_hg }} mmHg
+                                        @elseif($lastMeasurement->label === 'Wt. (lbs.)')
+                                            BP. {{ round(floatval($lastMeasurement->numeric_value), 2) }} lbs
+                                        @else
+                                            {{$lastMeasurement->label}}. {{$lastMeasurement->value}}
+                                        @endif
+                                @else
+                                    -
+                                @endif
+                            </td> */ ?>
+                            <td>{{$record->mcp_pro_id === $pro->id ? $record->rm_total_time_in_seconds_by_mcp : ($record->rme_pro_id === $pro->id ? $record->rm_total_time_in_seconds_by_rme_pro : ($record->rmm_pro_id === $pro->id ? $record->rm_total_time_in_seconds_by_rmm_pro : '-'))}}</td>
+                        </tr>
+                    @endforeach
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+@endsection

+ 290 - 0
resources/views/app/practice-management/notes-processing-center.blade.php

@@ -0,0 +1,290 @@
+@extends ('layouts/template')
+
+@section('content')
+    <style>
+      .iframes iframe {
+        width: 100%;
+        height: 800px;
+      }
+    </style>
+    <div id="notes-processing-center" class="p-3 mcp-theme-1">
+        <div class="card">
+
+            <div class="card-header p-2 d-flex align-items-center">
+                <strong class="mr-4">
+                    <i class="fas fa-user-injured"></i>
+                    Notes Processing Center
+                </strong>
+            </div>
+
+            <div class="card-header px-2 pt-2 pb-0 align-items-center bg-white">
+                <form id="filter-form" class="d-flex flex-wrap align-items-center">
+                    <div class="mr-2 mb-2 width-150px min-width-unset">
+                        <label class="text-secondary mb-1">Pro</label>
+                        <select class="form-control form-control-sm min-width-unset"
+                                name="proUid"
+                                provider-search
+                                data-pro-uid="{{request()->input('proUid')}}"
+                                required>
+                            <option value="">-- Select Pro --</option>
+                        </select>
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">Pro signed</label>
+                        <select class="form-control form-control-sm min-width-unset" name="proSigned">
+                            <option value="">All</option>
+                            <option {{request()->input('proSigned') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('proSigned') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">Billing marked done</label>
+                        <select class="form-control form-control-sm min-width-unset" name="billingMarkedDone">
+                            <option value="">All</option>
+                            <option {{request()->input('billingMarkedDone') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('billingMarkedDone') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">Billing Closed</label>
+                        <select class="form-control form-control-sm min-width-unset" name="billingClosed">
+                            <option value="">All</option>
+                            <option {{request()->input('billingClosed') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('billingClosed') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">Claiming Closed</label>
+                        <select class="form-control form-control-sm min-width-unset" name="claimingClosed">
+                            <option value="">All</option>
+                            <option {{request()->input('claimingClosed') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('claimingClosed') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">All claims submitted</label>
+                        <select class="form-control form-control-sm min-width-unset" name="allClaimsSubmitted">
+                            <option value="">All</option>
+                            <option {{request()->input('allClaimsSubmitted') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('allClaimsSubmitted') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">Good/Bad</label>
+                        <select class="form-control form-control-sm min-width-unset" name="goodBad">
+                            <option value="">All</option>
+                            <option {{request()->input('goodBad') === 'good' ? 'selected' : ''}} value="good">Good</option>
+                            <option {{request()->input('goodBad') === 'bad' ? 'selected' : ''}} value="bad">Bad</option>
+                            <option {{request()->input('goodBad') === 'unclassified' ? 'selected' : ''}} value="unclassified">Unclassified</option>
+                        </select>
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">Date From</label>
+                        <input type="date" name="startDate" class="form-control form-control-sm min-width-unset"
+                               value="{{request()->input('startDate')}}">
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">Date To</label>
+                        <input type="date" name="endDate" class="form-control form-control-sm min-width-unset"
+                               value="{{request()->input('endDate')}}">
+                    </div>
+                    <div class="mr-2 mb-2 width-150px">
+                        <label class="text-secondary mb-1">MC Part B</label>
+                        <select class="form-control form-control-sm min-width-unset" name="mcPartB">
+                            <option value="">All</option>
+                            <option {{request()->input('mcPartB') === 'yes' ? 'selected' : ''}} value="yes">Yes</option>
+                            <option {{request()->input('mcPartB') === 'no' ? 'selected' : ''}} value="no">No</option>
+                        </select>
+                    </div>
+                </form>
+
+
+
+            </div>
+            <div class="card-body p-0">
+
+                <table class="table table-sm table-condensed table-bordered border-0 p-0 m-0">
+                    <thead class="bg-light">
+                    <tr>
+                        <th>Patient</th>
+                        <th>Date</th>
+                        <th>HCP</th>
+                        <th>New/FU</th>  <!-- and method -->
+                        <th>ICDs</th>
+                        <th>HCP <br>signed?</th>
+                        <th>Billing <br>marked done?</th>
+                        <th>Billing <br>closed?</th>
+                        <th>Claiming <br>closed?</th>
+                        <th>Bills</th>
+                        <th>Claims</th>
+                        <th>Pickup</th>
+                        <th>Preview</th>
+                    </tr>
+                    </thead>
+                    <tbody>
+                    @foreach ($notes as $note)
+                        <?php $isCurrent = $note->currentNotePickupForProcessing && $note->currentNotePickupForProcessing->note && $note->currentNotePickupForProcessing->note->id === $note->id; ?>
+                        <tr class="{{$isCurrent ? 'bg-aliceblue' : ''}}">
+                            <td>
+                                <a href="/patients/view/{{ $note->client->uid }}">
+                                    {{ $note->client->displayName() }}
+                                </a>
+                            </td>
+                            <td>
+                                <a href="/patients/view/{{ $note->client->uid }}/notes/view/{{ $note->uid }}" class="font-weight-bold">
+                                    {{ friendly_date_time($note->effective_dateest, false) }}
+                                </a>
+                            </td>
+                            <td>
+                                {{$note->hcpPro ? $note->hcpPro->displayName() : '-'}}
+                            </td>
+                            <td>
+                                {{$note->new_or_fu_or_na}}
+                                @if($note->method)
+                                    <span class="text-secondary text-sm ml-1">({{$note->method}})</span>
+                                @endif
+                            </td>
+                            <td>
+                                <div class="d-flex flex-wrap width-100px">
+                                    @foreach($note->reasons as $reason)
+                                        <span class="border-bottom c-pointer mr-2 mb-1" title="{{$reason->description}}">{{$reason->code}}</span>
+                                    @endforeach
+                                </div>
+                            </td>
+                            <td>
+                                @if($note->is_signed_by_hcp)
+                                    <i class="fa fa-check text-info"></i>
+                                @else
+                                    <i class="fa fa-times text-warning-mellow"></i>
+                                @endif
+                            </td>
+                            <td>
+                                @if($note->is_billing_marked_done)
+                                    <i class="fa fa-check text-info"></i>
+                                @else
+                                    <i class="fa fa-times text-warning-mellow"></i>
+                                @endif
+                            </td>
+                            <td>
+                                @if($note->is_bill_closed)
+                                    <i class="fa fa-check text-info"></i>
+                                @else
+                                    <i class="fa fa-times text-warning-mellow"></i>
+                                @endif
+                            </td>
+                            <td>
+                                @if($note->is_claim_closed)
+                                    <i class="fa fa-check text-info"></i>
+                                @else
+                                    <i class="fa fa-times text-warning-mellow"></i>
+                                @endif
+                            </td>
+                            <td>
+                                @foreach($note->bills as $bill)
+                                    @if(!$bill->is_cancelled)
+                                        <div class="mb-1 d-flex align-items-baseline">
+                                            <b>{{$bill->code}}</b>
+                                            <?php
+                                            $mins = round($bill->number_of_units * 60);
+                                            ?>
+                                            <span class="ml-2">{{$mins}} min{{$mins !== 1 ? 's' : ''}}</span>
+                                        </div>
+                                    @endif
+                                @endforeach
+                            </td>
+                            <td>
+                                @foreach($note->claims as $claim)
+                                    @if(!$claim->is_cancelled && $claim->lines->count())
+                                        @foreach($claim->lines as $line)
+                                        <div class="mb-1 d-flex align-items-baseline">
+                                            <b>{{$line->cpt}}</b>
+                                            <span class="ml-2">{{friendlier_date($line->date_of_service)}}</span>
+                                            <span class="ml-2">
+                                                @if(count($line->claimLineIcds))
+                                                    @foreach($line->claimLineIcds as $icd)
+                                                        <span class="c-pointer border-bottom" title="{{$icd->description}}">{{$icd->code}}</span>
+                                                    @endforeach
+                                                @endif
+                                            </span>
+                                        </div>
+                                        @endforeach
+                                    @endif
+                                @endforeach
+                            </td>
+                            <td>
+                                @if($isCurrent)
+                                    <span class="text-info font-weight-bold">CURRENT</span>
+                                @else
+                                    <a href="#" data-uid="{{$note->uid}}" class="pick-up-for-processing">Pickup</a>
+                                @endif
+                            </td>
+                            <td>
+                                <a native target="_blank"
+                                   open-in-stag-popup
+                                   update-parent
+                                   mc-initer="note-single"
+                                   title="Note Details"
+                                   href="/patients/view/{{ $note->client->uid }}/notes/view/{{ $note->uid }}">
+                                    Preview
+                                </a>
+                            </td>
+                        </tr>
+                    @endforeach
+                    </tbody>
+                </table>
+
+                {{ $notes->withQueryString()->links() }}
+
+            </div>
+        </div>
+        @if($pro->currentNotePickupForProcessing && $pro->currentNotePickupForProcessing->note)
+            <?php
+            $cnPatientUid = $pro->currentNotePickupForProcessing->note->client->uid;
+            $cnNoteUid = $pro->currentNotePickupForProcessing->note->uid;
+            ?>
+            <div class="row iframes pt-5">
+                <div class="col-md-5">
+                    <iframe id="target-chart" data-src="/patients/view/{{$cnPatientUid}}/notes" native></iframe>
+                </div>
+                <div class="col-md-7">
+                    <iframe id="target-note" data-src="/patients/view/{{$cnPatientUid}}/notes/view/{{$cnNoteUid}}" native></iframe>
+                </div>
+            </div>
+        @endif
+    </div>
+
+    <script>
+        (function () {
+            function init() {
+                $('.pick-up-for-processing')
+                    .off('click')
+                    .on('click', function() {
+                         $.post('/api/note/pickUpForProcessing', {
+                             uid: $(this).attr('data-uid')
+                         }, _data => {
+                             if(!hasResponseError(_data)) {
+                                 fastReload();
+                             }
+                         }, 'json');
+                         return false;
+                    });
+                $('#filter-form select,#filter-form  input')
+                    .off('change')
+                    .on('change', function() {
+                        let params = $('#filter-form').serialize();
+                        fastLoad('/practice-management/notes-processing-center?' + params);
+                        return false;
+                    });
+                @if($pro->currentNotePickupForProcessing && $pro->currentNotePickupForProcessing->note)
+                    $('#target-chart').attr('src', $('#target-chart').attr('data-src'));
+                    $('#target-note').attr('src', $('#target-note').attr('data-src'));
+                    window.setTimeout(() => {
+                        $('.row.iframes')[0].scrollIntoView();
+                    }, 250);
+                @endif
+            }
+            addMCInitializer('notes-processing-center', init, '#notes-processing-center')
+        }).call(window);
+    </script>
+
+@endsection

+ 18 - 0
resources/views/app/practice-management/process-claims.blade.php

@@ -390,6 +390,7 @@
                         },
                         setCurrentClaim: function(_index) {
                             let claim = this.claims[_index];
+                            localStorage.currentClaimUid = claim.uid;
                             if(this.currentClaim && this.currentClaim.uid === claim.uid) return;
                             this.currentMBClaim = null;
                             this.currentClaimLines = null;
@@ -425,6 +426,18 @@
                         },
                         resetCurrentClaim: function() {
                             if(this.claims && this.claims.length) {
+
+                                let storedClaimUid = localStorage.currentClaimUid;
+                                if(storedClaimUid) {
+                                    for (let i = 0; i < this.claims.length; i++) {
+                                        if (storedClaimUid === this.claims[i].uid && (!this.claims[i].status || this.claims[i].status === 'NEW' ||
+                                            (this.claims[i].status === 'PICKED_UP' && this.claims[i].status_pro_id === this.proId))) {
+                                            this.setCurrentClaim(i);
+                                            return;
+                                        }
+                                    }
+                                }
+
                                 for (let i = 0; i < this.claims.length; i++) {
                                     if (!this.claims[i].status || this.claims[i].status === 'NEW' ||
                                         (this.claims[i].status === 'PICKED_UP' && this.claims[i].status_pro_id === this.proId)) {
@@ -512,6 +525,11 @@
                                 });
                                 return false;
                             });
+
+                        // auto-reload every minute
+                        window.setTimeout(() => {
+                            fastReload();
+                        }, 60000);
                     }
                 })
 

+ 109 - 69
resources/views/layouts/patient.blade.php

@@ -30,6 +30,10 @@
                             <a class="nav-link {{ strpos($routeName, 'patients.view.flowsheets') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.flowsheets', ['patient' => $patient]) }}">Flowsheets</a>
                         </li>
+                        <li class="nav-item">
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.vitals-settings') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.vitals-settings', ['patient' => $patient]) }}">Vitals Settings</a>
+                        </li>
                         <li class="nav-item">
                             <a class="nav-link {{ strpos($routeName, 'patients.view.vitals-graph') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.vitals-graph', ['patient' => $patient]) }}">Vitals Graph</a>
@@ -90,6 +94,42 @@
                                 </li>
                             </ul>
                         </li> */ ?>
+                        <li class="nav-item">
+                            <a class="nav-link {{ strpos($routeName, 'patients.view.patient-prescriptions') === 0 ? 'active' : '' }}"
+                               href="{{ route('patients.view.patient-prescriptions', ['patient' => $patient]) }}">Prescriptions **</a>
+                            <?php /*
+                            <ul class="m-0 p-0 nav-child-list">
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === '' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => '']) }}">All</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'erx' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'erx']) }}">Drug</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'lab' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'lab']) }}">Lab</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'imaging' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'imaging']) }}">Imaging</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'referral' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'referral']) }}">Referral</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'supply' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'supply']) }}">Supply</a>
+                                </li>
+                                <li class="nav-item">
+                                    <a class="nav-link {{ strpos($routeName, 'patients.view.patient-erx') === 0 && @$type === 'other' ? 'active' : '' }}"
+                                       href="{{ route('patients.view.patient-erx', ['patient' => $patient, 'type' => 'other']) }}">Other</a>
+                                </li>
+                            </ul>
+                            */ ?>
+                        </li>
                         <li class="nav-item">
                             <a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 ? 'active' : '' }}"
                                href="{{ route('patients.view.patient-tickets', ['patient' => $patient]) }}">ERx / Orders</a>
@@ -224,7 +264,7 @@
                             <button class="btn btn-info" onclick="$('.in-conv-confirmed').removeClass('d-none').addClass('d-inline-flex')">I am currently seeing or talking to this patient</button>
                             <div class="in-conv-confirmed d-none align-items-center">
                                 <i class="fa fa-chevron-right mx-3 text-secondary"></i>
-                                <div moe>
+                                <div moe class=" hide-inside-popup">
                                     <a href="" start show class="btn btn-primary font-weight-bold text-white">
                                         Assign myself as the MCP for this patient
                                     </a>
@@ -379,7 +419,7 @@
                                                 @endif
                                                 @if(!$patient->was_medicare_validation_successful)
                                                     @if(!$patient->is_coverage_manually_verified)
-                                                    <div moe relative class="ml-2">
+                                                    <div moe relative class="ml-2 hide-inside-popup">
                                                         <a start show class="font-weight-bold">Manually verify coverage</a>
                                                         <form url="/api/client/markCoverageAsManuallyVerified" class="mcp-theme-1" right>
                                                             <input type="hidden" name="uid" value="{{$patient->uid}}">
@@ -414,7 +454,7 @@
                                             <div>Joined <?=$memberSince?></div>
                                             <div><label>MCP:</label> {{$mcpName}}
                                                 @if($patient->has_mcp_done_onboarding_visit !== 'YES' && $pro->pro_type == 'ADMIN')
-                                                    <div moe class="ml-2">
+                                                    <div moe class="ml-2 hide-inside-popup">
                                                         <a start show><i class="fa fa-edit"></i></a>
                                                         <form url="/api/client/putMcp" class="mcp-theme-1">
                                                             <input type="hidden" name="uid" value="{{$patient->uid}}">
@@ -440,7 +480,7 @@
                                                         </form>
                                                     </div>
                                                     @if($patient->mcp)
-                                                        <div moe class="ml-2">
+                                                        <div moe class="ml-2 hide-inside-popup">
                                                             <a start show><i class="fa fa-times"></i></a>
                                                             <form url="/api/client/removeMcp" class="mcp-theme-1">
                                                                 <input type="hidden" name="uid" value="{{$patient->uid}}">
@@ -464,72 +504,72 @@
                                         <div>
                                             @if($patient->has_mcp_done_onboarding_visit !== 'YES')
                                                 <span class="text-dark d-inline-flex align-items-center">
-                                            <span class="mr-2">
-                                                <i class="fa fa-exclamation-triangle"></i>
-                                                MCP Onboarding Visit Pending
-                                            </span>
-                                        </span>
-                                                <span moe>
-                                            <a start show><i class="fa fa-edit"></i></a>
-                                            <form url="/api/client/updateMcpOnboardingVisitInfo" class="mcp-theme-1">
-                                                <input type="hidden" name="uid" value="{{$patient->uid}}">
-                                                <div class="mb-2">
-                                                    <select name="hasMcpDoneOnboardingVisit"
-                                                            class="form-control form-control-sm"
-                                                            onchange="toggleDisabledAsNeeded(this, 'YES', 'if-visit-done')">
-                                                        <option value="">-- Select Status --</option>
-                                                        <option value="YES" {{ $patient->has_mcp_done_onboarding_visit === 'YES' ? 'selected' : '' }}>YES</option>
-                                                        <option value="NO" {{ $patient->has_mcp_done_onboarding_visit === 'NO' ? 'selected' : '' }}>NO</option>
-                                                        <option value="UNKNOWN" {{ $patient->has_mcp_done_onboarding_visit === 'UNKNOWN' ? 'selected' : '' }}>UNKNOWN</option>
-                                                    </select>
-                                                </div>
-                                                <div class="mb-2">
-                                                    <input type="date"
-                                                           class="if-visit-done form-control form-control-sm" disabled
-                                                           name="mcpOnboardingVisitDate" value="{{ date('Y-m-d') }}"
-                                                           max="{{ date('Y-m-d') }}">
-                                                </div>
-                                                <div class="mb-2">
-                                                    <select name="mcpOnboardingVisitNoteUid" disabled
-                                                            class="form-control form-control-sm if-visit-done"
-                                                            onchange="if(this.value === '-- create --') createNewNote('{{$patient->uid}}', '{{$pro->uid}}', '{{date('Y-m-d')}}');">
-                                                        <option value="">-- Visit Note --</option>
-                                                        <?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
-                                                        @foreach ($notes as $note)
-                                                            @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
-                                                                <option
-                                                                    {{ $patient->mcp_onboarding_visit_note_id === $note->id ? 'selected' : '' }}
-                                                                    value="{{$note->uid}}">{{$note->title}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
-                                                            @endif
-                                                        @endforeach
-                                                        {{--<option value="-- create --">-- Create Note --</option>--}}
-                                                    </select>
-                                                </div>
-                                                <div class="mb-2 if-note-outside-system">
-                                                    <textarea class="form-control form-control-sm"
-                                                              name="reasonOnboardingVisitNoteOutsideSystem"
-                                                              placeholder="Visit note outside the system reason"
-                                                              spellcheck="false" data-gramm="false"></textarea>
-                                                </div>
-                                                <div>
-                                                    <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
-                                                    <button cancel class="btn btn-sm btn-default border">Cancel</button>
-                                                </div>
-                                            </form>
-                                        </span>
+                                                    <span class="mr-2">
+                                                        <i class="fa fa-exclamation-triangle"></i>
+                                                        MCP Onboarding Visit Pending
+                                                    </span>
+                                                </span>
+                                                <span moe class="hide-inside-popup">
+                                                    <a start show><i class="fa fa-edit"></i></a>
+                                                    <form url="/api/client/updateMcpOnboardingVisitInfo" class="mcp-theme-1">
+                                                        <input type="hidden" name="uid" value="{{$patient->uid}}">
+                                                        <div class="mb-2">
+                                                            <select name="hasMcpDoneOnboardingVisit"
+                                                                    class="form-control form-control-sm"
+                                                                    onchange="toggleDisabledAsNeeded(this, 'YES', 'if-visit-done')">
+                                                                <option value="">-- Select Status --</option>
+                                                                <option value="YES" {{ $patient->has_mcp_done_onboarding_visit === 'YES' ? 'selected' : '' }}>YES</option>
+                                                                <option value="NO" {{ $patient->has_mcp_done_onboarding_visit === 'NO' ? 'selected' : '' }}>NO</option>
+                                                                <option value="UNKNOWN" {{ $patient->has_mcp_done_onboarding_visit === 'UNKNOWN' ? 'selected' : '' }}>UNKNOWN</option>
+                                                            </select>
+                                                        </div>
+                                                        <div class="mb-2">
+                                                            <input type="date"
+                                                                   class="if-visit-done form-control form-control-sm" disabled
+                                                                   name="mcpOnboardingVisitDate" value="{{ date('Y-m-d') }}"
+                                                                   max="{{ date('Y-m-d') }}">
+                                                        </div>
+                                                        <div class="mb-2">
+                                                            <select name="mcpOnboardingVisitNoteUid" disabled
+                                                                    class="form-control form-control-sm if-visit-done"
+                                                                    onchange="if(this.value === '-- create --') createNewNote('{{$patient->uid}}', '{{$pro->uid}}', '{{date('Y-m-d')}}');">
+                                                                <option value="">-- Visit Note --</option>
+                                                                <?php $notes = \App\Models\Note::where('client_id', $patient->id)->get() ?>
+                                                                @foreach ($notes as $note)
+                                                                    @if(!empty($note->title) && $note->client_id === $patient->id && !$note->is_cancelled)
+                                                                        <option
+                                                                            {{ $patient->mcp_onboarding_visit_note_id === $note->id ? 'selected' : '' }}
+                                                                            value="{{$note->uid}}">{{$note->title}} ({{friendly_date_time($note->effective_dateest, false)}})</option>
+                                                                    @endif
+                                                                @endforeach
+                                                                {{--<option value="-- create --">-- Create Note --</option>--}}
+                                                            </select>
+                                                        </div>
+                                                        <div class="mb-2 if-note-outside-system">
+                                                            <textarea class="form-control form-control-sm"
+                                                                      name="reasonOnboardingVisitNoteOutsideSystem"
+                                                                      placeholder="Visit note outside the system reason"
+                                                                      spellcheck="false" data-gramm="false"></textarea>
+                                                        </div>
+                                                        <div>
+                                                            <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
+                                                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                                                        </div>
+                                                    </form>
+                                                </span>
                                             @else
                                                 <span class="text-dark d-inline-flex align-items-center">
-                                            <span class="mr-2 text-secondary">
-                                                <i class="fa fa-check text-sm"></i>
-                                                MCP Onboarding Visit Completed
-                                            </span>
-                                        </span>
+                                                    <span class="mr-2 text-secondary">
+                                                        <i class="fa fa-check text-sm"></i>
+                                                        MCP Onboarding Visit Completed
+                                                    </span>
+                                                </span>
                                             @endif
                                         </div>
                                         <div>
                                             <label>Physician:</label> {{$patient->pcp ? $patient->pcp->displayName() : '-' }}
                                             @if($pro->pro_type == 'ADMIN')
-                                                <div moe class="ml-2">
+                                                <div moe class="ml-2 hide-inside-popup">
                                                     <a start show><i class="fa fa-edit"></i></a>
                                                     <form url="/api/client/putPhysicianPro" class="mcp-theme-1">
                                                         <input type="hidden" name="uid" value="{{$patient->uid}}">
@@ -555,7 +595,7 @@
                                                     </form>
                                                 </div>
                                                 @if($patient->pcp)
-                                                <div moe class="ml-2">
+                                                <div moe class="ml-2 hide-inside-popup">
                                                     <a start show><i class="fa fa-times"></i></a>
                                                     <form url="/api/client/removePhysicianPro" class="mcp-theme-1">
                                                         <input type="hidden" name="uid" value="{{$patient->uid}}">
@@ -578,7 +618,7 @@
                                         <div>
                                             <label>Nurse:</label> {{$patient->defaultNaPro ? $patient->defaultNaPro->displayName() : '-' }}
                                             @if($pro->pro_type == 'ADMIN')
-                                                <div moe class="ml-2">
+                                                <div moe class="ml-2 hide-inside-popup">
                                                     <a start show><i class="fa fa-edit"></i></a>
                                                     <form url="/api/client/putDefaultNaPro" class="mcp-theme-1">
                                                         <input type="hidden" name="uid" value="{{$patient->uid}}">
@@ -604,7 +644,7 @@
                                                     </form>
                                                 </div>
                                                 @if($patient->defaultNaPro)
-                                                    <div moe class="ml-2">
+                                                    <div moe class="ml-2 hide-inside-popup">
                                                         <a start show><i class="fa fa-times"></i></a>
                                                         <form url="/api/client/removeDefaultNaPro" class="mcp-theme-1">
                                                             <input type="hidden" name="uid" value="{{$patient->uid}}">
@@ -682,7 +722,7 @@
                                             <label class="ml-2">RM:</label> {{ $patient->is_enrolled_in_rm === 'YES' ? 'Yes' : 'No' }}
                                         </div>
                                     </section>--}}
-                                    <section class="screen-only vbox mt-2 align-self-start ml-4">
+                                    <section class="hide-inside-popup screen-only vbox mt-2 align-self-start ml-4">
                                         <div moe>
                                             <button start show><i class="fa fa-plus text-sm text-secondary"></i>&nbsp;Note
                                             </button>
@@ -789,7 +829,7 @@
                                         </span>
                                         </div>
                                     </section>
-                                    <section class="screen-only vbox mt-2 align-self-start ml-1">
+                                    <section class="hide-inside-popup screen-only vbox mt-2 align-self-start ml-1">
                                         @if($performer->pro->pro_type == 'ADMIN')
                                         <div>
                                             <button class="col-2-button" onclick="return openInRHS('/pro/check-video/{{ $patient->uid }}')">Check Video</button>
@@ -927,7 +967,7 @@
                                             <span class="aligned-icon"><i class="fa fa-envelope" aria-hidden="true"></i></span>
                                             {{$confirmedEmail}}
                                         </li>
-                                        <li class="screen-only">
+                                        <li class="screen-only hide-inside-popup">
                                             <span class="aligned-icon text-primary">
                                                 <i class="fa fa-link" aria-hidden="true"></i>
                                             </span>

+ 2 - 0
resources/views/layouts/template.blade.php

@@ -112,6 +112,7 @@
                         <a class="dropdown-item" href="/practice-management/notes/not-yet-signed">Pending Notes to Sign</a>
                         <a class="dropdown-item" href="/practice-management/notes/not-yet-signed-but-ally-signed">Pending Notes to Sign (Ally Signed)</a>
                         <a class="dropdown-item" href="{{ route('practice-management.remote-monitoring') }}">Remote Monitoring</a>
+                        <a class="dropdown-item" href="{{ route('pro-care-month-report') }}">Care Month Report</a>
                         <a class="dropdown-item" href="{{ route('practice-management.rm-bills-to-sign') }}">RM Bills to Sign</a>
                         <a class="dropdown-item" href="{{ route('unmapped-sms') }}">Unmapped SMS</a>
                         <a class="dropdown-item" href="{{ route('practice-management.myTickets') }}">My Tickets</a>
@@ -135,6 +136,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.claims') }}">Claim Matrix</a>
                             <a class="dropdown-item" href="{{ route('practice-management.process-claims') }}">Process Claims</a>
                             <a class="dropdown-item" href="{{ route('practice-management.process-notes') }}">Process Notes</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.notes-processing-center') }}">Notes Processing Center</a>
 {{--                            <a class="dropdown-item" href="{{ route('practice-management.hcpBillMatrix') }}">HCP Bill Matrix</a>--}}
                             @if(false)
                                 <a class="dropdown-item" href="{{ route('practice-management.treatmentServiceUtil') }}">Treatment Service Util.</a>

+ 13 - 1
routes/web.php

@@ -45,6 +45,8 @@ Route::get("/appointment-confirmation/{appointmentUid}", 'GuestController@appoin
 Route::post("/process-appointment-confirmation", 'GuestController@processAppointmentConfirmation')->name('process-appointment_confirmation');
 
 Route::get('/ticket-download-as-pdf/{ticket}', 'TicketController@downloadAsPdf')->name('ticket-download-as-pdf');
+Route::get('/prescription-download-as-pdf/{prescription}', 'PatientController@downloadPrescriptionAsPdf')->name('prescription-download-as-pdf');
+Route::any('/prescription-transmit/{prescription}', 'PatientController@transmitPrescription')->name('prescription-transmit');
 Route::get('/get-ticket-faxes/{ticket}', 'TicketController@getTicketFaxes')->name('get-ticket-faxes');
 
 Route::middleware('pro.auth')->group(function () {
@@ -100,6 +102,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('rm-launch-and-clean', 'PracticeManagementController@rmLaunchAndClean')->name('rm-launch-and-clean');
         Route::get('process-claims', 'PracticeManagementController@processClaims')->name('process-claims');
         Route::get('process-notes', 'PracticeManagementController@processNotes')->name('process-notes');
+        Route::get('notes-processing-center', 'PracticeManagementController@notesProcessingCenter')->name('notes-processing-center');
         Route::get('picked-notes', 'PracticeManagementController@pickedNotes')->name('picked-notes');
         Route::get('bad-notes', 'PracticeManagementController@badNotes')->name('bad-notes');
         Route::get('done-notes', 'PracticeManagementController@doneNotes')->name('done-notes');
@@ -274,12 +277,18 @@ Route::middleware('pro.auth')->group(function () {
             // flowsheets
             Route::get('flowsheets/{filter?}', 'PatientController@flowsheets')->name('flowsheets');
 
+            // vitals-settings
+            Route::get('vitals-settings/{filter?}', 'PatientController@vitalsSettings')->name('vitals-settings');
+
             // vitals-graph
             Route::get('vitals-graph/{filter?}', 'PatientController@vitalsGraph')->name('vitals-graph');
 
-            // tickets
+            // tickets (old/deprecated)
             Route::get('tickets/{type?}/{currentTicket?}', 'PatientController@tickets')->name('patient-tickets');
 
+            // prescriptions (new)
+            Route::get('prescriptions/{type?}/{currentErx?}', 'PatientController@prescriptions')->name('patient-prescriptions');
+
             // appointments
             Route::get('appointments/{forPro}/{status}', 'PatientController@appointments')->name('appointments');
 
@@ -369,6 +378,9 @@ Route::middleware('pro.auth')->group(function () {
 
     Route::get('/remote-monitoring-measurements/{careMonth}', 'PracticeManagementController@remoteMonitoringMeasurements')->name('remote-monitoring-measurements');
 
+    Route::get('/patient-care-month-matrix/{careMonth}', 'PatientController@careMonthMatrix')->name('patient-care-month-matrix');
+    Route::get('/pro-care-month-report', 'PracticeManagementController@careMonthReport')->name('pro-care-month-report');
+
     // fdb playground
     Route::get('/fdb-pg-rx', 'FDBPGController@rx')->name('fdb-pg-rx');
     Route::get('/fdb-med-suggest', 'FDBPGController@medSuggest');

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů