new-patient.blade.php 3.8 KB

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