new-patient.blade.php 17 KB

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