new-patient.blade.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. @include('app.stat-tree.view', ['slug' => 'rm-tree', 'showForPro' => $pro])
  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>
  41. @include('app.patient.create-patient.insurance-coverage-form')
  42. </div>
  43. @endif
  44. </div>
  45. <div class="col-md-6">
  46. <div class="border-lighter">
  47. @if($pro->pro_type === 'ADMIN')
  48. @include('app.patient.create-patient.create-patient-script-templates')
  49. @else
  50. @include('app.patient.create-patient.insurance-coverage-form')
  51. @endif
  52. </div>
  53. </div>
  54. </div>
  55. </form>
  56. </div>
  57. <div class="card-footer text-center">
  58. <button class="btn btn-primary" submit>Create New Patient</button>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. <link href="/select2/select2.min.css" rel="stylesheet" />
  64. <script src="/select2/select2.min.js"></script>
  65. <script src="/inputmask-5.x/dist/inputmask.js"></script>
  66. <script>
  67. (function() {
  68. function init() {
  69. let im = new Inputmask("(999) 999-9999").mask('[stag-input-phone]');
  70. $(document)
  71. .off('change.insurance', '.insurance')
  72. .on('change.insurance', '.insurance', function() {
  73. $('[data-insurance]').addClass('d-none');
  74. $('[data-insurance="' + $(this).val() + '"]').removeClass('d-none');
  75. $(this).closest('form').attr('url', '/api/client/' + ($(this).val() === 'medicare' ? 'create' : 'createNonMcn'))
  76. $(this).closest('[moe]').removeAttr('initialized');
  77. initMoes();
  78. return false;
  79. });
  80. $('.select2').select2({
  81. width: '100%'
  82. });
  83. }
  84. addMCInitializer('new-patient', init, '#newPatientContainer');
  85. }).call(window);
  86. var newPatientContainer = new Vue({
  87. el: '#newPatientContainer',
  88. data: {
  89. form: {},
  90. planType: 'MEDICARE',
  91. isPatientSubscriber: true
  92. },
  93. methods: {
  94. hpnToCpn: function() {
  95. this.form.cellNumber = this.form.homeNumber;
  96. this.form.homeNumber = null;
  97. },
  98. cpnToHpn: function() {
  99. this.form.homeNumber = this.form.cellNumber;
  100. this.form.cellNumber = null;
  101. },
  102. swapHpnCpn: function() {
  103. var data = $.extend({}, this.form);
  104. this.form.homeNumber = data.cellNumber;
  105. this.form.cellNumber = data.homeNumber;
  106. },
  107. onCommercialPayerChange: function() {
  108. var input = $('input[name=commercialPayerUidSuggest]');
  109. var hiddenInput = $('input[name=commercialPayerUid]');
  110. input
  111. .off('stag-suggest-selected')
  112. .on('stag-suggest-selected', (e, input, _data) => {
  113. hiddenInput.val(_data.uid);
  114. });
  115. },
  116. initOnInputChange: function() {
  117. var self = this;
  118. var form = $('#createNewPatientForm');
  119. form.find('input,textarea').on('paste change', function() {
  120. var value = this.value.replace(/\s\s+/g, ' ');
  121. value = value.trim();
  122. self.form[this.name] = value;
  123. $(this).val(value);
  124. });
  125. },
  126. init: function() {
  127. this.initOnInputChange();
  128. this.onCommercialPayerChange();
  129. }
  130. },
  131. mounted: function() {
  132. this.init();
  133. }
  134. });
  135. </script>
  136. @endsection