@unite-us/app-create-referral 0.15.62 → 0.15.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/dist/AppReferrals.js +45 -45
  2. package/dist/AppReferrals.js.map +1 -1
  3. package/dist/AppReferrals.test.js +34 -60
  4. package/dist/AppReferrals.test.js.map +1 -1
  5. package/dist/__testUtils__/mockData/components/mockAppReferrals.js +13 -12
  6. package/dist/__testUtils__/mockData/components/mockAppReferrals.js.map +1 -1
  7. package/dist/__testUtils__/mockData/mockCases.js +1 -1
  8. package/dist/__testUtils__/mockData/mockCases.js.map +1 -1
  9. package/dist/__testUtils__/mockData/mockClinicalModifications.js +3 -3
  10. package/dist/__testUtils__/mockData/mockClinicalModifications.js.map +1 -1
  11. package/dist/__testUtils__/mockData/mockEmployees.js +1 -1
  12. package/dist/__testUtils__/mockData/mockEmployees.js.map +1 -1
  13. package/dist/__testUtils__/mockData/mockEnums.js +1 -1
  14. package/dist/__testUtils__/mockData/mockEnums.js.map +1 -1
  15. package/dist/__testUtils__/mockData/mockFeeSchedulePrograms.js +1 -1
  16. package/dist/__testUtils__/mockData/mockFeeSchedulePrograms.js.map +1 -1
  17. package/dist/__testUtils__/mockData/mockFiles.js +1 -1
  18. package/dist/__testUtils__/mockData/mockFiles.js.map +1 -1
  19. package/dist/__testUtils__/mockData/mockFormSubmissions.js +1 -1
  20. package/dist/__testUtils__/mockData/mockFormSubmissions.js.map +1 -1
  21. package/dist/__testUtils__/mockData/mockFormUsages.js +1 -1
  22. package/dist/__testUtils__/mockData/mockFormUsages.js.map +1 -1
  23. package/dist/__testUtils__/mockData/mockForms.js +1 -1
  24. package/dist/__testUtils__/mockData/mockForms.js.map +1 -1
  25. package/dist/__testUtils__/mockData/mockInsurances.js +1 -1
  26. package/dist/__testUtils__/mockData/mockInsurances.js.map +1 -1
  27. package/dist/__testUtils__/mockData/mockNetworks.js +1 -1
  28. package/dist/__testUtils__/mockData/mockNetworks.js.map +1 -1
  29. package/dist/__testUtils__/mockData/mockPeople.js +1 -1
  30. package/dist/__testUtils__/mockData/mockPeople.js.map +1 -1
  31. package/dist/__testUtils__/mockData/mockPrograms.js +31 -31
  32. package/dist/__testUtils__/mockData/mockPrograms.js.map +1 -1
  33. package/dist/__testUtils__/mockData/mockProviders.js +21 -21
  34. package/dist/__testUtils__/mockData/mockProviders.js.map +1 -1
  35. package/dist/__testUtils__/mockData/mockReferrals.js +1 -1
  36. package/dist/__testUtils__/mockData/mockReferrals.js.map +1 -1
  37. package/dist/__testUtils__/mockData/mockServiceAuthorizations.js +1 -1
  38. package/dist/__testUtils__/mockData/mockServiceAuthorizations.js.map +1 -1
  39. package/dist/__testUtils__/mockData/mockServices.js +1 -1
  40. package/dist/__testUtils__/mockData/mockServices.js.map +1 -1
  41. package/dist/__testUtils__/mockData/mockUnlistedPrograms.js +1 -1
  42. package/dist/__testUtils__/mockData/mockUnlistedPrograms.js.map +1 -1
  43. package/dist/__testUtils__/mockData/utils.js +218 -282
  44. package/dist/__testUtils__/mockData/utils.js.map +1 -1
  45. package/dist/__testUtils__/mockServer/handlers.js +80 -82
  46. package/dist/__testUtils__/mockServer/handlers.js.map +1 -1
  47. package/dist/__testUtils__/mockServer/server.js +7 -13
  48. package/dist/__testUtils__/mockServer/server.js.map +1 -1
  49. package/dist/__testUtils__/test-utils.js +22 -18
  50. package/dist/__testUtils__/test-utils.js.map +1 -1
  51. package/dist/actions/Document/Contact/Group/fetchCaseDocuments.js +10 -32
  52. package/dist/actions/Document/Contact/Group/fetchCaseDocuments.js.map +1 -1
  53. package/dist/actions/Document/Contact/Group/fetchContactDocuments.js +10 -32
  54. package/dist/actions/Document/Contact/Group/fetchContactDocuments.js.map +1 -1
  55. package/dist/actions/Document/Contact/Group/fileUploadUtils.js +8 -10
  56. package/dist/actions/Document/Contact/Group/fileUploadUtils.js.map +1 -1
  57. package/dist/actions/Group/fetchCoreGroupForms.js +46 -88
  58. package/dist/actions/Group/fetchCoreGroupForms.js.map +1 -1
  59. package/dist/actions/Referral/cannotMoveToReferralReasons.js +23 -21
  60. package/dist/actions/Referral/cannotMoveToReferralReasons.js.map +1 -1
  61. package/dist/actions/Referral/fetchCoreServices.js +70 -152
  62. package/dist/actions/Referral/fetchCoreServices.js.map +1 -1
  63. package/dist/actions/Referral/fetchNetworks.js +11 -35
  64. package/dist/actions/Referral/fetchNetworks.js.map +1 -1
  65. package/dist/actions/Referral/fetchPrimaryWorkers.js +51 -75
  66. package/dist/actions/Referral/fetchPrimaryWorkers.js.map +1 -1
  67. package/dist/actions/Referral/removeReferralProgram.js +10 -15
  68. package/dist/actions/Referral/removeReferralProgram.js.map +1 -1
  69. package/dist/api/ApiHooks.js +40 -39
  70. package/dist/api/ApiHooks.js.map +1 -1
  71. package/dist/api/config.js +20 -23
  72. package/dist/api/config.js.map +1 -1
  73. package/dist/common/form/CurrencyField/index.js +22 -21
  74. package/dist/common/form/CurrencyField/index.js.map +1 -1
  75. package/dist/common/form/DocumentUploader/components/ContactDocumentsSelector.js +51 -48
  76. package/dist/common/form/DocumentUploader/components/ContactDocumentsSelector.js.map +1 -1
  77. package/dist/common/form/DocumentUploader/components/DocumentsListView.js +14 -12
  78. package/dist/common/form/DocumentUploader/components/DocumentsListView.js.map +1 -1
  79. package/dist/common/form/DocumentUploader/components/ListViewDocument.js +21 -17
  80. package/dist/common/form/DocumentUploader/components/ListViewDocument.js.map +1 -1
  81. package/dist/common/form/ErrorMessage/index.js +17 -9
  82. package/dist/common/form/ErrorMessage/index.js.map +1 -1
  83. package/dist/common/form/FileUploadV2/FileUpload.js +159 -137
  84. package/dist/common/form/FileUploadV2/FileUpload.js.map +1 -1
  85. package/dist/common/form/FileUploadV2/components/FilePreview.js +8 -5
  86. package/dist/common/form/FileUploadV2/components/FilePreview.js.map +1 -1
  87. package/dist/common/form/FileUploadV2/components/FilePreviewWrapper.js +26 -21
  88. package/dist/common/form/FileUploadV2/components/FilePreviewWrapper.js.map +1 -1
  89. package/dist/common/form/FormForm/index.js +143 -186
  90. package/dist/common/form/FormForm/index.js.map +1 -1
  91. package/dist/common/utils/utils.js +3 -3
  92. package/dist/common/utils/utils.js.map +1 -1
  93. package/dist/components/Card.js +12 -8
  94. package/dist/components/Card.js.map +1 -1
  95. package/dist/components/CreateReferralContainer.js +21 -13
  96. package/dist/components/CreateReferralContainer.js.map +1 -1
  97. package/dist/components/DollarAmount.js +18 -14
  98. package/dist/components/DollarAmount.js.map +1 -1
  99. package/dist/components/ExpandableButton.js +21 -16
  100. package/dist/components/ExpandableButton.js.map +1 -1
  101. package/dist/components/NavButtons.js +57 -51
  102. package/dist/components/NavButtons.js.map +1 -1
  103. package/dist/components/ReferralStepper.js +44 -41
  104. package/dist/components/ReferralStepper.js.map +1 -1
  105. package/dist/components/SearchableField.js +121 -125
  106. package/dist/components/SearchableField.js.map +1 -1
  107. package/dist/components/StepHeader.js +25 -16
  108. package/dist/components/StepHeader.js.map +1 -1
  109. package/dist/components/Stepper.js +55 -51
  110. package/dist/components/Stepper.js.map +1 -1
  111. package/dist/components/modal/Dialog.js +141 -170
  112. package/dist/components/modal/Dialog.js.map +1 -1
  113. package/dist/components/modal/Overlay.js +2 -1
  114. package/dist/components/modal/Overlay.js.map +1 -1
  115. package/dist/components/service_authorization/AuthorizationSpendCard.js +72 -60
  116. package/dist/components/service_authorization/AuthorizationSpendCard.js.map +1 -1
  117. package/dist/components/service_authorization/CapsInfo.js +143 -120
  118. package/dist/components/service_authorization/CapsInfo.js.map +1 -1
  119. package/dist/components/service_authorization/CaseStatus.js +18 -14
  120. package/dist/components/service_authorization/CaseStatus.js.map +1 -1
  121. package/dist/components/service_authorization/PreviousAuthorizationRequestsDetails.js +121 -96
  122. package/dist/components/service_authorization/PreviousAuthorizationRequestsDetails.js.map +1 -1
  123. package/dist/components/service_authorization/ReferralAuthSpendExpandable.js +43 -43
  124. package/dist/components/service_authorization/ReferralAuthSpendExpandable.js.map +1 -1
  125. package/dist/components/service_authorization/ReferralAuthorizationRequestSummary.js +82 -65
  126. package/dist/components/service_authorization/ReferralAuthorizationRequestSummary.js.map +1 -1
  127. package/dist/components/service_authorization/Spend.js +10 -5
  128. package/dist/components/service_authorization/Spend.js.map +1 -1
  129. package/dist/components/service_authorization/formatShortDate.js +6 -6
  130. package/dist/components/service_authorization/formatShortDate.js.map +1 -1
  131. package/dist/components/service_authorization/messageConstants.js +2 -2
  132. package/dist/components/service_authorization/messageConstants.js.map +1 -1
  133. package/dist/components/spinners/OverlaySpinner/OverlaySpinner.js +34 -23
  134. package/dist/components/spinners/OverlaySpinner/OverlaySpinner.js.map +1 -1
  135. package/dist/components/spinners/Spinner/Spinner.js +33 -27
  136. package/dist/components/spinners/Spinner/Spinner.js.map +1 -1
  137. package/dist/constants/enums.js +1 -1
  138. package/dist/constants/enums.js.map +1 -1
  139. package/dist/constants/eventConstants.js +48 -48
  140. package/dist/constants/eventConstants.js.map +1 -1
  141. package/dist/constants/findEnumDisplayName.js +3 -3
  142. package/dist/constants/findEnumDisplayName.js.map +1 -1
  143. package/dist/constants.js +6 -6
  144. package/dist/constants.js.map +1 -1
  145. package/dist/context/AppCreateReferralProvider.js +25 -36
  146. package/dist/context/AppCreateReferralProvider.js.map +1 -1
  147. package/dist/context/state.js +2 -5
  148. package/dist/context/state.js.map +1 -1
  149. package/dist/context/withAppCreateReferralContext.js +9 -5
  150. package/dist/context/withAppCreateReferralContext.js.map +1 -1
  151. package/dist/hooks/__tests__/useCreateReferrals.test.js +456 -544
  152. package/dist/hooks/__tests__/useCreateReferrals.test.js.map +1 -1
  153. package/dist/hooks/sendReferral.js +155 -318
  154. package/dist/hooks/sendReferral.js.map +1 -1
  155. package/dist/hooks/useClinicalModificationOptions.js +24 -34
  156. package/dist/hooks/useClinicalModificationOptions.js.map +1 -1
  157. package/dist/hooks/useCreateReferrals.js +463 -706
  158. package/dist/hooks/useCreateReferrals.js.map +1 -1
  159. package/dist/hooks/useCreateResourceList.js +56 -66
  160. package/dist/hooks/useCreateResourceList.js.map +1 -1
  161. package/dist/hooks/useCreateShareEvent.js +18 -33
  162. package/dist/hooks/useCreateShareEvent.js.map +1 -1
  163. package/dist/hooks/useForwardReferral.js +78 -105
  164. package/dist/hooks/useForwardReferral.js.map +1 -1
  165. package/dist/hooks/usePerson.js +21 -40
  166. package/dist/hooks/usePerson.js.map +1 -1
  167. package/dist/hooks/useUpdateResourceList.js +34 -28
  168. package/dist/hooks/useUpdateResourceList.js.map +1 -1
  169. package/dist/pages/builder/AboutGroupedReferralsModal.js +48 -27
  170. package/dist/pages/builder/AboutGroupedReferralsModal.js.map +1 -1
  171. package/dist/pages/builder/AuthorizationSubform.js +143 -131
  172. package/dist/pages/builder/AuthorizationSubform.js.map +1 -1
  173. package/dist/pages/builder/ChooseOneServiceTypeModal.js +56 -53
  174. package/dist/pages/builder/ChooseOneServiceTypeModal.js.map +1 -1
  175. package/dist/pages/builder/DetailsDrawer.js +74 -72
  176. package/dist/pages/builder/DetailsDrawer.js.map +1 -1
  177. package/dist/pages/builder/LineItem.js +28 -25
  178. package/dist/pages/builder/LineItem.js.map +1 -1
  179. package/dist/pages/builder/NoReferralsDisplay.js +41 -29
  180. package/dist/pages/builder/NoReferralsDisplay.js.map +1 -1
  181. package/dist/pages/builder/ProgramHeader.js +33 -20
  182. package/dist/pages/builder/ProgramHeader.js.map +1 -1
  183. package/dist/pages/builder/ProgramMenu.js +19 -18
  184. package/dist/pages/builder/ProgramMenu.js.map +1 -1
  185. package/dist/pages/builder/ReferralBuilder.js +341 -435
  186. package/dist/pages/builder/ReferralBuilder.js.map +1 -1
  187. package/dist/pages/builder/ReferralBuilderForm.js +323 -383
  188. package/dist/pages/builder/ReferralBuilderForm.js.map +1 -1
  189. package/dist/pages/builder/ReferralCard.js +125 -99
  190. package/dist/pages/builder/ReferralCard.js.map +1 -1
  191. package/dist/pages/builder/ReferralProgramCard.js +109 -148
  192. package/dist/pages/builder/ReferralProgramCard.js.map +1 -1
  193. package/dist/pages/builder/ReferralProgramMenu.js +102 -116
  194. package/dist/pages/builder/ReferralProgramMenu.js.map +1 -1
  195. package/dist/pages/builder/__tests__/AuthRequiredClinicalCodes.test.js +99 -220
  196. package/dist/pages/builder/__tests__/AuthRequiredClinicalCodes.test.js.map +1 -1
  197. package/dist/pages/builder/__tests__/AuthRequiredNonFundedPrograms.test.js +48 -74
  198. package/dist/pages/builder/__tests__/AuthRequiredNonFundedPrograms.test.js.map +1 -1
  199. package/dist/pages/builder/__tests__/AuthorizationRequiredPrograms.test.js +74 -117
  200. package/dist/pages/builder/__tests__/AuthorizationRequiredPrograms.test.js.map +1 -1
  201. package/dist/pages/builder/__tests__/NonSensitiveGroupedPrograms.test.js +674 -1151
  202. package/dist/pages/builder/__tests__/NonSensitiveGroupedPrograms.test.js.map +1 -1
  203. package/dist/pages/builder/__tests__/NonSensitiveSingleProgram.test.js +305 -519
  204. package/dist/pages/builder/__tests__/NonSensitiveSingleProgram.test.js.map +1 -1
  205. package/dist/pages/builder/__tests__/ReferralBuilder.test.js +14 -33
  206. package/dist/pages/builder/__tests__/ReferralBuilder.test.js.map +1 -1
  207. package/dist/pages/builder/__tests__/SensitiveProviderGroupedPrograms.test.js +407 -727
  208. package/dist/pages/builder/__tests__/SensitiveProviderGroupedPrograms.test.js.map +1 -1
  209. package/dist/pages/builder/__tests__/SensitiveServiceGroupedPrograms.test.js +139 -227
  210. package/dist/pages/builder/__tests__/SensitiveServiceGroupedPrograms.test.js.map +1 -1
  211. package/dist/pages/builder/__tests__/SensitiveServiceSensitiveProviderGroupedPrograms.test.js +262 -461
  212. package/dist/pages/builder/__tests__/SensitiveServiceSensitiveProviderGroupedPrograms.test.js.map +1 -1
  213. package/dist/pages/builder/__tests__/SensitiveSingleProgram.test.js +273 -455
  214. package/dist/pages/builder/__tests__/SensitiveSingleProgram.test.js.map +1 -1
  215. package/dist/pages/builder/buildDraftState.js +21 -21
  216. package/dist/pages/builder/buildDraftState.js.map +1 -1
  217. package/dist/pages/builder/buildGroupedReferrals.js +80 -113
  218. package/dist/pages/builder/buildGroupedReferrals.js.map +1 -1
  219. package/dist/pages/builder/constants.js +12 -12
  220. package/dist/pages/builder/constants.js.map +1 -1
  221. package/dist/pages/builder/formatProgramDetail.js +152 -167
  222. package/dist/pages/builder/formatProgramDetail.js.map +1 -1
  223. package/dist/pages/builder/useBuildReferrals.js +95 -153
  224. package/dist/pages/builder/useBuildReferrals.js.map +1 -1
  225. package/dist/pages/builder/utils.js +84 -133
  226. package/dist/pages/builder/utils.js.map +1 -1
  227. package/dist/pages/review/DeleteReferralModal.js +45 -31
  228. package/dist/pages/review/DeleteReferralModal.js.map +1 -1
  229. package/dist/pages/review/DropdownMultiplesReferrals.js +75 -92
  230. package/dist/pages/review/DropdownMultiplesReferrals.js.map +1 -1
  231. package/dist/pages/review/ReferralsSent.js +200 -231
  232. package/dist/pages/review/ReferralsSent.js.map +1 -1
  233. package/dist/pages/review/Review.js +451 -544
  234. package/dist/pages/review/Review.js.map +1 -1
  235. package/dist/pages/review/__tests__/CallbackNotifications.test.js +46 -57
  236. package/dist/pages/review/__tests__/CallbackNotifications.test.js.map +1 -1
  237. package/dist/pages/review/__tests__/ReferralsSent.test.js +189 -333
  238. package/dist/pages/review/__tests__/ReferralsSent.test.js.map +1 -1
  239. package/dist/pages/review/__tests__/Review.test.js +380 -572
  240. package/dist/pages/review/__tests__/Review.test.js.map +1 -1
  241. package/dist/pages/review/__tests__/data.js +5 -5
  242. package/dist/pages/review/__tests__/data.js.map +1 -1
  243. package/dist/pages/review/constants.js +5 -5
  244. package/dist/pages/review/constants.js.map +1 -1
  245. package/dist/pages/supporting-info/SupportingInfo.js +123 -160
  246. package/dist/pages/supporting-info/SupportingInfo.js.map +1 -1
  247. package/dist/pages/supporting-info/__tests__/SupportingInfo.test.js +85 -146
  248. package/dist/pages/supporting-info/__tests__/SupportingInfo.test.js.map +1 -1
  249. package/dist/pages/supporting-info/__tests__/data.js +1 -1
  250. package/dist/pages/supporting-info/__tests__/data.js.map +1 -1
  251. package/dist/reportWebVitals.js +9 -7
  252. package/dist/reportWebVitals.js.map +1 -1
  253. package/dist/setupTests.js +8 -30
  254. package/dist/setupTests.js.map +1 -1
  255. package/dist/utils/__tests__/canChangeHoldReason.test.js +23 -23
  256. package/dist/utils/__tests__/canChangeHoldReason.test.js.map +1 -1
  257. package/dist/utils/__tests__/checkRoles.test.js +10 -10
  258. package/dist/utils/__tests__/checkRoles.test.js.map +1 -1
  259. package/dist/utils/canAccept.js +14 -9
  260. package/dist/utils/canAccept.js.map +1 -1
  261. package/dist/utils/canChangeHoldReason.js +16 -11
  262. package/dist/utils/canChangeHoldReason.js.map +1 -1
  263. package/dist/utils/canHoldForReview.js +13 -8
  264. package/dist/utils/canHoldForReview.js.map +1 -1
  265. package/dist/utils/canReject.js +21 -14
  266. package/dist/utils/canReject.js.map +1 -1
  267. package/dist/utils/checkRoles.js +10 -10
  268. package/dist/utils/checkRoles.js.map +1 -1
  269. package/dist/utils/getProgramServicesPayload.js +20 -20
  270. package/dist/utils/getProgramServicesPayload.js.map +1 -1
  271. package/dist/utils/hasUserRole.js +8 -8
  272. package/dist/utils/hasUserRole.js.map +1 -1
  273. package/dist/utils/isReferralForwarded.js +4 -2
  274. package/dist/utils/isReferralForwarded.js.map +1 -1
  275. package/dist/utils/referralToConsent.js +14 -19
  276. package/dist/utils/referralToConsent.js.map +1 -1
  277. package/dist/utils/useDebounce.js +7 -18
  278. package/dist/utils/useDebounce.js.map +1 -1
  279. package/dist/utils/useFeatureFlag.js +1 -1
  280. package/dist/utils/useFeatureFlag.js.map +1 -1
  281. package/dist/utils/validateCostAmount.js +4 -4
  282. package/dist/utils/validateCostAmount.js.map +1 -1
  283. package/dist/utils/validateUnitAmount.js +4 -4
  284. package/dist/utils/validateUnitAmount.js.map +1 -1
  285. package/package.json +63 -37
  286. package/.github/CODEOWNERS +0 -3
  287. package/.github/pull_request_template.md +0 -25
  288. package/.github/workflows/quality.yml +0 -44
  289. package/.github/workflows/semantic-release.yml +0 -26
  290. package/.nvmrc +0 -1
  291. package/babel.config.js +0 -11
  292. package/config-overrides.js +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"buildGroupedReferrals.js","names":["isEmpty","every","head","groupBy","flatMap","isUnlistedReferral","filterNetworks","programIsOffPlatform","programIsOnPlatform","OFF_PLATFORM_REFERRALS_ONLY","withPreventUngroup","fn","referral","prevent_ungroup","groupByNetworkImpl","networks","length","network","singleNetworkPrograms","programs","filter","program","_program$provider","provider","multipleNetworkPrograms","_program$provider2","noNetworkPrograms","_program$provider3","programsGroupedByNetworkId","sameNetworkReferrals","Object","values","map","_programs$0$provider","_objectSpread","multipleNetworkReferrals","noNetworkReferrals","concat","_toConsumableArray","groupByNetwork","groupByNetworkStatus","p","inNetworkPrograms","OONPrograms","groupBySensitivityImpl","_head","_p$provider","sensitive","sensitivePrograms","_p$provider2","nonSensitivePrograms","_p$provider3","nonSensitiveReferrals","groupBySensitivity","groupByCCImpl","_head2","_p$provider4","provider_type","ccPrograms","_p$provider5","nonCCPrograms","_p$provider6","nonCCReferrals","groupByCC","preventGroupingForSensitiveProvider","groupByFunded","fundedWithAuthorizationPrograms","_p$fee_schedule_progr","fee_schedule_program","authorization_required","fundedWithoutAuthorizationPrograms","_p$fee_schedule_progr2","programsGroupedByFeeSchedule","sameFeePrograms","sameFeeReferrals","nonAuthReferrals","ungroup","groupUnlistedProgramsToReferrals","referrals","unlistedReferrals","listedReferrals","forEach","id","includes","push","unlistedReferral","processReferral","foundReferral","find","_unlistedReferral$pro","_referral$programs$","services","service","status","toLowerCase","splice","updatedUnlistedReferrals","_unlistedReferral$pro2","buildGroupedReferrals","newReferrals","currentProvider","groupedReferrals","groupOperations","operation"],"sources":["../../../src/pages/builder/buildGroupedReferrals.js"],"sourcesContent":["import { isEmpty, every, head, groupBy, flatMap } from 'lodash';\nimport { isUnlistedReferral, filterNetworks, programIsOffPlatform, programIsOnPlatform } from './utils';\nimport { OFF_PLATFORM_REFERRALS_ONLY } from './constants';\n\n// Grouping Rules:\n// - On- and off-platform programs cannot be grouped\n// - Service must be the same\n// - Programs in coordination centers cannot be grouped\n// - Programs must be in the same network\n// - Programs in sensitive providers cannot be grouped\n// - Programs at the same provider cannot be grouped\n// - Users at sensitive providers cannot group programs\n// - Funded programs that require authroization with the same fee schedule program can be grouped\n// - Unlisted programs can only be grouped with programs in the same service and with off platform referrals\n\nconst withPreventUngroup = (fn) => (referral) => (\n referral.prevent_ungroup ? [referral] : fn(referral)\n);\n\nconst groupByNetworkImpl = (referral) => {\n const networks = filterNetworks(referral);\n // if there is only one possible network, set the referral's network and return the referral\n if (networks.length === 1 || isUnlistedReferral(referral)) {\n referral.network = head(networks);\n return [referral];\n }\n // if there is more than one possible network, divide the programs into multiple referrals:\n // referrals with programs in providers in a single network and\n // referrals with programs in providers in multiple networks\n // referrals with unlisted programs, don't have network\n const singleNetworkPrograms = referral.programs.filter(program => program.provider?.networks?.length === 1);\n const multipleNetworkPrograms = referral.programs.filter(program => program.provider?.networks?.length > 1);\n const noNetworkPrograms = referral.programs.filter(program => !program.provider?.networks?.length);\n // group single network programs by network id\n const programsGroupedByNetworkId = groupBy(singleNetworkPrograms, 'provider.networks[0].id');\n // create a grouped referral for programs with the same single network\n const sameNetworkReferrals = Object.values(programsGroupedByNetworkId).map(programs => ({\n ...referral,\n programs,\n network: head(programs[0].provider?.networks),\n }))\n // create separate referrals for each program with multiple networks\n const multipleNetworkReferrals = multipleNetworkPrograms.map(program => ({\n ...referral,\n programs: [program],\n network: head(networks),\n }))\n // create separate referrals for each program with no network\n const noNetworkReferrals = noNetworkPrograms.map(program => ({\n ...referral,\n programs: [program],\n }))\n\n return [...multipleNetworkReferrals, ...sameNetworkReferrals, ...noNetworkReferrals];\n}\n\nconst groupByNetwork = withPreventUngroup(groupByNetworkImpl);\n\nconst groupByNetworkStatus = (referral) => {\n if (referral.prevent_ungroup) {\n return [referral];\n }\n // if every program is on-platform or every programs is off-platform, return the referral\n if (every(referral.programs.map(p => programIsOnPlatform(p))) ||\n every(referral.programs.map(p => programIsOffPlatform(p)))) {\n return [referral];\n }\n // divide programs into on- and off-platform referrals\n const inNetworkPrograms = referral.programs.filter(p => programIsOnPlatform(p));\n const OONPrograms = referral.programs.filter(p => programIsOffPlatform(p));\n\n return [\n ...inNetworkPrograms.length ? [{ ...referral, programs: inNetworkPrograms }] : [],\n ...OONPrograms.length ? [{ ...referral, programs: OONPrograms }] : []\n ];\n}\n\nconst groupBySensitivityImpl = (referral) => {\n // if every program is non-sensitive or the referral contains only one sensitive program, return referral\n if (every(referral.programs.map(p => !p?.provider?.sensitive)) ||\n (referral.programs.length === 1 && head(referral.programs)?.provider?.sensitive)) {\n return [referral];\n }\n // create a new referral for each sensitive program\n const sensitivePrograms = referral.programs.filter(p => p?.provider?.sensitive).map(program => ({\n ...referral, programs: [program]\n }));\n // create a new referral for non-sensitive programs\n const nonSensitivePrograms = referral.programs.filter(p => !p?.provider?.sensitive);\n const nonSensitiveReferrals = !isEmpty(nonSensitivePrograms) ? [{ ...referral, programs: nonSensitivePrograms }] : [];\n\n return [...sensitivePrograms, ...nonSensitiveReferrals];\n}\n\nconst groupBySensitivity = withPreventUngroup(groupBySensitivityImpl);\n\nconst groupByCCImpl = (referral) => {\n // if no programs are in a coordination center or the referral contains only one program in a cc, return referral\n if (every(referral.programs.map(p => p?.provider?.provider_type !== 'coordination_center')) ||\n (referral.programs.length === 1 && head(referral.programs)?.provider?.provider_type === 'coordination_center')) {\n return [referral];\n }\n // create a new referral for each program in a cc\n const ccPrograms = referral.programs.filter(p => p?.provider?.provider_type === 'coordination_center')\n .map(program => ({\n ...referral, programs: [program]\n }));\n // create a new referral for programs not in a cc\n const nonCCPrograms = referral.programs.filter(p => p?.provider?.provider_type !== 'coordination_center');\n const nonCCReferrals = !isEmpty(nonCCPrograms) ? [{ ...referral, programs: nonCCPrograms }] : [];\n\n return [...ccPrograms, ...nonCCReferrals];\n}\n\nconst groupByCC = withPreventUngroup(groupByCCImpl);\n\nconst preventGroupingForSensitiveProvider = (referral) => {\n const networks = filterNetworks(referral);\n // if there is only one possible network, set the referral's network\n if (networks.length === 1) {\n referral.network = head(networks);\n }\n const { programs } = referral;\n return programs.length > 1 ?\n programs.map(program => ({ ...referral, programs: [program] })) :\n [referral];\n};\n\nconst groupByFunded = (referral) => {\n const networks = filterNetworks(referral);\n // if there is only one possible network, set the referral's network\n if (networks.length === 1) {\n referral.network = head(networks);\n }\n\n const fundedWithAuthorizationPrograms = referral.programs.filter(p => p.fee_schedule_program?.authorization_required);\n const fundedWithoutAuthorizationPrograms = referral.programs.filter(p => !p.fee_schedule_program?.authorization_required);\n\n const programsGroupedByFeeSchedule = groupBy(fundedWithAuthorizationPrograms, 'fee_schedule_program.id');\n const sameFeePrograms = Object.values(programsGroupedByFeeSchedule);\n\n // Create a new referral for each program with a shared fee schedule program\n const sameFeeReferrals = sameFeePrograms.map(program => ({\n ...referral,\n programs: program,\n ...(program.length >= 2 ? { prevent_ungroup: true } : {}) // A referral with two or more programs with the same fee schedule cannot be ungrouped\n }));\n\n // Create a new referral for programs without fee authorization required\n const nonAuthReferrals = !isEmpty(fundedWithoutAuthorizationPrograms) ? [{ ...referral, programs: fundedWithoutAuthorizationPrograms, ungroup: true }] : [];\n\n return [...nonAuthReferrals, ...sameFeeReferrals];\n};\n\nconst groupUnlistedProgramsToReferrals = (referrals) => {\n const unlistedReferrals = [], listedReferrals = [];\n\n referrals.forEach(referral => {\n if (every(referral.programs, p => p.id.includes('unlisted')))\n unlistedReferrals.push(referral);\n else\n listedReferrals.push(referral);\n });\n\n if (unlistedReferrals.length === 0) {\n return listedReferrals;\n }\n\n // Loop over the unlisted referrals, in case of a match, add the unlisted program to the referral \n // and remove it from the unlisted referral\n unlistedReferrals.forEach(unlistedReferral => {\n const processReferral = (referrals) => {\n // Find a referral with the same service and off-platform status\n const foundReferral = referrals.find(referral =>\n unlistedReferral.programs[0]?.services[0] === referral.service.id &&\n referral.programs[0]?.status?.toLowerCase() === OFF_PLATFORM_REFERRALS_ONLY\n );\n \n if (foundReferral) {\n // Add the unlisted program to the referral\n foundReferral.programs.push(unlistedReferral.programs[0]);\n // Remove the unlisted program from the referral, otherwise, it will be added to referrals multiple times\n unlistedReferral.programs.splice(0, 1);\n }\n };\n \n processReferral(listedReferrals);\n processReferral(unlistedReferrals);\n });\n\n // Remove referrals with no programs\n const updatedUnlistedReferrals = unlistedReferrals.filter(unlistedReferral => {\n if (unlistedReferral?.programs?.length > 0)\n return unlistedReferral;\n });\n\n return [...listedReferrals, ...updatedUnlistedReferrals];\n}\n\nexport const buildGroupedReferrals = (newReferrals, currentProvider) => {\n let groupedReferrals = newReferrals;\n // if the current provider is sensitive, prevent grouping\n if (currentProvider?.sensitive) {\n groupedReferrals = flatMap(groupedReferrals, preventGroupingForSensitiveProvider);\n } else {\n const groupOperations = [];\n\n groupOperations.push(groupByFunded, groupByNetwork, groupByNetworkStatus, groupBySensitivity, groupByCC);\n\n groupOperations.forEach(operation => {\n groupedReferrals = flatMap(groupedReferrals, operation);\n });\n\n groupedReferrals = groupUnlistedProgramsToReferrals(groupedReferrals);\n }\n\n return groupedReferrals;\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAASA,OAAO,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAO,EAAEC,OAAO,QAAQ,QAAQ;AAC/D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,oBAAoB,EAAEC,mBAAmB,QAAQ,SAAS;AACvG,SAASC,2BAA2B,QAAQ,aAAa;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,EAAE;EAAA,OAAK,UAACC,QAAQ;IAAA,OAC1CA,QAAQ,CAACC,eAAe,GAAG,CAACD,QAAQ,CAAC,GAAGD,EAAE,CAACC,QAAQ,CAAC;EAAA,CACrD;AAAA;AAED,IAAME,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIF,QAAQ,EAAK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OqE,gBAAgB;EAC3B,CAAC,CAAC;EAEF,UAAAhD,MAAA,CAAW2C,eAAe,EAAA1C,kBAAA,CAAK0D,wBAAwB;AACzD,CAAC;AAED,OAAO,IAAME,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,YAAY,EAAEC,eAAe,EAAK;EACtE,IAAIC,gBAAgB,GAAGF,YAAY;EACnC;EACA,IAAIC,eAAe,aAAfA,eAAe,eAAfA,eAAe,CAAErD,SAAS,EAAE;IAC9BsD,gBAAgB,GAAGjG,OAAO,CAACiG,gBAAgB,EAAErC,mCAAmC,CAAC;EACnF,CAAC,MAAM;IACL,IAAMsC,eAAe,GAAG,EAAE;IAE1BA,eAAe,CAAClB,IAAI,CAACnB,aAAa,EAAE1B,cAAc,EAAEC,oBAAoB,EAAEa,kBAAkB,EAAEU,SAAS,CAAC;IAExGuC,eAAe,CAACrB,OAAO,CAAC,UAAAsB,SAAS,EAAI;MACnCF,gBAAgB,GAAGjG,OAAO,CAACiG,gBAAgB,EAAEE,SAAS,CAAC;IACzD,CAAC,CAAC;IAEFF,gBAAgB,GAAGxB,gCAAgC,CAACwB,gBAAgB,CAAC;EACvE;EAEA,OAAOA,gBAAgB;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"buildGroupedReferrals.js","names":["isEmpty","every","head","groupBy","flatMap","isUnlistedReferral","filterNetworks","programIsOffPlatform","programIsOnPlatform","OFF_PLATFORM_REFERRALS_ONLY","withPreventUngroup","fn","referral","prevent_ungroup","groupByNetworkImpl","networks","length","network","singleNetworkPrograms","programs","filter","program","_program$provider","provider","multipleNetworkPrograms","_program$provider2","noNetworkPrograms","_program$provider3","programsGroupedByNetworkId","sameNetworkReferrals","Object","values","map","_programs$0$provider","_objectSpread","multipleNetworkReferrals","noNetworkReferrals","groupByNetwork","groupByNetworkStatus","p","inNetworkPrograms","OONPrograms","groupBySensitivityImpl","_head","_p$provider","sensitive","sensitivePrograms","_p$provider2","nonSensitivePrograms","_p$provider3","nonSensitiveReferrals","groupBySensitivity","groupByCCImpl","_head2","_p$provider4","provider_type","ccPrograms","_p$provider5","nonCCPrograms","_p$provider6","nonCCReferrals","groupByCC","preventGroupingForSensitiveProvider","groupByFunded","fundedWithAuthorizationPrograms","_p$fee_schedule_progr","fee_schedule_program","authorization_required","fundedWithoutAuthorizationPrograms","_p$fee_schedule_progr2","programsGroupedByFeeSchedule","sameFeePrograms","sameFeeReferrals","nonAuthReferrals","ungroup","groupUnlistedProgramsToReferrals","referrals","unlistedReferrals","listedReferrals","forEach","id","includes","push","unlistedReferral","processReferral","foundReferral","find","_unlistedReferral$pro","_referral$programs$","services","service","status","toLowerCase","splice","updatedUnlistedReferrals","_unlistedReferral$pro2","buildGroupedReferrals","newReferrals","currentProvider","groupedReferrals","groupOperations","operation"],"sources":["../../../src/pages/builder/buildGroupedReferrals.js"],"sourcesContent":["import { isEmpty, every, head, groupBy, flatMap } from 'lodash';\nimport { isUnlistedReferral, filterNetworks, programIsOffPlatform, programIsOnPlatform } from './utils';\nimport { OFF_PLATFORM_REFERRALS_ONLY } from './constants';\n\n// Grouping Rules:\n// - On- and off-platform programs cannot be grouped\n// - Service must be the same\n// - Programs in coordination centers cannot be grouped\n// - Programs must be in the same network\n// - Programs in sensitive providers cannot be grouped\n// - Programs at the same provider cannot be grouped\n// - Users at sensitive providers cannot group programs\n// - Funded programs that require authroization with the same fee schedule program can be grouped\n// - Unlisted programs can only be grouped with programs in the same service and with off platform referrals\n\nconst withPreventUngroup = (fn) => (referral) => (\n referral.prevent_ungroup ? [referral] : fn(referral)\n);\n\nconst groupByNetworkImpl = (referral) => {\n const networks = filterNetworks(referral);\n // if there is only one possible network, set the referral's network and return the referral\n if (networks.length === 1 || isUnlistedReferral(referral)) {\n referral.network = head(networks);\n return [referral];\n }\n // if there is more than one possible network, divide the programs into multiple referrals:\n // referrals with programs in providers in a single network and\n // referrals with programs in providers in multiple networks\n // referrals with unlisted programs, don't have network\n const singleNetworkPrograms = referral.programs.filter(program => program.provider?.networks?.length === 1);\n const multipleNetworkPrograms = referral.programs.filter(program => program.provider?.networks?.length > 1);\n const noNetworkPrograms = referral.programs.filter(program => !program.provider?.networks?.length);\n // group single network programs by network id\n const programsGroupedByNetworkId = groupBy(singleNetworkPrograms, 'provider.networks[0].id');\n // create a grouped referral for programs with the same single network\n const sameNetworkReferrals = Object.values(programsGroupedByNetworkId).map(programs => ({\n ...referral,\n programs,\n network: head(programs[0].provider?.networks),\n }))\n // create separate referrals for each program with multiple networks\n const multipleNetworkReferrals = multipleNetworkPrograms.map(program => ({\n ...referral,\n programs: [program],\n network: head(networks),\n }))\n // create separate referrals for each program with no network\n const noNetworkReferrals = noNetworkPrograms.map(program => ({\n ...referral,\n programs: [program],\n }))\n\n return [...multipleNetworkReferrals, ...sameNetworkReferrals, ...noNetworkReferrals];\n}\n\nconst groupByNetwork = withPreventUngroup(groupByNetworkImpl);\n\nconst groupByNetworkStatus = (referral) => {\n if (referral.prevent_ungroup) {\n return [referral];\n }\n // if every program is on-platform or every programs is off-platform, return the referral\n if (every(referral.programs.map(p => programIsOnPlatform(p))) ||\n every(referral.programs.map(p => programIsOffPlatform(p)))) {\n return [referral];\n }\n // divide programs into on- and off-platform referrals\n const inNetworkPrograms = referral.programs.filter(p => programIsOnPlatform(p));\n const OONPrograms = referral.programs.filter(p => programIsOffPlatform(p));\n\n return [\n ...inNetworkPrograms.length ? [{ ...referral, programs: inNetworkPrograms }] : [],\n ...OONPrograms.length ? [{ ...referral, programs: OONPrograms }] : []\n ];\n}\n\nconst groupBySensitivityImpl = (referral) => {\n // if every program is non-sensitive or the referral contains only one sensitive program, return referral\n if (every(referral.programs.map(p => !p?.provider?.sensitive)) ||\n (referral.programs.length === 1 && head(referral.programs)?.provider?.sensitive)) {\n return [referral];\n }\n // create a new referral for each sensitive program\n const sensitivePrograms = referral.programs.filter(p => p?.provider?.sensitive).map(program => ({\n ...referral, programs: [program]\n }));\n // create a new referral for non-sensitive programs\n const nonSensitivePrograms = referral.programs.filter(p => !p?.provider?.sensitive);\n const nonSensitiveReferrals = !isEmpty(nonSensitivePrograms) ? [{ ...referral, programs: nonSensitivePrograms }] : [];\n\n return [...sensitivePrograms, ...nonSensitiveReferrals];\n}\n\nconst groupBySensitivity = withPreventUngroup(groupBySensitivityImpl);\n\nconst groupByCCImpl = (referral) => {\n // if no programs are in a coordination center or the referral contains only one program in a cc, return referral\n if (every(referral.programs.map(p => p?.provider?.provider_type !== 'coordination_center')) ||\n (referral.programs.length === 1 && head(referral.programs)?.provider?.provider_type === 'coordination_center')) {\n return [referral];\n }\n // create a new referral for each program in a cc\n const ccPrograms = referral.programs.filter(p => p?.provider?.provider_type === 'coordination_center')\n .map(program => ({\n ...referral, programs: [program]\n }));\n // create a new referral for programs not in a cc\n const nonCCPrograms = referral.programs.filter(p => p?.provider?.provider_type !== 'coordination_center');\n const nonCCReferrals = !isEmpty(nonCCPrograms) ? [{ ...referral, programs: nonCCPrograms }] : [];\n\n return [...ccPrograms, ...nonCCReferrals];\n}\n\nconst groupByCC = withPreventUngroup(groupByCCImpl);\n\nconst preventGroupingForSensitiveProvider = (referral) => {\n const networks = filterNetworks(referral);\n // if there is only one possible network, set the referral's network\n if (networks.length === 1) {\n referral.network = head(networks);\n }\n const { programs } = referral;\n return programs.length > 1 ?\n programs.map(program => ({ ...referral, programs: [program] })) :\n [referral];\n};\n\nconst groupByFunded = (referral) => {\n const networks = filterNetworks(referral);\n // if there is only one possible network, set the referral's network\n if (networks.length === 1) {\n referral.network = head(networks);\n }\n\n const fundedWithAuthorizationPrograms = referral.programs.filter(p => p.fee_schedule_program?.authorization_required);\n const fundedWithoutAuthorizationPrograms = referral.programs.filter(p => !p.fee_schedule_program?.authorization_required);\n\n const programsGroupedByFeeSchedule = groupBy(fundedWithAuthorizationPrograms, 'fee_schedule_program.id');\n const sameFeePrograms = Object.values(programsGroupedByFeeSchedule);\n\n // Create a new referral for each program with a shared fee schedule program\n const sameFeeReferrals = sameFeePrograms.map(program => ({\n ...referral,\n programs: program,\n ...(program.length >= 2 ? { prevent_ungroup: true } : {}) // A referral with two or more programs with the same fee schedule cannot be ungrouped\n }));\n\n // Create a new referral for programs without fee authorization required\n const nonAuthReferrals = !isEmpty(fundedWithoutAuthorizationPrograms) ? [{ ...referral, programs: fundedWithoutAuthorizationPrograms, ungroup: true }] : [];\n\n return [...nonAuthReferrals, ...sameFeeReferrals];\n};\n\nconst groupUnlistedProgramsToReferrals = (referrals) => {\n const unlistedReferrals = [], listedReferrals = [];\n\n referrals.forEach(referral => {\n if (every(referral.programs, p => p.id.includes('unlisted')))\n unlistedReferrals.push(referral);\n else\n listedReferrals.push(referral);\n });\n\n if (unlistedReferrals.length === 0) {\n return listedReferrals;\n }\n\n // Loop over the unlisted referrals, in case of a match, add the unlisted program to the referral \n // and remove it from the unlisted referral\n unlistedReferrals.forEach(unlistedReferral => {\n const processReferral = (referrals) => {\n // Find a referral with the same service and off-platform status\n const foundReferral = referrals.find(referral =>\n unlistedReferral.programs[0]?.services[0] === referral.service.id &&\n referral.programs[0]?.status?.toLowerCase() === OFF_PLATFORM_REFERRALS_ONLY\n );\n \n if (foundReferral) {\n // Add the unlisted program to the referral\n foundReferral.programs.push(unlistedReferral.programs[0]);\n // Remove the unlisted program from the referral, otherwise, it will be added to referrals multiple times\n unlistedReferral.programs.splice(0, 1);\n }\n };\n \n processReferral(listedReferrals);\n processReferral(unlistedReferrals);\n });\n\n // Remove referrals with no programs\n const updatedUnlistedReferrals = unlistedReferrals.filter(unlistedReferral => {\n if (unlistedReferral?.programs?.length > 0)\n return unlistedReferral;\n });\n\n return [...listedReferrals, ...updatedUnlistedReferrals];\n}\n\nexport const buildGroupedReferrals = (newReferrals, currentProvider) => {\n let groupedReferrals = newReferrals;\n // if the current provider is sensitive, prevent grouping\n if (currentProvider?.sensitive) {\n groupedReferrals = flatMap(groupedReferrals, preventGroupingForSensitiveProvider);\n } else {\n const groupOperations = [];\n\n groupOperations.push(groupByFunded, groupByNetwork, groupByNetworkStatus, groupBySensitivity, groupByCC);\n\n groupOperations.forEach(operation => {\n groupedReferrals = flatMap(groupedReferrals, operation);\n });\n\n groupedReferrals = groupUnlistedProgramsToReferrals(groupedReferrals);\n }\n\n return groupedReferrals;\n}\n"],"mappings":";;;AAAA,SAASA,OAAO,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAO,EAAEC,OAAO,QAAQ,QAAQ;AAC/D,SAASC,kBAAkB,EAAEC,cAAc,EAAEC,oBAAoB,EAAEC,mBAAmB,QAAQ,SAAS;AACvG,SAASC,2BAA2B,QAAQ,aAAa;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,kBAAkB,GAAIC,EAAE,IAAMC,QAAQ,IAC1CA,QAAQ,CAACC,eAAe,GAAG,CAACD,QAAQ,CAAC,GAAGD,EAAE,CAACC,QAAQ,CACpD;AAED,MAAME,kBAAkB,GAAIF,QAAQ,IAAK;EACvC,MAAMG,QAAQ,GAAGT,cAAc,CAACM,QAAQ,CAAC;EACzC;EACA,IAAIG,QAAQ,CAACC,MAAM,KAAK,CAAC,IAAIX,kBAAkB,CAACO,QAAQ,CAAC,EAAE;IACzDA,QAAQ,CAACK,OAAO,GAAGf,IAAI,CAACa,QAAQ,CAAC;IACjC,OAAO,CAACH,QAAQ,CAAC;EACnB;EACA;EACA;EACA;EACA;EACA,MAAMM,qBAAqB,GAAGN,QAAQ,CAACO,QAAQ,CAACC,MAAM,CAACC,OAAO;IAAA,IAAAC,iBAAA;IAAA,OAAI,EAAAA,iBAAA,GAAAD,OAAO,CAACE,QAAQ,cAAAD,iBAAA,gBAAAA,iBAAA,GAAhBA,iBAAA,CAAkBP,QAAQ,cAAAO,iBAAA,uBAA1BA,iBAAA,CAA4BN,MAAM,MAAK,CAAC;EAAA,EAAC;EAC3G,MAAMQ,uBAAuB,GAAGZ,QAAQ,CAACO,QAAQ,CAACC,MAAM,CAACC,OAAO;IAAA,IAAAI,kBAAA;IAAA,OAAI,EAAAA,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IAAG,CAAC,EACxC,OAAOmE,gBAAgB;EAC3B,CAAC,CAAC;EAEF,OAAO,CAAC,GAAGL,eAAe,EAAE,GAAGgB,wBAAwB,CAAC;AAC1D,CAAC;AAED,OAAO,MAAME,qBAAqB,GAAGA,CAACC,YAAY,EAAEC,eAAe,KAAK;EACtE,IAAIC,gBAAgB,GAAGF,YAAY;EACnC;EACA,IAAIC,eAAe,aAAfA,eAAe,eAAfA,eAAe,CAAErD,SAAS,EAAE;IAC9BsD,gBAAgB,GAAG/F,OAAO,CAAC+F,gBAAgB,EAAErC,mCAAmC,CAAC;EACnF,CAAC,MAAM;IACL,MAAMsC,eAAe,GAAG,EAAE;IAE1BA,eAAe,CAAClB,IAAI,CAACnB,aAAa,EAAE1B,cAAc,EAAEC,oBAAoB,EAAEa,kBAAkB,EAAEU,SAAS,CAAC;IAExGuC,eAAe,CAACrB,OAAO,CAACsB,SAAS,IAAI;MACnCF,gBAAgB,GAAG/F,OAAO,CAAC+F,gBAAgB,EAAEE,SAAS,CAAC;IACzD,CAAC,CAAC;IAEFF,gBAAgB,GAAGxB,gCAAgC,CAACwB,gBAAgB,CAAC;EACvE;EAEA,OAAOA,gBAAgB;AACzB,CAAC","ignoreList":[]}
@@ -1,13 +1,13 @@
1
- export var REFERRAL_BUILDER_DESCRIPTION = "We automatically group compatible referrals.\n Reorganize referrals based on your client's needs, \n add referral descriptions, and upload any attachments. ";
2
- export var SUPPORTING_INFO = "Provide supporting information to help\n quickly connect your client with services.";
3
- export var ON_PLATFORM_REFERRALS = "An on-platform program uses Unite Us, just like you. \n If you send them a referral, then can accept, reject, or forward it using Unite Us.";
4
- export var OFF_PLATFORM_REFERRALS = "An off-platform program doesn't use Unite Us yet. \n If you send them a referral, you must contact them directly to request services, share\n their information with your client, and document the outcome in Unite Us.";
5
- export var GROUPED_REFERRALS_EXPLANATION = "With grouped referrals, you can send referrals\n to multiple, on-platform programs at once. Whoever accepts the referral first works with\n the client and the rest of the referrals are recalled. To be grouped, referrals must\n have the same: ";
6
- export var UNGROUP_REFERRAL_EXPLANATION = "We automatically group compatible referrals for \n you. You can ungroup referrals by clicking the three-dot icon next to any program and move\n it to a new referral.";
7
- export var GROUPED_REFERRAL_MUST_HAVE_SAME = ['Service type', 'Program status (on- or off-platform)', 'Authorization (required or not)'];
8
- export var REFERRAL_PII_PHI_DESCRIPTION = "Include personally identifiable information (PII), protected health information (PHI), or other sensitive information only if it's necessary to provide services.";
9
- export var REFERRAL_SENT_SUCCESS = "We've saved these referred programs to the Resources tab on the client's profile.";
10
- export var OFF_PLATFORM_REFERRALS_ONLY = 'off-platform referrals only';
11
- export var ROLE_KEYS = ['case_manager', 'referrals_user', 'referrals_admin', 'oversight', 'org_admin'];
12
- export var NEXT_STEPS = ['Share these resources with the client by text, email, or print.', 'Confirm whether any on-platform referrals have been accepted by any organizations.', 'Contact any off-platform programs directly, follow up with your client, and update the case.'];
1
+ export const REFERRAL_BUILDER_DESCRIPTION = "We automatically group compatible referrals.\n Reorganize referrals based on your client's needs, \n add referral descriptions, and upload any attachments. ";
2
+ export const SUPPORTING_INFO = "Provide supporting information to help\n quickly connect your client with services.";
3
+ export const ON_PLATFORM_REFERRALS = "An on-platform program uses Unite Us, just like you. \n If you send them a referral, then can accept, reject, or forward it using Unite Us.";
4
+ export const OFF_PLATFORM_REFERRALS = "An off-platform program doesn't use Unite Us yet. \n If you send them a referral, you must contact them directly to request services, share\n their information with your client, and document the outcome in Unite Us.";
5
+ export const GROUPED_REFERRALS_EXPLANATION = "With grouped referrals, you can send referrals\n to multiple, on-platform programs at once. Whoever accepts the referral first works with\n the client and the rest of the referrals are recalled. To be grouped, referrals must\n have the same: ";
6
+ export const UNGROUP_REFERRAL_EXPLANATION = "We automatically group compatible referrals for \n you. You can ungroup referrals by clicking the three-dot icon next to any program and move\n it to a new referral.";
7
+ export const GROUPED_REFERRAL_MUST_HAVE_SAME = ['Service type', 'Program status (on- or off-platform)', 'Authorization (required or not)'];
8
+ export const REFERRAL_PII_PHI_DESCRIPTION = "Include personally identifiable information (PII), protected health information (PHI), or other sensitive information only if it's necessary to provide services.";
9
+ export const REFERRAL_SENT_SUCCESS = "We've saved these referred programs to the Resources tab on the client's profile.";
10
+ export const OFF_PLATFORM_REFERRALS_ONLY = 'off-platform referrals only';
11
+ export const ROLE_KEYS = ['case_manager', 'referrals_user', 'referrals_admin', 'oversight', 'org_admin'];
12
+ export const NEXT_STEPS = ['Share these resources with the client by text, email, or print.', 'Confirm whether any on-platform referrals have been accepted by any organizations.', 'Contact any off-platform programs directly, follow up with your client, and update the case.'];
13
13
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["REFERRAL_BUILDER_DESCRIPTION","SUPPORTING_INFO","ON_PLATFORM_REFERRALS","OFF_PLATFORM_REFERRALS","GROUPED_REFERRALS_EXPLANATION","UNGROUP_REFERRAL_EXPLANATION","GROUPED_REFERRAL_MUST_HAVE_SAME","REFERRAL_PII_PHI_DESCRIPTION","REFERRAL_SENT_SUCCESS","OFF_PLATFORM_REFERRALS_ONLY","ROLE_KEYS","NEXT_STEPS"],"sources":["../../../src/pages/builder/constants.js"],"sourcesContent":["export const REFERRAL_BUILDER_DESCRIPTION = `We automatically group compatible referrals.\n Reorganize referrals based on your client's needs, \n add referral descriptions, and upload any attachments. `;\n\nexport const SUPPORTING_INFO = `Provide supporting information to help\n quickly connect your client with services.`;\n\nexport const ON_PLATFORM_REFERRALS = `An on-platform program uses Unite Us, just like you. \n If you send them a referral, then can accept, reject, or forward it using Unite Us.`;\n\nexport const OFF_PLATFORM_REFERRALS = `An off-platform program doesn't use Unite Us yet. \n If you send them a referral, you must contact them directly to request services, share\n their information with your client, and document the outcome in Unite Us.`;\n\nexport const GROUPED_REFERRALS_EXPLANATION = `With grouped referrals, you can send referrals\n to multiple, on-platform programs at once. Whoever accepts the referral first works with\n the client and the rest of the referrals are recalled. To be grouped, referrals must\n have the same: `;\n\nexport const UNGROUP_REFERRAL_EXPLANATION = `We automatically group compatible referrals for \n you. You can ungroup referrals by clicking the three-dot icon next to any program and move\n it to a new referral.`;\n\nexport const GROUPED_REFERRAL_MUST_HAVE_SAME = ['Service type', 'Program status (on- or off-platform)', 'Authorization (required or not)'];\n\nexport const REFERRAL_PII_PHI_DESCRIPTION = \"Include personally identifiable information (PII), protected health information (PHI), or other sensitive information only if it's necessary to provide services.\";\n\nexport const REFERRAL_SENT_SUCCESS = `We've saved these referred programs to the Resources tab on the client's profile.`;\n\nexport const OFF_PLATFORM_REFERRALS_ONLY = 'off-platform referrals only';\n\nexport const ROLE_KEYS = ['case_manager', 'referrals_user', 'referrals_admin', 'oversight', 'org_admin'];\n\nexport const NEXT_STEPS = ['Share these resources with the client by text, email, or print.',\n 'Confirm whether any on-platform referrals have been accepted by any organizations.',\n 'Contact any off-platform programs directly, follow up with your client, and update the case.'];\n"],"mappings":"AAAA,OAAO,IAAMA,4BAA4B,mKAEiB;AAE1D,OAAO,IAAMC,eAAe,yFACiB;AAE7C,OAAO,IAAMC,qBAAqB,iJACoD;AAEtF,OAAO,IAAMC,sBAAsB,8NAEyC;AAE5E,OAAO,IAAMC,6BAA6B,0PAGxB;AAElB,OAAO,IAAMC,4BAA4B,4KAEjB;AAExB,OAAO,IAAMC,+BAA+B,GAAG,CAAC,cAAc,EAAE,sCAAsC,EAAE,iCAAiC,CAAC;AAE1I,OAAO,IAAMC,4BAA4B,GAAG,mKAAmK;AAE/M,OAAO,IAAMC,qBAAqB,sFAAsF;AAExH,OAAO,IAAMC,2BAA2B,GAAG,6BAA6B;AAExE,OAAO,IAAMC,SAAS,GAAG,CAAC,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,CAAC;AAExG,OAAO,IAAMC,UAAU,GAAG,CAAC,iEAAiE,EAC1F,oFAAoF,EACpF,8FAA8F,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"constants.js","names":["REFERRAL_BUILDER_DESCRIPTION","SUPPORTING_INFO","ON_PLATFORM_REFERRALS","OFF_PLATFORM_REFERRALS","GROUPED_REFERRALS_EXPLANATION","UNGROUP_REFERRAL_EXPLANATION","GROUPED_REFERRAL_MUST_HAVE_SAME","REFERRAL_PII_PHI_DESCRIPTION","REFERRAL_SENT_SUCCESS","OFF_PLATFORM_REFERRALS_ONLY","ROLE_KEYS","NEXT_STEPS"],"sources":["../../../src/pages/builder/constants.js"],"sourcesContent":["export const REFERRAL_BUILDER_DESCRIPTION = `We automatically group compatible referrals.\n Reorganize referrals based on your client's needs, \n add referral descriptions, and upload any attachments. `;\n\nexport const SUPPORTING_INFO = `Provide supporting information to help\n quickly connect your client with services.`;\n\nexport const ON_PLATFORM_REFERRALS = `An on-platform program uses Unite Us, just like you. \n If you send them a referral, then can accept, reject, or forward it using Unite Us.`;\n\nexport const OFF_PLATFORM_REFERRALS = `An off-platform program doesn't use Unite Us yet. \n If you send them a referral, you must contact them directly to request services, share\n their information with your client, and document the outcome in Unite Us.`;\n\nexport const GROUPED_REFERRALS_EXPLANATION = `With grouped referrals, you can send referrals\n to multiple, on-platform programs at once. Whoever accepts the referral first works with\n the client and the rest of the referrals are recalled. To be grouped, referrals must\n have the same: `;\n\nexport const UNGROUP_REFERRAL_EXPLANATION = `We automatically group compatible referrals for \n you. You can ungroup referrals by clicking the three-dot icon next to any program and move\n it to a new referral.`;\n\nexport const GROUPED_REFERRAL_MUST_HAVE_SAME = ['Service type', 'Program status (on- or off-platform)', 'Authorization (required or not)'];\n\nexport const REFERRAL_PII_PHI_DESCRIPTION = \"Include personally identifiable information (PII), protected health information (PHI), or other sensitive information only if it's necessary to provide services.\";\n\nexport const REFERRAL_SENT_SUCCESS = `We've saved these referred programs to the Resources tab on the client's profile.`;\n\nexport const OFF_PLATFORM_REFERRALS_ONLY = 'off-platform referrals only';\n\nexport const ROLE_KEYS = ['case_manager', 'referrals_user', 'referrals_admin', 'oversight', 'org_admin'];\n\nexport const NEXT_STEPS = ['Share these resources with the client by text, email, or print.',\n 'Confirm whether any on-platform referrals have been accepted by any organizations.',\n 'Contact any off-platform programs directly, follow up with your client, and update the case.'];\n"],"mappings":"AAAA,OAAO,MAAMA,4BAA4B,mKAEiB;AAE1D,OAAO,MAAMC,eAAe,yFACiB;AAE7C,OAAO,MAAMC,qBAAqB,iJACoD;AAEtF,OAAO,MAAMC,sBAAsB,8NAEyC;AAE5E,OAAO,MAAMC,6BAA6B,0PAGxB;AAElB,OAAO,MAAMC,4BAA4B,4KAEjB;AAExB,OAAO,MAAMC,+BAA+B,GAAG,CAAC,cAAc,EAAE,sCAAsC,EAAE,iCAAiC,CAAC;AAE1I,OAAO,MAAMC,4BAA4B,GAAG,mKAAmK;AAE/M,OAAO,MAAMC,qBAAqB,sFAAsF;AAExH,OAAO,MAAMC,2BAA2B,GAAG,6BAA6B;AAExE,OAAO,MAAMC,SAAS,GAAG,CAAC,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,CAAC;AAExG,OAAO,MAAMC,UAAU,GAAG,CAAC,iEAAiE,EAC1F,oFAAoF,EACpF,8FAA8F,CAAC","ignoreList":[]}
@@ -1,125 +1,129 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
6
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
8
- function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
9
- function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
10
- function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
11
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
12
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
15
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
16
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
4
  import { isEmpty } from 'lodash';
18
5
  import { ageRangeConverters } from '@unite-us/client-utils';
19
6
  import { SEARCH_ROLES, SERVICE_AREA_TYPES, STATIC_FILTER_OPTIONS } from '../../constants';
20
7
  import selectHours from './utils';
21
8
  import fetchProviderPrograms from '../../actions/Referral/fetchCoreServices';
22
- var US_STATES = STATIC_FILTER_OPTIONS.US_STATES,
23
- ACCESSIBILITY_OPTIONS = STATIC_FILTER_OPTIONS.ACCESSIBILITY_OPTIONS,
24
- LANGUAGE_OPTIONS = STATIC_FILTER_OPTIONS.LANGUAGE_OPTIONS,
25
- TRANSPORTATION_OPTIONS = STATIC_FILTER_OPTIONS.TRANSPORTATION_OPTIONS,
26
- PAYMENT_OPTIONS = STATIC_FILTER_OPTIONS.PAYMENT_OPTIONS,
27
- POPULATIONS = STATIC_FILTER_OPTIONS.POPULATIONS,
28
- PROGRAM_DELIVERY_OPTIONS = STATIC_FILTER_OPTIONS.PROGRAM_DELIVERY_OPTIONS;
29
- var convertApiAgeRangeToUnits = ageRangeConverters.convertApiAgeRangeToUnits,
30
- processAgeText = ageRangeConverters.processAgeText;
31
- var parseAge = function parseAge(_ref) {
32
- var min_months = _ref.min_months,
33
- max_months = _ref.max_months;
9
+ const {
10
+ US_STATES,
11
+ ACCESSIBILITY_OPTIONS,
12
+ LANGUAGE_OPTIONS,
13
+ TRANSPORTATION_OPTIONS,
14
+ PAYMENT_OPTIONS,
15
+ POPULATIONS,
16
+ PROGRAM_DELIVERY_OPTIONS
17
+ } = STATIC_FILTER_OPTIONS;
18
+ const {
19
+ convertApiAgeRangeToUnits,
20
+ processAgeText
21
+ } = ageRangeConverters;
22
+ const parseAge = _ref => {
23
+ let {
24
+ min_months,
25
+ max_months
26
+ } = _ref;
34
27
  if (!min_months && !max_months) return '';
35
- return processAgeText.apply(void 0, _toConsumableArray(convertApiAgeRangeToUnits("".concat(min_months, "...").concat(max_months))));
28
+ return processAgeText(...convertApiAgeRangeToUnits("".concat(min_months, "...").concat(max_months)));
36
29
  };
37
- var mapValuesToLabels = function mapValuesToLabels(values, options) {
38
- return values.map(function (value) {
39
- var option = options.find(function (opt) {
40
- return opt.value === value;
41
- });
30
+ const mapValuesToLabels = (values, options) => {
31
+ return values.map(value => {
32
+ const option = options.find(opt => opt.value === value);
42
33
  return option ? option.label : value;
43
34
  }).join(', ');
44
35
  };
45
- var getProgramProps = /*#__PURE__*/function () {
46
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref2) {
47
- var name, description, eligibility_text, _ref2$population_rest, population_restrictions, _ref2$accessibility_o, accessibility_options, _ref2$delivery_option, delivery_options, _ref2$payment_options, payment_options, _ref2$population_spec, population_specializations, _ref2$languages, languages, _ref2$services, services, _ref2$transportation_, transportation_options, _ref2$city_requiremen, city_requirements, _ref2$county_requirem, county_requirements, _ref2$postal_code_req, postal_code_requirements, _ref2$state_requireme, state_requirements, _ref2$age_specializat, age_specializations, _ref2$gender_requirem, gender_requirements, _ref2$age_requirement, age_requirements, _ref2$phone_numbers, phone_numbers, _ref2$email_addresses, email_addresses, website_url, _ref2$locations, locations, receiving_referrals, provider, offers_specialized_screening, fee_schedule_screenings, suggest_edit_enabled, id, hasRequirements, hasAccessibility, hasOtherEligibility, hasEligibility, hasContactInfo, hours, accessibilityLabels, languageLabels, transportationLabels, paymentLabels, populationRestrictionLabels, populationSpecializationLabels, deliveryOptionLabels, providersWithServices, appRoles;
48
- return _regenerator().w(function (_context) {
49
- while (1) switch (_context.n) {
50
- case 0:
51
- name = _ref2.name, description = _ref2.description, eligibility_text = _ref2.eligibility_text, _ref2$population_rest = _ref2.population_restrictions, population_restrictions = _ref2$population_rest === void 0 ? [] : _ref2$population_rest, _ref2$accessibility_o = _ref2.accessibility_options, accessibility_options = _ref2$accessibility_o === void 0 ? [] : _ref2$accessibility_o, _ref2$delivery_option = _ref2.delivery_options, delivery_options = _ref2$delivery_option === void 0 ? [] : _ref2$delivery_option, _ref2$payment_options = _ref2.payment_options, payment_options = _ref2$payment_options === void 0 ? [] : _ref2$payment_options, _ref2$population_spec = _ref2.population_specializations, population_specializations = _ref2$population_spec === void 0 ? [] : _ref2$population_spec, _ref2$languages = _ref2.languages, languages = _ref2$languages === void 0 ? [] : _ref2$languages, _ref2$services = _ref2.services, services = _ref2$services === void 0 ? [] : _ref2$services, _ref2$transportation_ = _ref2.transportation_options, transportation_options = _ref2$transportation_ === void 0 ? [] : _ref2$transportation_, _ref2$city_requiremen = _ref2.city_requirements, city_requirements = _ref2$city_requiremen === void 0 ? [] : _ref2$city_requiremen, _ref2$county_requirem = _ref2.county_requirements, county_requirements = _ref2$county_requirem === void 0 ? [] : _ref2$county_requirem, _ref2$postal_code_req = _ref2.postal_code_requirements, postal_code_requirements = _ref2$postal_code_req === void 0 ? [] : _ref2$postal_code_req, _ref2$state_requireme = _ref2.state_requirements, state_requirements = _ref2$state_requireme === void 0 ? [] : _ref2$state_requireme, _ref2$age_specializat = _ref2.age_specializations, age_specializations = _ref2$age_specializat === void 0 ? {} : _ref2$age_specializat, _ref2$gender_requirem = _ref2.gender_requirements, gender_requirements = _ref2$gender_requirem === void 0 ? [] : _ref2$gender_requirem, _ref2$age_requirement = _ref2.age_requirements, age_requirements = _ref2$age_requirement === void 0 ? {} : _ref2$age_requirement, _ref2$phone_numbers = _ref2.phone_numbers, phone_numbers = _ref2$phone_numbers === void 0 ? [] : _ref2$phone_numbers, _ref2$email_addresses = _ref2.email_addresses, email_addresses = _ref2$email_addresses === void 0 ? [] : _ref2$email_addresses, website_url = _ref2.website_url, _ref2$locations = _ref2.locations, locations = _ref2$locations === void 0 ? [] : _ref2$locations, receiving_referrals = _ref2.receiving_referrals, provider = _ref2.provider, offers_specialized_screening = _ref2.offers_specialized_screening, fee_schedule_screenings = _ref2.fee_schedule_screenings, suggest_edit_enabled = _ref2.suggest_edit_enabled, id = _ref2.id;
52
- hasRequirements = !!(age_requirements !== null && age_requirements !== void 0 && age_requirements.min_months) || !!(age_requirements !== null && age_requirements !== void 0 && age_requirements.max_months) || !!city_requirements.length || !!county_requirements.length || !!gender_requirements.length || !!population_restrictions.length || !!postal_code_requirements.length || !!state_requirements.length;
53
- hasAccessibility = !!delivery_options.length || !!languages.length || !!population_specializations.length || !!(age_specializations !== null && age_specializations !== void 0 && age_specializations.min_months) || !!(age_specializations !== null && age_specializations !== void 0 && age_specializations.max_months) || !!accessibility_options.length || !!transportation_options.length || !!payment_options.length;
54
- hasOtherEligibility = !!eligibility_text;
55
- hasEligibility = hasRequirements || hasAccessibility || hasOtherEligibility;
56
- hasContactInfo = !!phone_numbers.length || !!email_addresses.length || !!website_url || !!locations.length;
57
- hours = selectHours(locations, provider === null || provider === void 0 ? void 0 : provider.hours);
58
- accessibilityLabels = mapValuesToLabels(accessibility_options, ACCESSIBILITY_OPTIONS);
59
- languageLabels = mapValuesToLabels(languages, LANGUAGE_OPTIONS);
60
- transportationLabels = mapValuesToLabels(transportation_options, TRANSPORTATION_OPTIONS);
61
- paymentLabels = mapValuesToLabels(payment_options, PAYMENT_OPTIONS);
62
- populationRestrictionLabels = mapValuesToLabels(population_restrictions, POPULATIONS);
63
- populationSpecializationLabels = mapValuesToLabels(population_specializations, POPULATIONS);
64
- deliveryOptionLabels = mapValuesToLabels(delivery_options, PROGRAM_DELIVERY_OPTIONS);
65
- _context.n = 1;
66
- return fetchProviderPrograms(provider === null || provider === void 0 ? void 0 : provider.id, id);
67
- case 1:
68
- providersWithServices = _context.v;
69
- appRoles = [SEARCH_ROLES.PAYMENTS];
70
- return _context.a(2, {
71
- name: name,
72
- description: description,
73
- eligibility_text: eligibility_text,
74
- hasRequirements: hasRequirements,
75
- hasAccessibility: hasAccessibility,
76
- hasOtherEligibility: hasOtherEligibility,
77
- hasEligibility: hasEligibility,
78
- hasContactInfo: hasContactInfo,
79
- postal_code_requirements: postal_code_requirements.join(', '),
80
- city_requirements: city_requirements.join('; '),
81
- county_requirements: county_requirements.join('; '),
82
- state_requirements: state_requirements.join(', '),
83
- age_requirements: parseAge(age_requirements),
84
- age_specializations: parseAge(age_specializations),
85
- gender_requirements: gender_requirements.join(', '),
86
- delivery_options: deliveryOptionLabels,
87
- population_restrictions: populationRestrictionLabels,
88
- languages: languageLabels,
89
- population_specializations: populationSpecializationLabels,
90
- accessibility_options: accessibilityLabels,
91
- residency: {
92
- state_requirements: state_requirements.join(', '),
93
- city_requirements: city_requirements.join('; '),
94
- county_requirements: county_requirements.join('; '),
95
- postal_code_requirements: postal_code_requirements.join(', ')
96
- },
97
- hasEligibilityText: !isEmpty(eligibility_text),
98
- transportation_options: transportationLabels,
99
- payment_options: paymentLabels,
100
- services: providersWithServices.services,
101
- phone_numbers: phone_numbers,
102
- email_addresses: email_addresses.sort(function (_a, _b) {
103
- return _b.is_primary === null ? -1 : 1;
104
- }),
105
- website_url: website_url,
106
- locations: locations,
107
- hours: hours,
108
- receiving_referrals: receiving_referrals,
109
- offersSpecializedScreening: offers_specialized_screening,
110
- feeScheduleScreenings: fee_schedule_screenings,
111
- suggest_edit_enabled: suggest_edit_enabled,
112
- providerPrograms: providersWithServices.providerPrograms,
113
- appRoles: appRoles
114
- });
115
- }
116
- }, _callee);
117
- }));
118
- return function getProgramProps(_x) {
119
- return _ref3.apply(this, arguments);
36
+ const getProgramProps = async _ref2 => {
37
+ let {
38
+ name,
39
+ description,
40
+ eligibility_text,
41
+ population_restrictions = [],
42
+ accessibility_options = [],
43
+ delivery_options = [],
44
+ payment_options = [],
45
+ population_specializations = [],
46
+ languages = [],
47
+ services = [],
48
+ transportation_options = [],
49
+ city_requirements = [],
50
+ county_requirements = [],
51
+ postal_code_requirements = [],
52
+ state_requirements = [],
53
+ age_specializations = {},
54
+ gender_requirements = [],
55
+ age_requirements = {},
56
+ phone_numbers = [],
57
+ email_addresses = [],
58
+ website_url,
59
+ locations = [],
60
+ receiving_referrals,
61
+ provider,
62
+ offers_specialized_screening,
63
+ fee_schedule_screenings,
64
+ suggest_edit_enabled,
65
+ id
66
+ } = _ref2;
67
+ const hasRequirements = !!(age_requirements !== null && age_requirements !== void 0 && age_requirements.min_months) || !!(age_requirements !== null && age_requirements !== void 0 && age_requirements.max_months) || !!city_requirements.length || !!county_requirements.length || !!gender_requirements.length || !!population_restrictions.length || !!postal_code_requirements.length || !!state_requirements.length;
68
+ const hasAccessibility = !!delivery_options.length || !!languages.length || !!population_specializations.length || !!(age_specializations !== null && age_specializations !== void 0 && age_specializations.min_months) || !!(age_specializations !== null && age_specializations !== void 0 && age_specializations.max_months) || !!accessibility_options.length || !!transportation_options.length || !!payment_options.length;
69
+ const hasOtherEligibility = !!eligibility_text;
70
+ const hasEligibility = hasRequirements || hasAccessibility || hasOtherEligibility;
71
+ const hasContactInfo = !!phone_numbers.length || !!email_addresses.length || !!website_url || !!locations.length;
72
+ const hours = selectHours(locations, provider === null || provider === void 0 ? void 0 : provider.hours);
73
+ const accessibilityLabels = mapValuesToLabels(accessibility_options, ACCESSIBILITY_OPTIONS);
74
+ const languageLabels = mapValuesToLabels(languages, LANGUAGE_OPTIONS);
75
+ const transportationLabels = mapValuesToLabels(transportation_options, TRANSPORTATION_OPTIONS);
76
+ const paymentLabels = mapValuesToLabels(payment_options, PAYMENT_OPTIONS);
77
+ const populationRestrictionLabels = mapValuesToLabels(population_restrictions, POPULATIONS);
78
+ const populationSpecializationLabels = mapValuesToLabels(population_specializations, POPULATIONS);
79
+ const deliveryOptionLabels = mapValuesToLabels(delivery_options, PROGRAM_DELIVERY_OPTIONS);
80
+ const providersWithServices = await fetchProviderPrograms(provider === null || provider === void 0 ? void 0 : provider.id, id);
81
+ const appRoles = [SEARCH_ROLES.PAYMENTS];
82
+ return {
83
+ name,
84
+ description,
85
+ eligibility_text,
86
+ hasRequirements,
87
+ hasAccessibility,
88
+ hasOtherEligibility,
89
+ hasEligibility,
90
+ hasContactInfo,
91
+ postal_code_requirements: postal_code_requirements.join(', '),
92
+ city_requirements: city_requirements.join('; '),
93
+ county_requirements: county_requirements.join('; '),
94
+ state_requirements: state_requirements.join(', '),
95
+ age_requirements: parseAge(age_requirements),
96
+ age_specializations: parseAge(age_specializations),
97
+ gender_requirements: gender_requirements.join(', '),
98
+ delivery_options: deliveryOptionLabels,
99
+ population_restrictions: populationRestrictionLabels,
100
+ languages: languageLabels,
101
+ population_specializations: populationSpecializationLabels,
102
+ accessibility_options: accessibilityLabels,
103
+ residency: {
104
+ state_requirements: state_requirements.join(', '),
105
+ city_requirements: city_requirements.join('; '),
106
+ county_requirements: county_requirements.join('; '),
107
+ postal_code_requirements: postal_code_requirements.join(', ')
108
+ },
109
+ hasEligibilityText: !isEmpty(eligibility_text),
110
+ transportation_options: transportationLabels,
111
+ payment_options: paymentLabels,
112
+ services: providersWithServices.services,
113
+ phone_numbers,
114
+ email_addresses: email_addresses.sort((_a, _b) => _b.is_primary === null ? -1 : 1),
115
+ website_url,
116
+ locations,
117
+ hours,
118
+ receiving_referrals,
119
+ offersSpecializedScreening: offers_specialized_screening,
120
+ feeScheduleScreenings: fee_schedule_screenings,
121
+ suggest_edit_enabled,
122
+ providerPrograms: providersWithServices.providerPrograms,
123
+ appRoles
120
124
  };
121
- }();
122
- var favorPrimaryEmail = function favorPrimaryEmail(emailA, emailB) {
125
+ };
126
+ const favorPrimaryEmail = (emailA, emailB) => {
123
127
  if (emailB.is_primary) {
124
128
  return 1;
125
129
  }
@@ -128,20 +132,20 @@ var favorPrimaryEmail = function favorPrimaryEmail(emailA, emailB) {
128
132
  }
129
133
  return 0;
130
134
  };
131
- var getProviderProps = function getProviderProps(_ref4) {
132
- var name = _ref4.name,
133
- description = _ref4.description,
134
- phone_numbers = _ref4.phone_numbers,
135
- email_addresses = _ref4.email_addresses,
136
- website_url = _ref4.website_url,
137
- hours = _ref4.hours,
138
- licensed = _ref4.licensed,
139
- addresses = _ref4.addresses,
140
- id = _ref4.id,
141
- sensitive = _ref4.sensitive;
142
- var emailsSortedByPriority = email_addresses.length > 0 ? email_addresses.sort(favorPrimaryEmail).map(function (addr) {
143
- return addr.email_address;
144
- }) : [];
135
+ const getProviderProps = _ref3 => {
136
+ let {
137
+ name,
138
+ description,
139
+ phone_numbers,
140
+ email_addresses,
141
+ website_url,
142
+ hours,
143
+ licensed,
144
+ addresses,
145
+ id,
146
+ sensitive
147
+ } = _ref3;
148
+ const emailsSortedByPriority = email_addresses.length > 0 ? email_addresses.sort(favorPrimaryEmail).map(addr => addr.email_address) : [];
145
149
  return {
146
150
  provider_id: id,
147
151
  provider_name: name,
@@ -156,64 +160,45 @@ var getProviderProps = function getProviderProps(_ref4) {
156
160
  hasOrgInfo: !isEmpty(description) || !isEmpty(phone_numbers) || !isEmpty(email_addresses) || !isEmpty(website_url) || !isEmpty(hours) || !isEmpty(locations)
157
161
  };
158
162
  };
159
- var generateServesThisAreaOption = function generateServesThisAreaOption(area) {
163
+ const generateServesThisAreaOption = area => {
160
164
  if (area.service_area_type === SERVICE_AREA_TYPES.NATIONAL) {
161
165
  return SERVICE_AREA_TYPES.NATIONAL;
162
166
  }
163
- return US_STATES.find(function (state) {
164
- return state.value === area.state_abbreviation.toUpperCase();
165
- }).display_name;
167
+ return US_STATES.find(state => state.value === area.state_abbreviation.toUpperCase()).display_name;
166
168
  };
167
- var getMapProps = function getMapProps(_ref5) {
169
+ const getMapProps = _ref4 => {
168
170
  var _locations$find;
169
- var _ref5$locations = _ref5.locations,
170
- locations = _ref5$locations === void 0 ? [] : _ref5$locations,
171
- _ref5$service_areas = _ref5.service_areas,
172
- service_areas = _ref5$service_areas === void 0 ? [] : _ref5$service_areas;
173
- var closestOrFirstLocation = (_locations$find = locations === null || locations === void 0 ? void 0 : locations.find(function (loc) {
174
- return loc.is_closest;
175
- })) !== null && _locations$find !== void 0 ? _locations$find : locations[0];
176
- var servingArea = '';
171
+ let {
172
+ locations = [],
173
+ service_areas = []
174
+ } = _ref4;
175
+ const closestOrFirstLocation = (_locations$find = locations === null || locations === void 0 ? void 0 : locations.find(loc => loc.is_closest)) !== null && _locations$find !== void 0 ? _locations$find : locations[0];
176
+ let servingArea = '';
177
177
  if ((service_areas === null || service_areas === void 0 ? void 0 : service_areas.length) > 0) {
178
178
  var _service_areas$find;
179
- var area = (_service_areas$find = service_areas.find(function (a) {
180
- return a.service_area_type !== SERVICE_AREA_TYPES.NATIONAL;
181
- })) !== null && _service_areas$find !== void 0 ? _service_areas$find : service_areas[0];
179
+ const area = (_service_areas$find = service_areas.find(a => a.service_area_type !== SERVICE_AREA_TYPES.NATIONAL)) !== null && _service_areas$find !== void 0 ? _service_areas$find : service_areas[0];
182
180
  servingArea = generateServesThisAreaOption(area);
183
181
  }
184
- var _ref6 = closestOrFirstLocation !== null && closestOrFirstLocation !== void 0 ? closestOrFirstLocation : {},
185
- latitude = _ref6.latitude,
186
- longitude = _ref6.longitude;
182
+ const {
183
+ latitude,
184
+ longitude
185
+ } = closestOrFirstLocation !== null && closestOrFirstLocation !== void 0 ? closestOrFirstLocation : {};
187
186
  return {
188
- latitude: latitude,
189
- longitude: longitude,
187
+ latitude,
188
+ longitude,
190
189
  zoom: '15',
191
- servingArea: servingArea,
190
+ servingArea,
192
191
  hasMap: !!latitude && !!longitude
193
192
  };
194
193
  };
195
194
 
196
195
  // eslint-disable-next-line import/prefer-default-export
197
- export var formatForProgramDetail = /*#__PURE__*/function () {
198
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(program) {
199
- var programProps, providerProps, mapProps;
200
- return _regenerator().w(function (_context2) {
201
- while (1) switch (_context2.n) {
202
- case 0:
203
- _context2.n = 1;
204
- return getProgramProps(program);
205
- case 1:
206
- programProps = _context2.v;
207
- providerProps = program !== null && program !== void 0 && program.provider ? getProviderProps(program.provider) : {};
208
- mapProps = getMapProps(program);
209
- return _context2.a(2, _objectSpread(_objectSpread(_objectSpread({
210
- id: program.id
211
- }, programProps), providerProps), mapProps));
212
- }
213
- }, _callee2);
214
- }));
215
- return function formatForProgramDetail(_x2) {
216
- return _ref7.apply(this, arguments);
217
- };
218
- }();
196
+ export const formatForProgramDetail = async program => {
197
+ const programProps = await getProgramProps(program);
198
+ const providerProps = program !== null && program !== void 0 && program.provider ? getProviderProps(program.provider) : {};
199
+ const mapProps = getMapProps(program);
200
+ return _objectSpread(_objectSpread(_objectSpread({
201
+ id: program.id
202
+ }, programProps), providerProps), mapProps);
203
+ };
219
204
  //# sourceMappingURL=formatProgramDetail.js.map