new-patient.blade.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. <div class="p-3 mcp-theme-1" id="newPatientContainer" v-cloak>
  20. <div class="col-12">
  21. <div class="card d-block mb-3" moe="">
  22. <div class="card-header">
  23. <strong>
  24. <i class="fas fa-user-plus"></i>
  25. New Patient
  26. </strong>
  27. </div>
  28. <div class="card-body">
  29. <form id="createNewPatientForm" show url="/api/client/create" class="px-2 pb-1 primary-form" redir="patients/view/[data]">
  30. @if (session('message'))
  31. <div class="alert alert-danger">{{ session('message') }}</div>
  32. @endif
  33. <div class="row">
  34. <div class="border-lighter col-md-6 px-0">
  35. <div class="px-3">
  36. @include('app.patient.create-patient.demographics-form')
  37. </div>
  38. @if($pro->pro_type === 'ADMIN')
  39. <div class="border-bottom">
  40. @include('app.patient.create-patient.insurance-coverage-form')
  41. </div>
  42. @endif
  43. <div class="px-3 pt-3">
  44. <div class="row m-0">
  45. <div class='form-group mb-3 checkbox'>
  46. <label class="d-flex align-items-center">
  47. <input type='checkbox' name='forceNewChartCreation' class="mr-2" />
  48. Force New Chart Creation
  49. </label>
  50. </div>
  51. <div class='form-group mb-3 ml-3 checkbox'>
  52. <label class="d-flex align-items-center">
  53. <input type='checkbox' name='isTestRecord' class="mr-2" />
  54. <b>Test Record</b>
  55. </label>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="col-md-6">
  61. <div class="border-lighter">
  62. @if($pro->pro_type === 'ADMIN')
  63. @include('app.patient.create-patient.create-patient-script-templates')
  64. @else
  65. @include('app.patient.create-patient.insurance-coverage-form')
  66. @endif
  67. </div>
  68. </div>
  69. </div>
  70. </form>
  71. </div>
  72. <div class="card-footer text-center">
  73. <button class="btn btn-primary" submit>Create New Patient</button>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. <link href="/select2/select2.min.css" rel="stylesheet" />
  79. <script src="/select2/select2.min.js"></script>
  80. <script src="/inputmask-5.x/dist/inputmask.js"></script>
  81. <script>
  82. (function() {
  83. function init() {
  84. let im = new Inputmask("(999) 999-9999").mask('[stag-input-phone]');
  85. $(document)
  86. .off('change.insurance', '.insurance')
  87. .on('change.insurance', '.insurance', function() {
  88. $('[data-insurance]').addClass('d-none');
  89. $('[data-insurance="' + $(this).val() + '"]').removeClass('d-none');
  90. $(this).closest('form').attr('url', '/api/client/' + ($(this).val() === 'medicare' ? 'create' : 'createNonMcn'))
  91. $(this).closest('[moe]').removeAttr('initialized');
  92. initMoes();
  93. return false;
  94. });
  95. $('.select2').select2({
  96. width: '100%'
  97. });
  98. }
  99. addMCInitializer('new-patient', init, '#newPatientContainer');
  100. }).call(window);
  101. var newPatientContainer = new Vue({
  102. el: '#newPatientContainer',
  103. data: {
  104. form: {},
  105. planType: 'MEDICARE',
  106. isPatientSubscriber: true
  107. },
  108. methods: {
  109. hpnToCpn: function() {
  110. this.form.cellNumber = this.form.homeNumber;
  111. this.form.homeNumber = null;
  112. },
  113. cpnToHpn: function() {
  114. this.form.homeNumber = this.form.cellNumber;
  115. this.form.cellNumber = null;
  116. },
  117. swapHpnCpn: function() {
  118. var data = $.extend({}, this.form);
  119. this.form.homeNumber = data.cellNumber;
  120. this.form.cellNumber = data.homeNumber;
  121. },
  122. onCommercialPayerChange: function() {
  123. var input = $('input[name=commercialPayerUidSuggest]');
  124. var hiddenInput = $('input[name=commercialPayerUid]');
  125. input
  126. .off('stag-suggest-selected')
  127. .on('stag-suggest-selected', (e, input, _data) => {
  128. hiddenInput.val(_data.uid);
  129. });
  130. },
  131. initOnInputChange: function() {
  132. var self = this;
  133. var form = $('#createNewPatientForm');
  134. form.find('input,textarea').on('paste change', function() {
  135. var value = this.value.replace(/\s\s+/g, ' ');
  136. value = value.trim();
  137. self.form[this.name] = value;
  138. $(this).val(value);
  139. });
  140. },
  141. init: function() {
  142. this.initOnInputChange();
  143. this.onCommercialPayerChange();
  144. }
  145. },
  146. mounted: function() {
  147. this.init();
  148. }
  149. });
  150. </script>
  151. @endsection