new-patient.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. @extends ('layouts.template')
  2. @section('content')
  3. <?php
  4. $patients = [1, 2, 3, 4];
  5. $medicaidStates = Config::get('constants.medicaid_states');
  6. ?>
  7. <style media="screen">
  8. .form-control {
  9. border-radius: 0;
  10. color: rgb(0, 54, 175);
  11. }
  12. .form-control:focus {
  13. color: rgb(0, 54, 175);
  14. }
  15. #newPatientContainer label {
  16. font-size: 11px;
  17. }
  18. </style>
  19. <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
  20. <div class="p-3 mcp-theme-1" id="newPatientContainer" v-cloak>
  21. <div class="col-12">
  22. <div class="card d-block mb-3" moe="">
  23. <div class="card-header">
  24. <strong>
  25. <i class="fas fa-user-plus"></i>
  26. New Patient
  27. </strong>
  28. </div>
  29. <div class="card-body">
  30. <form id="createNewPatientForm" show url="/api/client/create" class="px-2 pb-1 primary-form" redir="patients/view/[data]">
  31. @if (session('message'))
  32. <div class="alert alert-danger">{{ session('message') }}</div>
  33. @endif
  34. <div class="row">
  35. <div class="border-lighter col-md-6 px-0">
  36. <div class="px-3">
  37. @include('app.patient.create-patient.demographics-form')
  38. </div>
  39. {{--@if($pro->pro_type === 'ADMIN')
  40. <div class="border-bottom">
  41. @include('app.patient.create-patient.insurance-coverage-form')
  42. </div>
  43. @endif--}}
  44. <div class="px-3 pt-3">
  45. <div class="row m-0">
  46. <div class='form-group mb-3 checkbox'>
  47. <label class="d-flex align-items-center">
  48. <input type='checkbox' name='forceNewChartCreation' class="mr-2" />
  49. Force New Chart Creation
  50. </label>
  51. </div>
  52. <div class='form-group mb-3 ml-3 checkbox'>
  53. <label class="d-flex align-items-center">
  54. <input type='checkbox' name='isTestRecord' class="mr-2" />
  55. Test Record
  56. </label>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="col-md-6">
  62. <div class="border-lighter">
  63. {{--@if($pro->pro_type === 'ADMIN')
  64. @include('app.patient.create-patient.create-patient-script-templates')
  65. @else--}}
  66. @include('app.patient.create-patient.insurance-coverage-form')
  67. {{--@endif--}}
  68. </div>
  69. </div>
  70. </div>
  71. </form>
  72. </div>
  73. <div class="card-footer text-center">
  74. <button class="btn btn-primary" submit>Create New Patient</button>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <link href="/select2/select2.min.css" rel="stylesheet" />
  80. <script src="/select2/select2.min.js"></script>
  81. <script src="/inputmask-5.x/dist/inputmask.js"></script>
  82. <script>
  83. (function() {
  84. function init() {
  85. let im = new Inputmask("(999) 999-9999").mask('[stag-input-phone]');
  86. $(document)
  87. .off('change.insurance', '.insurance')
  88. .on('change.insurance', '.insurance', function() {
  89. $('[data-insurance]').addClass('d-none');
  90. $('[data-insurance="' + $(this).val() + '"]').removeClass('d-none');
  91. $(this).closest('form').attr('url', '/api/client/' + ($(this).val() === 'medicare' ? 'create' : 'createNonMcn'))
  92. $(this).closest('[moe]').removeAttr('initialized');
  93. initMoes();
  94. return false;
  95. });
  96. $('.select2').select2({
  97. width: '100%'
  98. });
  99. }
  100. addMCInitializer('new-patient', init, '#newPatientContainer');
  101. }).call(window);
  102. var newPatientContainer = new Vue({
  103. el: '#newPatientContainer',
  104. data: {
  105. form: {},
  106. skip: false,
  107. isSelfPay: false,
  108. carrierCategory: '',
  109. carrierCategoryInternal: '',
  110. isPatientSubscriber: true
  111. },
  112. methods: {
  113. setSkipInsurance: function(_event) {
  114. if(!$(_event.target).prop('checked')) return;
  115. this.skip = true;
  116. this.isSelfPay = false;
  117. this.carrierCategory = '';
  118. Vue.nextTick(() => {
  119. console.log($('#createNewPatientForm').serialize());
  120. });
  121. },
  122. setSelfPay: function(_event) {
  123. if(!$(_event.target).prop('checked')) return;
  124. this.isSelfPay = true;
  125. this.skip = false;
  126. this.carrierCategory = '';
  127. Vue.nextTick(() => {
  128. console.log($('#createNewPatientForm').serialize());
  129. });
  130. },
  131. setCarrierCategory: function(_event, _carrierCategory) {
  132. if(!$(_event.target).prop('checked')) return;
  133. this.isSelfPay = false;
  134. this.skip = false;
  135. this.carrierCategory = _carrierCategory;
  136. Vue.nextTick(() => {
  137. console.log($('#createNewPatientForm').serialize());
  138. });
  139. },
  140. hpnToCpn: function() {
  141. this.form.cellNumber = this.form.homeNumber;
  142. this.form.homeNumber = null;
  143. },
  144. cpnToHpn: function() {
  145. this.form.homeNumber = this.form.cellNumber;
  146. this.form.cellNumber = null;
  147. },
  148. swapHpnCpn: function() {
  149. var data = $.extend({}, this.form);
  150. this.form.homeNumber = data.cellNumber;
  151. this.form.cellNumber = data.homeNumber;
  152. },
  153. onCommercialPayerChange: function() {
  154. var input = $('input[name=commercialPayerUidSuggest]');
  155. var hiddenInput = $('input[name=commercialPayerUid]');
  156. input
  157. .off('stag-suggest-selected')
  158. .on('stag-suggest-selected', (e, input, _data) => {
  159. hiddenInput.val(_data.uid);
  160. });
  161. },
  162. initOnInputChange: function() {
  163. var self = this;
  164. var form = $('#createNewPatientForm');
  165. form.find('input,textarea').on('paste change', function() {
  166. var value = this.value.replace(/\s\s+/g, ' ');
  167. value = value.trim();
  168. self.form[this.name] = value;
  169. $(this).val(value);
  170. });
  171. },
  172. initAutocomplete: function(){
  173. $( "input[name=carrierFreeText]" ).autocomplete({
  174. source: <?= json_encode(config('constants.insurance_payers')) ?>
  175. });
  176. },
  177. init: function() {
  178. this.initOnInputChange();
  179. this.onCommercialPayerChange();
  180. this.initAutocomplete();
  181. }
  182. },
  183. mounted: function() {
  184. this.init();
  185. },
  186. updated: function(){
  187. var self = this;
  188. self.$nextTick(function(){
  189. self.initAutocomplete();
  190. });
  191. }
  192. });
  193. </script>
  194. @endsection