浏览代码

Note sections - support for +/- fields

Vijayakrishnan Krishnan 4 年之前
父节点
当前提交
a512e0ca37
共有 3 个文件被更改,包括 142 次插入53 次删除
  1. 6 4
      public/css/style.css
  2. 48 5
      resources/views/app/patient/note/dashboard.blade.php
  3. 88 44
      storage/sections/subjective/templates.json

+ 6 - 4
public/css/style.css

@@ -447,18 +447,20 @@ input.search_field, textarea.search_field {
     position: relative;
     height: 25px;
 }
+.note-template-container .note-template-item .note-template-text {
+    border-bottom: 1px solid #eee;
+}
 .note-template-container .note-template-item .label {
     padding: 3px 6px;
     padding-right: 25px;
     white-space: nowrap;
-    display: flex;
+    display: inline-flex;
     align-items: center;
-    border-bottom: 1px solid #eee;
     min-width: 120px;
     cursor: pointer;
 }
-.note-template-container .note-template-item .label:hover,
-.note-template-container .note-template-item.selected>.note-template-text>.label {
+.note-template-container .note-template-item:hover,
+.note-template-container .note-template-item.selected {
     background: aliceblue;
 }
 .note-template-container .note-template-item .label>input[type="checkbox"] {

+ 48 - 5
resources/views/app/patient/note/dashboard.blade.php

@@ -234,12 +234,18 @@
                             'template="' . (isset($template->template) ? $template->template : $template->text) . '" ' .
                             'type="' . (isset($template->type) ? $template->type : "value") . '" ' .
                             '>' .
-                            '<div class="note-template-text">' .
+                            '<div class="note-template-text d-flex align-items-center">' .
                                 '<span class="label">' .
                                 '<input type="checkbox" />' .
                                 '<span>' . $template->text . '</span>' .
-                                '</span>
-                            </div>';
+                                '</span>';
+                            if(isset($template->type) && $template->type === 'plus-minus') {
+                                echo '<div class="ml-auto mr-2 text-nowrap">';
+                                echo '<a href="#" class="plus-trigger"><i class="fa fa-plus-circle"></i></a>';
+                                echo '<a href="#" class="minus-trigger ml-1"><i class="fa fa-minus-circle"></i></a>';
+                                echo '</div>';
+                            }
+                            echo '</div>';
                     if(isset($template->children) && count($template->children)) {
                         echo '<i class="fa fa-chevron-right has-children"></i>';
                         echo '<div class="note-template-children">';
@@ -248,7 +254,7 @@
                         }
                         echo '</div>';
                     }
-                    else if(isset($template->type)) {
+                    else if(isset($template->type) && $template->type !== 'plus-minus') {
                         echo '<i class="fa fa-chevron-right has-children"></i>';
                         echo '<div class="note-template-children">';
                         if($template->type === 'alpha') {
@@ -521,6 +527,7 @@
                         let container = $(this).closest('.note-section').find('.note-template-container');
                         container.find('.note-template-children').hide();
                         container.find('.note-template-item.selected').removeClass('selected');
+                        container.find('.note-template-item[prefix]').removeAttr('prefix');
                         container.find('input[type="checkbox"]').prop('checked', false);
                         container.find('.note-template-output-text').empty();
                         container.show();
@@ -590,10 +597,46 @@
                         generateTemplateOutput();
                     });
 
+                $('.note-template-item .plus-trigger')
+                    .off('click.plus-trigger')
+                    .on('click.plus-trigger', function() {
+                        let item = $(this).closest('.note-template-item');
+                        if(item.attr('prefix') === '(+)') {
+                            item.removeAttr('prefix');
+                            item.find('>.note-template-text>.label>input[type="checkbox"]').prop('checked', false);
+                            item.removeClass('selected');
+                        }
+                        else {
+                            item.attr('prefix', '(+)');
+                            item.find('>.note-template-text>.label>input[type="checkbox"]').prop('checked', true);
+                            item.addClass('selected');
+                        }
+                        generateTemplateOutput();
+                        return false;
+                    });
+
+                $('.note-template-item .minus-trigger')
+                    .off('click.plus-trigger')
+                    .on('click.plus-trigger', function() {
+                        let item = $(this).closest('.note-template-item');
+                        if(item.attr('prefix') === '(-)') {
+                            item.removeAttr('prefix');
+                            item.find('>.note-template-text>.label>input[type="checkbox"]').prop('checked', false);
+                            item.removeClass('selected');
+                        }
+                        else {
+                            item.attr('prefix', '(-)');
+                            item.find('>.note-template-text>.label>input[type="checkbox"]').prop('checked', true);
+                            item.addClass('selected');
+                        }
+                        generateTemplateOutput();
+                        return false;
+                    });
+
             }
 
             function generateOutputForNode(_node) {
-                let template = _node.attr('template'),
+                let template = (_node.attr('prefix') ? _node.attr('prefix') + ' ' : '') + _node.attr('template'),
                     value = template;
                 if(value.indexOf('{text}') !== -1) {
                     value = value.replace('{text}',

+ 88 - 44
storage/sections/subjective/templates.json

@@ -300,87 +300,108 @@
             "children": [
                 {
                     "text": "able to tolerate fluids",
-                    "template": "able to tolerate fluids"
+                    "template": "able to tolerate fluids",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "able to tolerate food",
-                    "template": "able to tolerate food"
+                    "template": "able to tolerate food",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "anorexia",
-                    "template": "anorexia"
+                    "template": "anorexia",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "weight loss",
-                    "template": "weight loss"
+                    "template": "weight loss",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "weight gain",
-                    "template": "weight gain"
+                    "template": "weight gain",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "hemetemesis",
-                    "template": "hemetemesis"
+                    "template": "hemetemesis",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "bilious vomiting",
-                    "template": "bilious vomiting"
+                    "template": "bilious vomiting",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "projectile vomiting",
-                    "template": "projectile vomiting"
+                    "template": "projectile vomiting",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "dysphagia",
-                    "template": "dysphagia"
+                    "template": "dysphagia",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "bloating",
-                    "template": "bloating"
+                    "template": "bloating",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "flatulence",
-                    "template": "flatulence"
+                    "template": "flatulence",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "reflux",
-                    "template": "reflux"
+                    "template": "reflux",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "blood in stool",
-                    "template": "blood in stool"
+                    "template": "blood in stool",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "melena",
-                    "template": "melena"
+                    "template": "melena",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "diarrhea",
-                    "template": "diarrhea"
+                    "template": "diarrhea",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "constipation",
-                    "template": "constipation"
+                    "template": "constipation",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "chest pain",
-                    "template": "chest pain"
+                    "template": "chest pain",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "back pain",
-                    "template": "back pain"
+                    "template": "back pain",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "dysuria",
-                    "template": "dysuria"
+                    "template": "dysuria",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "urinary frequency",
-                    "template": "urinary frequency"
+                    "template": "urinary frequency",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "genital discharge",
-                    "template": "genital discharge"
+                    "template": "genital discharge",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "other pertinent sx (describe)",
@@ -777,47 +798,58 @@
             "children": [
                 {
                     "text": "diabetes type 1",
-                    "template": "diabetes type 1"
+                    "template": "diabetes type 1",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "diabetes type 2",
-                    "template": "diabetes type 2"
+                    "template": "diabetes type 2",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "migraine",
-                    "template": "migraine"
+                    "template": "migraine",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "nephrolithiasis",
-                    "template": "nephrolithiasis"
+                    "template": "nephrolithiasis",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "C difficile infection",
-                    "template": "C difficile infection"
+                    "template": "C difficile infection",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "inflammatory bowel disease",
-                    "template": "inflammatory bowel disease"
+                    "template": "inflammatory bowel disease",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "irritable bowel disease",
-                    "template": "irritable bowel disease"
+                    "template": "irritable bowel disease",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "s\/p appendectomy",
-                    "template": "s\/p appendectomy"
+                    "template": "s\/p appendectomy",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "s\/p cholecystectomy",
-                    "template": "s\/p cholecystectomy"
+                    "template": "s\/p cholecystectomy",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "Hx small bowel obstruction",
-                    "template": "Hx small bowel obstruction"
+                    "template": "Hx small bowel obstruction",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "Hx STD",
-                    "template": "Hx STD"
+                    "template": "Hx STD",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "other medical Hx (describe)",
@@ -832,15 +864,18 @@
             "children": [
                 {
                     "text": "ovarian cyst",
-                    "template": "ovarian cyst"
+                    "template": "ovarian cyst",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "Hx STD",
-                    "template": "Hx STD"
+                    "template": "Hx STD",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "pregnant",
-                    "template": "pregnant"
+                    "template": "pregnant",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "LMP (specify)",
@@ -860,15 +895,18 @@
             "children": [
                 {
                     "text": "alcohol use",
-                    "template": "alcohol use"
+                    "template": "alcohol use",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "illicit drug use",
-                    "template": "illicit drug use"
+                    "template": "illicit drug use",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "sexually active",
-                    "template": "sexually active"
+                    "template": "sexually active",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "Food exposure (specify)",
@@ -912,11 +950,13 @@
                 },
                 {
                     "text": "tobacco abuse",
-                    "template": "tobacco abuse"
+                    "template": "tobacco abuse",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "tobacco dependence",
-                    "template": "tobacco dependence"
+                    "template": "tobacco dependence",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "tobacco products used",
@@ -970,11 +1010,13 @@
                 },
                 {
                     "text": "tobacco withdrawal",
-                    "template": "tobacco withdrawal"
+                    "template": "tobacco withdrawal",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "tobacco remission",
-                    "template": "tobacco remission"
+                    "template": "tobacco remission",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "hx of nicotine dependence (describe)",
@@ -999,11 +1041,13 @@
             "children": [
                 {
                     "text": "colon cancer",
-                    "template": "colon cancer"
+                    "template": "colon cancer",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "inflammatory bowel disease",
-                    "template": "inflammatory bowel disease"
+                    "template": "inflammatory bowel disease",
+                    "type": "plus-minus"
                 },
                 {
                     "text": "other family Hx (describe)",