new-patient.blade.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. @extends ('layouts.template')
  2. @section('content')
  3. <?php
  4. $patients = [1, 2, 3, 4];
  5. $medicaidStates = Config::get('constants.medicaid_states');
  6. ?>
  7. <div class="p-3 mcp-theme-1" id="newPatientContainer" v-cloak>
  8. <div class="col-12">
  9. <div class="card d-block mb-3" moe="">
  10. <div class="card-header">
  11. <strong>
  12. <i class="fas fa-user-plus"></i>
  13. New Patient
  14. </strong>
  15. </div>
  16. <div class="card-body">
  17. <form id="createNewPatientForm" show url="/api/client/create" class="px-2 pb-1 primary-form" redir="patients/view/[data]">
  18. @if (session('message'))
  19. <div class="alert alert-danger">{{ session('message') }}</div>
  20. @endif
  21. <div class="row">
  22. <div class="border-lighter col-md-5">
  23. <div class="row">
  24. <div class="col-md-12 bg-light p-3 mb-2">
  25. <h5 class="m-0 font-weight-bold">Patient Name / Demographics:</h5>
  26. </div>
  27. <div class="form-group col-md-4">
  28. <label class="control-label">First Name <span class="text-danger">*</span> </label>
  29. <input type="text" required name="patientNameFirst" value="" class="form-control input-sm">
  30. </div>
  31. <div class="form-group col-md-4">
  32. <label class="control-label">Middle Name / MI</label>
  33. <input type="text" name="patientNameMiddle" value="" class="form-control input-sm">
  34. </div>
  35. <div class="form-group col-md-4">
  36. <label class="control-label">Last Name <span class="text-danger">*</span></label>
  37. <input type="text" required name="patientNameLast" value="" class="form-control input-sm">
  38. </div>
  39. <div class="form-group col-md-4">
  40. <label class="control-label">Prefix</label>
  41. <input type="text" name="patientNamePrefix" value="" class="form-control input-sm">
  42. </div>
  43. <div class="form-group col-md-4">
  44. <label class="control-label">Suffix</label>
  45. <input type="text" name="patientNameSuffix" value="" class="form-control input-sm">
  46. </div>
  47. <div class="form-group col-md-4">
  48. <label class="control-label">Sex</label>
  49. <select class="form-control input-sm" name="patientSex" select2>
  50. <option value="">--</option>
  51. <option value="M">Male</option>
  52. <option value="F">Female</option>
  53. <option value="UNKNOWN">Unknown</option>
  54. </select>
  55. </div>
  56. <div class="form-group col-md-6">
  57. <label class="control-label">Date of Birth <span class="text-danger">*</span></label>
  58. <input type="date" required name="patientDob" value="" class="form-control input-sm">
  59. </div>
  60. <div class="form-group col-md-6">
  61. <label class="control-label">Date Of Service</label>
  62. <input type="date" name="dateOfService" value="{{date('Y-m-d')}}" class="form-control input-sm">
  63. </div>
  64. </div>
  65. @if($pro->pro_type === 'ADMIN')
  66. <div class="row">
  67. <div class="col-md-6">
  68. <div class='form-group mb-3'>
  69. <label class='control-label'>HCP Pro</label>
  70. <select name="hcpProUid" class="form-control" provider-search provider-type="hcp">
  71. <option value="">--select--</option>
  72. </select>
  73. </div>
  74. </div>
  75. <div class="col-md-6">
  76. <div class='form-group mb-3'>
  77. <label class='control-label'>Care Coordinator</label>
  78. <select name="assistantProUid" class="form-control" provider-search provider-type="default-na">
  79. <option value="">--select--</option>
  80. </select>
  81. </div>
  82. </div>
  83. </div>
  84. @elseif($pro->is_hcp === true)
  85. <div class="row">
  86. <div class="col-md-12">
  87. <div class='form-group mb-3'>
  88. <label class='control-label'>HCP Pro</label>
  89. <input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
  90. <input type="hidden" name="hcpProUid" value="{{$pro->uid}}">
  91. </div>
  92. </div>
  93. </div>
  94. @elseif($pro->isDefaultNA())
  95. <div class="row">
  96. <div class="col-md-6">
  97. <div class='form-group mb-3'>
  98. <label class='control-label'>HCP Pro</label>
  99. <?php $teams = $pro->teamsWhereAssistant; ?>
  100. <select name="hcpProUid" class="form-control">
  101. @if(count($teams) > 1)
  102. <option value="">--select--</option>
  103. @endif
  104. @foreach($teams as $team)
  105. <option value="{{$team->mcp->uid}}">{{$team->mcp->displayName()}}</option>
  106. @endforeach
  107. </select>
  108. </div>
  109. </div>
  110. <div class="col-md-6">
  111. <div class='form-group mb-3'>
  112. <label class='control-label'>Care Coordinator</label>
  113. <input type="text" class="form-control" readonly value="{{$pro->displayName()}}">
  114. <input type="hidden" name="assistantProUid" value="{{$pro->uid}}">
  115. </div>
  116. </div>
  117. </div>
  118. @endif
  119. <div class="row">
  120. <div class="col-md-4">
  121. <div class='form-group mb-3'>
  122. <label class='control-label d-flex align-items-center'>
  123. <span>Home Phone Number</span>
  124. <a v-if="form.homeNumber" @click="hpnToCpn" class="ml-1 px-1 on-hover-opaque hpn-to-cpn c-pointer">
  125. <i class="fa fa-arrow-right"></i>
  126. </a>
  127. <a v-if="form.cellNumber && form.homeNumber" @click="swapHpnCpn" class="ml-1 px-1 on-hover-opaque swap-pns c-pointer">
  128. <i class="fa fa-retweet"></i>
  129. </a>
  130. </label>
  131. <input class='form-control' stag-input-phone type='tel' name='homeNumber' v-model="form.homeNumber">
  132. </div>
  133. </div>
  134. <div class="col-md-4">
  135. <div class='form-group mb-3'>
  136. <label class='control-label d-flex align-items-center'>
  137. <span>Cell Phone Number</span>
  138. <a v-if="form.cellNumber" @click="cpnToHpn" class="ml-1 px-1 on-hover-opaque cpn-to-hpn c-pointer">
  139. <i class="fa fa-arrow-left"></i>
  140. </a>
  141. </label>
  142. <input class='form-control' stag-input-phone type='tel' name='cellNumber' v-model="form.cellNumber">
  143. </div>
  144. </div>
  145. <div class="col-md-4">
  146. <div class='form-group mb-3'>
  147. <label class='control-label'>Email Address </label>
  148. <input class='form-control' type='email' name='emailAddress'>
  149. </div>
  150. </div>
  151. </div>
  152. <div class='form-group mb-3'>
  153. <label class='control-label'>How did you hear about us?</label>
  154. <input class='form-control' type='text' name='initiative' />
  155. </div>
  156. <div class='form-group mb-3 checkbox'>
  157. <label>
  158. <input type='checkbox' name='isTestRecord' />
  159. This is a test record
  160. </label>
  161. </div>
  162. </div>
  163. <div class="col-md-7">
  164. <div class="border-lighter">
  165. <div class="col-md-12 bg-light py-3 px-3 mb-2 ">
  166. <h5 class="m-0 font-weight-bold">Insurance Coverage:</h5>
  167. </div>
  168. <div class="px-3">
  169. <div class="row">
  170. <div class="form-group col-md-12">
  171. <p class="mb-1 font-weight-bold">Type of insurance card:</p>
  172. <div class="form-check form-check-inline">
  173. <label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="MEDICARE">Medicare Part B (Primary)</label>
  174. </div>
  175. <div class="form-check form-check-inline">
  176. <label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="MEDICAID">Medicaid (Primary)</label>
  177. </div>
  178. <div class="form-check form-check-inline">
  179. <label class="form-check-label"><input class="form-check-input" type="radio" v-model="planType" name="planType" value="COMMERCIAL">Commercial / Third Party (Primary)</label>
  180. </div>
  181. </div>
  182. </div>
  183. <div class="px-2">
  184. <div class="row" v-show="planType == 'COMMERCIAL'">
  185. <div class="form-group col-md-12">
  186. <label for="" class="control-label">Commercial Payer</label>
  187. <input name="commercialPayerUidSuggest" class="form-control input-sm" value="" stag-suggest stag-suggest-ep="/search-payer/json" />
  188. <input type="hidden" name="commercialPayerUid" />
  189. </div>
  190. <div class="form-group col-md-6">
  191. <label class="control-label">Patient Member Identifier</label>
  192. <input type="text" name="commercialMemberIdentifier" class="form-control input-sm">
  193. </div>
  194. <div class="form-group col-md-6">
  195. <label class="control-label">Patient Group Number</label>
  196. <input type="text" name="commercialGroupNumber" class="form-control input-sm">
  197. </div>
  198. </div>
  199. <div class="row">
  200. <div class="form-group col-md-12" v-if="planType == 'MEDICAID' || planType == 'COMMERCIAL'">
  201. <div class="form-check form-check-inline">
  202. <label class="form-check-label"><input class="form-check-input" type="checkbox" name="isPatientSubscriber" v-model="isPatientSubscriber">Is Patient The Subscriber?</label>
  203. </div>
  204. </div>
  205. </div>
  206. <div v-if="!isPatientSubscriber && (planType == 'MEDICAID' || planType == 'COMMERCIAL')" class="row">
  207. <div class="col-md-12 bg-light p-3 mb-2">
  208. <h5 class="m-0 font-weight-bold">Subscriber Details:</h5>
  209. </div>
  210. <div class="form-group col-md-4">
  211. <label class="control-label">Subscriber First Name</label>
  212. <input type="text" name="subscriberNameFirst" value="" class="form-control input-sm">
  213. </div>
  214. <div class="form-group col-md-4">
  215. <label class="control-label">Subscriber Middle Name / MI</label>
  216. <input type="text" name="subscriberNameMiddle" value="" class="form-control input-sm">
  217. </div>
  218. <div class="form-group col-md-4">
  219. <label class="control-label">Subscriber Last Name</label>
  220. <input type="text" name="subscriberNameLast" value="" class="form-control input-sm">
  221. </div>
  222. <div class="form-group col-md-4">
  223. <label class="control-label">Subscriber Suffix</label>
  224. <input type="text" name="subscriberNameSuffix" value="" class="form-control input-sm">
  225. </div>
  226. <div class="form-group col-md-4">
  227. <label class="control-label">Subscriber Sex</label>
  228. <select class="form-control input-sm" name="subscriberSex">
  229. <option value="">--</option>
  230. <option value="M">Male</option>
  231. <option value="F">Female</option>
  232. <option value="UNKNOWN">Unknown</option>
  233. </select>
  234. </div>
  235. <div class="form-group col-md-4">
  236. <label class="control-label">Subscriber Dob</label>
  237. <input type="date" name="subscriberDob" value="" class="form-control input-sm">
  238. </div>
  239. <div class="form-group col-md-12">
  240. <label class="control-label">What is the patient's relationship to the subscriber?</label>
  241. <select name="patientRelationshipToSubscriber" class="form-control input-sm">
  242. <option value="">--</option>
  243. <option value="SPOUSE">Spouse</option>
  244. <option value="CHILD">Child</option>
  245. <option value="EMPLOYEE">Employee</option>
  246. <option value="ORGAN_DONOR">Organ Donor</option>
  247. <option value="CADAVER_DONOR">Cadaver Donor</option>
  248. <option value="LIFE_PARTNER">Life Partner</option>
  249. <option value="OTHER_RELATIONSHIP">Other Relationship</option>
  250. <option value="UNKNOWN">Unknown</option>
  251. </select>
  252. </div>
  253. </div>
  254. <div class="mb-1" v-if="planType == 'COMMERCIAL'">
  255. <h6 class="font-weight-bold">Does the patient also have either a Medicare or Medicaid #? (optional)</h6>
  256. </div>
  257. <div class="row" v-if="planType == 'MEDICAID' || planType == 'COMMERCIAL'" :class="planType == 'COMMERCIAL' ? 'mx-0' : ''">
  258. <div class="col-md-12">
  259. <div class="bg-light p-2 mb-2">
  260. <h5 class="m-0 font-weight-bold">Medicaid Information:</h5>
  261. </div>
  262. </div>
  263. <div class="col-12 px-0">
  264. <div class="px-2">
  265. <div class="form-group col-md-6">
  266. <label for="" class="control-label">Medicaid State</label>
  267. <input class="form-control input-sm" list="mcdPayer" name="mcdPayerName" id="mcdPayerName">
  268. <datalist id="mcdPayer">
  269. <option value="">--</option>
  270. @foreach($medicaidStates as $state)
  271. <option>{{ $state }}</option>
  272. @endforeach
  273. </datalist>
  274. </div>
  275. <div class="form-group col-md-6">
  276. <label class="control-label">Medicaid Number</label>
  277. <input type="text" name="mcdNumber" class="form-control input-sm" oninput="this.value = this.value.toUpperCase()">
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. <div class="row" v-if="planType == 'MEDICARE' || planType == 'COMMERCIAL'" :class="planType == 'COMMERCIAL' ? 'mx-0' : ''">
  283. <div class="col-md-12">
  284. <div class="bg-light p-2 mb-2">
  285. <h5 class="m-0 font-weight-bold">Medicare Information:</h5>
  286. </div>
  287. </div>
  288. <div class="col-12 px-0">
  289. <div class="px-2">
  290. <div class="form-group col-md-6">
  291. <label class="control-label">Medicare Number</label>
  292. <input type="text" name="mcrNumber" class="form-control input-sm" oninput="this.value = this.value.toUpperCase()">
  293. </div>
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. </form>
  303. </div>
  304. <div class="card-footer text-center">
  305. <button class="btn btn-primary" submit>Create New Patient</button>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <link href="/select2/select2.min.css" rel="stylesheet" />
  311. <script src="/select2/select2.min.js"></script>
  312. <script src="/inputmask-5.x/dist/inputmask.js"></script>
  313. <script>
  314. (function() {
  315. function init() {
  316. let im = new Inputmask("(999) 999-9999").mask('[stag-input-phone]');
  317. $(document)
  318. .off('change.insurance', '.insurance')
  319. .on('change.insurance', '.insurance', function() {
  320. $('[data-insurance]').addClass('d-none');
  321. $('[data-insurance="' + $(this).val() + '"]').removeClass('d-none');
  322. $(this).closest('form').attr('url', '/api/client/' + ($(this).val() === 'medicare' ? 'create' : 'createNonMcn'))
  323. $(this).closest('[moe]').removeAttr('initialized');
  324. initMoes();
  325. return false;
  326. });
  327. $('.select2').select2({
  328. width: '100%'
  329. });
  330. }
  331. addMCInitializer('new-patient', init, '#newPatientContainer');
  332. }).call(window);
  333. var newPatientContainer = new Vue({
  334. el: '#newPatientContainer',
  335. data: {
  336. form: {},
  337. planType: 'MEDICARE',
  338. isPatientSubscriber: true
  339. },
  340. methods: {
  341. hpnToCpn: function() {
  342. this.form.cellNumber = this.form.homeNumber;
  343. this.form.homeNumber = null;
  344. },
  345. cpnToHpn: function() {
  346. this.form.homeNumber = this.form.cellNumber;
  347. this.form.cellNumber = null;
  348. },
  349. swapHpnCpn: function() {
  350. var data = $.extend({}, this.form);
  351. this.form.homeNumber = data.cellNumber;
  352. this.form.cellNumber = data.homeNumber;
  353. },
  354. onCommercialPayerChange: function() {
  355. var input = $('input[name=commercialPayerUidSuggest]');
  356. var hiddenInput = $('input[name=commercialPayerUid]');
  357. input
  358. .off('stag-suggest-selected')
  359. .on('stag-suggest-selected', (e, input, _data) => {
  360. hiddenInput.val(_data.uid);
  361. });
  362. },
  363. initOnInputChange: function(){
  364. var form = $('#createNewPatientForm');
  365. form.find('input[type=text],textarea').change(function(){
  366. var value = this.value.replace(/\s\s+/g, ' ');
  367. value = value.trim();
  368. $(this).val(value);
  369. });
  370. },
  371. init: function() {
  372. this.initOnInputChange();
  373. this.onCommercialPayerChange();
  374. }
  375. },
  376. mounted: function() {
  377. this.init();
  378. }
  379. });
  380. </script>
  381. @endsection