new-patient.blade.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. planType: 'MEDICARE',
  107. isPatientSubscriber: true
  108. },
  109. methods: {
  110. hpnToCpn: function() {
  111. this.form.cellNumber = this.form.homeNumber;
  112. this.form.homeNumber = null;
  113. },
  114. cpnToHpn: function() {
  115. this.form.homeNumber = this.form.cellNumber;
  116. this.form.cellNumber = null;
  117. },
  118. swapHpnCpn: function() {
  119. var data = $.extend({}, this.form);
  120. this.form.homeNumber = data.cellNumber;
  121. this.form.cellNumber = data.homeNumber;
  122. },
  123. onCommercialPayerChange: function() {
  124. var input = $('input[name=commercialPayerUidSuggest]');
  125. var hiddenInput = $('input[name=commercialPayerUid]');
  126. input
  127. .off('stag-suggest-selected')
  128. .on('stag-suggest-selected', (e, input, _data) => {
  129. hiddenInput.val(_data.uid);
  130. });
  131. },
  132. initOnInputChange: function() {
  133. var self = this;
  134. var form = $('#createNewPatientForm');
  135. form.find('input,textarea').on('paste change', function() {
  136. var value = this.value.replace(/\s\s+/g, ' ');
  137. value = value.trim();
  138. self.form[this.name] = value;
  139. $(this).val(value);
  140. });
  141. },
  142. initAutocomplete: function(){
  143. $( "input[name=carrierFreeText]" ).autocomplete({
  144. source: <?= json_encode(config('constants.insurance_payers')) ?>
  145. });
  146. },
  147. init: function() {
  148. this.initOnInputChange();
  149. this.onCommercialPayerChange();
  150. this.initAutocomplete();
  151. }
  152. },
  153. mounted: function() {
  154. this.init();
  155. },
  156. updated: function(){
  157. var self = this;
  158. self.$nextTick(function(){
  159. self.initAutocomplete();
  160. });
  161. }
  162. });
  163. </script>
  164. @endsection