{"version":3,"sources":["store/APIStore.ts","store/index.ts","util/authConfig.js","util/authService.js","components/common/ProfileHelper.ts","components/dashboard/AcutePatientsByMonth.tsx","components/dashboard/PatientFacilities.tsx","components/dashboard/DischargeDispositionType.tsx","components/Home.tsx","components/Counter.tsx","store/Counter.ts","store/WeatherForecasts.ts","components/FetchData.tsx","components/Account.tsx","components/NotificationsTable.tsx","components/Notifications.tsx","components/common/ProgramAdministrator.tsx","components/common/PhysicianNameComponent.tsx","components/common/DateDisplay.tsx","components/patient/DiagnosisCodeHcc.tsx","components/patient/DiagnosisList.tsx","components/patient/EncounterList.tsx","components/patient/DocumentIndex.tsx","components/common/DateHelper.ts","components/patient/PatientDischargeDisplay.tsx","components/patient/PatientRoomDisplay.tsx","components/Patient.tsx","components/VitalsMDTheme.tsx","images/vitalsmd-portal-nav-logo.svg","components/LoginButton.tsx","components/LoginPage.tsx","components/DrawerBadge.tsx","components/BottomNav.tsx","images/vitalsmd-portal-square-logo.svg","components/LogoutButton.tsx","components/Drawer.tsx","components/AppBar.tsx","components/Layout.tsx","components/common/PrivateRoute.js","util/userManager.js","components/CallbackPage.js","components/LogoutPage.tsx","components/ConfirmDialog.tsx","components/notification/NotificationPatient.tsx","components/MessageAttachment.tsx","components/NotificationItem.tsx","components/NotificationReply.tsx","components/notification/NotificationCompose.tsx","components/PatientsTable.tsx","components/directadmit/DirectAdmitRequest.tsx","components/common/SelectableText.tsx","components/PracticeCoordinatorPatientsTable.tsx","components/CareCoordinatorAccount.tsx","components/notification/Helpers.ts","components/notification/AdmitNotificationItem.tsx","components/patient/NextSiteOfCare.tsx","components/notification/DischargeNotificationItem.tsx","components/notification/NotificationComposeSingle.tsx","App.tsx","index.tsx","store/configureStore.ts"],"names":["host","process","findMessage","messageId","messages","ret","filter","val","length","addMessageIfMissing","newMessage","concat","actionCreators","submitRefMD","profileState","accessToken","dispatch","getState","_appState$vitalsConte","appState","vitalsContext","userRefMdProfile","options","headers","Accept","Authorization","method","body","JSON","stringify","fetch","then","response","json","data","type","profile","catch","err","console","log","submitCareCoordinator","_appState$vitalsConte2","userPracticeCoordinatorProfile","coordinatorProfile","clearSentMessageState","receiveTokenResponse","apiToken","getUnreadMessageCount","_appState$vitalsConte3","isDemoMode","countStatus","unloadedState","NotificationCount","ok","Error","statusText","error","submitReplyMessage","replyMessage","requestMessage","_objectSpread","patient","parentMessageId","message","submitNewMessageWithAttachment","formData","ErrorMessage","archiveMessage","subjectMessage","status","archived","errMessage","detail","archiveMessages","subjectMessages","oidc","user","access_token","requestPatientLocationStatsForProvider","_appState$vitalsConte4","_appState$vitalsConte5","patientFacilityCounts","PatientLocationStats","isLoaded","requestPatientLocationStatsByTag","practice","_appState$vitalsConte6","_appState$vitalsConte7","_appState$vitalsConte8","isLoading","searchTag","tagDescription","requestPatientLocationStatsForPractice","practiceId","_appState$vitalsConte9","_appState$vitalsConte10","_appState$vitalsConte11","requestDischargeDispositionStatsForProvider","_appState$vitalsConte12","dischargeDispositions","DischargeDispositionStats","e","currentUserIsCareCoordinator","_appState$vitalsConte13","_appState$vitalsConte14","requestDischargeDispositionStatsForByTag","_appState$vitalsConte15","_appState$vitalsConte16","requestDischargeDispositionStatsForPractice","_appState$vitalsConte17","_appState$vitalsConte18","requestAdmitStatsForPracticeByTag","_appState$vitalsConte19","admitStats","PhysicianAdmitsStats","physicianAdmits","requestAdmitStatsForPractice","_appState$vitalsConte20","requestAdmitStatsForProvider","_appState$vitalsConte21","_appState$vitalsConte22","markMessageAsRead","Messages","CurrentMessages","_appState$vitalsConte23","requestProviderMessage","_appState$vitalsConte24","foundMessage","Message","errorMessage","requestMessagesForProvider","_appState$vitalsConte25","_appState$vitalsConte26","state","apiHost","requestMessageContactsUser","_appState$vitalsConte27","physicianContacts","PatientPhysiciansContacts","userPatientContacts","MonthsBack","requestMessageContactsForPractice","_appState$vitalsConte28","requestSystemSpecialties","_appState$vitalsConte29","AvailableSpecialties","SystemSpecialties","VitalsReferenceSpecialties","requestCareCoordinatorProfile","requestCurrentUserCareCoordinatorProfile","_appState$vitalsConte30","requestVitalsMdProfile","_appState$vitalsConte31","refmdProfile","requestPatientsByPracticeIdWithDays","coordinatorId","daysBack","_appState$vitalsConte32","request","PracticeId","PracticeCareCoordinatorId","DaysBack","Patients","patientsByPracticeId","requestPatientsByRefMDIdWithDays","refMdId","monthsBack","includeInactivePatients","_appState$vitalsConte33","patientsByRefMDId","_appState$vitalsConte34","_appState$vitalsConte35","cachedPts","RefMDId","IncludeInactivePatients","requestPatientsByRefMDId","requestsPatientsByFacility","facilityId","patientsByFacilityId","requestConsolidatedPatientById","patientId","_appState$vitalsConte36","samplePatient","fullPatients","_appState$vitalsConte37","cachedPt","p","patientEncounterId","newFocusPatient","clearMessageState","requestBlobById","janeId","janeMbi","johnMbi","johnId","jayId","jayMbi","abbyId","abbyMbi","testPatientData","mrn","firstName","lastName","pcn","ptId","mbi","dateOfBirth","admitDate","dischargeDate","daysToDischarge","primaryProviderContact","email","displayName","referringMdUserName","recentAdmits","facilityName","johnDx1","diagnosedBy","diagnosis","diagnosisCodeValue","codingSystem","dxId","shortDescription","riskAdjusted","hccCategory","johnDx2","johnDx3","johnDx4","johnDx5","abbyDx1","testDocumentHpJane","name","createdBy","createdDate","extension","path","id","testDocumentPnJane","testDocumentDcJohn","samplePatientJane","insuranceName","dateOfAdmission","encounters","encounterId","encounterStart","encounterEnd","referringMD","facility","facilityProgramManager","patientDiagnosisList","patientDocuments","patientChargeList","encounterInsurance","companyNameFromFacility","globalIsDemoMode","emptyState","PatientPhysicians","isErrored","UnreadCount","Errors","ReplyOptions","notFound","referringMDId","specialties","APIToken","dateOfDischarge","formattedName","emailAddress","DischargeLocationStats","DischargeLocations","startFacilityId","dischargeFacilityName","dischargeCount","patientsCount","typeDesciption","patientCount","totalAdmits","AssignedMDUserName","year","month","FocusMessage","subject","senderId","sendDate","receiverId","description","patientLastName","documentFileName","messageReadDate","document","undefined","patientFirstName","phone","npi","notifyAdmits","notifyDischarges","AllMessageTypes","messageTypeId","specialtyId","FocusPatient","removeMessage","messageList","reducers","incomingAction","action","newFocusMessage","tempCurMessages","isError","patientsBypracticeId","patientsState","_toConsumableArray","admitStatsMessage","dischargeLocStats","dischargeDispState","dischargeLocations","existingState","curRefProfileStateVal","curRefProfileStateValError","curRefProfileState","curRefProfileStateRequest","patientLocationStatsState","patientLocStats","availSpecialties","requestState","userContacts","v","SendMessageState","newMessagesState","deletedMessages","_step","retList","_iterator","_createForOfIteratorHelper","s","n","done","delMsg","value","f","removeMessages","newPersistedMessageReply","currentMessages","isSent","newPersistedMessage","currentMessagesNewItem","failedLoading","sendMessageState","newError","curErrors","newErrors","unreadCount","msalConfig","auth","clientId","authority","redirectUri","window","location","protocol","hostname","port","cache","cacheLocation","storeAuthStateInCookie","loginRequest","scopes","RequestAccessToken","_useMsal","useMsal","instance","accounts","_useState","inProgress","useState","_useState2","_slicedToArray","setAccessToken","account","Promise","resolve","acquireTokenSilent","acquireTokenPopup","shouldTryRefMDProfile","userRefMDProfile","shouldTryCareCoordinatorProfile","refMDLoaded","practiceCoordinatorLoaded","connect","APIStore","props","tokenState","setTokenState","token","useEffect","_jsx","Slide","in","timeout","direction","children","Grid","container","item","md","BarChartIcon","className","style","fontSize","color","React","Fragment","ChartJS","register","CategoryScale","LinearScale","PointElement","LineElement","Title","Tooltip","Legend","Filler","width","height","gradient","monthNames","labels","map","datasets","label","borderColor","backgroundColor","context","chart","ctx","chartArea","chartWidth","right","left","chartHeight","bottom","top","createLinearGradient","addColorStop","getBlueGradient","fill","xs","Line","responsive","plugins","legend","position","title","display","text","BarElement","ArcElement","PatientFacilityCounts","defaultPractice","slice","values","abrLookup","_i","_abrLookup","abbrPair","replaceAll","mnSearch","match","substring","truncateFacilityName","scaleShowValues","tooltips","callbacks","tooltipItem","Number","yLabel","scales","yAxes","ticks","autoSkip","xAxes","hoverOffset","borderWidth","Bar","indexAxis","DischargeDispositions","padding","_jsxs","justifyContent","spacing","Typography","variant","gutterBottom","lg","Card","elevation","AcutePatientsByMonth","PatientFacilities","DischargeDispositionType","Counter","_React$PureComponent","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","_this","this","count","onClick","increment","counter","decrement","requestWeatherForecasts","startDateIndex","weatherForecasts","alert","forecasts","FetchData","ensureDataFetched","renderForecastsTable","renderPagination","parseInt","params","forecast","date","temperatureC","temperatureF","summary","prevStartDateIndex","nextStartDateIndex","Link","to","WeatherForecastsStore","useStyles","makeStyles","theme","root","margin","chip","classes","setProfileState","_useState3","_useState4","loadState","setLoadState","_useState5","_useState6","specialtiesLoaded","refSpecialties","_useState7","_useState8","setSpecialties","specialtiesAsList","handleAlertChange","event","target","history","useHistory","push","MenuProps","PaperProps","maxHeight","ITEM_HEIGHT","icon","AssignmentIndIcon","FormControl","InputLabel","htmlFor","Input","onChange","newProfile","disabled","FormHelperText","Select","labelId","multiple","selectedItem","input","renderValue","selected","Chip","deleteIcon","CancelIcon","onMouseDown","stopPropagation","onDelete","filtered","handleSpecialtyDelete","refSpecialty","MenuItem","required","component","FormLabel","FormGroup","FormControlLabel","control","Checkbox","checked","alignContent","alignItems","Button","size","disableElevation","formatSender","messageType","toLowerCase","formatSubject","fullMessage","setCareCoordinatorProfileState","columns","getMuiTheme","createTheme","viewColumns","print","download","customFooter","selectableRows","delete","searchAlwaysOpen","customRowRender","dataIndex","rowIndex","outbound","TableRow","GotoNotificationItem","TableCell","colSpan","Hidden","mdUp","smDown","loadingOptions","page","rowsPerPage","changeRowsPerPage","changePage","TableFooter","textLabels","noMatch","ThemeProvider","MUIDataTable","moment","format","isOutbound","Notifications","NotificationsTable","ProgramAdministrator","contact","ProviderContact","startIcon","Mail","PhysicianNameComponent","startsWith","handleNameClick","DateDisplay","dateVal","Label","DateNullText","DateValue","replace","DiagnosisCodeHcc","dxCode","DiagnosisList","diagnosisCodes","listLabel","isRiskAdjusted","formatDate","dateOnly","EncounterList","TableContainer","Table","TableHead","align","TableBody","scope","downloadingState","setDownloadState","downloadDoc","documentId","preventDefault","documentName","DocumentId","Name","Extension","Path","res","blob","a","createElement","href","URL","createObjectURL","click","downloadDocument","CircularProgress","dt","hours","minutes","seconds","PatientDischargeDisplay","encounter","daysUntilDischarge","PatientRoomDisplay","roomNumber","_Fragment","ptidNumber","PtId","_userPracticeCoordina","_FocusPatient$patient","drgDesc","referringMDName","Divider","DocumentsIndex","defaultTheme","VitalsMDTheme","palette","primary","main","light","dark","secondary","overrides","MuiCssBaseline","textDecoration","cursor","MuiTypography","caption","lineHeight","h5","h6","fontWeight","body1","body2","overline","smalldate","MuiContainer","_root","_defineProperty","breakpoints","up","paddingLeft","paddingRight","MuiAppBar","colorPrimary","boxShadow","borderBottom","MuiDrawer","paper","MuiIconButton","MuiListItemText","opacity","MuiListItemIcon","MuiBottomNavigation","marginTop","MuiBottomNavigationAction","MuiBadge","badge","MuiTab","wrapper","letterSpacing","MuiTabs","MuiButton","contained","MuiInput","underline","MuiOutlinedInput","MuiFormControl","minWidth","flexDirection","MuiFormLabel","asterisk","MUIDataTableSelectCell","headerCell","MuiTableCell","MUIDataTableHeadCell","fixedHeader","borderRadius","transition","MUIDataTableSearch","LoginButton","_React$useState","_React$useState2","setChecked","isAuthenticated","useIsAuthenticated","textAlign","redirect","loginRedirect","handleLogin","rel","marginBottom","LoginPage","pathname","redirectPath","src","navlogo","alt","sm","DrawerBadge","_props$notificationSt","notificationState","Badge","badgeContent","NotificationsNone","HourglassEmptyIcon","ReportProblemIcon","yellow","setValue","AppBar","BottomNavigation","showLabels","BottomNavigationAction","NavLink","AssessmentOutlined","PeopleOutlined","LocalHospital","AccountCircle","LogoutButton","logoutPopup","handleLogout","ExitToAppIcon","drawerWidth","createStyles","appBar","zIndex","drawer","transitions","create","easing","sharp","duration","leavingScreen","appBarShift","marginLeft","enteringScreen","menuButton","marginRight","hide","flexShrink","whiteSpace","drawerOpen","drawerClose","overflowX","toolbar","mixins","content","flexGrow","_clsx3","_clsx4","useTheme","open","setOpen","friendlyPath","useLocation","split","includes","CssBaseline","clsx","Toolbar","IconButton","edge","squarelogo","tag","MenuIcon","noWrap","Drawer","MenuOpen","List","ListItem","button","activeClassName","exact","ListItemIcon","ListItemText","ButtonAppBar","Layout","Container","BottomNav","PrivateRoute","_ref","Component","rest","_objectWithoutProperties","_excluded","Route","render","userManagerConfig","client_id","redirect_uri","post_logout_redirect_uri","automaticSilentRenew","filterProtocolClaims","loadUserInfo","response_type","extraQueryParams","resource","signingKeys","userManager","createUserManager","CallbackPage","CallbackComponent","successCallback","errorCallback","LogoutPage","signoutRedirect","ConfirmDialog","question","onClose","valueProp","other","Dialog","maxWidth","DialogTitle","DialogContent","dividers","DialogActions","autoFocus","formatPcn","pcnVal","_patient","_patient2","subjectEncounter","Paper","MessageAttachment","downloadErrorState","setDownloadErrorState","setErrorMessage","ErrorOutlineIcon","FileCopyIcon","messageIsSystemNotification","MessageIsAdmitNotification","MessageIsDischargeNotification","readNotification","setReadNotification","deleteDialogOpen","setDeleteDialogOpen","initial","detailedPatientState","setDetailedPatientState","MessageId","_FocusMessage$message","messageSent","sentMessage","generalErrorMessage","handleClose","goBack","handleCloseSnack","sentMessageSubject","Reply","xsDown","Delete","Cancel","Box","m","statusStr","sender","keepMounted","NotificationPatient","Snackbar","ErrorIcon","anchorOrigin","vertical","horizontal","autoHideDuration","CloseIcon","makeReplyMessage","orginalMessage","userId","replyMessageState","setReplyMessageState","azureAdAccount","_userRefMdProfile$ref","Send","Date","TextField","multiline","rows","defaultValue","_props$FocusPatient","newInitialState","physicianSelectionState","setPhysicianSelectionState","newMessageState","setNewMessageState","messageError","physicianSelectionTemp","handleErrorClose","sendFormAndFileState","FormData","append","fullWidth","handleReceiverChange","accept","file","files","fileName","tableColumns","setCellProps","filterType","sort","customBodyRender","isValid","refMDIdStr","RefMdId","onRowClick","rowData","rowMeta","patientRowClick","DoneAllIcon","red","errorOptions","DirectAdmitRequest","setFacility","minRows","SelectableText","textSelected","textVal","sx","setDaysBack","getTime","practiceCoordId","actionMethod","fetchPatientsForPractice","practiceCareCoordinatorId","_loop","pt","fm","customSort","colIndex","order","b","ButtonGroup","chartTitle","practiceName","MUIDataTableBodyCell","colorSecondary","MUIDataTablePagination","userName","primaryCareProvider","trim","payer","admitStamp","handleAlertPref","emailPreferred","textPreferred","cell","practices","formatGreetingByPractice","curGreeting","memberPCPcontact","refMd","isRosterPractice","_props$match","userGreetStr","setUserGreetStr","_detailedPatientState","pcpFromRosterContact","assignedProviderEmail","toLocaleLowerCase","handleReply","NextSiteOfCare","nextSiteOfCare","dischargingPhysician","assignedProviderFormatted","dischargeProviderFormatted","receiverContact","setReceiverContact","singleContact","handleSubjectChange","Router","Switch","Home","PatientsTable","PracticeCoordinatorPatientsTable","DocumentIndex","Account","Patient","NotificationItem","AdmitNotificationItem","DischargeNotificationItem","NotificationReply","NotificationCompose","NotificationComposeSingle","CareCoordinatorAccount","msalInstance","PublicClientApplication","baseUrl","getElementsByTagName","getAttribute","createBrowserHistory","basename","store","initialState","middleware","thunk","routerMiddleware","rootReducer","combineReducers","router","connectRouter","enhancers","windowIfDefined","__REDUX_DEVTOOLS_EXTENSION__","createStore","compose","applyMiddleware","configureStore","ReactDOM","Provider","MsalProvider","ConnectedRouter","App","getElementById"],"mappings":"kXAsvBIA,EAAOC,mBAEEC,EAAc,SAACC,EAAmBC,GAC3C,IAAIC,EAAMD,EAASE,QAAO,SAACC,GAAG,OAAKA,EAAIJ,YAAcA,KACrD,OAAKE,EAAIG,OAIFH,EAAI,GAHA,MAMTI,EAAsB,SAACC,EAAqBN,GAE9C,OADgBF,EAAYQ,EAAWP,UAAWC,GAM3CA,EAJHA,EAAWA,EAASO,OAAOD,IAatBE,EAAiB,CAE1BC,YAAa,SAACC,EAAmBC,GAAmB,OAAkC,SAACC,EAAUC,GAAc,IAADC,EACpGC,EAAWF,IAEjB,GAAIE,GAAkC,QAA1BD,EAAIC,EAASC,qBAAa,IAAAF,GAAtBA,EAAwBG,iBAAkB,CACtD,IAAMC,EAAU,CACZC,QAAS,CACLC,OAAQ,m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AwBuW,UAAWma,WCxB5DyE,GAAe,I,OAAIC,GAAwBhuB,GAG3CiuB,GAAU/xB,SAASgyB,qBAAqB,QAAQ,GAAGC,aAAa,QAChEnhB,GAAUohB,YAAqB,CAAEC,SAAUJ,KAI3CK,GC3BS,SAAwBthB,EAAkBuhB,GACrD,IAAMC,EAAa,CACfC,IACAC,YAAiB1hB,IAGf2hB,EAAcC,YAAe/gC,wBAAC,GAC7BkP,GAAQ,IACX8xB,OAAQC,YAAc9hB,MAGpB+hB,EAAY,GACZC,EAAoC,qBAAX3uB,OAAyB,KAAOA,OAU/D,OATI2uB,GAAmBA,EAAgBC,8BACnCF,EAAU7hB,KAAK8hB,EAAgBC,gCAGrBC,YACVP,EACAJ,EACAY,IAAO1lB,WAAC,EAAD,CAAC2lB,IAAe3lB,WAAC,EAAG+kB,IAAW7jC,OAAKokC,KDOrCM,CAAeriB,IAG7BsiB,SACI3sB,eAAC4sB,IAAQ,CAACjB,MAAOA,GAAMtrB,SACnBL,eAAC6sB,IAAY,CAACtuB,SAAU6sB,GAAa/qB,SACjCL,eAAC8sB,IAAe,CAACziB,QAASA,GAAQhK,SAC9BL,eAAC+sB,GAAG,UAIhBxzB,SAASyzB,eAAe,U","file":"static/js/main.00a400a8.chunk.js","sourcesContent":["import { debug } from \"console\";\r\nimport { Action, Reducer } from \"redux\";\r\nimport { AppThunkAction } from \".\";\r\n\r\n// -----------------\r\n// STATE - This defines the type of data maintained in the Redux store.\r\n\r\nexport interface PatientState {\r\n facilityId?: number;\r\n refMdId?: number;\r\n practiceId?: number;\r\n patientsByRefMDId: ListPatient[];\r\n patientsByPracticeId: ListPatient[];\r\n fullPatients: Patient[];\r\n isLoading: boolean;\r\n isLoaded: boolean;\r\n isError: boolean;\r\n errorMessage: string;\r\n}\r\n\r\nexport interface FocusPatientState {\r\n isLoading: boolean;\r\n patient?: Patient;\r\n patientId: number;\r\n}\r\n\r\nexport interface FocusMessageState {\r\n isLoading: boolean;\r\n message?: Message;\r\n messageId: number;\r\n isErrored: boolean;\r\n errorMessage: string;\r\n}\r\n\r\nexport interface SpecialtyState {\r\n isLoading: boolean;\r\n isLoaded: boolean,\r\n VitalsReferenceSpecialties: VitalsReferenceSpecialties;\r\n}\r\n\r\nexport interface MessageState {\r\n isLoading: boolean;\r\n isLoaded: boolean,\r\n failedLoading: boolean,\r\n CurrentMessages: Message[];\r\n FocusMessage: FocusMessageState;\r\n Errors: MessageStateError[];\r\n SendMessageState: SendMessageState;\r\n ReplyOptions: string[];\r\n}\r\n\r\nexport interface NotificationCountState {\r\n isLoading: boolean;\r\n isLoaded: boolean;\r\n isErrored: boolean;\r\n UnreadCount: number\r\n}\r\n\r\nexport interface NotificationCountDto {\r\n isErrored: boolean;\r\n UnreadCount: number;\r\n}\r\n\r\nexport interface MessageStateError {\r\n messageId: number,\r\n error: string\r\n}\r\n\r\nexport interface SendMessageState {\r\n message: Message,\r\n isSent: boolean,\r\n isErrored: boolean,\r\n error: string;\r\n}\r\n\r\nexport interface AdmitSummaryState {\r\n physicianAdmits: AdmitSummaryStatistics[];\r\n isErrored: boolean,\r\n error: string,\r\n isLoading: boolean,\r\n isLoaded: boolean\r\n}\r\n\r\nexport interface DischargeLocationState {\r\n dischargeLocations: DischargeLocationStatistics[];\r\n isErrored: boolean,\r\n error: string,\r\n isLoading: boolean\r\n}\r\n\r\nexport interface DischargeDispositionsState {\r\n dischargeDispositions: DischargeDispositionStatistics[];\r\n isErrored: boolean,\r\n error: string,\r\n isLoading: boolean;\r\n isLoaded: boolean;\r\n}\r\n\r\nexport interface PatientLocationStatsState {\r\n patientFacilityCounts: PatientFacility[];\r\n isErrored: boolean,\r\n error: string,\r\n isLoading: boolean,\r\n isLoaded: boolean\r\n}\r\n\r\nexport interface PracticeState {\r\n isErrored: boolean,\r\n error: string,\r\n isLoading: boolean,\r\n isLoaded: boolean,\r\n practice: Practice\r\n}\r\n\r\nexport interface PracticeCoordinatorState {\r\n isErrored: boolean,\r\n error: string,\r\n isLoading: boolean,\r\n isLoaded: boolean,\r\n notFound: boolean,\r\n coordinatorProfile: CareCoordinatorModel\r\n}\r\n\r\nexport interface RefMDProfileState {\r\n isErrored: boolean,\r\n notFound: boolean,\r\n error: string,\r\n isLoading: boolean,\r\n isLoaded: boolean,\r\n refmdProfile?: RefMdProfile\r\n}\r\n\r\nexport interface PhysicianContactsState {\r\n isErrored: boolean,\r\n error: string,\r\n isLoading: boolean,\r\n isLoaded: boolean,\r\n userPatientContacts: HNIProviderContact[];\r\n}\r\n\r\nexport interface HNIContextState {\r\n isLoading: boolean;\r\n isDemoMode: boolean;\r\n apiHost: string;\r\n startDateIndex?: number;\r\n userRefMdProfile: RefMDProfileState,\r\n userPracticeCoordinatorProfile: PracticeCoordinatorState;\r\n practice: PracticeState;\r\n Patients: PatientState;\r\n FocusPatient: FocusPatientState;\r\n SystemSpecialties: SpecialtyState;\r\n Messages: MessageState;\r\n NotificationCount: NotificationCountState;\r\n PatientPhysiciansContacts: PhysicianContactsState;\r\n PhysicianAdmitsStats: AdmitSummaryState;\r\n DischargeDispositionStats: DischargeDispositionsState;\r\n PatientLocationStats: PatientLocationStatsState;\r\n AllMessageTypes: MessageType[];\r\n APIToken : TokenType;\r\n}\r\n\r\nexport interface HNIProviderContact {\r\n displayName : string;\r\n type : string;\r\n email : string;\r\n lastName: string;\r\n}\r\n\r\n// -----------------\r\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\r\n// They do not themselves have any side-effects; they just describe something that is going to happen.\r\n\r\nexport interface ListPatient {\r\n firstName: string;\r\n lastName: string;\r\n facilityName: string;\r\n ptId: number;\r\n facilityId: number;\r\n mrn: string;\r\n mbi : string,\r\n pcn: string;\r\n dateOfBirth: string;\r\n primaryProviderContact : HNIProviderContact,\r\n referringMdContact : HNIProviderContact,\r\n admitDate: string;\r\n admitStamp : number;\r\n dischargeDate: string;\r\n daysToDischarge:number;\r\n roomNumber:string;\r\n recentAdmits: number;\r\n referringMdUserName: string;\r\n primaryCareProvider : string,\r\n payer : string\r\n}\r\n\r\nexport interface Patient {\r\n firstName: string;\r\n lastName: string;\r\n patientEncounterId: number;\r\n facilityId: number,\r\n facilityName: string,\r\n mrn: string;\r\n mbi: string,\r\n pcn: string;\r\n dateOfBirth: string,\r\n primaryProviderContact: HNIProviderContact,\r\n dateOfAdmission: string,\r\n dateOfDischarge: string,\r\n encounters: Encounter[],\r\n mostRecentEncounter : Encounter,\r\n insuranceName: string,\r\n}\r\n\r\nexport interface Practice {\r\n practiceId: number;\r\n practiceName: string;\r\n tagDescription: string;\r\n isRosterPractice : boolean\r\n}\r\n\r\nexport interface CareCoordinatorModel {\r\n azureAdAccount: string;\r\n practiceCareCoordinatorId: number;\r\n firstName: string;\r\n lastName: string;\r\n cell: string;\r\n phone: string;\r\n emailPreferred: boolean | undefined,\r\n textPreferred: boolean | undefined,\r\n defaultPractice: Practice,\r\n practices : Practice[]\r\n}\r\n\r\nexport interface Message {\r\n subject: string,\r\n senderId: string,\r\n description: string,\r\n receiverId: string,\r\n sendDate: string,\r\n createdDate: string,\r\n messageId: number,\r\n message: string,\r\n parentMessageId: number,\r\n status: string,\r\n ptId : string,\r\n patientLastName: string,\r\n patientFirstName: string,\r\n document: Blob | undefined,\r\n documentFileName: string,\r\n messageReadDate: string,\r\n}\r\n\r\nexport interface MessageType {\r\n messageTypeId: number;\r\n description: string;\r\n}\r\n\r\nexport interface Encounter {\r\n encounterId: number,\r\n patientId: number,\r\n facility: VitalsFacility,\r\n encounterStart: string,\r\n encounterEnd: string,\r\n dateOfBirth : string,\r\n roomNumber : string,\r\n primaryProviderContact : HNIProviderContact,\r\n dischargingPhysician: HNIProviderContact,\r\n pcpFromRosterContact : HNIProviderContact,\r\n daysUntilDischarge: number,\r\n mrn: string,\r\n policyNumber : string,\r\n patientDiagnosisList: PatientDiagnosis[],\r\n patientChargeList: PatientCharge[],\r\n encounterInsurance: VitalsInsurance,\r\n patientDocuments: PatientDocument[],\r\n nextSiteOfCare: NextSiteOfCare,\r\n referringMD: HNIProviderContact\r\n}\r\n\r\nexport interface PatientDocument {\r\n name: string,\r\n path: string,\r\n createdBy: string,\r\n displayName: string,\r\n createdDate: string,\r\n extension: string,\r\n id:string\r\n}\r\n\r\nexport interface PatientDiagnosis {\r\n diagnosedBy: string,\r\n diagnosis: Diagnosis,\r\n shortDescription: string,\r\n\r\n}\r\n\r\nexport interface PatientCharge {\r\n ChargeAddedBy: string,\r\n procedureModel: Procedure\r\n}\r\n\r\nexport interface Diagnosis {\r\n diagnosisCodeValue: string,\r\n codingSystem: string,\r\n dxId: number,\r\n isRiskAdjusted : boolean,\r\n hccCategory : string,\r\n\r\n}\r\n\r\nexport interface Procedure {\r\n procedureCodeValue: string\r\n}\r\n\r\nexport interface VitalsInsurance {\r\n companyNameFromFacility: string\r\n}\r\n\r\nexport interface DocumentResponseModel {\r\n documentId: string\r\n}\r\n\r\n\r\nexport interface VitalsFacility {\r\n facilityName: string,\r\n facilityId: number,\r\n facilityProgramManager: VitalsProgramManager\r\n}\r\n\r\nexport interface VitalsProgramManager {\r\n email: string,\r\n name: string\r\n}\r\n\r\nexport interface RefMdProfile {\r\n referringMDId: string,\r\n firstName: string,\r\n lastName: string,\r\n email: string,\r\n npi: string,\r\n phone: string,\r\n specialties: VitalsReferenceSpecialty[],\r\n notifyAdmits: boolean,\r\n notifyDischarges: boolean,\r\n emailPreferred: boolean,\r\n textPreferred: boolean,\r\n}\r\n\r\nexport interface AdmitSummaryStatistics {\r\n referringMDId: string,\r\n assignedMDUserName: string,\r\n year: number,\r\n totalAdmits: number,\r\n month: number\r\n}\r\n\r\nexport interface DischargeLocationStatistics {\r\n dischargeFacilityName: string,\r\n dischargeCount: number\r\n}\r\n\r\nexport interface DischargeDispositionStatistics {\r\n typeDesciption: string,\r\n patientCount: number\r\n}\r\n\r\nexport interface PatientFacility {\r\n facilityName: string,\r\n patientsCount: number,\r\n}\r\n\r\nexport interface VitalsReferenceSpecialty {\r\n specialtyId: string,\r\n description: string\r\n}\r\n\r\nexport interface VitalsReferenceSpecialties {\r\n AsOfDate: Date,\r\n SystemSpecialties: VitalsReferenceSpecialty[]\r\n}\r\n\r\nexport interface Profile {\r\n name: string,\r\n unique_name: string,\r\n family_name: string,\r\n upn: string\r\n}\r\n\r\nexport interface TokenType {\r\n accessToken: string,\r\n}\r\n\r\nexport interface PatientListRequest {\r\n RefMDId: number;\r\n MonthsBack: number;\r\n IncludeInactivePatients: boolean;\r\n}\r\n\r\nexport interface NextSiteOfCare {\r\n ccn: string,\r\n name: string\r\n}\r\n\r\ninterface CareCoordinatorRequest {\r\n PracticeId: number;\r\n PracticeCareCoordinatorId: number;\r\n AzureADUserName: string | undefined;\r\n DaysBack : number\r\n}\r\n\r\n\r\ninterface RequestPatientsByFacilityAction {\r\n type: \"REQUEST_PATIENTS_BY_FACILITYID\";\r\n facilityId: number;\r\n}\r\n\r\ninterface RequestPatientsByRefMDIdAction {\r\n type: \"REQUEST_PATIENTS_BY_REFMD_ID\";\r\n refMdId: number;\r\n}\r\n\r\ninterface RequestPatientByIdAction {\r\n type: \"REQUEST_PATIENT_BY_ID\";\r\n patientId: number;\r\n}\r\n\r\ninterface RequestPatientByPracticeId {\r\n type: \"REQUEST_PATIENTS_BY_PRACTICE_ID\";\r\n practiceId: number;\r\n}\r\n\r\n\r\ninterface RequestUserRefMdProfile {\r\n type: \"REQUEST_USER_REFMD_PROFILE\";\r\n}\r\n\r\ninterface RequestAllAvailableSpecialties {\r\n type: \"REQUEST_AVAILABLE_SPECIALTIES\";\r\n}\r\n\r\ninterface RequestCurrentMessages {\r\n type: \"REQUEST_CURRENT_MESSAGES\";\r\n}\r\n\r\ninterface RequestUpdateRefMDProfile {\r\n type: \"UPDATE_REF_MD_PROFILE\";\r\n profile: RefMdProfile;\r\n}\r\n\r\ninterface RequestUserCareCoordinatorProfile {\r\n type: \"REQUEST_USER_CARE_COORD_PROFILE\";\r\n}\r\n\r\ninterface RequestRefMDAdmitStats {\r\n type: \"REQUEST_ADMIT_STATS\";\r\n}\r\n\r\ninterface RequestRefMDDischargeLocationStats {\r\n type: \"REQUEST_DISCHARGE_STATS_LOCATIONS\";\r\n}\r\n\r\ninterface RequestRefMDPatientLocationStats {\r\n type: \"REQUEST_PATIENT_STATS_LOCATIONS\";\r\n}\r\n\r\ninterface RequestNSOCTypeStats {\r\n type: \"REQUEST_NSOC_TYPE_STATS\";\r\n}\r\n\r\ninterface ReceivePatientsByRefMDIdAction {\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID\";\r\n refMdId: number;\r\n patientsByRefMDId: ListPatient[];\r\n}\r\n\r\ninterface ReceivePatientsByRefMDIdError {\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID_ERROR\";\r\n err: string\r\n}\r\n\r\ninterface ReceivePatientsByFacilityAction {\r\n type: \"RECEIVE_PATIENTS_BY_FACILITYID\";\r\n facilityId: number;\r\n patientsByFacilityId: Patient[];\r\n}\r\n\r\n\r\ninterface ReceivePatientsByPractice {\r\n type: \"RECEIVE_PATIENTS_BY_PRACTICEID\";\r\n practiceId: number;\r\n patientsByPracticeId: ListPatient[];\r\n}\r\n\r\ninterface ReceivePatientByIdAction {\r\n type: \"RECEIVE_PATIENT_BY_ID\";\r\n patientId: number;\r\n patient: Patient;\r\n}\r\n\r\ninterface ReceivetUserRefMdProfile {\r\n type: \"RECEIVE_USER_REFMD_PROFILE\";\r\n profile: RefMdProfile;\r\n}\r\n\r\ninterface ReceiveUserRefMDProfileError {\r\n type: \"RECEIVE_USER_REFMD_PROFILE_FAILED\";\r\n}\r\n\r\n\r\ninterface UserRefMdProfileNotFound {\r\n type: \"RECEIVE_USER_REFMD_PROFILE_NOT_FOUND\";\r\n}\r\n\r\ninterface ReceiveUserCareCoordinatorProfile {\r\n type: \"RECEIVE_USER_CARE_COORD_PROFILE\";\r\n coordinatorProfile: CareCoordinatorModel;\r\n}\r\n\r\ninterface ReceiveUserCareCoordinatorProfileNotFound {\r\n type: \"RECEIVE_USER_CARE_COORD_PROFILE_NOT_FOUND\";\r\n}\r\n\r\ninterface ReceiveAllAvailableSpecialties {\r\n type: \"RECEIVE_ALL_SYSTEM_SPECIALTIES\";\r\n AvailableSpecialties: VitalsReferenceSpecialties;\r\n}\r\n\r\ninterface ReceiveCurrentMessages {\r\n type: \"RECEIVE_CURRENT_MESSAGES\";\r\n Messages: Message[];\r\n}\r\n\r\ninterface ReceiveFocusMessage {\r\n type: \"RECEIVED_FOCUS_MESSAGE\";\r\n Message: Message;\r\n}\r\n\r\ninterface ReceiveFocusMessageError {\r\n type: \"RECEIVE_FOCUS_MESSAGE_ERROR\";\r\n errorMessage: string\r\n}\r\n\r\ninterface RequestFetchFocusMessage {\r\n type: \"REQUEST_FOCUS_MESSAGE\";\r\n}\r\n\r\ninterface RequestFetchFocusMessagePartial {\r\n type: \"REQUEST_FOCUS_MESSAGE_PARTIAL\";\r\n}\r\n\r\ninterface ReceiveCurrentMessagesError {\r\n type: \"RECEIVE_CURRENT_MESSAGES_ERROR\";\r\n ErrorMessage: string;\r\n}\r\n\r\ninterface ReceiveMessageSendResponse {\r\n type: \"RECEIVE_SENT_MESSAGE\";\r\n Messages: Message;\r\n}\r\n\r\n\r\ninterface SubmitMessageReply {\r\n type: \"SUBMIT_MESSAGE_REPLY\";\r\n}\r\n\r\ninterface SubmitNewMessage {\r\n type: \"SUBMIT_NEW_MESSAGE\";\r\n}\r\n\r\ninterface ReceivedMessageReplyResponse {\r\n type: \"RECEIVED_MESSAGE_REPLY_RESPONSE\";\r\n message: Message;\r\n}\r\n\r\ninterface ReceivedNewMessageResponse {\r\n type: \"RECEIVED_NEW_MESSAGE_SEND_RESPONSE\";\r\n message: Message;\r\n}\r\n\r\ninterface ReceivedNewMessageSendError {\r\n type: \"RECEIVED_NEW_MESSAGE_SEND_RESPONSE_ERROR\";\r\n ErrorMessage: string;\r\n}\r\n\r\ninterface ArchiveMessageResponse {\r\n type: \"ARCHIVED_MESSAGE_RESPONSE\";\r\n archived: Message;\r\n}\r\n\r\ninterface ArchiveMessageRequest {\r\n type: \"ARCHIVE_MESSAGE_REQUEST\";\r\n}\r\n\r\ninterface ArchiveMessagesResponse {\r\n type: \"ARCHIVED_MESSAGES_RESPONSE\";\r\n archived: Message[];\r\n}\r\n\r\ninterface ArchiveMessageResponseError {\r\n type: \"ARCHIVE_MESSAGE_ERROR\";\r\n messageId: number;\r\n errMessage: string;\r\n}\r\n\r\ninterface ClearSendMessageResponse {\r\n type: \"CLEAR_SEND_MESSAGE_RESPONSE\"\r\n}\r\n\r\ninterface ReceiveRefMdAdmitStats {\r\n type: \"RECEIVE_REF_MD_ADMIT_STATS\",\r\n admitStats: AdmitSummaryStatistics[]\r\n}\r\n\r\ninterface ReceiveAdmitStatusError {\r\n type: \"REQUEST_ADMIT_STATS_ERROR\";\r\n errMessage: string;\r\n}\r\n\r\ninterface ReceiveRefMdDischargeLocationStats {\r\n type: 'RECEIVE_DISCHARGE_STATS_LOCATIONS',\r\n dischageLocations: DischargeLocationStatistics[]\r\n}\r\n\r\ninterface ReceiveNSOCTypeStats {\r\n type: 'RECEIVE_NSOC_STATS',\r\n dischargeDispositions: DischargeDispositionStatistics[]\r\n}\r\n\r\n\r\ninterface RequestPatientLocationStats {\r\n type: 'REQUEST_PATIENTS_LOCATION_STATS'\r\n}\r\n\r\ninterface ReceivePatientLocationStats {\r\n type: 'RECEIVE_PATIENTS_LOCATION_STATS',\r\n patientFacilityCounts: PatientFacility[]\r\n}\r\n\r\ninterface ReceivePatientLocationStatsError {\r\n type: 'RECEIVE_PATIENTS_LOCATION_STATS_ERROR',\r\n errMessage: string;\r\n}\r\n\r\ninterface ReceiveDischargeStatsLocationsError {\r\n type: 'RECEIVE_DISCHARGE_STATS_LOCATIONS_ERROR';\r\n errMessage: string;\r\n}\r\n\r\ninterface ReceiveDischargeNSOCTypeError {\r\n type: 'RECEIVE_NSOC_STATS_ERROR';\r\n errMessage: string;\r\n}\r\n\r\ninterface ReceiveUpdatedApiHost {\r\n type: 'UPDATE_API_HOST';\r\n apiHost: string;\r\n}\r\n\r\ninterface RequestNotificationUnreadCount {\r\n type: 'REQUEST_NOTIFICATION_UNREAD_COUNT';\r\n}\r\n\r\ninterface ReceiveNotificationUnreadCountError {\r\n type: 'RECEIVE_NOTIFICATION_UNREAD_COUNT_ERROR'\r\n}\r\n\r\ninterface ReceiveNotificationUnreadCount {\r\n type: 'RECEIVE_NOTIFICATION_UNREAD_COUNT';\r\n countStatus: NotificationCountDto;\r\n}\r\n\r\ninterface UpdateCareCoordinatorProfile {\r\n type: 'UPDATE_CARE_COORD_PROFILE',\r\n coordinatorProfile: CareCoordinatorModel\r\n}\r\n\r\ninterface RequestUserPracticePhysicianContacts {\r\n type: 'REQUEST_USER_PRACTICE_PHYSICIAN_CONTACTS';\r\n}\r\n\r\ninterface ReceiveUserPracticePhysicianContacts {\r\n type: 'RECEIVE_USER_PRACTICE_PHYSICIAN_CONTACTS';\r\n physicianContacts: HNIProviderContact[];\r\n}\r\n\r\ninterface ReceiveTokenResponse {\r\n type: 'RECEIVE_TOKEN_RESPONSE';\r\n apiToken: TokenType;\r\n}\r\n\r\n\r\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\r\n// declared type strings (and not any other arbitrary string).\r\ntype KnownAction =\r\n | RequestPatientsByFacilityAction\r\n | ReceivePatientsByFacilityAction\r\n | RequestPatientsByRefMDIdAction\r\n | ReceivePatientsByRefMDIdAction\r\n | RequestPatientByIdAction\r\n | ReceivePatientByIdAction\r\n | RequestUserRefMdProfile\r\n | ReceivetUserRefMdProfile\r\n | RequestAllAvailableSpecialties\r\n | ReceiveAllAvailableSpecialties\r\n | RequestUpdateRefMDProfile\r\n | RequestCurrentMessages\r\n | ReceiveCurrentMessages\r\n | SubmitMessageReply\r\n | ReceivedMessageReplyResponse\r\n | ArchiveMessageRequest\r\n | ArchiveMessageResponse\r\n | ArchiveMessagesResponse\r\n | ArchiveMessageResponseError\r\n | ReceiveMessageSendResponse\r\n | SubmitNewMessage\r\n | ReceivedNewMessageResponse\r\n | ClearSendMessageResponse\r\n | ReceiveCurrentMessagesError\r\n | ReceivedNewMessageSendError\r\n | ReceiveRefMdAdmitStats\r\n | RequestRefMDAdmitStats\r\n | RequestRefMDDischargeLocationStats\r\n | ReceiveRefMdDischargeLocationStats\r\n | ReceiveDischargeStatsLocationsError\r\n | ReceiveAdmitStatusError\r\n | ReceiveDischargeNSOCTypeError\r\n | RequestNSOCTypeStats\r\n | ReceiveNSOCTypeStats\r\n | ReceivePatientLocationStats\r\n | RequestRefMDPatientLocationStats\r\n | ReceivePatientLocationStatsError\r\n | ReceiveUpdatedApiHost\r\n | ReceivePatientsByRefMDIdError\r\n | ReceiveFocusMessage\r\n | ReceiveFocusMessageError\r\n | RequestFetchFocusMessage\r\n | RequestNotificationUnreadCount\r\n | ReceiveNotificationUnreadCount\r\n | ReceiveNotificationUnreadCountError\r\n | RequestPatientByPracticeId\r\n | ReceivePatientsByPractice\r\n | RequestUserCareCoordinatorProfile\r\n | ReceiveUserCareCoordinatorProfile\r\n | UserRefMdProfileNotFound\r\n | UpdateCareCoordinatorProfile\r\n | ReceiveUserRefMDProfileError\r\n | RequestPatientLocationStats\r\n | ReceiveUserCareCoordinatorProfileNotFound\r\n | RequestUserPracticePhysicianContacts\r\n | ReceiveUserPracticePhysicianContacts\r\n | RequestFetchFocusMessagePartial\r\n | ReceiveTokenResponse\r\n\r\n\r\n// ----------------\r\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\r\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\r\n\r\nlet host = process.env.REACT_APP_API_ENDPOINT;\r\n\r\nexport const findMessage = (messageId: number, messages: Message[]) => {\r\n let ret = messages.filter((val) => val.messageId === messageId);\r\n if (!ret.length) {\r\n return null;\r\n }\r\n\r\n return ret[0];\r\n};\r\n\r\nconst addMessageIfMissing = (newMessage: Message, messages: Message[]) => {\r\n let exMessage = findMessage(newMessage.messageId, messages);\r\n if (!exMessage) {\r\n messages = messages.concat(newMessage);\r\n return messages;\r\n }\r\n\r\n return messages;\r\n};\r\n\r\nconst filterServiceDeskContacts = (source:HNIProviderContact[]) => {\r\n return source.filter(v => v.email != 'support@hnihc.com')\r\n}\r\n\r\n\r\n\r\nexport const actionCreators = {\r\n\r\n submitRefMD: (profileState: any, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState && appState.vitalsContext?.userRefMdProfile) {\r\n const options = {\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n\r\n },\r\n method: \"POST\",\r\n body: JSON.stringify(profileState),\r\n\r\n };\r\n fetch(`https://${host}/ReferringMD/profile/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_USER_REFMD_PROFILE\",\r\n profile: profileState\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n\r\n dispatch({\r\n type: \"UPDATE_REF_MD_PROFILE\",\r\n profile: profileState\r\n });\r\n }\r\n },\r\n\r\n submitCareCoordinator: (profileState: CareCoordinatorModel, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState && appState.vitalsContext?.userPracticeCoordinatorProfile) {\r\n const options = {\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n\r\n },\r\n method: \"POST\",\r\n body: JSON.stringify(profileState),\r\n };\r\n\r\n fetch(`https://${host}/CareCoordinator/profile/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_USER_CARE_COORD_PROFILE\",\r\n coordinatorProfile: data\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n\r\n dispatch({\r\n type: \"UPDATE_CARE_COORD_PROFILE\",\r\n coordinatorProfile: profileState\r\n });\r\n }\r\n },\r\n\r\n clearSentMessageState: (): AppThunkAction => (dispatch, getState) => {\r\n dispatch({\r\n type: \"CLEAR_SEND_MESSAGE_RESPONSE\"\r\n });\r\n },\r\n\r\n receiveTokenResponse: (apiToken: TokenType): AppThunkAction => (dispatch, getState) => {\r\n dispatch({\r\n type: \"RECEIVE_TOKEN_RESPONSE\",\r\n apiToken : apiToken\r\n });\r\n },\r\n\r\n getUnreadMessageCount: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_NOTIFICATION_UNREAD_COUNT\",\r\n countStatus: unloadedState.NotificationCount\r\n });\r\n return unloadedState.NotificationCount;\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n fetch(`https://${host}/Message/Messages/UnRead/`, options)\r\n\r\n .then((response): Promise => {\r\n if (!response.ok) {\r\n\r\n throw Error(response.statusText);\r\n }\r\n\r\n return response.json()\r\n })\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_NOTIFICATION_UNREAD_COUNT\",\r\n countStatus: data\r\n });\r\n })\r\n .catch((err) => {\r\n\r\n dispatch({\r\n type: \"RECEIVE_NOTIFICATION_UNREAD_COUNT_ERROR\"\r\n });\r\n console.error(err);\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_NOTIFICATION_UNREAD_COUNT\"\r\n });\r\n }\r\n },\r\n\r\n\r\n submitReplyMessage: (replyMessage: Message, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n\r\n let requestMessage = {\r\n ...replyMessage,\r\n patient: null\r\n }\r\n const options = {\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n\r\n },\r\n method: \"POST\",\r\n body: JSON.stringify(requestMessage),\r\n\r\n };\r\n\r\n fetch(`https://${host}/Message/Messages/Replies/${replyMessage.parentMessageId}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVED_MESSAGE_REPLY_RESPONSE\",\r\n message: data\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n\r\n dispatch({\r\n type: \"SUBMIT_MESSAGE_REPLY\"\r\n });\r\n },\r\n\r\n\r\n submitNewMessageWithAttachment: (formData: FormData, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n const options = {\r\n headers: {\r\n Accept: \"*.*\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n method: \"POST\",\r\n body: formData,\r\n };\r\n\r\n fetch(`https://${host}/Message/Messages/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVED_NEW_MESSAGE_SEND_RESPONSE\",\r\n message: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: 'RECEIVED_NEW_MESSAGE_SEND_RESPONSE_ERROR',\r\n ErrorMessage: err.message\r\n })\r\n });\r\n\r\n dispatch({\r\n type: \"SUBMIT_NEW_MESSAGE\"\r\n });\r\n },\r\n\r\n archiveMessage: (subjectMessage: Message, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n\r\n const appState = getState();\r\n\r\n let requestMessage = {\r\n ...subjectMessage,\r\n patient: null\r\n }\r\n\r\n const options = {\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n\r\n },\r\n method: \"POST\",\r\n body: JSON.stringify(requestMessage),\r\n\r\n };\r\n\r\n fetch(`https://${host}/Message/Messages/Archived/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n if (data.status == '500') {\r\n dispatch({\r\n type: \"ARCHIVE_MESSAGE_ERROR\",\r\n messageId: subjectMessage.messageId,\r\n errMessage: data.detail\r\n });\r\n return;\r\n }\r\n dispatch({\r\n type: \"ARCHIVED_MESSAGE_RESPONSE\",\r\n archived: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"ARCHIVE_MESSAGE_ERROR\",\r\n messageId: subjectMessage.messageId,\r\n errMessage: err\r\n });\r\n });\r\n\r\n dispatch({\r\n type: \"ARCHIVE_MESSAGE_REQUEST\"\r\n });\r\n },\r\n\r\n archiveMessages: (subjectMessages: Message[]): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n const accessToken = appState.oidc.user.access_token;\r\n\r\n const options = {\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n\r\n },\r\n method: \"POST\",\r\n body: JSON.stringify(subjectMessages),\r\n\r\n };\r\n\r\n fetch(`https://${host}/Message/Messages/Archived/list/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"ARCHIVED_MESSAGES_RESPONSE\",\r\n archived: data\r\n });\r\n })\r\n .catch((err) => {\r\n\r\n });\r\n\r\n dispatch({\r\n type: \"ARCHIVE_MESSAGE_REQUEST\"\r\n });\r\n },\r\n\r\n\r\n requestPatientLocationStatsForProvider: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS\",\r\n patientFacilityCounts: unloadedState.PatientLocationStats.patientFacilityCounts\r\n });\r\n\r\n return unloadedState.PatientLocationStats.patientFacilityCounts;\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode && !appState.vitalsContext?.PatientLocationStats.isLoaded) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n fetch(`https://${host}/Home/Stats/Locations/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS\",\r\n patientFacilityCounts: data\r\n\r\n });\r\n })\r\n .catch((err) => {\r\n\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS_ERROR\",\r\n errMessage: err.message\r\n });\r\n\r\n console.error(err);\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_PATIENTS_LOCATION_STATS\"\r\n });\r\n }\r\n },\r\n\r\n requestPatientLocationStatsByTag: (accessToken: string, practice: Practice): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS\",\r\n patientFacilityCounts: unloadedState.PatientLocationStats.patientFacilityCounts\r\n });\r\n\r\n return unloadedState.PatientLocationStats.patientFacilityCounts;\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode\r\n && !appState.vitalsContext?.PatientLocationStats.isLoaded\r\n && !appState.vitalsContext?.PatientLocationStats.isLoading) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n }\r\n }\r\n\r\n\r\n let searchTag = practice.tagDescription;\r\n fetch(`https://${host}/Home/Stats/Locations/Practice/Tag/${searchTag}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS\",\r\n patientFacilityCounts: data\r\n\r\n });\r\n })\r\n .catch((err) => {\r\n\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS_ERROR\",\r\n errMessage: err.message\r\n });\r\n\r\n console.error(err);\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_PATIENT_STATS_LOCATIONS\"\r\n });\r\n }\r\n\r\n },\r\n\r\n requestPatientLocationStatsForPractice: (accessToken: string, practiceId: number): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS\",\r\n patientFacilityCounts: unloadedState.PatientLocationStats.patientFacilityCounts\r\n });\r\n\r\n return unloadedState.PatientLocationStats.patientFacilityCounts;\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode\r\n && !appState.vitalsContext?.PatientLocationStats.isLoaded\r\n && !appState.vitalsContext?.PatientLocationStats.isLoading) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n fetch(`https://${host}/Home/Stats/Locations/Practice/${practiceId}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS\",\r\n patientFacilityCounts: data\r\n\r\n });\r\n })\r\n .catch((err) => {\r\n\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_LOCATION_STATS_ERROR\",\r\n errMessage: err.message\r\n });\r\n\r\n console.error(err);\r\n });\r\n }\r\n\r\n dispatch({\r\n type: \"REQUEST_PATIENTS_LOCATION_STATS\"\r\n });\r\n },\r\n\r\n requestDischargeDispositionStatsForProvider: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS\",\r\n dischargeDispositions: unloadedState.DischargeDispositionStats.dischargeDispositions\r\n });\r\n return unloadedState.DischargeDispositionStats.dischargeDispositions;\r\n }\r\n\r\n\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode\r\n && !appState.vitalsContext.DischargeDispositionStats.isLoaded\r\n && !appState.vitalsContext.DischargeDispositionStats.isLoading) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n try {\r\n fetch(`https://${host}/Home/Stats/Discharges/NextSiteOfCare/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS\",\r\n dischargeDispositions: data\r\n });\r\n }).catch((err) => {\r\n\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS_ERROR\",\r\n errMessage: err.message\r\n });\r\n\r\n console.error(err);\r\n });\r\n } catch (e) {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS_ERROR\",\r\n errMessage: 'Error'\r\n });\r\n }\r\n dispatch({\r\n type: \"REQUEST_NSOC_TYPE_STATS\"\r\n });\r\n\r\n }\r\n },\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n currentUserIsCareCoordinator : (): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n if (appState?.vitalsContext?.isDemoMode) {\r\n return false;\r\n }\r\n\r\n if(appState.vitalsContext?.userPracticeCoordinatorProfile.isLoaded) {\r\n return false;\r\n }\r\n },\r\n\r\n requestDischargeDispositionStatsForByTag: (accessToken: string, practice: Practice): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS\",\r\n dischargeDispositions: unloadedState.DischargeDispositionStats.dischargeDispositions\r\n });\r\n return appState.vitalsContext?.DischargeDispositionStats.dischargeDispositions;\r\n }\r\n\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode\r\n && !appState.vitalsContext.DischargeDispositionStats.isLoaded\r\n && !appState.vitalsContext.DischargeDispositionStats.isLoading) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n let { tagDescription } = practice;\r\n\r\n try {\r\n fetch(`https://${host}/Home/Stats/Discharges/NextSiteOfCare/Practice/Tag/${tagDescription}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS\",\r\n dischargeDispositions: data\r\n });\r\n }).catch((err) => {\r\n\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS_ERROR\",\r\n errMessage: err.message\r\n });\r\n\r\n console.error(err);\r\n });\r\n } catch (e) {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS_ERROR\",\r\n errMessage: 'Error'\r\n });\r\n }\r\n\r\n dispatch({\r\n type: \"REQUEST_NSOC_TYPE_STATS\"\r\n });\r\n }\r\n\r\n\r\n },\r\n\r\n\r\n requestDischargeDispositionStatsForPractice: (accessToken: string, practiceId: number): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS\",\r\n dischargeDispositions: unloadedState.DischargeDispositionStats.dischargeDispositions\r\n });\r\n return appState.vitalsContext?.DischargeDispositionStats.dischargeDispositions;\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode && !appState.vitalsContext.DischargeDispositionStats.isLoaded) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n try {\r\n fetch(`https://${host}/Home/Stats/Discharges/NextSiteOfCare/Practice/${practiceId}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS\",\r\n dischargeDispositions: data\r\n });\r\n }).catch((err) => {\r\n\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS_ERROR\",\r\n errMessage: err.message\r\n });\r\n\r\n console.error(err);\r\n });\r\n } catch (e) {\r\n dispatch({\r\n type: \"RECEIVE_NSOC_STATS_ERROR\",\r\n errMessage: 'Error'\r\n });\r\n }\r\n\r\n dispatch({\r\n type: \"REQUEST_NSOC_TYPE_STATS\"\r\n });\r\n }\r\n },\r\n\r\n requestAdmitStatsForPracticeByTag: (accessToken: string, practice: Practice): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_REF_MD_ADMIT_STATS\",\r\n admitStats: unloadedState.PhysicianAdmitsStats.physicianAdmits\r\n });\r\n\r\n return unloadedState.PhysicianAdmitsStats.physicianAdmits;\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode\r\n && !appState.vitalsContext.PhysicianAdmitsStats.isLoaded\r\n && !appState.vitalsContext.PhysicianAdmitsStats.isLoading) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n let searchTag = practice.tagDescription;\r\n fetch(`https://${host}/Home/Stats/Admits/Practice/Tag/${searchTag}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_REF_MD_ADMIT_STATS\",\r\n admitStats: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"REQUEST_ADMIT_STATS_ERROR\",\r\n errMessage: err.message\r\n })\r\n });\r\n\r\n\r\n dispatch({\r\n type: \"REQUEST_ADMIT_STATS\"\r\n });\r\n }\r\n },\r\n\r\n requestAdmitStatsForPractice: (accessToken: string, practiceId: number): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n\r\n if (appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_REF_MD_ADMIT_STATS\",\r\n admitStats: unloadedState.PhysicianAdmitsStats.physicianAdmits\r\n });\r\n\r\n return unloadedState.PhysicianAdmitsStats.physicianAdmits;\r\n }\r\n\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode && !appState.vitalsContext.PhysicianAdmitsStats.isLoaded) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n fetch(`https://${host}/Home/Stats/Admits/Practice/${practiceId}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_REF_MD_ADMIT_STATS\",\r\n admitStats: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"REQUEST_ADMIT_STATS_ERROR\",\r\n errMessage: err.message\r\n })\r\n });\r\n\r\n\r\n dispatch({\r\n type: \"REQUEST_ADMIT_STATS\"\r\n });\r\n }\r\n },\r\n\r\n\r\n requestAdmitStatsForProvider: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState && appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_REF_MD_ADMIT_STATS\",\r\n admitStats: unloadedState.PhysicianAdmitsStats.physicianAdmits\r\n });\r\n\r\n return appState.vitalsContext?.PhysicianAdmitsStats.physicianAdmits;\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode && !appState.vitalsContext.PhysicianAdmitsStats.isLoaded) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n fetch(`https://${host}/Home/Stats/Admits/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_REF_MD_ADMIT_STATS\",\r\n admitStats: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"REQUEST_ADMIT_STATS_ERROR\",\r\n errMessage: err.message\r\n })\r\n });\r\n\r\n\r\n dispatch({\r\n type: \"REQUEST_ADMIT_STATS\"\r\n });\r\n }\r\n },\r\n\r\n markMessageAsRead: (accessToken: string, message: Message): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext && appState.vitalsContext.Messages.CurrentMessages) {\r\n let requestMessage = {\r\n ...message,\r\n patient: null\r\n }\r\n\r\n if (appState && appState.vitalsContext?.isDemoMode) {\r\n return;\r\n }\r\n const options = {\r\n method: \"POST\",\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(requestMessage),\r\n }\r\n\r\n fetch(`https://${host}/Message/Messages/Read/`, options)\r\n .then((response): Promise => {\r\n if (!response.ok) {\r\n if (response.status === 404) {\r\n throw Error('Message not found in mailbox');\r\n }\r\n throw Error(response.statusText);\r\n }\r\n\r\n return response.json()\r\n })\r\n .then((data) => {\r\n dispatch({\r\n type: 'RECEIVE_NOTIFICATION_UNREAD_COUNT',\r\n countStatus: data\r\n })\r\n })\r\n .catch((error) => {\r\n\r\n });\r\n\r\n\r\n }\r\n },\r\n\r\n requestProviderMessage: (accessToken: string, messageId: number): AppThunkAction => (dispatch, getState) => {\r\n\r\n const appState = getState();\r\n\r\n\r\n if (appState.vitalsContext?.isDemoMode) {\r\n let messages = unloadedState.Messages.CurrentMessages\r\n\r\n\r\n let foundMessage = findMessage(messageId, messages);\r\n dispatch({\r\n type: \"RECEIVED_FOCUS_MESSAGE\",\r\n Message: foundMessage\r\n });\r\n\r\n return foundMessage;\r\n }\r\n\r\n\r\n\r\n if (appState?.vitalsContext) {\r\n let messages = appState.vitalsContext.Messages.CurrentMessages;\r\n\r\n let foundMessage = findMessage(messageId, messages);\r\n if (foundMessage) {\r\n\r\n dispatch({\r\n type: \"RECEIVED_FOCUS_MESSAGE\",\r\n Message: foundMessage\r\n });\r\n\r\n return foundMessage;\r\n }\r\n else {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n if(appState.vitalsContext.Messages.isLoaded) {\r\n dispatch({\r\n type: \"REQUEST_FOCUS_MESSAGE\"\r\n })\r\n } else {\r\n dispatch({\r\n type: \"REQUEST_FOCUS_MESSAGE_PARTIAL\"\r\n })\r\n }\r\n\r\n\r\n fetch(`https://${host}/Message/Messages/${messageId}`, options)\r\n .then((response): Promise => {\r\n if (!response.ok) {\r\n if (response.status === 404) {\r\n throw Error('Message not found in mailbox');\r\n }\r\n throw Error(response.statusText);\r\n }\r\n\r\n return response.json()\r\n })\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVED_FOCUS_MESSAGE\",\r\n Message: data\r\n });\r\n })\r\n .catch((error) => {\r\n dispatch({\r\n type: \"RECEIVE_FOCUS_MESSAGE_ERROR\",\r\n errorMessage: error.message\r\n });\r\n });\r\n }\r\n }\r\n\r\n },\r\n\r\n requestMessagesForProvider: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_CURRENT_MESSAGES\",\r\n Messages: unloadedState.Messages.CurrentMessages\r\n });\r\n\r\n return unloadedState.Messages.CurrentMessages;\r\n }\r\n\r\n let state = appState.vitalsContext?.Messages;\r\n\r\n if (!state?.isLoading && !state?.isLoaded) {\r\n\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n fetch(`https://${host}/Message/Messages/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_CURRENT_MESSAGES\",\r\n Messages: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"RECEIVE_CURRENT_MESSAGES_ERROR\",\r\n ErrorMessage: err.message\r\n });\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_CURRENT_MESSAGES\"\r\n });\r\n\r\n dispatch({\r\n type: \"UPDATE_API_HOST\",\r\n apiHost: host\r\n });\r\n }\r\n },\r\n\r\n requestMessageContactsUser : (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if(appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_USER_PRACTICE_PHYSICIAN_CONTACTS\",\r\n physicianContacts: unloadedState.PatientPhysiciansContacts.userPatientContacts\r\n });\r\n return;\r\n }\r\n\r\n if (appState?.vitalsContext) {\r\n if(!appState.vitalsContext.PatientPhysiciansContacts.isLoaded && !appState.vitalsContext.PatientPhysiciansContacts.isLoading) {\r\n \r\n let request : PatientListRequest = {\r\n MonthsBack : -6\r\n };\r\n const options = {\r\n method: \"POST\",\r\n body: JSON.stringify(request),\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;', \r\n Authorization: `Bearer ${accessToken}`,\r\n \r\n },\r\n }\r\n\r\n fetch(`https://${host}/Patient/Contacts/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_USER_PRACTICE_PHYSICIAN_CONTACTS\",\r\n physicianContacts: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"RECEIVE_CURRENT_MESSAGES_ERROR\",\r\n ErrorMessage: err.message\r\n });\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_USER_PRACTICE_PHYSICIAN_CONTACTS\"\r\n });\r\n }\r\n }\r\n },\r\n\r\n requestMessageContactsForPractice : (accessToken: string, practiceId: number): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if(appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_USER_PRACTICE_PHYSICIAN_CONTACTS\",\r\n physicianContacts: unloadedState.PatientPhysiciansContacts.userPatientContacts\r\n });\r\n return;\r\n }\r\n\r\n\r\n if (appState?.vitalsContext) {\r\n if(!appState.vitalsContext.PatientPhysiciansContacts.isLoaded && !appState.vitalsContext.PatientPhysiciansContacts.isLoading) {\r\n \r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\", \r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n }\r\n\r\n fetch(`https://${host}/CareCoordinator/Patients/Search/Contacts/id/${practiceId}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_USER_PRACTICE_PHYSICIAN_CONTACTS\",\r\n physicianContacts: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"RECEIVE_CURRENT_MESSAGES_ERROR\",\r\n ErrorMessage: err.message\r\n });\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_USER_PRACTICE_PHYSICIAN_CONTACTS\"\r\n });\r\n\r\n\r\n }\r\n }\r\n },\r\n\r\n requestSystemSpecialties: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_ALL_SYSTEM_SPECIALTIES\",\r\n AvailableSpecialties: unloadedState.SystemSpecialties.VitalsReferenceSpecialties\r\n });\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n fetch(`https://${host}/Specialty/available/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_ALL_SYSTEM_SPECIALTIES\",\r\n AvailableSpecialties: data\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_AVAILABLE_SPECIALTIES\"\r\n });\r\n }\r\n },\r\n\r\n requestCareCoordinatorProfile: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n fetch(`https://${host}/CareCoordinator/Search/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_USER_CARE_COORD_PROFILE\",\r\n coordinatorProfile: data\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_USER_CARE_COORD_PROFILE\"\r\n });\r\n\r\n }\r\n },\r\n\r\n requestCurrentUserCareCoordinatorProfile: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_USER_CARE_COORD_PROFILE_NOT_FOUND\",\r\n });\r\n return;\r\n }\r\n\r\n if (appState && !appState?.vitalsContext.userPracticeCoordinatorProfile.isLoaded\r\n && !appState.vitalsContext.userPracticeCoordinatorProfile.isLoading) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n fetch(`https://${host}/CareCoordinator/Current/`, options)\r\n .then((response) :Promise => {\r\n if (!response.ok) {\r\n if (response.status === 404) {\r\n dispatch({\r\n type: \"RECEIVE_USER_CARE_COORD_PROFILE_NOT_FOUND\",\r\n });\r\n \r\n }\r\n throw Error(response.statusText);\r\n };\r\n return response.json();\r\n })\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_USER_CARE_COORD_PROFILE\",\r\n coordinatorProfile: data\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_USER_CARE_COORD_PROFILE\"\r\n });\r\n\r\n dispatch({\r\n type: \"UPDATE_API_HOST\",\r\n apiHost: host\r\n });\r\n\r\n }\r\n },\r\n\r\n requestVitalsMdProfile: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState.vitalsContext?.isDemoMode) {\r\n dispatch({\r\n type: \"RECEIVE_USER_REFMD_PROFILE\",\r\n profile: unloadedState.userRefMdProfile.refmdProfile\r\n });\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n fetch(`https://${host}/ReferringMD/id/current/`, options)\r\n .then((response): Promise => {\r\n if (!response.ok) {\r\n if (response.status === 404) {\r\n dispatch({\r\n type: \"RECEIVE_USER_REFMD_PROFILE_NOT_FOUND\",\r\n });\r\n\r\n }\r\n throw Error(response.statusText);\r\n }\r\n\r\n\r\n return response.json()\r\n })\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_USER_REFMD_PROFILE\",\r\n profile: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"RECEIVE_USER_REFMD_PROFILE_FAILED\",\r\n error: err\r\n });\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_USER_REFMD_PROFILE\"\r\n });\r\n\r\n dispatch({\r\n type: \"UPDATE_API_HOST\",\r\n apiHost: host\r\n });\r\n }\r\n },\r\n\r\n requestPatientsByPracticeIdWithDays: (practiceId: number, coordinatorId: number, daysBack : number, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n let request: CareCoordinatorRequest = {\r\n PracticeId: practiceId,\r\n PracticeCareCoordinatorId: coordinatorId,\r\n DaysBack: daysBack\r\n }\r\n\r\n\r\n const options = {\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n\r\n },\r\n method: \"POST\",\r\n body: JSON.stringify(request),\r\n };\r\n\r\n if (!appState.vitalsContext?.Patients.isLoading) {\r\n fetch(`https://${host}/CareCoordinator/Patients/Search/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_PRACTICEID\",\r\n practiceId: practiceId,\r\n patientsByPracticeId: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID_ERROR\",\r\n err: err.message\r\n });\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_PATIENTS_BY_PRACTICE_ID\",\r\n practiceId: practiceId\r\n });\r\n }\r\n },\r\n\r\n requestPatientsByRefMDIdWithDays: (refMdId: number, monthsBack: number, includeInactivePatients: boolean, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState.vitalsContext?.isDemoMode) {\r\n \r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID\",\r\n refMdId: refMdId,\r\n patientsByRefMDId: unloadedState.Patients.patientsByRefMDId\r\n });\r\n\r\n return unloadedState.Patients.patientsByRefMDId;\r\n }\r\n\r\n if(monthsBack == 0) {\r\n return;\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode ) {\r\n\r\n if (appState.vitalsContext?.Patients.patientsByRefMDId.length > 0) {\r\n var cachedPts = appState.vitalsContext?.Patients\r\n .patientsByRefMDId;\r\n\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID\",\r\n refMdId: refMdId,\r\n patientsByRefMDId: cachedPts\r\n });\r\n\r\n return cachedPts;\r\n }\r\n\r\n let request: PatientListRequest = {\r\n RefMDId: refMdId,\r\n MonthsBack: monthsBack,\r\n IncludeInactivePatients: includeInactivePatients\r\n }\r\n\r\n const options = {\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n\r\n },\r\n method: \"POST\",\r\n body: JSON.stringify(request),\r\n\r\n };\r\n fetch(`https://${host}/Patient/Search/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID\",\r\n refMdId: refMdId,\r\n patientsByRefMDId: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID_ERROR\",\r\n err: err.message\r\n });\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_PATIENTS_BY_REFMD_ID\",\r\n refMdId: refMdId,\r\n });\r\n\r\n dispatch({\r\n type: \"UPDATE_API_HOST\",\r\n apiHost: host\r\n });\r\n }\r\n },\r\n\r\n requestPatientsByRefMDId: (refMdId: number, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n fetch(`https://${host}/Patient/RefMDId/${refMdId}/ALL`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID\",\r\n refMdId: refMdId,\r\n patientsByRefMDId: data\r\n });\r\n })\r\n .catch((err) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_REFMD_ID_ERROR\",\r\n err: err.message\r\n });\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_PATIENTS_BY_REFMD_ID\",\r\n refMdId: refMdId,\r\n });\r\n }\r\n },\r\n requestsPatientsByFacility: (facilityId: number): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState && appState.vitalsContext && appState.vitalsContext.Patients.facilityId && facilityId != appState.vitalsContext.Patients.facilityId) {\r\n const accessToken = appState.oidc.user.access_token;\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n fetch(`https://${host}/Patient/Facility/${facilityId}/`, options)\r\n .then((response) => response.json() as Promise)\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENTS_BY_FACILITYID\",\r\n facilityId: facilityId,\r\n patientsByFacilityId: data,\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err);\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_PATIENTS_BY_FACILITYID\",\r\n facilityId: facilityId,\r\n });\r\n }\r\n },\r\n requestConsolidatedPatientById: (patientId: number, accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n\r\n if (appState?.vitalsContext && appState.vitalsContext.isDemoMode) {\r\n let samplePatient = null;\r\n if(patientId === 8268643) {\r\n samplePatient = unloadedState.Patients.fullPatients[1]\r\n dispatch({\r\n type: \"RECEIVE_PATIENT_BY_ID\",\r\n patientId: patientId,\r\n patient: samplePatient\r\n });\r\n \r\n }\r\n\r\n if(patientId ===124567) {\r\n samplePatient = unloadedState.Patients.fullPatients[0]\r\n dispatch({\r\n type: \"RECEIVE_PATIENT_BY_ID\",\r\n patientId: patientId,\r\n patient: samplePatient\r\n });\r\n \r\n\r\n }\r\n\r\n if(patientId ===23567) {\r\n samplePatient = unloadedState.Patients.fullPatients[2]\r\n dispatch({\r\n type: \"RECEIVE_PATIENT_BY_ID\",\r\n patientId: patientId,\r\n patient: samplePatient\r\n });\r\n }\r\n\r\n if(patientId ===123) {\r\n samplePatient = unloadedState.Patients.fullPatients[3]\r\n dispatch({\r\n type: \"RECEIVE_PATIENT_BY_ID\",\r\n patientId: patientId,\r\n patient: samplePatient\r\n });\r\n }\r\n\r\n dispatch({\r\n type: \"UPDATE_API_HOST\",\r\n apiHost: host\r\n });\r\n return samplePatient;\r\n }\r\n\r\n if (appState.vitalsContext?.Patients.fullPatients) {\r\n\r\n let fullPatients = appState.vitalsContext?.Patients\r\n .fullPatients;\r\n\r\n let cachedPt = fullPatients.filter(p => p.patientEncounterId === patientId);\r\n if (cachedPt && cachedPt.length >= 1) {\r\n var newFocusPatient = cachedPt[0];\r\n dispatch({\r\n type: \"RECEIVE_PATIENT_BY_ID\",\r\n patientId: patientId,\r\n patient: newFocusPatient,\r\n });\r\n return newFocusPatient;\r\n }\r\n }\r\n\r\n if (appState && appState.vitalsContext && !appState.vitalsContext.isDemoMode) {\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n fetch(`https://${host}/Patient/id/${patientId}/`, options)\r\n .then((response): Promise => {\r\n if (!response.ok) {\r\n throw Error(response.statusText);\r\n }\r\n return response.json();\r\n })\r\n .then((data) => {\r\n dispatch({\r\n type: \"RECEIVE_PATIENT_BY_ID\",\r\n patientId: patientId,\r\n patient: data,\r\n });\r\n }).catch((err) => {\r\n console.log(err);\r\n });\r\n\r\n dispatch({\r\n type: \"REQUEST_PATIENT_BY_ID\",\r\n patientId: patientId,\r\n });\r\n }\r\n },\r\n\r\n clearMessageState: (): AppThunkAction => (dispatch, getState) => {\r\n dispatch({\r\n type: \"CLEAR_SEND_MESSAGE_RESPONSE\",\r\n });\r\n },\r\n requestBlobById: (accessToken: string): AppThunkAction => (dispatch, getState) => {\r\n const appState = getState();\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n };\r\n\r\n fetch(`https://${host}/api/AzureStorage/GetBlob/`, options)\r\n .then((data) => {\r\n console.log(data);\r\n }).catch((err) => {\r\n console.log(err);\r\n });\r\n }\r\n};\r\n\r\n// ----------------\r\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\r\n\r\n\r\n\r\nconst janeId = 8268643;\r\nconst janeMbi = '4AG4-GE5-KJ81'\r\nconst johnMbi = '1EG4-TE5-MK73'\r\n\r\n\r\nconst johnId = 124567;\r\nconst jayId = 23567;\r\nconst jayMbi = '7CG4-RB3-NJ52'\r\nconst abbyId = 123;\r\nconst abbyMbi = '2BD1-ED8-MI44'\r\n\r\nconst testPatientData: ListPatient[] = [\r\n {\r\n mrn: 'L000000093',\r\n firstName: 'John',\r\n lastName: 'Doe',\r\n pcn: '9641947463452',\r\n ptId: johnId,\r\n patientEncounterId : johnId,\r\n mbi : johnMbi,\r\n facilityId: 0,\r\n dateOfBirth: '01/01/1960',\r\n admitDate: '03/04/2024',\r\n dischargeDate: '03/06/2024',\r\n daysToDischarge : 0,\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider'\r\n },\r\n referringMdUserName: 'doctor.smith@hospnow.com',\r\n recentAdmits: 2,\r\n facilityName: 'Austin Memorial'\r\n\r\n },\r\n {\r\n mrn: '854942197',\r\n firstName: 'Jane',\r\n lastName: 'Roe',\r\n pcn: '97989847',\r\n mbi : janeMbi,\r\n ptId: janeId,\r\n patientEncounterId : janeId,\r\n facilityId: 0,\r\n facilityName: 'Austin Memorial',\r\n dateOfBirth: '01/01/1944',\r\n admitDate: '2/21/2024',\r\n dischargeDate: '02/23/2024',\r\n daysToDischarge : 0,\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider'\r\n },\r\n referringMdUserName: 'doctor.smith@hospnow.com',\r\n recentAdmits: 0,\r\n },\r\n {\r\n mrn: 'AE-187723-Q4',\r\n firstName: 'Jaylen',\r\n lastName: 'Watts',\r\n pcn: 'JM05531595',\r\n mbi : jayMbi,\r\n ptId: jayId,\r\n patientEncounterId : jayId,\r\n facilityId: 0,\r\n facilityName: 'Golden Palms Retirement and Health Center',\r\n dateOfBirth: '01/01/1951',\r\n admitDate: '1/9/2024',\r\n\r\n daysToDischarge : 4,\r\n primaryProviderContact : {\r\n email:'Eillen.Ward@hnihc.com',\r\n displayName: 'Eillen Ward',\r\n type: 'Assigned Provider'\r\n },\r\n referringMdUserName: 'Jack.Kefler@hnihc.com',\r\n recentAdmits: 0,\r\n },\r\n {\r\n mrn: '4001-Q4H1156',\r\n firstName: 'Abbigail',\r\n lastName: 'Larson',\r\n pcn: 'M059519',\r\n mbi : abbyMbi,\r\n ptId: abbyId,\r\n patientEncounterId : abbyId,\r\n facilityId: 0,\r\n facilityName: 'Midland Memorial Hospital',\r\n dateOfBirth: '01/01/1959',\r\n admitDate: '2/2/2024',\r\n daysToDischarge : 2,\r\n primaryProviderContact : {\r\n email:'Eillen.Ward@hnihc.com',\r\n displayName: 'Eillen Ward',\r\n type: 'Assigned Provider'\r\n },\r\n referringMdUserName: 'Jack.Kefler@hnihc.com',\r\n recentAdmits: 2,\r\n }\r\n]\r\n\r\n\r\n\r\nlet janeDx1: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'K59.09',\r\n codingSystem: 'ICD10CM',\r\n dxId: 445\r\n\r\n },\r\n shortDescription: 'Other constipation',\r\n riskAdjusted : false,\r\n hccCategory : ''\r\n}\r\n\r\n\r\nlet janeDx2: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'I50.9',\r\n codingSystem: 'ICD10CM',\r\n dxId: 446\r\n\r\n },\r\n shortDescription: 'Heart failure, unspecified',\r\n riskAdjusted : true,\r\n hccCategory : '85'\r\n}\r\nlet janeDx22: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'I48.0',\r\n codingSystem: 'ICD10CM',\r\n dxId: 446\r\n\r\n },\r\n shortDescription: 'Paroxysmal atrial fibrillation ',\r\n riskAdjusted : true,\r\n hccCategory : '96'\r\n}\r\n\r\n\r\nlet janeDx3: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: ' D69.49',\r\n codingSystem: 'ICD10CM',\r\n dxId: 447\r\n\r\n },\r\n shortDescription: 'Other primary thrombocytopenia',\r\n riskAdjusted : true,\r\n hccCategory : '48'\r\n}\r\n\r\nlet janeDx4: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'I10',\r\n codingSystem: 'ICD10CM',\r\n dxId: 448\r\n\r\n },\r\n shortDescription: 'Essential (primary) hypertension',\r\n riskAdjusted : false,\r\n hccCategory : ''\r\n}\r\n\r\nlet janeDx5: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'E55.9',\r\n codingSystem: 'ICD10CM',\r\n dxId: 448\r\n\r\n },\r\n shortDescription: 'Vitamin D deficiency, unspecified',\r\n riskAdjusted : false,\r\n hccCategory : ''\r\n}\r\n\r\nlet janeDx6: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'R94.6',\r\n codingSystem: 'ICD10CM',\r\n dxId: 448\r\n\r\n },\r\n shortDescription: 'Abnormal results of thyroid function studies',\r\n riskAdjusted : false,\r\n hccCategory : ''\r\n}\r\n\r\n\r\n\r\nlet johnDx1: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'R12',\r\n codingSystem: 'ICD10CM',\r\n dxId: 449\r\n\r\n },\r\n shortDescription: 'Heartburn',\r\n riskAdjusted : false,\r\n hccCategory : ''\r\n}\r\n\r\nlet johnDx2: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'R45.851',\r\n codingSystem: 'ICD10CM',\r\n dxId: 450\r\n\r\n },\r\n shortDescription: 'Suicidal ideations',\r\n riskAdjusted : false,\r\n hccCategory : ''\r\n}\r\n\r\nlet johnDx3: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'F33.9',\r\n codingSystem: 'ICD10CM',\r\n dxId: 451\r\n\r\n },\r\n shortDescription: 'Major depressive disorder, recurrent, unspecified',\r\n riskAdjusted : true,\r\n hccCategory : '59'\r\n}\r\n\r\n\r\nlet johnDx4: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'Z94.2',\r\n codingSystem: 'ICD10CM',\r\n dxId: 452\r\n\r\n },\r\n shortDescription: 'Lung transplant status',\r\n riskAdjusted : true,\r\n hccCategory : '186'\r\n}\r\n\r\nlet johnDx5: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'D84.9',\r\n codingSystem: 'ICD10CM',\r\n dxId: 453\r\n\r\n },\r\n shortDescription: 'Immunodeficiency, unspecified',\r\n riskAdjusted : true,\r\n hccCategory : '47'\r\n}\r\n\r\nlet johnDx6: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'I25.10',\r\n codingSystem: 'ICD10CM',\r\n dxId: 454\r\n\r\n },\r\n shortDescription: 'Atherosclerotic heart disease of native coronary artery without angina pectoris',\r\n riskAdjusted : false,\r\n hccCategory : ''\r\n}\r\n\r\n\r\nlet abbyDx1: PatientDiagnosis = {\r\n diagnosedBy: 'jules.hodge@hnihc.com',\r\n\r\n diagnosis: {\r\n diagnosisCodeValue: 'F02.80',\r\n codingSystem: 'ICD10CM',\r\n dxId: 455\r\n\r\n },\r\n shortDescription: 'Dementia In Other Diseases Classified Elsewhere, Unspecified Severity, Without Behavioral Disturbance, Psychotic Disturbance, Mood Disturbance, And Anxiety',\r\n riskAdjusted : true,\r\n hccCategory : '52'\r\n}\r\n\r\nlet testDocumentHpJane: PatientDocument = {\r\n name: 'Jane_Roe_HP_AustinMemorial.pdf',\r\n displayName : 'History And Physical',\r\n createdBy: 'Reuben W. Tovar, MD',\r\n createdDate: '2024-02-22T08:19:56.73',\r\n extension : 'pdf',\r\n path: 'eNotes',\r\n id : 'eNoteService'\r\n}\r\n\r\nlet testDocumentDcJane: PatientDocument = {\r\n name: 'Jane_Roe_DC_AustinMemorial.pdf',\r\n displayName : 'Discharge Summary',\r\n createdBy: 'Reuben W. Tovar, MD',\r\n createdDate: '2024-02-23T08:19:56.73',\r\n extension : 'pdf',\r\n path: 'eNotes',\r\n id : 'eNoteService'\r\n}\r\n\r\nlet testDocumentPnJane: PatientDocument = {\r\n name: 'Jane_Roe_PN_AustinMemorial.pdf',\r\n displayName : 'Progress Note',\r\n createdBy: 'Reuben W. Tovar, MD',\r\n createdDate: '2024-02-22T08:19:56.73',\r\n extension : 'pdf',\r\n path: 'eNotes',\r\n id : 'eNoteService'\r\n}\r\n\r\nlet testDocumentDcJohn: PatientDocument = {\r\n name: 'John_Doe_Hosp_DC.pdf',\r\n displayName : 'Discharge Summary',\r\n createdBy: 'Reuben W. Tovar, MD',\r\n createdDate: '2024-03-06T08:19:56.73',\r\n extension : 'pdf',\r\n path: 'eNotes',\r\n id : 'eNoteService'\r\n}\r\n\r\n\r\nlet testDocumentPnJohn: PatientDocument = {\r\n name: 'John_Doe_PN.pdf',\r\n displayName : 'Progress Note',\r\n createdBy: 'Reuben W. Tovar, MD',\r\n createdDate: '2024-03-03T08:19:56.73',\r\n extension : 'pdf',\r\n path: 'eNotes',\r\n id : 'eNoteService'\r\n}\r\n\r\n\r\nlet testDocumentHpJohn: PatientDocument = {\r\n name: 'John_Doe_HP.pdf',\r\n displayName : 'History And Physical',\r\n createdBy: 'Reuben W. Tovar, MD',\r\n createdDate: '2024-03-03T08:19:56.73',\r\n extension : 'pdf',\r\n path: 'eNotes',\r\n id : 'eNoteService'\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nlet testEncounterJane: Encounter = {\r\n encounterId: janeId,\r\n patientEncounterId : janeId,\r\n ptId: janeId,\r\n \r\n encounterStart: '02/21/2024',\r\n encounterEnd: '02/23/2024',\r\n dateOfBirth : '01/01/1944',\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n referringMD : {\r\n lastName: 'Smith',\r\n email:'Ryan.Smith@hnihc.com',\r\n displayName: 'Ryan Smith',\r\n type: 'Assigned Provider',\r\n },\r\n mrn: 'mrn',\r\n daysToDischarge : 0,\r\n mbi : janeMbi,\r\n facility: {\r\n facilityName: 'Austin Memorial',\r\n facilityId: 10000001,\r\n facilityProgramManager: {\r\n name: 'Jules Hodge',\r\n email: 'jules.hodge@hnihc.com'\r\n }\r\n },\r\n patientDiagnosisList: [janeDx1, janeDx2, janeDx22, janeDx3, janeDx4, janeDx5, janeDx6],\r\n patientDocuments: [testDocumentHpJane, testDocumentPnJane, testDocumentDcJane],\r\n patientChargeList: [],\r\n encounterInsurance: {\r\n companyNameFromFacility: 'Medicare'\r\n }\r\n}\r\n\r\nlet testEncounterJohn1: Encounter = {\r\n encounterId: johnId,\r\n patientId: johnId,\r\n encounterStart: '03/03/2024',\r\n encounterEnd: '03/06/2024',\r\n dateOfBirth : '01/01/1960',\r\n primaryProviderContact : {\r\n email:'Eillen.Ward@hnihc.com',\r\n displayName: 'Eileen Ward',\r\n type: 'Assigned Provider',\r\n lastName: 'Ward '\r\n },\r\n referringMD : {\r\n lastName: 'Smith',\r\n email:'Ryan.Smith@hnihc.com',\r\n displayName: 'Ryan Smith',\r\n type: 'Assigned Provider',\r\n },\r\n mrn: '4849216126',\r\n mbi : johnMbi,\r\n daysToDischarge : 0,\r\n facility: {\r\n facilityName: 'Austin Memorial',\r\n facilityId: 10000001,\r\n facilityProgramManager: {\r\n name: 'Jules Hodge',\r\n email: 'jules.hodge@hnihc.com'\r\n }\r\n },\r\n patientDiagnosisList: [johnDx1, johnDx2, johnDx3, johnDx4, johnDx5, johnDx6],\r\n patientChargeList: [],\r\n patientDocuments: [testDocumentDcJohn, testDocumentPnJohn, testDocumentHpJohn],\r\n encounterInsurance: {\r\n companyNameFromFacility: 'Medicare'\r\n }\r\n}\r\n\r\nlet testEncounterJohn2 : Encounter = {\r\n encounterId: 5567331,\r\n patientId: 5567331,\r\n encounterStart: '9/5/2021',\r\n encounterEnd: '9/6/2021',\r\n dateOfBirth : '01/01/1960',\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n referringMD : {\r\n lastName: 'Smith',\r\n email:'Ryan.Smith@hnihc.com',\r\n displayName: 'Ryan Smith',\r\n type: 'Assigned Provider',\r\n },\r\n mrn: 'mrn',\r\n mbi : johnMbi,\r\n daysToDischarge : 2,\r\n facility: {\r\n facilityName: 'Seton Health',\r\n facilityId: 10000001,\r\n facilityProgramManager: {\r\n name: 'Jules Hodge',\r\n email: 'jules.hodge@hnihc.com'\r\n }\r\n },\r\n patientDiagnosisList: [johnDx1, johnDx2, johnDx3, johnDx4, johnDx5],\r\n patientChargeList: [],\r\n patientDocuments: [testDocumentDcJohn],\r\n encounterInsurance: {\r\n companyNameFromFacility: 'Medicare'\r\n }\r\n}\r\n\r\n\r\nlet testEncounterJay : Encounter = {\r\n encounterId: jayId,\r\n patientId: jayId,\r\n encounterStart: '1/9/2024',\r\n encounterEnd: '1/17/2024',\r\n dateOfBirth : '01/01/1951',\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n referringMD : {\r\n lastName: 'Smith',\r\n email:'Ryan.Smith@hnihc.com',\r\n displayName: 'Ryan Smith',\r\n type: 'Assigned Provider',\r\n },\r\n mrn: 'AE-187723-Q4',\r\n mbi : jayMbi,\r\n daysToDischarge : 4,\r\n facility: {\r\n facilityName: 'Golden Palms Retirement and Health Center',\r\n facilityId: 10000001,\r\n facilityProgramManager: {\r\n name: 'Jules Hodge',\r\n email: 'jules.hodge@hnihc.com'\r\n }\r\n },\r\n patientDiagnosisList: [johnDx2, johnDx4],\r\n patientChargeList: [],\r\n patientDocuments: [],\r\n encounterInsurance: {\r\n companyNameFromFacility: 'Medicare'\r\n }\r\n}\r\n\r\n\r\nlet testEncounterAby : Encounter = {\r\n encounterId: abbyId,\r\n patientId: abbyId,\r\n encounterStart: '02/02/2024',\r\n dateOfBirth : '01/01/1959',\r\n primaryProviderContact : {\r\n email:'larry.david@hnihc.com',\r\n displayName: 'Larry David',\r\n type: 'Assigned Provider',\r\n lastName: 'David'\r\n },\r\n referringMD : {\r\n lastName: 'Smith',\r\n email:'Ryan.Smith@hnihc.com',\r\n displayName: 'Ryan Smith',\r\n type: 'Assigned Provider',\r\n },\r\n mrn: '4001-Q4H1156',\r\n mbi : abbyMbi,\r\n daysToDischarge : 2,\r\n facility: {\r\n facilityName: 'Midland Memorial Hospital',\r\n facilityId: 10000001,\r\n facilityProgramManager: {\r\n name: 'Jules Hodge',\r\n email: 'jules.hodge@hnihc.com'\r\n }\r\n },\r\n patientDiagnosisList: [abbyDx1, johnDx4],\r\n patientChargeList: [],\r\n patientDocuments: [],\r\n encounterInsurance: {\r\n companyNameFromFacility: 'Medicare'\r\n }\r\n}\r\n\r\nlet testEncounterAby2 : Encounter = {\r\n encounterId: abbyId,\r\n patientId: abbyId,\r\n encounterStart: '07/22/2021',\r\n encounterEnd: '07/29/2021',\r\n dateOfBirth : '01/01/1959',\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n referringMD : {\r\n lastName: 'Smith',\r\n email:'Ryan.Smith@hnihc.com',\r\n displayName: 'Ryan Smith',\r\n type: 'Assigned Provider',\r\n },\r\n mrn: '4001-Q4H1156',\r\n mbi : abbyMbi,\r\n daysToDischarge : 0,\r\n facility: {\r\n facilityName: 'Midland Memorial Hospital',\r\n facilityId: 10000001,\r\n facilityProgramManager: {\r\n name: 'Jules Hodge',\r\n email: 'jules.hodge@hnihc.com'\r\n }\r\n },\r\n patientDiagnosisList: [abbyDx1, johnDx4],\r\n patientChargeList: [],\r\n patientDocuments: [],\r\n encounterInsurance: {\r\n companyNameFromFacility: 'Medicare'\r\n }\r\n}\r\n\r\n\r\n\r\n\r\nlet samplePatientJane: Patient = {\r\n firstName: 'Jane',\r\n lastName: 'Roe',\r\n patientEncounterId : janeId,\r\n ptId: janeId,\r\n \r\n mrn: '854942197',\r\n pcn : 97989847,\r\n mbi : janeMbi,\r\n facilityId: 0,\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n facilityName: `Austin Memorial`,\r\n insuranceName: 'Medicare',\r\n dateOfBirth: ' 01/01/1944',\r\n dateOfAdmission: '2/5/2024',\r\n encounters: [testEncounterJane],\r\n patientDocuments: [testDocumentHpJane, testDocumentPnJane]\r\n}\r\n\r\nlet samplePatientJohn: Patient = {\r\n firstName: 'John',\r\n lastName: 'Doe',\r\n patientEncounterId : johnId,\r\n ptId: johnId,\r\n mrn: '4849216126',\r\n mbi : johnMbi,\r\n facilityId: 0,\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n facilityName: `Austin Memorial`,\r\n insuranceName: 'Medicare',\r\n dateOfBirth: '01/01/1960',\r\n dateOfAdmission: '2/5/2024',\r\n encounters: [testEncounterJohn1, testEncounterJohn2],\r\n patientDocuments: [testDocumentDcJohn]\r\n}\r\n\r\nlet samplePatientJaylen: Patient = {\r\n firstName: 'Jaylen',\r\n lastName: 'Watts',\r\n patientEncounterId : jayId,\r\n ptId: jayId,\r\n mrn: 'AE-187723-Q4',\r\n mbi : jayMbi,\r\n facilityId: 0,\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n facilityName: `Golden Palms Retirement and Health Center`,\r\n insuranceName: 'Medicare',\r\n dateOfBirth: '01/01/1960',\r\n dateOfAdmission: '2/5/2024',\r\n encounters: [testEncounterJay],\r\n patientDocuments: [testDocumentDcJohn]\r\n}\r\n\r\nlet samplePatientAbby: Patient = {\r\n firstName: 'Abbigail',\r\n lastName: 'Larson',\r\n patientEncounterId : abbyId,\r\n ptId: abbyId,\r\n \r\n mrn: 'AE-187723-Q4',\r\n mbi : abbyMbi,\r\n facilityId: 0,\r\n primaryProviderContact : {\r\n email:'Jack.Kefler@hnihc.com',\r\n displayName: 'Jack Kefler',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n facilityName: `Midland Memorial Hospital`,\r\n insuranceName: 'Medicare',\r\n dateOfBirth: '01/01/1959',\r\n dateOfAdmission: '2/2/2024',\r\n dateOfDischarge: '2/10/2024',\r\n encounters: [testEncounterAby, testEncounterAby2],\r\n patientDocuments: []\r\n}\r\n\r\n\r\n\r\nlet globalIsDemoMode: boolean = false;\r\n\r\nexport function getGlobalIsDemoMode(): boolean {\r\n return globalIsDemoMode;\r\n}\r\n \r\n\r\nconst emptyState: HNIContextState = {\r\n isLoading: false,\r\n isDemoMode: globalIsDemoMode,\r\n PatientPhysicians: [],\r\n NotificationCount: {\r\n isLoaded: false,\r\n isLoading: false,\r\n isErrored: false,\r\n UnreadCount: 0\r\n },\r\n Patients: {\r\n patientsByFacilityId: [],\r\n patientsByRefMDId: [],\r\n isLoading: false,\r\n facilityId: 0,\r\n refMdId: 0,\r\n fullPatients: []\r\n },\r\n PatientLocationStats: {\r\n isLoaded: false,\r\n isLoading: false,\r\n isErrored: false,\r\n error: '',\r\n patientFacilityCounts: []\r\n },\r\n DischargeDispositionStats: {\r\n isLoading: false,\r\n isErrored: false,\r\n isLoaded: false,\r\n error: '',\r\n dischargeDispositions: []\r\n },\r\n PhysicianAdmitsStats: {\r\n isLoading: false,\r\n isErrored: false,\r\n isLoaded: false,\r\n error: '',\r\n physicianAdmits: []\r\n },\r\n Messages: {\r\n\r\n isLoading: false,\r\n isLoaded: false,\r\n Errors: [],\r\n ReplyOptions: [\"Reply To \", \"Message Physician\", \"Message Physician Management\"],\r\n CurrentMessages: []\r\n },\r\n userPracticeCoordinatorProfile: {\r\n notFound: false,\r\n isLoaded: false,\r\n isLoading: false,\r\n isErrored: false,\r\n coordinatorProfile: {\r\n practiceId: 0\r\n }\r\n },\r\n userRefMdProfile: {\r\n notFound: false,\r\n isLoaded: false,\r\n isLoading: false,\r\n isErrored: false,\r\n refmdProfile: {\r\n referringMDId: null\r\n }\r\n },\r\n SystemSpecialties: {\r\n isLoading: false,\r\n isLoaded: false,\r\n VitalsReferenceSpecialties: {\r\n specialties: []\r\n }\r\n },\r\n PatientPhysiciansContacts : {\r\n isLoaded: false,\r\n isLoading: false,\r\n userPatientContacts: [],\r\n isErrored: false,\r\n error : ''\r\n },\r\n APIToken: null\r\n}\r\n\r\nconst unloadedState: HNIContextState = {\r\n isLoading: false,\r\n isDemoMode: globalIsDemoMode,\r\n Patients: {\r\n patientsByFacilityId: [],\r\n patientsByRefMDId: testPatientData,\r\n patientsByPracticeId : testPatientData,\r\n fullPatients: [samplePatientJohn, samplePatientJane, samplePatientJaylen, samplePatientAbby],\r\n isLoading: false,\r\n isLoaded: true,\r\n facilityId: 3,\r\n refMdId: 194\r\n },\r\n PatientPhysicians: [\r\n {\r\n formattedName: 'Jules Hodge',\r\n emailAddress: 'jules.hodge@hnihc.com'\r\n },\r\n {\r\n formattedName: 'Eillen Ward',\r\n emailAddress: 'Eillen.Ward@hnihc.com'\r\n },\r\n {\r\n formattedName: 'Arnold',\r\n emailAddress: 'arnold.dealejandro@hnihc.com'\r\n },\r\n {\r\n formattedName: 'Arnold',\r\n emailAddress: 'arnold.dealejandro@hnihc.com'\r\n },\r\n {\r\n formattedName: 'Frank Thomas',\r\n emailAddress: 'frank.thomas@hnihealthcare.com'\r\n },\r\n {\r\n formattedName: 'Larry David',\r\n emailAddress: 'larry.david@hnihealthcare.com'\r\n },\r\n {\r\n formattedName: 'Ryan Smith',\r\n emailAddress: 'Ryan.Smith@hnihc.com'\r\n },\r\n {\r\n formattedName: 'Jim Bones',\r\n emailAddress: 'bones.jim@hnihc.com'\r\n }\r\n ],\r\n DischargeLocationStats: {\r\n isLoading: false,\r\n isErrored: false,\r\n isLoaded: true,\r\n error: '',\r\n DischargeLocations: [{\r\n startFacilityId: 3,\r\n dischargeFacilityName: `St. Joseph's`,\r\n dischargeCount: 21\r\n }, {\r\n startFacilityId: 3,\r\n dischargeFacilityName: 'Herman Memorial',\r\n dischargeCount: 15\r\n }, {\r\n startFacilityId: 3,\r\n dischargeFacilityName: 'Seton Health',\r\n dischargeCount: 15\r\n }, {\r\n startFacilityId: 8,\r\n dischargeFacilityName: 'Sacred Heart',\r\n dischargeCount: 2\r\n }, {\r\n startFacilityId: 156,\r\n dischargeFacilityName: 'Sacred Heart',\r\n dischargeCount: 92\r\n }]\r\n },\r\n PatientLocationStats: {\r\n isLoading: false,\r\n isErrored: false,\r\n isLoaded: true,\r\n error: '',\r\n patientFacilityCounts: [\r\n {\r\n facilityName: 'Southpoint Terrace Nursing Rehab - Jacksonville',\r\n patientsCount: 4\r\n }, {\r\n facilityName: 'Hill Country Memorial Health System (HCMHS)',\r\n patientsCount: 7\r\n }, {\r\n facilityName: 'Fort Duncan Regional Medical Center',\r\n patientsCount: 12\r\n }\r\n ]\r\n },\r\n DischargeDispositionStats: {\r\n isLoading: false,\r\n isErrored: false,\r\n isLoaded: true,\r\n error: '',\r\n dischargeDispositions: [{\r\n typeDesciption: 'Skilled Nursing Facility (SNF)',\r\n patientCount: 9\r\n }, {\r\n typeDesciption: 'Home',\r\n patientCount: 25\r\n }, {\r\n typeDesciption: 'Acute Hospital',\r\n patientCount: 4\r\n }, {\r\n typeDesciption: 'Outpatient',\r\n patientCount: 2\r\n }]\r\n },\r\n PhysicianAdmitsStats: {\r\n isLoading: false,\r\n isErrored: false,\r\n isLoaded: true,\r\n error: '',\r\n physicianAdmits: [{\r\n totalAdmits: 1,\r\n AssignedMDUserName : 'Rebecca Cooper',\r\n year: 24,\r\n month: 11,\r\n referringMDId: '13000'\r\n },\r\n {\r\n totalAdmits: 7,\r\n month: 0,\r\n AssignedMDUserName : 'Welena Qazizada',\r\n year: 24,\r\n referringMDId: '13000'\r\n },\r\n {\r\n totalAdmits: 3,\r\n month: 1,\r\n AssignedMDUserName : 'Matthew Rossmann',\r\n year: 24,\r\n referringMDId: '13000'\r\n },\r\n {\r\n totalAdmits: 12,\r\n month: 2,\r\n AssignedMDUserName : 'Osman.Ismaeel',\r\n year: 24,\r\n referringMDId: '13000'\r\n },\r\n {\r\n totalAdmits: 3,\r\n month: 3,\r\n year: 24,\r\n AssignedMDUserName : 'William Yates',\r\n referringMDId: '13000'\r\n },\r\n {\r\n totalAdmits: 12,\r\n month: 4,\r\n year: 24,\r\n AssignedMDUserName : 'Rajiv Doddamani',\r\n referringMDId: '13000'\r\n }\r\n ]\r\n },\r\n\r\n\r\n Messages: {\r\n isLoading: false,\r\n isLoaded: true,\r\n FocusMessage: {\r\n isLoading: false,\r\n isErrored: false,\r\n messageId: 101,\r\n errorMessage: '',\r\n\r\n message: {\r\n subject: 'Jane dx codes',\r\n senderId: 'doctor.thomas@hnihealthcare.com',\r\n sendDate: '2/5/2024',\r\n createdDate: '2/05/2024',\r\n messageId: 101,\r\n message: 'We have updated the diagnosis bundle for your patient. Let me know if you have any questions.',\r\n parentMessageId: 0,\r\n receiverId: 'jules.hodge@hospnow.com',\r\n status: '0',\r\n description: 'user',\r\n patientLastName: 'Doe',\r\n ptId : janeId,\r\n documentFileName: '',\r\n messageReadDate: '11/05/2021',\r\n document: undefined\r\n }\r\n },\r\n Errors: [],\r\n ReplyOptions: [\"Reply To \", \"Message Physician\", \"Message Physician Management\"],\r\n CurrentMessages: [\r\n \r\n {\r\n subject: 'Jane dx codes',\r\n senderId: 'doctor.thomas@hnihealthcare.com',\r\n \r\n sendDate: '2/6/2024',\r\n createdDate: '2/06/2024',\r\n messageId: 101,\r\n message: 'We have updated the diagnosis bundle for your patient. Let me know if you have any questions.',\r\n parentMessageId: 0,\r\n receiverId: 'jules.hodge@hospnow.com',\r\n status: '0',\r\n patientId: '8268643',\r\n ptId : janeId,\r\n description: 'user',\r\n patientLastName: 'Thomas',\r\n patientFirstName : 'Bill',\r\n documentFileName: '',\r\n messageReadDate: '11/05/2021',\r\n document: undefined\r\n },\r\n {\r\n subject: 'Patient Admit: Roe, Jane',\r\n senderId: 'system',\r\n sendDate: '2/04/2024',\r\n createdDate: '2/04/2024',\r\n messageId: 100,\r\n message: 'Dear Dr. HodgeSupport. Thank you for the referral of the following patient: MIPSTEST, Jules at HNI Healthcare on 8/2/2021. Date of Birth: . Current diagnosis codes: Z20.828, E11.65. Assigned MD: Jules Hodge. Respectfully, HNI Healthcare. Phone (Ph: 956-440-6300) Fax (Fax: (888) 570-1735).',\r\n parentMessageId: 0,\r\n receiverId: 'jules.hodge@hospnow.com',\r\n status: '0',\r\n patientId: janeId,\r\n ptId : janeId,\r\n description: 'admit',\r\n patientLastName: 'Doe',\r\n patientFirstName : 'Jane',\r\n documentFileName: '',\r\n messageReadDate: '11/05/2021',\r\n document: undefined\r\n },\r\n {\r\n subject: 'Discharge Notification: Doe, John',\r\n senderId: 'system',\r\n sendDate: '02/13/2024',\r\n createdDate: '02/13/2024',\r\n messageId: 201,\r\n message: 'Dear Dr. HodgeSupport. Thank you for the referral of the following patient: Doe, John at HNI Healthcare on 8/2/2023. Date of Birth: . Current diagnosis codes: Z20.828, E11.65. Assigned MD: Jules Hodge. Respectfully, HNI Healthcare. Phone (Ph: 956-440-6300) Fax (Fax: (888) 570-1735).',\r\n parentMessageId: 0,\r\n receiverId: 'jules.hodge@hospnow.com',\r\n status: '0',\r\n ptId :johnId,\r\n patientId: johnId,\r\n description: 'discharge',\r\n patientLastName: 'Doe',\r\n patientFirstName : 'John',\r\n messageReadDate: '11/05/2021',\r\n documentFileName: '',\r\n document: undefined\r\n }\r\n ]\r\n },\r\n userRefMdProfile: {\r\n isLoaded: true,\r\n isErrored: false,\r\n isLoading: false,\r\n error: '',\r\n notFound: false,\r\n refmdProfile: {\r\n referringMDId: \"13000\",\r\n firstName: 'Frank',\r\n lastName: 'Thomas',\r\n phone: '555-409-2006',\r\n npi: '123456780',\r\n email: 'frank.thomas@hnihealtchare.com',\r\n notifyAdmits: true,\r\n notifyDischarges: false,\r\n specialties: [\r\n // {\r\n // specialtyId: '1',\r\n // description: 'Gerontology'\r\n //}, {\r\n // specialtyId: '2',\r\n // description: 'Space Psychologist'\r\n // }\r\n ]\r\n }\r\n },\r\n userPracticeCoordinatorProfile: {\r\n notFound: true,\r\n isLoaded: false,\r\n isErrored: false,\r\n coordinatorProfile: null\r\n },\r\n AllMessageTypes: [{\r\n messageTypeId: 1,\r\n description: 'a type'\r\n }],\r\n SystemSpecialties: {\r\n isLoading: false,\r\n isLoaded: true,\r\n VitalsReferenceSpecialties: {\r\n specialties: [{\r\n specialtyId: '1',\r\n description: 'Neurosurgery'\r\n }, {\r\n specialtyId: '2',\r\n description: 'Orthopedic Surgery'\r\n }, {\r\n specialtyId: '3',\r\n description: 'Vascular Surgery'\r\n }, {\r\n specialtyId: '4',\r\n description: 'Cardiology'\r\n }, {\r\n specialtyId: '5',\r\n description: 'Geriatric Psychiatry'\r\n }, {\r\n specialtyId: '6',\r\n description: 'Dietitian'\r\n }]\r\n }\r\n },\r\n\r\n NotificationCount: {\r\n isLoaded: false,\r\n isErrored: true,\r\n isLoading: false,\r\n UnreadCount: 0\r\n\r\n },\r\n\r\n PatientPhysiciansContacts : {\r\n isLoaded: false,\r\n isLoading: false,\r\n userPatientContacts: [{\r\n displayName: 'Dr. Jack Kefler',\r\n email: 'Jack.Kefler@hnihc.com',\r\n type: 'Assigned Provider',\r\n lastName: 'Kefler'\r\n },\r\n {\r\n displayName: 'Dr. Eillen Ward',\r\n email: 'Eillen.Ward@hnihc.com',\r\n type: 'Assigned Provider',\r\n lastName: 'Ward'\r\n },\r\n {\r\n displayName: 'Dr. Ryan Smith',\r\n email: 'Ryan.Smith@hnihc.com',\r\n type: 'Assigned Provider',\r\n lastName: 'Smith'\r\n },\r\n {\r\n displayName: 'Dr. Frank Thomas',\r\n email: 'frank.thomas@hnihealthcare.com',\r\n type: 'Assigned Provider',\r\n lastName: 'Thomas'\r\n },\r\n {\r\n displayName: 'Dr. Larry David',\r\n email: 'larry.david@hnihc.com',\r\n type: 'Assigned Provider',\r\n lastName: 'David'\r\n }],\r\n isErrored: false,\r\n error : ''\r\n\r\n },\r\n\r\n\r\n FocusPatient: {\r\n patientId: 12642976,\r\n patient: samplePatientJane,\r\n isLoading: false\r\n },\r\n};\r\n\r\n// Not sure if this is best location for data helper methods\r\nconst removeMessage = (message: Message, messageList: Message[]) => {\r\n if (message.status === 'ARCHIVED') {\r\n return messageList.filter(val => val.messageId !== message.messageId);\r\n }\r\n\r\n return messageList;\r\n}\r\n\r\nconst removeMessages = (deletedMessages: Message[], messageList: Message[]) => {\r\n let retList = messageList;\r\n for (let delMsg of deletedMessages) {\r\n retList = removeMessage(delMsg, retList)\r\n }\r\n\r\n return retList;\r\n}\r\n\r\n\r\nexport const reducer: Reducer = (state: HNIContextState | undefined, incomingAction: Action): HNIContextState => {\r\n if (state === undefined || incomingAction === undefined) {\r\n return emptyState;\r\n }\r\n\r\n const action = incomingAction as KnownAction;\r\n switch (action.type) {\r\n\r\n case \"REQUEST_PATIENTS_BY_FACILITYID\":\r\n return {\r\n ...state,\r\n Patients: {\r\n ...state.Patients,\r\n facilityId: action.facilityId,\r\n isLoading: true,\r\n },\r\n };\r\n case \"RECEIVE_PATIENTS_BY_FACILITYID\":\r\n return {\r\n ...state,\r\n Patients: {\r\n ...state.Patients,\r\n patientsByFacilityId: action.patientsByFacilityId,\r\n isLoading: false,\r\n },\r\n };\r\n break;\r\n case \"RECEIVED_FOCUS_MESSAGE\": {\r\n let newFocusMessage = action.Message;\r\n let tempCurMessages = state.Messages.CurrentMessages;\r\n\r\n return {\r\n ...state,\r\n\r\n Messages: {\r\n ...state.Messages,\r\n isLoading: false,\r\n CurrentMessages: addMessageIfMissing(newFocusMessage,tempCurMessages) ,\r\n FocusMessage: {\r\n isLoading: false,\r\n message: newFocusMessage,\r\n messageId: newFocusMessage.messageId,\r\n isErrored: false,\r\n errorMessage: ''\r\n }\r\n\r\n }\r\n }\r\n };\r\n break;\r\n case \"REQUEST_PATIENTS_BY_REFMD_ID\":\r\n return {\r\n ...state,\r\n Patients: {\r\n ...state.Patients,\r\n refMdId: action.refMdId,\r\n isLoading: true,\r\n isLoaded: false,\r\n patientsByRefMDId: []\r\n }\r\n };\r\n break;\r\n case \"REQUEST_PATIENTS_BY_PRACTICE_ID\":\r\n return {\r\n ...state,\r\n Patients: {\r\n ...state.Patients,\r\n refMdId: 0,\r\n isLoading: true,\r\n isLoaded: false,\r\n patientsByPracticeId: []\r\n }\r\n };\r\n break;\r\n case \"RECEIVE_PATIENTS_BY_REFMD_ID_ERROR\":\r\n\r\n return {\r\n ...state,\r\n Patients: {\r\n ...state.Patients,\r\n patientsByRefMDId: [],\r\n isLoading: false,\r\n isError: true,\r\n errorMessage: action.err\r\n },\r\n }\r\n break;\r\n case \"RECEIVE_PATIENTS_BY_REFMD_ID\":\r\n let patients = action.patientsByRefMDId;\r\n return {\r\n ...state,\r\n Patients: {\r\n ...state.Patients,\r\n patientsByRefMDId: action.patientsByRefMDId,\r\n fullPatients : action.patientsByRefMDId,\r\n isLoading: false,\r\n isLoaded: true\r\n }\r\n }\r\n break;\r\n\r\n case \"RECEIVE_PATIENTS_BY_PRACTICEID\":\r\n let patientsBypracticeId = action.patientsByPracticeId;\r\n return {\r\n ...state,\r\n Patients: {\r\n ...state.Patients,\r\n patientsByPracticeId: patientsBypracticeId,\r\n isLoading: false,\r\n isLoaded: true\r\n }\r\n }\r\n break;\r\n case \"REQUEST_PATIENT_BY_ID\":\r\n return {\r\n ...state,\r\n FocusPatient: {\r\n ...state.FocusPatient,\r\n isLoading: true\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_PATIENT_BY_ID\":\r\n let patientsState = state.Patients;\r\n let fullPatients = [...patientsState.fullPatients, action.patient];\r\n\r\n\r\n return {\r\n ...state,\r\n Patients: {\r\n ...patientsState,\r\n fullPatients: fullPatients\r\n },\r\n FocusPatient: {\r\n ...state.FocusPatient,\r\n isLoading: false,\r\n patient: action.patient\r\n }\r\n }\r\n break;\r\n case \"REQUEST_USER_REFMD_PROFILE\":\r\n return {\r\n ...state,\r\n isLoading: true,\r\n userRefMdProfile : {\r\n isLoading: true,\r\n isErrored: false,\r\n isLoaded: false,\r\n notFound: false,\r\n error:''\r\n }\r\n }\r\n break;\r\n\r\n case \"REQUEST_ADMIT_STATS\":\r\n let admitStatsMessage = state.PhysicianAdmitsStats;\r\n return {\r\n ...state,\r\n PhysicianAdmitsStats: {\r\n ...admitStatsMessage,\r\n isLoading: true,\r\n isLoaded: false,\r\n physicianAdmits: []\r\n }\r\n }\r\n break;\r\n case \"REQUEST_DISCHARGE_STATS_LOCATIONS\":\r\n let dischargeLocStats = state.DischargeDispositionStats;\r\n return {\r\n ...state,\r\n DischargeDispositionStats: {\r\n ...dischargeLocStats,\r\n isLoading: true,\r\n isLoaded: false,\r\n dischargeDispositions: []\r\n }\r\n }\r\n break;\r\n case \"REQUEST_NSOC_TYPE_STATS\":\r\n let dischargeDispState = state.DischargeDispositionStats;\r\n return {\r\n ...state,\r\n DischargeDispositionStats: {\r\n ...dischargeDispState,\r\n isLoading: true,\r\n isLoaded: false,\r\n dischargeDispositions: []\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_NSOC_STATS\":\r\n let dischargeLocations = state.DischargeDispositionStats;\r\n return {\r\n ...state,\r\n DischargeDispositionStats: {\r\n ...dischargeLocations,\r\n isLoading: false,\r\n isLoaded: true,\r\n isErrored: false,\r\n dischargeDispositions: action.dischargeDispositions\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_NSOC_STATS_ERROR\":\r\n let existingState = state.DischargeDispositionStats;\r\n return {\r\n ...state,\r\n DischargeDispositionStats: {\r\n ...existingState,\r\n isLoading: false,\r\n isErrored: true,\r\n isLoaded: false,\r\n error: action.errMessage,\r\n dischargeDispositions: []\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_USER_REFMD_PROFILE_NOT_FOUND\":\r\n let curRefProfileStateVal = state.userRefMdProfile;\r\n return {\r\n ...state,\r\n userRefMdProfile: {\r\n ...curRefProfileStateVal,\r\n refmdProfile: undefined,\r\n isLoaded: false,\r\n isErrored: false,\r\n isLoading: false,\r\n notFound: true\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_USER_REFMD_PROFILE_FAILED\":\r\n let curRefProfileStateValError = state.userRefMdProfile;\r\n return {\r\n ...state,\r\n userRefMdProfile: {\r\n ...curRefProfileStateValError,\r\n isErrored: true,\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_USER_REFMD_PROFILE\": {\r\n let curRefProfileState = state.userRefMdProfile;\r\n return {\r\n ...state,\r\n\r\n userRefMdProfile: {\r\n ...curRefProfileState,\r\n refmdProfile: action.profile,\r\n isLoaded: true,\r\n isErrored: false,\r\n isLoading: false,\r\n notFound: false\r\n }\r\n }\r\n };\r\n break;\r\n case \"REQUEST_USER_CARE_COORD_PROFILE\": {\r\n let curRefProfileStateRequest = state.userPracticeCoordinatorProfile;\r\n\r\n return {\r\n ...state,\r\n userPracticeCoordinatorProfile: {\r\n ...curRefProfileStateRequest,\r\n isLoaded: false,\r\n isErrored: false,\r\n isLoading: true,\r\n notFound: false\r\n }\r\n }\r\n };\r\n break;\r\n case \"RECEIVE_USER_CARE_COORD_PROFILE\": {\r\n let curRefProfileState = state.userPracticeCoordinatorProfile;\r\n\r\n return {\r\n ...state,\r\n userPracticeCoordinatorProfile: {\r\n ...curRefProfileState,\r\n coordinatorProfile: action.coordinatorProfile,\r\n isLoaded: true,\r\n isErrored: false,\r\n isLoading: false,\r\n notFound: false\r\n }\r\n }\r\n };\r\n break;\r\n case \"RECEIVE_USER_CARE_COORD_PROFILE_NOT_FOUND\" : {\r\n let curRefProfileState = state.userPracticeCoordinatorProfile;\r\n\r\n return {\r\n ...state,\r\n userPracticeCoordinatorProfile: {\r\n ...curRefProfileState,\r\n coordinatorProfile: undefined,\r\n isLoaded: false,\r\n isErrored: false,\r\n isLoading: false,\r\n notFound: true\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case \"RECEIVE_REF_MD_ADMIT_STATS\": {\r\n let admitStatsMessage = state.PhysicianAdmitsStats;\r\n return {\r\n ...state,\r\n PhysicianAdmitsStats: {\r\n ...admitStatsMessage,\r\n isLoading: false,\r\n isLoaded: true,\r\n physicianAdmits: action.admitStats\r\n }\r\n }\r\n };\r\n break;\r\n case \"REQUEST_PATIENT_STATS_LOCATIONS\": {\r\n let patientLocationStatsState = state.PatientLocationStats;\r\n return {\r\n ...state,\r\n PatientLocationStats: {\r\n ...patientLocationStatsState,\r\n isLoading: true,\r\n isLoaded: false,\r\n patientFacilityCounts: []\r\n }\r\n }\r\n }\r\n break;\r\n case \"REQUEST_ADMIT_STATS_ERROR\": {\r\n let admitStatsMessage = state.PhysicianAdmitsStats;\r\n return {\r\n ...state,\r\n PhysicianAdmitsStats: {\r\n ...admitStatsMessage,\r\n isLoading: false,\r\n isErrored: true,\r\n isLoaded: false,\r\n physicianAdmits: []\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case \"RECEIVE_DISCHARGE_STATS_LOCATIONS_ERROR\": {\r\n let dischargeLocStats = state.DischargeLocationStats;\r\n return {\r\n ...state,\r\n DischargeLocationStats: {\r\n ...dischargeLocStats,\r\n isLoading: false,\r\n isErrored: true,\r\n dischargeLocations: []\r\n }\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_DISCHARGE_STATS_LOCATIONS\": {\r\n let dischargeLocStats = state.DischargeLocationStats;\r\n return {\r\n ...state,\r\n DischargeLocationStats: {\r\n ...dischargeLocStats,\r\n isLoading: false,\r\n dischargeLocations: action.dischargeLocations\r\n }\r\n }\r\n }\r\n break;\r\n case \"REQUEST_PATIENTS_LOCATION_STATS\": {\r\n let patientLocStats = state.PatientLocationStats;\r\n return {\r\n ...state,\r\n PatientLocationStats: {\r\n ...patientLocStats,\r\n isLoading: true,\r\n isLoaded: false,\r\n isErrored: false\r\n }\r\n }\r\n }\r\n case \"RECEIVE_PATIENTS_LOCATION_STATS\": {\r\n let patientLocStats = state.PatientLocationStats;\r\n return {\r\n ...state,\r\n PatientLocationStats: {\r\n ...patientLocStats,\r\n isLoading: false,\r\n isLoaded: true,\r\n patientFacilityCounts: action.patientFacilityCounts\r\n }\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_ALL_SYSTEM_SPECIALTIES\": {\r\n let availSpecialties = action.AvailableSpecialties;\r\n return {\r\n ...state,\r\n SystemSpecialties: {\r\n isLoading: false,\r\n isLoaded: true,\r\n VitalsReferenceSpecialties: availSpecialties\r\n }\r\n }\r\n\r\n };\r\n break;\r\n case \"REQUEST_AVAILABLE_SPECIALTIES\": {\r\n\r\n let requestState = {\r\n ...state.SystemSpecialties,\r\n isLoading: true,\r\n isLoaded: false\r\n };\r\n return {\r\n ...state,\r\n SystemSpecialties: requestState\r\n }\r\n };\r\n break;\r\n case \"REQUEST_USER_PRACTICE_PHYSICIAN_CONTACTS\" : {\r\n return {\r\n ...state,\r\n PatientPhysiciansContacts : {\r\n isErrored: false,\r\n isLoaded: false,\r\n isLoading: true,\r\n error: '',\r\n userPatientContacts : []\r\n }\r\n }\r\n };\r\n break;\r\n case \"RECEIVE_USER_PRACTICE_PHYSICIAN_CONTACTS\" : {\r\n let userContacts = filterServiceDeskContacts(action.physicianContacts)\r\n return {\r\n ...state,\r\n PatientPhysiciansContacts : {\r\n isErrored: false,\r\n isLoaded: true,\r\n isLoading: false,\r\n error: '',\r\n userPatientContacts : userContacts\r\n }\r\n }\r\n };\r\n break;\r\n case \"REQUEST_CURRENT_MESSAGES\": {\r\n let sendState = state.Messages.SendMessageState;\r\n let requestState = {\r\n ...state.Messages,\r\n isLoading: true,\r\n isLoaded: false\r\n };\r\n return {\r\n ...state,\r\n Messages: requestState\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_CURRENT_MESSAGES\": {\r\n let messages = action.Messages;\r\n return {\r\n ...state,\r\n\r\n Messages: {\r\n ...state.Messages,\r\n isLoaded: true,\r\n isLoading: false,\r\n CurrentMessages: messages,\r\n }\r\n }\r\n };\r\n break;\r\n\r\n case \"REQUEST_FOCUS_MESSAGE_PARTIAL\": {\r\n return {\r\n ...state, \r\n Messages: {\r\n ...state.Messages,\r\n isLoaded: false,\r\n FocusMessage: {\r\n ...state.Messages.FocusMessage,\r\n isLoading: true,\r\n errorMessage: '',\r\n isErrored: false\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case \"REQUEST_FOCUS_MESSAGE\": {\r\n return {\r\n ...state,\r\n Messages: {\r\n ...state.Messages,\r\n FocusMessage: {\r\n ...state.Messages.FocusMessage,\r\n isLoading: true,\r\n errorMessage: '',\r\n isErrored: false\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_FOCUS_MESSAGE_ERROR\": {\r\n return {\r\n ...state,\r\n\r\n Messages: {\r\n ...state.Messages,\r\n FocusMessage: {\r\n ...state.Messages.FocusMessage,\r\n isLoading: false,\r\n errorMessage: action.errorMessage,\r\n isErrored: true\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n\r\n case \"ARCHIVED_MESSAGE_RESPONSE\": {\r\n let message = action.archived;\r\n let newMessagesState = removeMessage(message, state.Messages.CurrentMessages)\r\n return {\r\n ...state,\r\n\r\n Messages: {\r\n ...state.Messages,\r\n isLoaded: true,\r\n isLoading: false,\r\n CurrentMessages: newMessagesState\r\n }\r\n }\r\n };\r\n break;\r\n case \"ARCHIVED_MESSAGES_RESPONSE\": {\r\n let removedMessages = action.archived;\r\n let newMessagesState = removeMessages(removedMessages, state.Messages.CurrentMessages);\r\n return {\r\n ...state,\r\n Messages: {\r\n ...state.Messages,\r\n isLoaded: true,\r\n isLoading: false,\r\n CurrentMessages: newMessagesState,\r\n\r\n }\r\n }\r\n };\r\n break;\r\n case \"RECEIVED_MESSAGE_REPLY_RESPONSE\": {\r\n let newPersistedMessageReply = action.message;\r\n let currentMessages = [...state.Messages.CurrentMessages, newPersistedMessageReply];\r\n\r\n return {\r\n ...state,\r\n Messages: {\r\n ...state.Messages,\r\n isLoaded: true,\r\n isLoading: false,\r\n CurrentMessages: currentMessages,\r\n SendMessageState: {\r\n message: newPersistedMessageReply,\r\n isSent: true,\r\n isErrored: false,\r\n error: ''\r\n }\r\n }\r\n }\r\n };\r\n break;\r\n case \"CLEAR_SEND_MESSAGE_RESPONSE\": {\r\n return {\r\n ...state,\r\n Messages: {\r\n ...state.Messages,\r\n Errors: [],\r\n SendMessageState: {\r\n message: null,\r\n isSent: false,\r\n isErrored: false,\r\n error: ''\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case \"RECEIVED_NEW_MESSAGE_SEND_RESPONSE\": {\r\n let newPersistedMessage = action.message;\r\n let currentMessagesNewItem = [...state.Messages.CurrentMessages, newPersistedMessage];\r\n return {\r\n ...state,\r\n Messages: {\r\n ...state.Messages,\r\n CurrentMessages :currentMessagesNewItem,\r\n isLoaded: true,\r\n isLoading: false,\r\n failedLoading: false,\r\n\r\n SendMessageState: {\r\n message: action.message,\r\n isSent: true,\r\n isErrored: false,\r\n error: ''\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case \"RECEIVED_NEW_MESSAGE_SEND_RESPONSE_ERROR\": {\r\n let sendMessageState = state.Messages.SendMessageState;\r\n return {\r\n ...state,\r\n Messages: {\r\n ...state.Messages,\r\n isLoaded: true,\r\n isLoading: false,\r\n\r\n SendMessageState: {\r\n ...sendMessageState,\r\n isSent: false,\r\n isErrored: true,\r\n error: action.ErrorMessage\r\n }\r\n }\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_CURRENT_MESSAGES_ERROR\": {\r\n let newError: MessageStateError = {\r\n messageId: -1,\r\n error: action.ErrorMessage\r\n }\r\n let curErrors = [...state.Messages.Errors, newError]\r\n return {\r\n ...state,\r\n Messages: {\r\n ...state.Messages,\r\n isLoaded: false,\r\n isLoading: false,\r\n failedLoading: true,\r\n Errors: curErrors\r\n }\r\n }\r\n }\r\n break;\r\n case \"ARCHIVE_MESSAGE_ERROR\": {\r\n let id = action.messageId;\r\n let err = action.errMessage;\r\n\r\n\r\n let newError: MessageStateError = {\r\n messageId: id,\r\n error: err\r\n }\r\n\r\n let newErrors = [...state.Messages.Errors, newError];\r\n\r\n return {\r\n ...state,\r\n Messages: {\r\n ...state.Messages,\r\n isLoaded: true,\r\n isLoading: false,\r\n Errors: newErrors\r\n }\r\n }\r\n }; break;\r\n\r\n case \"RECEIVE_NOTIFICATION_UNREAD_COUNT_ERROR\": {\r\n return {\r\n ...state,\r\n NotificationCount: {\r\n ...state.NotificationCount,\r\n isLoaded: false,\r\n isErrored: true,\r\n isLoading: false,\r\n UnreadCount: 0\r\n\r\n }\r\n }\r\n } break;\r\n\r\n case \"RECEIVE_NOTIFICATION_UNREAD_COUNT\": {\r\n return {\r\n ...state,\r\n NotificationCount: {\r\n ...state.NotificationCount,\r\n isLoaded: true,\r\n isErrored: false,\r\n isLoading: false,\r\n UnreadCount: action.countStatus.unreadCount\r\n\r\n }\r\n }\r\n }\r\n break;\r\n case \"REQUEST_NOTIFICATION_UNREAD_COUNT\": {\r\n return {\r\n ...state,\r\n NotificationCount: {\r\n ...state.NotificationCount,\r\n isLoaded: false,\r\n isLoading: true,\r\n UnreadCount: 0\r\n }\r\n }\r\n }\r\n break;\r\n case \"UPDATE_API_HOST\": {\r\n return {\r\n ...state,\r\n apiHost: action.apiHost\r\n }\r\n }\r\n break;\r\n case \"RECEIVE_TOKEN_RESPONSE\": {\r\n return {\r\n ...state,\r\n APIToken: action.apiToken\r\n }\r\n }\r\n }\r\n\r\n return state;\r\n};\r\n\r\n","import * as HNIContext from './APIStore';;\r\nimport * as Counter from './Counter';\r\n\r\n\r\n// The top-level state object\r\nexport interface ApplicationState {\r\n counter: Counter.CounterState | undefined;\r\n vitalsContext: HNIContext.HNIContextState | undefined;\r\n oidc : HNIContext.OIDC\r\n}\r\n\r\n// Whenever an action is dispatched, Redux will update each top-level application state property using\r\n// the reducer with the matching name. It's important that the names match exactly, and that the reducer\r\n// acts on the corresponding ApplicationState property type.\r\nexport const reducers = {\r\n vitalsContext: HNIContext.reducer\r\n};\r\n\r\n// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are\r\n// correctly typed to match your store.\r\nexport interface AppThunkAction {\r\n (dispatch: (action: TAction) => void, getState: () => ApplicationState): void;\r\n};","const clientId = \"57d78c7b-0c9f-416e-8c5a-0ac66f04cf48\"; //GUID Client Application ID\r\n//const clientId = \"5ba09613-bfc9-4988-93b4-90999978e29d\"; // this is the application id for the vitalsmd-api\r\nconst tenantId = \"6aa88db0-b38c-43a9-83a7-18c2294002e5\"; //GUID Azure Tenant ID\r\nconst resourceId = \"api://5ba09613-bfc9-4988-93b4-90999978e29d\"; //GUID API Application ID\r\nconst authority = `https://login.microsoftonline.com/${tenantId}`;\r\nconst redirect_uri = `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : \"\"}`;\r\n\r\nexport const msalConfig = {\r\n auth: {\r\n clientId: clientId,\r\n authority: authority,\r\n redirectUri: redirect_uri,\r\n },\r\n cache: {\r\n cacheLocation: \"sessionStorage\", // This configures where your cache will be stored\r\n storeAuthStateInCookie: false, // Set this to \"true\" if you are having issues on IE11 or Edge\r\n }\r\n};\r\n\r\n// Add scopes here for ID token to be used at Microsoft identity platform endpoints.\r\nexport const loginRequest = {\r\n //scopes: [`${msalConfig.auth.clientId}/.default`] // this scope might be necessary for the api\r\n //scopes: [\"User.Read\"]\r\n scopes: [\"api://5ba09613-bfc9-4988-93b4-90999978e29d/VitalsMD_Data_Read\"]\r\n};\r\n\r\n// Add the endpoints here for Microsoft Graph API services you'd like to use.\r\nexport const graphConfig = {\r\n graphMeEndpoint: \"https://graph.microsoft.com\"\r\n};","import { React, useState } from \"react\";\r\nimport { useMsal } from \"@azure/msal-react\";\r\nimport { loginRequest } from \"./authConfig\";\r\n\r\nconst tokenExpired = (token) => {\r\n // Placeholder for token expiration logic via expiresOn field\r\n return false;\r\n}\r\nfunction RequestAccessToken() {\r\n\r\n const { instance, accounts, inProgress } = useMsal();\r\n const [accessToken, setAccessToken] = useState(null);\r\n\r\n const name = accounts[0] && accounts[0].name;\r\n\r\n\r\n const request = {\r\n ...loginRequest,\r\n account: accounts[0]\r\n };\r\n\r\n if(accessToken && !tokenExpired(accessToken)) {\r\n return Promise.resolve(accessToken); \r\n }\r\n\r\n // Silently acquires an access token which is then attached to a request for Microsoft Graph data\r\n\r\n return instance.acquireTokenSilent(request).then((response) => {\r\n\r\n setAccessToken(response);\r\n\r\n console.log(\"returning token\");\r\n //console.log(response);\r\n return accessToken;\r\n }).catch((e) => {\r\n instance.acquireTokenPopup(request).then((response) => {\r\n setAccessToken(response.accessToken);\r\n\r\n console.log(\"returning token after failure\");\r\n //console.log(accessToken);\r\n return accessToken;\r\n });\r\n });\r\n\r\n}\r\nexport default RequestAccessToken;","import * as APIStore from \"../../store/APIStore\";\r\n\r\n\r\nexport const shouldTryRefMDProfile = (userRefMDProfile: APIStore.RefMDProfileState) => {\r\n\r\n if (!userRefMDProfile) {\r\n return true;\r\n }\r\n\r\n let { isLoaded, notFound, isErrored, isLoading } = userRefMDProfile;\r\n\r\n if(isLoaded || isLoading || isErrored || notFound) {\r\n return false;\r\n }\r\n\r\n return true;\r\n}\r\n\r\nexport const shouldTryCareCoordinatorProfile = (userPracticeCoordinatorProfile: APIStore.PracticeCoordinatorState) => {\r\n\r\n if (!userPracticeCoordinatorProfile) {\r\n return true;\r\n }\r\n\r\n let { isLoaded, notFound, isErrored, isLoading } = userPracticeCoordinatorProfile;\r\n\r\n if(isLoaded || isLoading || isErrored || notFound) {\r\n return false;\r\n }\r\n\r\n return true;\r\n}\r\n\r\n\r\n\r\nexport const refMDLoaded = (userRefMDProfile: APIStore.RefMDProfileState) => {\r\n\r\n if (!userRefMDProfile) {\r\n return false;\r\n }\r\n\r\n let { isLoaded, notFound } = userRefMDProfile;\r\n\r\n if(isLoaded) {\r\n return true;\r\n }\r\n\r\n if (!isLoaded || !notFound) {\r\n return false;\r\n }\r\n\r\n return true\r\n}\r\n\r\nexport const practiceCoordinatorLoaded = (userPracticeCoordinatorProfile: APIStore.PracticeCoordinatorState) => {\r\n\r\n if (!userPracticeCoordinatorProfile) {\r\n return false;\r\n }\r\n\r\n let { isLoaded, notFound } = userPracticeCoordinatorProfile;\r\n\r\n if(isLoaded) {\r\n return true;\r\n }\r\n\r\n if (!isLoaded) {\r\n return false;\r\n }\r\n\r\n if (!isLoaded || !notFound) {\r\n return false;\r\n }\r\n\r\n return true\r\n}","import React, { useState, useEffect, useRef, Fragment } from \"react\";\r\nimport { Line } from \"react-chartjs-2\";\r\nimport { Box, Grid, Paper, Slide } from '@material-ui/core';\r\nimport MUIDataTable from \"mui-datatables\";\r\n\r\nimport {\r\n Chart as ChartJS,\r\n CategoryScale,\r\n LinearScale,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend, Filler\r\n} from 'chart.js';\r\nimport { connect } from \"react-redux\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport RequestAccessToken from '../../util/authService';\r\nimport BarChartIcon from '@material-ui/icons/BarChart';\r\nimport { refMDLoaded, practiceCoordinatorLoaded, shouldTryRefMDProfile, shouldTryCareCoordinatorProfile } from '../common/ProfileHelper'\r\n\r\ntype AcutePatientsByMonthProps = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators;\r\n\r\nconst styles = gridtheme => ({\r\n root: {\r\n flexGrow: 1,\r\n },\r\n paper: {\r\n padding: theme.spacing.unit * 2,\r\n textAlign: 'center',\r\n color: theme.palette.text.secondary,\r\n },\r\n});\r\n\r\nconst AcutePatientsByMonth = (props: AcutePatientsByMonthProps) => {\r\n\r\n let {\r\n PhysicianAdmitsStats,\r\n requestVitalsMdProfile,\r\n userPracticeCoordinatorProfile,\r\n userRefMdProfile,\r\n APIToken,\r\n requestCurrentUserCareCoordinatorProfile,\r\n requestAdmitStatsForPractice,\r\n requestAdmitStatsForProvider,\r\n requestAdmitStatsForPracticeByTag,\r\n receiveTokenResponse } = props;\r\n\r\n let [tokenState, setTokenState] = useState();\r\n let PhysicianAdmits = {};\r\n\r\n if (PhysicianAdmitsStats) {\r\n PhysicianAdmits = PhysicianAdmitsStats;\r\n }\r\n\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n receiveTokenResponse(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (APIToken && !tokenState?.accessToken) {\r\n setTokenState(APIToken);\r\n }\r\n\r\n }, [APIToken, tokenState])\r\n\r\n useEffect(() => {\r\n if (shouldTryRefMDProfile(userRefMdProfile) && tokenState?.accessToken && userPracticeCoordinatorProfile.notFound) {\r\n requestVitalsMdProfile(tokenState.accessToken);\r\n }\r\n\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile])\r\n\r\n useEffect(() => {\r\n if (shouldTryCareCoordinatorProfile(userPracticeCoordinatorProfile) && tokenState?.accessToken) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken && !PhysicianAdmitsStats.isLoaded && !PhysicianAdmitsStats.isLoading) {\r\n requestAdmitStatsForProvider(tokenState.accessToken);\r\n }\r\n\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n\r\n if (!PhysicianAdmitsStats || PhysicianAdmitsStats.isLoading || !PhysicianAdmitsStats.isLoaded) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )\r\n }\r\n\r\n if (PhysicianAdmitsStats.isErrored) {\r\n return (

Error Loading

)\r\n }\r\n\r\n ChartJS.register(\r\n CategoryScale,\r\n LinearScale,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend, Filler\r\n );\r\n const options = {\r\n responsive: true,\r\n plugins: {\r\n legend: {\r\n position: \"top\" as const,\r\n },\r\n title: {\r\n display: true,\r\n text: \"All Patients\",\r\n },\r\n },\r\n };\r\n\r\n let width: number, height: number, gradient: number;\r\n function getBlueGradient(ctx: any, chartArea: any) {\r\n const chartWidth = chartArea.right - chartArea.left;\r\n const chartHeight = chartArea.bottom - chartArea.top;\r\n if (!gradient || width !== chartWidth || height !== chartHeight) {\r\n // Create the gradient because this is either the first render\r\n // or the size of the chart has changed\r\n width = chartWidth;\r\n height = chartHeight;\r\n gradient = ctx.createLinearGradient(\r\n 0,\r\n chartArea.bottom,\r\n 0,\r\n chartArea.top\r\n );\r\n\r\n gradient.addColorStop(0, \"rgba(82, 189, 228, 0.05)\");\r\n gradient.addColorStop(0.5, \"rgba(82, 189, 228, 0.1)\");\r\n gradient.addColorStop(1, \"rgba(82, 189, 228, 0.2)\");\r\n }\r\n\r\n return gradient;\r\n }\r\n\r\n const monthNames = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\",\r\n \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"\r\n ];\r\n\r\n\r\n let labels = PhysicianAdmitsStats.physicianAdmits.map(val => `${monthNames[val.month - 1]}/${val.year}`);\r\n let values = PhysicianAdmitsStats.physicianAdmits.map(val => {\r\n return val.totalAdmits;\r\n });\r\n\r\n\r\n const data = {\r\n labels,\r\n datasets: [\r\n {\r\n label: \"Admits\",\r\n data: values,\r\n borderColor: \"rgba(82, 189, 228, 1)\",\r\n backgroundColor: function (context) {\r\n const chart = context.chart;\r\n const { ctx, chartArea } = chart;\r\n\r\n if (!chartArea) {\r\n // This case happens on initial chart load\r\n return;\r\n }\r\n return getBlueGradient(ctx, chartArea);\r\n },\r\n\r\n fill: true,\r\n },\r\n ],\r\n };\r\n const tableColumns = [{\r\n name: \"Month\"\r\n }, {\r\n name: \"Physician\"\r\n }, {\r\n name: \"Admits\"\r\n }]\r\n\r\n const gridoptions = {\r\n elevation: 0,\r\n filter: true,\r\n viewColumns: false,\r\n selectableRows: false,\r\n\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n\r\n \r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(AcutePatientsByMonth as any);\r\n","import React, { useEffect, useState } from 'react';\r\nimport { Slide, Grid } from \"@material-ui/core\";\r\nimport { Bar } from \"react-chartjs-2\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport {\r\n Chart as ChartJS,\r\n CategoryScale,\r\n LinearScale,\r\n BarElement,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend,\r\n ArcElement\r\n} from 'chart.js';\r\nimport RequestAccessToken from \"../../util/authService\";\r\nimport BarChartIcon from '@material-ui/icons/BarChart';\r\nimport { refMDLoaded, practiceCoordinatorLoaded, shouldTryRefMDProfile, shouldTryCareCoordinatorProfile } from '../common/ProfileHelper'\r\nimport { debug } from 'console';\r\n\r\n\r\n\r\ntype PatientFacilitiesStatsProps = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators;\r\n\r\n\r\nconst PatientFacilities = (props: PatientFacilitiesStatsProps) => {\r\n let {\r\n PatientLocationStats, requestPatientLocationStatsForProvider,\r\n requestVitalsMdProfile,\r\n receiveTokenResponse,\r\n userPracticeCoordinatorProfile,\r\n userRefMdProfile,\r\n APIToken,\r\n requestCurrentUserCareCoordinatorProfile,\r\n requestPatientLocationStatsForPractice,\r\n requestPatientLocationStatsByTag } = props;\r\n\r\n let [tokenState, setTokenState] = useState();\r\n\r\n ChartJS.register(\r\n CategoryScale,\r\n LinearScale,\r\n BarElement,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend,\r\n ArcElement\r\n );\r\n\r\n const options = {\r\n indexAxis: 'y',\r\n responsive: true,\r\n\r\n plugins: {\r\n legend: {\r\n display: false\r\n },\r\n title: {\r\n display: true,\r\n text: 'Top 10 Admitting Facilities'\r\n }\r\n },\r\n };\r\n\r\n let PatientFacilityCounts: APIStore.PatientFacility[] = [];\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n receiveTokenResponse(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (APIToken && !tokenState?.accessToken) {\r\n setTokenState(APIToken);\r\n }\r\n\r\n }, [APIToken, tokenState])\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken && !PatientLocationStats.isLoaded && !PatientLocationStats.isLoading) {\r\n if (refMDLoaded(userRefMdProfile)) {\r\n requestPatientLocationStatsForProvider(tokenState.accessToken)\r\n }\r\n }\r\n }, [tokenState, userRefMdProfile]);\r\n\r\n useEffect(() => {\r\n if (practiceCoordinatorLoaded(userPracticeCoordinatorProfile) && tokenState?.accessToken) {\r\n if (userPracticeCoordinatorProfile.coordinatorProfile.defaultPractice.tagDescription) {\r\n requestPatientLocationStatsForProvider(tokenState.accessToken);\r\n } else {\r\n requestPatientLocationStatsForProvider(tokenState.accessToken)\r\n }\r\n }\r\n\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n\r\n useEffect(() => {\r\n if (shouldTryCareCoordinatorProfile(userPracticeCoordinatorProfile) && tokenState?.accessToken) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState?.accessToken);\r\n }\r\n }, [tokenState, userRefMdProfile]);\r\n\r\n\r\n\r\n if (PatientLocationStats.isErrored) {\r\n return (

Error Loading

)\r\n }\r\n\r\n if (!PatientFacilityCounts || !PatientLocationStats.isLoaded) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n )\r\n }\r\n\r\n if (PatientLocationStats) {\r\n PatientFacilityCounts = PatientLocationStats.patientFacilityCounts\r\n }\r\n\r\n let labels = PatientFacilityCounts.map(val => val.facilityName).slice(0, 10);\r\n let values = PatientFacilityCounts.map(val => {\r\n return val.patientsCount;\r\n }).slice(0, 10);\r\n\r\n const abrLookup = [\r\n ['System', 'Sys.'],\r\n ['Southwest', 'S.W.'],\r\n ['Northwest', 'N.W.'],\r\n ['Memorial', 'MEML.'],\r\n ['Fort', 'FRT.'],\r\n ['Terrace', 'TCE.'],\r\n ['Regional', 'RGNL.'],\r\n ['Baptist', 'BAPT.']\r\n ]\r\n\r\n const truncateFacilityName = (facilityName: string) => {\r\n let ret: string = facilityName;\r\n if(!facilityName) {\r\n \r\n return 'n/a';\r\n }\r\n const mnPtrn = /\\([A-Z]+\\)/;\r\n for (let abbrPair of abrLookup) {\r\n ret = ret.replaceAll(abbrPair[0], abbrPair[1])\r\n }\r\n\r\n let mnSearch = ret.match(mnPtrn);\r\n if (!mnSearch) {\r\n return `${ret.substring(0, 35)}`\r\n }\r\n\r\n return `${ret.substring(0, 25)} ${mnSearch[0]}`\r\n }\r\n\r\n labels = labels.map(val => truncateFacilityName(val))\r\n\r\n const data = {\r\n labels,\r\n scaleShowValues: true,\r\n responsive: false,\r\n tooltips: {\r\n callbacks: {\r\n label: function (tooltipItem) {\r\n return \"$\" + Number(tooltipItem.yLabel);\r\n }\r\n }\r\n },\r\n scales: {\r\n yAxes: [{\r\n ticks: {\r\n autoSkip: false\r\n }\r\n }],\r\n xAxes: [{\r\n ticks: {\r\n autoSkip: false\r\n }\r\n }]\r\n },\r\n datasets: [\r\n {\r\n label: \"Patients\",\r\n data: values,\r\n backgroundColor: [\r\n 'rgba(82, 189, 228, 0.2)',\r\n 'rgba(48, 82, 98, 0.2)',\r\n 'rgba(165, 209, 229, 0.2)',\r\n 'rgba(84, 144, 174, 0.2)',\r\n 'rgba(71, 91, 100, 0.2)',\r\n 'rgba(141, 206, 233, 0.2)',\r\n 'rgba(125, 151, 158, 0.2)'\r\n ],\r\n borderColor: [\r\n 'rgb(82, 189, 228)',\r\n 'rgb(48, 82, 98)',\r\n 'rgb(165, 209, 229)',\r\n 'rgb(84, 144, 174)',\r\n 'rgb(71, 91, 100)',\r\n 'rgb(141, 206, 233)',\r\n 'rgb(125, 151, 158)'\r\n ],\r\n hoverOffset: 4,\r\n borderWidth: 2\r\n },\r\n ],\r\n };\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n )\r\n}\r\n\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(PatientFacilities as any);","import React, { useEffect, useState } from 'react';\r\nimport { Slide, Grid } from \"@material-ui/core\";\r\nimport { Bar } from \"react-chartjs-2\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport {\r\n Chart as ChartJS,\r\n CategoryScale,\r\n LinearScale,\r\n BarElement,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend,\r\n ArcElement\r\n} from 'chart.js';\r\nimport RequestAccessToken from \"../../util/authService\";\r\nimport BarChartIcon from '@material-ui/icons/BarChart';\r\nimport { refMDLoaded, practiceCoordinatorLoaded, shouldTryRefMDProfile, shouldTryCareCoordinatorProfile } from '../common/ProfileHelper'\r\n\r\n\r\ntype NextSiteOfCareStatsProps = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators;\r\n\r\nconst DischargeDispositionType = (props: NextSiteOfCareStatsProps) => {\r\n let {\r\n DischargeDispositionStats,\r\n requestDischargeDispositionStatsForProvider,\r\n requestDischargeDispositionStatsForPractice,\r\n requestDischargeDispositionStatsForByTag,\r\n requestCurrentUserCareCoordinatorProfile,\r\n userRefMdProfile,\r\n requestVitalsMdProfile,\r\n userPracticeCoordinatorProfile,\r\n receiveTokenResponse,\r\n APIToken } = props;\r\n\r\n let [tokenState, setTokenState] = useState();\r\n\r\n ChartJS.register(\r\n CategoryScale,\r\n LinearScale,\r\n BarElement,\r\n PointElement,\r\n LineElement,\r\n Title,\r\n Tooltip,\r\n Legend,\r\n ArcElement\r\n );\r\n\r\n const options = {\r\n indexAxis: 'y',\r\n responsive: true,\r\n plugins: {\r\n legend: {\r\n display: false\r\n },\r\n title: {\r\n display: true,\r\n text: 'Next Sites of Care'\r\n },\r\n }\r\n };\r\n\r\n let DischargeDispositions: APIStore.DischargeDispositionStatistics[] = [];\r\n\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n receiveTokenResponse(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (APIToken && !tokenState?.accessToken) {\r\n setTokenState(APIToken);\r\n }\r\n\r\n }, [APIToken, tokenState])\r\n\r\n useEffect(() => {\r\n if (shouldTryRefMDProfile(userRefMdProfile) && tokenState?.accessToken && userPracticeCoordinatorProfile.notFound) {\r\n requestVitalsMdProfile(tokenState.accessToken);\r\n }\r\n\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile])\r\n\r\n useEffect(() => {\r\n if (shouldTryCareCoordinatorProfile(userPracticeCoordinatorProfile) && tokenState?.accessToken) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n useEffect(() => {\r\n if ((refMDLoaded(userRefMdProfile) && tokenState?.accessToken)) {\r\n requestDischargeDispositionStatsForProvider(tokenState.accessToken)\r\n }\r\n\r\n }, [tokenState, userRefMdProfile]);\r\n\r\n useEffect(() => {\r\n if (!DischargeDispositionStats.isLoaded && !DischargeDispositionStats.isLoading && tokenState?.accessToken) {\r\n if (practiceCoordinatorLoaded(userPracticeCoordinatorProfile)) {\r\n requestDischargeDispositionStatsForProvider(tokenState.accessToken)\r\n }\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile, DischargeDispositionStats]);\r\n\r\n\r\n if (DischargeDispositionStats.isErrored) {\r\n return (

Error Loading

)\r\n }\r\n\r\n if (DischargeDispositionStats.isLoading || !DischargeDispositionStats.isLoaded) {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n )\r\n }\r\n\r\n if (DischargeDispositionStats) {\r\n DischargeDispositions = DischargeDispositionStats.dischargeDispositions;\r\n }\r\n\r\n let labels = DischargeDispositions.map(val => val.typeDesciption);\r\n let values = DischargeDispositions.map(val => {\r\n return val.patientCount;\r\n });\r\n\r\n const data = {\r\n labels,\r\n datasets: [\r\n {\r\n label: \"Count\",\r\n data: values,\r\n backgroundColor: [\r\n 'rgba(82, 189, 228, 0.2)',\r\n 'rgba(48, 82, 98, 0.2)',\r\n 'rgba(165, 209, 229, 0.2)',\r\n 'rgba(84, 144, 174, 0.2)',\r\n 'rgba(71, 91, 100, 0.2)',\r\n 'rgba(141, 206, 233, 0.2)',\r\n 'rgba(125, 151, 158, 0.2)'\r\n ],\r\n borderColor: [\r\n 'rgb(82, 189, 228)',\r\n 'rgb(48, 82, 98)',\r\n 'rgb(165, 209, 229)',\r\n 'rgb(84, 144, 174)',\r\n 'rgb(71, 91, 100)',\r\n 'rgb(141, 206, 233)',\r\n 'rgb(125, 151, 158)'\r\n ],\r\n hoverOffset: 4,\r\n borderWidth: 2\r\n },\r\n ],\r\n };\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n )\r\n}\r\n\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(DischargeDispositionType as any);","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Grid, Paper, Card, Typography } from '@material-ui/core';\r\nimport AcutePatientsByMonth from \"./dashboard/AcutePatientsByMonth\";\r\nimport PatientFacilities from './dashboard/PatientFacilities'\r\nimport DischargeDispositionType from './dashboard/DischargeDispositionType';\r\n\r\nconst Home = () => {\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n Patient Population in the last 6 months\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n )\r\n}\r\n\r\nexport default connect()(Home);\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { ApplicationState } from '../store';\r\nimport * as CounterStore from '../store/Counter';\r\n\r\ntype CounterProps =\r\n CounterStore.CounterState &\r\n typeof CounterStore.actionCreators &\r\n RouteComponentProps<{}>;\r\n\r\nclass Counter extends React.PureComponent {\r\n public render() {\r\n return (\r\n \r\n

Counter

\r\n\r\n

This is a simple example of a React component.

\r\n\r\n

Current count: {this.props.count}

\r\n\r\n \r\n
\r\n );\r\n }\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.counter,\r\n CounterStore.actionCreators\r\n)(Counter);\r\n","import { Action, Reducer } from 'redux';\r\n\r\n// -----------------\r\n// STATE - This defines the type of data maintained in the Redux store.\r\n\r\nexport interface CounterState {\r\n count: number;\r\n}\r\n\r\n// -----------------\r\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\r\n// They do not themselves have any side-effects; they just describe something that is going to happen.\r\n// Use @typeName and isActionType for type detection that works even after serialization/deserialization.\r\n\r\nexport interface IncrementCountAction { type: 'INCREMENT_COUNT' }\r\nexport interface DecrementCountAction { type: 'DECREMENT_COUNT' }\r\n\r\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\r\n// declared type strings (and not any other arbitrary string).\r\nexport type KnownAction = IncrementCountAction | DecrementCountAction;\r\n\r\n// ----------------\r\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\r\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\r\n\r\nexport const actionCreators = {\r\n increment: () => ({ type: 'INCREMENT_COUNT' } as IncrementCountAction),\r\n decrement: () => ({ type: 'DECREMENT_COUNT' } as DecrementCountAction)\r\n};\r\n\r\n// ----------------\r\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\r\n\r\nexport const reducer: Reducer = (state: CounterState | undefined, incomingAction: Action): CounterState => {\r\n if (state === undefined) {\r\n return { count: 0 };\r\n }\r\n\r\n const action = incomingAction as KnownAction;\r\n switch (action.type) {\r\n case 'INCREMENT_COUNT':\r\n return { count: state.count + 1 };\r\n case 'DECREMENT_COUNT':\r\n return { count: state.count - 1 };\r\n default:\r\n return state;\r\n }\r\n};\r\n","import { Action, Reducer } from 'redux';\r\nimport { AppThunkAction } from './';\r\n//import AccessToken from '../components/common/AccessToken'\r\n\r\n\r\n\r\n// -----------------\r\n// STATE - This defines the type of data maintained in the Redux store.\r\n\r\nexport interface WeatherForecastsState {\r\n isLoading: boolean;\r\n startDateIndex?: number;\r\n forecasts: WeatherForecast[];\r\n}\r\n\r\nexport interface WeatherForecast {\r\n date: string;\r\n temperatureC: number;\r\n temperatureF: number;\r\n summary: string;\r\n}\r\n\r\n// -----------------\r\n// ACTIONS - These are serializable (hence replayable) descriptions of state transitions.\r\n// They do not themselves have any side-effects; they just describe something that is going to happen.\r\n\r\ninterface RequestWeatherForecastsAction {\r\n type: 'REQUEST_WEATHER_FORECASTS';\r\n startDateIndex: number;\r\n}\r\n\r\ninterface ReceiveWeatherForecastsAction {\r\n type: 'RECEIVE_WEATHER_FORECASTS';\r\n startDateIndex: number;\r\n forecasts: WeatherForecast[];\r\n}\r\n\r\n// Declare a 'discriminated union' type. This guarantees that all references to 'type' properties contain one of the\r\n// declared type strings (and not any other arbitrary string).\r\ntype KnownAction = RequestWeatherForecastsAction | ReceiveWeatherForecastsAction;\r\n\r\n\r\n\r\n\r\n// ----------------\r\n// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition.\r\n// They don't directly mutate state, but they can have external side-effects (such as loading data).\r\n\r\nexport const actionCreators = {\r\n requestWeatherForecasts: (startDateIndex: number): AppThunkAction => (dispatch, getState) => {\r\n // Only load data if it's something we don't already have (and are not already loading)\r\n const appState = getState();\r\n const accessToken = appState.oidc.user.access_token;\r\n const options = {\r\n method: \"GET\",\r\n headers: {\r\n Accept: \"application/json\",\r\n Authorization: `Bearer ${accessToken}`\r\n }\r\n };\r\n if (appState && appState.weatherForecasts && startDateIndex !== appState.weatherForecasts.startDateIndex) {\r\n alert(\"about to call api\");\r\n fetch(`https://api-staging.vitalsmd.com/weatherforecast`, options)\r\n .then(response => response.json() as Promise)\r\n .then(data => {\r\n dispatch({ type: 'RECEIVE_WEATHER_FORECASTS', startDateIndex: startDateIndex, forecasts: data });\r\n })\r\n .catch((error) => {\r\n console.error('YO YO YO:', error);\r\n });\r\n\r\n dispatch({ type: 'REQUEST_WEATHER_FORECASTS', startDateIndex: startDateIndex });\r\n }\r\n }\r\n};\r\n\r\n// ----------------\r\n// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state.\r\n\r\nconst unloadedState: WeatherForecastsState = { forecasts: [], isLoading: false };\r\n\r\nexport const reducer: Reducer = (state: WeatherForecastsState | undefined, incomingAction: Action): WeatherForecastsState => {\r\n if (state === undefined) {\r\n return unloadedState;\r\n }\r\n\r\n const action = incomingAction as KnownAction;\r\n switch (action.type) {\r\n case 'REQUEST_WEATHER_FORECASTS':\r\n return {\r\n startDateIndex: action.startDateIndex,\r\n forecasts: state.forecasts,\r\n isLoading: true\r\n };\r\n case 'RECEIVE_WEATHER_FORECASTS':\r\n // Only accept the incoming data if it matches the most recent request. This ensures we correctly\r\n // handle out-of-order responses.\r\n if (action.startDateIndex === state.startDateIndex) {\r\n return {\r\n startDateIndex: action.startDateIndex,\r\n forecasts: action.forecasts,\r\n isLoading: false\r\n };\r\n }\r\n break;\r\n }\r\n\r\n return state;\r\n};\r\n","import * as React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { Link } from 'react-router-dom';\r\nimport { ApplicationState } from '../store';\r\nimport * as WeatherForecastsStore from '../store/WeatherForecasts';\r\n\r\n// At runtime, Redux will merge together...\r\ntype WeatherForecastProps =\r\n WeatherForecastsStore.WeatherForecastsState // ... state we've requested from the Redux store\r\n & typeof WeatherForecastsStore.actionCreators // ... plus action creators we've requested\r\n & RouteComponentProps<{ startDateIndex: string }>; // ... plus incoming routing parameters\r\n\r\n\r\nclass FetchData extends React.PureComponent {\r\n // This method is called when the component is first added to the document\r\n public componentDidMount() {\r\n this.ensureDataFetched();\r\n }\r\n\r\n // This method is called when the route parameters change\r\n public componentDidUpdate() {\r\n this.ensureDataFetched();\r\n }\r\n\r\n public render() {\r\n return (\r\n \r\n

Weather forecast

\r\n

This component demonstrates fetching data from the server and working with URL parameters.

\r\n {this.renderForecastsTable()}\r\n {this.renderPagination()}\r\n
\r\n );\r\n }\r\n\r\n private ensureDataFetched() {\r\n const startDateIndex = parseInt(this.props.match.params.startDateIndex, 10) || 0;\r\n this.props.requestWeatherForecasts(startDateIndex);\r\n }\r\n\r\n private renderForecastsTable() {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {this.props.forecasts.map((forecast: WeatherForecastsStore.WeatherForecast) =>\r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n
DateTemp. (C)Temp. (F)Summary
{forecast.date}{forecast.temperatureC}{forecast.temperatureF}{forecast.summary}
\r\n );\r\n }\r\n\r\n private renderPagination() {\r\n const prevStartDateIndex = (this.props.startDateIndex || 0) - 5;\r\n const nextStartDateIndex = (this.props.startDateIndex || 0) + 5;\r\n\r\n return (\r\n
\r\n Previous\r\n {this.props.isLoading && Loading...}\r\n Next\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.weatherForecasts, // Selects which state properties are merged into the component's props\r\n WeatherForecastsStore.actionCreators // Selects which action creators are merged into the component's props\r\n)(FetchData as any); // eslint-disable-line @typescript-eslint/no-explicit-any\r\n","import React from \"react\";\r\nimport {\r\n Slide,\r\n TextField,\r\n Grid,\r\n FormControl,\r\n InputLabel,\r\n FormHelperText,\r\n Input,\r\n FormLabel,\r\n FormGroup,\r\n FormControlLabel,\r\n Checkbox,\r\n Button,\r\n Paper\r\n} from \"@material-ui/core\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\n\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { useState, useEffect } from \"react\";\r\nimport Chip from \"@material-ui/core/Chip\";\r\nimport AssignmentIndIcon from \"@material-ui/icons/AssignmentInd\";\r\nimport Select from \"@material-ui/core/Select\";\r\nimport MenuItem from \"@material-ui/core/MenuItem\";\r\nimport CancelIcon from \"@material-ui/icons/Cancel\";\r\nimport RequestAccessToken from '../util/authService';\r\nimport './style.css';\r\n\r\n\r\ntype AccountProfileByRefMDProps = APIStore.RefMdProfile &\r\n APIStore.HNIContextState &\r\n typeof APIStore.actionCreators;\r\n\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n \"& .MuiTextField-root\": {\r\n margin: theme.spacing(1),\r\n width: \"25ch\",\r\n },\r\n },\r\n chip: {\r\n margin: theme.spacing(0.5),\r\n },\r\n}));\r\n\r\nconst Account = (props: AccountProfileByRefMDProps) => {\r\n const classes = useStyles();\r\n let [profileState, setProfileState] = useState(\r\n {} as APIStore.RefMdProfile\r\n );\r\n\r\n let [loadState, setLoadState] = useState({ status: true });\r\n let [tokenState, setTokenState] = useState();\r\n\r\n let {\r\n requestVitalsMdProfile,\r\n requestSystemSpecialties,\r\n userRefMdProfile,\r\n submitRefMD,\r\n requestCurrentUserCareCoordinatorProfile,\r\n userPracticeCoordinatorProfile\r\n } = props;\r\n\r\n let SystemSpecialties: APIStore.SpecialtyState = props.SystemSpecialties;\r\n let { isLoading, VitalsReferenceSpecialties }: APIStore.SpecialtyState = SystemSpecialties;\r\n let specialtiesLoaded = SystemSpecialties.isLoaded;\r\n\r\n let { specialties: refSpecialties } = VitalsReferenceSpecialties;\r\n\r\n let [specialties, setSpecialties] = useState(\r\n [] as Array\r\n );\r\n\r\n let { refmdProfile, notFound, isLoaded, isErrored }: APIStore.RefMDProfileState = userRefMdProfile;\r\n\r\n useEffect(() => {\r\n if (isLoaded && !isErrored && !notFound) {\r\n setProfileState(refmdProfile);\r\n setLoadState({ status: true });\r\n let specialtiesAsList = [...refmdProfile.specialties];\r\n setSpecialties(specialtiesAsList);\r\n }\r\n }, [refmdProfile]);\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (!isLoaded && !isErrored && !notFound && tokenState && tokenState.accessToken) {\r\n requestVitalsMdProfile(tokenState.accessToken);\r\n }\r\n }, [tokenState]);\r\n\r\n useEffect(() => {\r\n if (notFound && tokenState && tokenState.accessToken) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n }\r\n }, [tokenState, notFound]);\r\n\r\n useEffect(() => {\r\n if (!isLoading && !specialtiesLoaded && tokenState?.accessToken) {\r\n requestSystemSpecialties(tokenState.accessToken);\r\n }\r\n }, [tokenState]);\r\n\r\n const handleChange = (event: any) => {\r\n let selectedItem = event.target.value;\r\n setSpecialties(selectedItem);\r\n setProfileState({\r\n ...profileState,\r\n specialties: selectedItem\r\n });\r\n };\r\n\r\n const handleAlertChange = (event: any) => {\r\n if (event.target.name === \"admitalerts\") {\r\n setProfileState({\r\n ...profileState,\r\n notifyAdmits: !profileState.notifyAdmits,\r\n });\r\n }\r\n\r\n if (event.target.name === \"dischargealerts\") {\r\n setProfileState({\r\n ...profileState,\r\n notifyDischarges: !profileState.notifyDischarges,\r\n });\r\n }\r\n };\r\n\r\n const handleSpecialtyDelete = (specialtyId: any) => {\r\n let filtered = specialties.filter((val) => val.specialtyId !== specialtyId);\r\n setSpecialties(filtered);\r\n setProfileState({\r\n ...profileState,\r\n specialties: filtered\r\n });\r\n };\r\n\r\n const submitUpdate = () => {\r\n\r\n submitRefMD(profileState, tokenState?.accessToken);\r\n };\r\n\r\n const updateFirstName = (e: any) => {\r\n let newProfile = {\r\n ...refmdProfile,\r\n firstName: e.target.value,\r\n };\r\n setProfileState(newProfile);\r\n };\r\n\r\n const updateLastName = (e: any) => {\r\n let newProfile = {\r\n ...refmdProfile,\r\n lastName: e.target.value,\r\n };\r\n setProfileState(newProfile);\r\n };\r\n\r\n const updatePhoneNumber = (e: any) => {\r\n let newProfile = {\r\n ...refmdProfile,\r\n phone: e.target.value,\r\n };\r\n setProfileState(newProfile);\r\n };\r\n\r\n const history = useHistory();\r\n\r\n if (userPracticeCoordinatorProfile && userPracticeCoordinatorProfile.isLoaded) {\r\n history.push(`/account-care-coord`);\r\n return (\r\n \r\n

No RefMD profile found

\r\n
\r\n );\r\n }\r\n\r\n if (notFound) {\r\n return (\r\n \r\n

No profile found

\r\n
\r\n );\r\n }\r\n\r\n\r\n if (\r\n !loadState ||\r\n !loadState.status ||\r\n !refSpecialties ||\r\n !refSpecialties.length ||\r\n !profileState ||\r\n !profileState.referringMDId\r\n ) {\r\n return (\r\n \r\n

Loading

\r\n
\r\n );\r\n }\r\n\r\n const ITEM_HEIGHT = 48;\r\n const ITEM_PADDING_TOP = 8;\r\n const MenuProps = {\r\n PaperProps: {\r\n style: {\r\n maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,\r\n width: 250,\r\n },\r\n },\r\n };\r\n\r\n let icon = ;\r\n\r\n\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n First Name\r\n \r\n \r\n \r\n \r\n \r\n Last Name\r\n \r\n \r\n \r\n \r\n \r\n Email Address\r\n \r\n \r\n Email used by VitalsMD™\r\n \r\n \r\n \r\n \r\n \r\n Phone Number\r\n \r\n \r\n \r\n \r\n \r\n 10 digit NPI\r\n \r\n \r\n \r\n \r\n \r\n Specialty\r\n }\r\n renderValue={(selected) => (\r\n
\r\n {selected.map((val) => {\r\n return (\r\n event.stopPropagation()}\r\n />\r\n }\r\n onDelete={(event) =>\r\n handleSpecialtyDelete(val.specialtyId)\r\n }\r\n />\r\n );\r\n })}\r\n
\r\n )}\r\n MenuProps={MenuProps}\r\n >\r\n {refSpecialties.map((refSpecialty) => (\r\n \r\n {refSpecialty.description}\r\n \r\n ))}\r\n \r\n
\r\n
\r\n\r\n \r\n \r\n Send me alerts on:\r\n \r\n \r\n }\r\n label=\"Admits\"\r\n />\r\n \r\n }\r\n label=\"Discharges\"\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(Account as any);\r\n","import * as React from \"react\";\r\nimport { useState, useEffect } from \"react\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { TableFooter, TableCell, TableRow } from \"@material-ui/core\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport MUIDataTable, { MUIDataTableOptions } from \"mui-datatables\";\r\nimport { Grid, Button } from '@material-ui/core';\r\nimport moment from 'moment';\r\nimport { createTheme, ThemeProvider } from '@material-ui/core/styles';\r\nimport RequestAccessToken from '../util/authService';\r\nimport { Typography } from \"@material-ui/core\";\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport '@fontsource/roboto/300.css';\r\nimport '@fontsource/roboto/400.css';\r\nimport '@fontsource/roboto/500.css';\r\nimport { practiceCoordinatorLoaded, shouldTryCareCoordinatorProfile, shouldTryRefMDProfile } from \"./common/ProfileHelper\";\r\n\r\n\r\ntype MessagesForProviderProps = {\r\n Messages : APIStore.MessageState,\r\n APIToken : APIStore.TokenType,\r\n userPracticeCoordinatorProfile : APIStore.PracticeCoordinatorState,\r\n userRefMdProfile : APIStore.RefMDProfileState\r\n\r\n} &\r\n typeof APIStore.actionCreators;\r\n\r\nconst findMessage = (messageId: number, messages: APIStore.Message[]) => {\r\n let ret = messages.filter((val) => val.messageId === messageId);\r\n if (!ret.length) {\r\n return null;\r\n }\r\n\r\n return ret[0];\r\n};\r\n\r\nconst formatDate = (date) => {\r\n return moment(date).format(\"hh:mm A MM/DD/YY\");\r\n};\r\n\r\nconst formatSender = (message: APIStore.Message) => {\r\n // format physician names\r\n // potentially display phone\r\n // properly display VitalsMD symbol\r\n\r\n let messageType = message.description;\r\n if (!messageType) {\r\n return '';\r\n }\r\n if (messageType.toLowerCase() === 'admit' || messageType.toLowerCase() === 'discharge') {\r\n return 'VitalsMD';\r\n }\r\n\r\n return message.senderId;\r\n};\r\n\r\nconst formatSubject = (fullMessage: APIStore.Message) => {\r\n\r\n\r\n let messageType = fullMessage.description;\r\n\r\n\r\n if (!messageType) {\r\n return '';\r\n }\r\n if (messageType.toLowerCase() === 'admit') {\r\n return `Patient Admit: ${fullMessage.patientLastName}`\r\n }\r\n\r\n if (messageType.toLowerCase() === 'discharge') {\r\n return `Patient Discharge: ${fullMessage.patientLastName}`\r\n }\r\n\r\n\r\n return fullMessage.subject;\r\n};\r\n\r\nconst NotifcationsTable = (props: MessagesForProviderProps) => {\r\n let {\r\n requestMessagesForProvider,\r\n requestMessageContactsUser,\r\n userRefMdProfile,\r\n requestVitalsMdProfile,\r\n Messages,\r\n clearMessageState,\r\n requestMessageContactsForPractice,\r\n requestCurrentUserCareCoordinatorProfile,\r\n userPracticeCoordinatorProfile,\r\n receiveTokenResponse,\r\n APIToken } = props;\r\n let { isLoading, isLoaded } = Messages;\r\n let CurrentMessages: APIStore.Message[] = Messages.CurrentMessages;\r\n let [tokenState, setTokenState] = useState();\r\n let [careCoordinatorProfileState, setCareCoordinatorProfileState] = useState();\r\n let tableTitle: string = 'Messages';\r\n let aProfileIsLoaded: boolean = false;\r\n\r\n const columns = [\r\n {\r\n name: \"Message\",\r\n options: {\r\n display: false,\r\n }\r\n },\r\n \"Subject\",\r\n \"Sender\",\r\n \"Sent\", {\r\n name: \"Status\",\r\n options: {\r\n display: false,\r\n }\r\n }, {\r\n name: \"Yours\",\r\n options: {\r\n display: false,\r\n }\r\n }];\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n receiveTokenResponse(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (APIToken && !tokenState?.accessToken) {\r\n setTokenState(APIToken);\r\n }\r\n\r\n }, [APIToken, tokenState])\r\n\r\n useEffect(() => {\r\n if (userPracticeCoordinatorProfile) {\r\n let { isLoaded, isLoading, coordinatorProfile }: APIStore.PracticeCoordinatorState = userPracticeCoordinatorProfile;\r\n\r\n\r\n if (isLoaded && !isLoading && tokenState?.accessToken) {\r\n setCareCoordinatorProfileState(coordinatorProfile);\r\n aProfileIsLoaded = true;\r\n requestMessageContactsForPractice(tokenState.accessToken, coordinatorProfile.defaultPractice.practiceId);\r\n requestMessagesForProvider(tokenState.accessToken);\r\n }\r\n }\r\n\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile, Messages.isLoaded]);\r\n\r\n\r\n\r\n useEffect(() => {\r\n if (userRefMdProfile && tokenState && !practiceCoordinatorLoaded(userPracticeCoordinatorProfile)) {\r\n let { notFound, isLoaded, isErrored, isLoading }: APIStore.RefMDProfileState = userRefMdProfile;\r\n if (shouldTryRefMDProfile(userRefMdProfile) && userPracticeCoordinatorProfile.notFound) {\r\n requestVitalsMdProfile(tokenState.accessToken);\r\n }\r\n\r\n if (isLoaded) {\r\n requestMessagesForProvider(tokenState?.accessToken);\r\n requestMessageContactsUser(tokenState?.accessToken);\r\n aProfileIsLoaded = true;\r\n }\r\n\r\n if (shouldTryCareCoordinatorProfile(userPracticeCoordinatorProfile)) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n }\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n const handleClose = () => {\r\n clearMessageState();\r\n }\r\n\r\n const history = useHistory();\r\n\r\n const getMuiTheme = () =>\r\n createTheme({\r\n\r\n });\r\n\r\n\r\n const options = {\r\n elevation: 0,\r\n filter: false,\r\n viewColumns: false,\r\n print: false,\r\n download: false,\r\n customFooter: null,\r\n selectableRows: false,\r\n delete: false,\r\n searchAlwaysOpen: false,\r\n responsive: 'vertical',\r\n customRowRender: (data, dataIndex, rowIndex) => {\r\n let outbound = data[5];\r\n let readStr = data[4];\r\n\r\n if (!readStr && !outbound) {\r\n\r\n return ( { GotoNotificationItem(data[0]) }}>\r\n\r\n \r\n \r\n {\r\n data[1]\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n data[3]\r\n }\r\n \r\n \r\n )\r\n }\r\n\r\n\r\n if (outbound) {\r\n return ( { GotoNotificationItem(data[0]) }}>\r\n\r\n\r\n \r\n {\r\n data[1]\r\n }\r\n\r\n \r\n \r\n You\r\n \r\n \r\n {\r\n data[3]\r\n }\r\n\r\n \r\n )\r\n }\r\n\r\n return ( { GotoNotificationItem(data[0]) }}>\r\n\r\n \r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n\r\n \r\n \r\n \r\n \r\n {\r\n data[3]\r\n }\r\n\r\n \r\n \r\n \r\n \r\n {\r\n data[1]\r\n }\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n {\r\n data[1]\r\n }\r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n {\r\n data[3]\r\n }\r\n \r\n \r\n )\r\n }\r\n };\r\n\r\n\r\n const loadingOptions = {\r\n filter: false,\r\n viewColumns: false,\r\n print: false,\r\n download: false,\r\n delete: false,\r\n searchAlwaysOpen: false,\r\n customRowRender: (data, dataIndex, rowIndex) => {\r\n\r\n if (dataIndex === 0) {\r\n return (\r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n\r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n );\r\n },\r\n\r\n customFooter: (\r\n count,\r\n page,\r\n rowsPerPage,\r\n changeRowsPerPage,\r\n changePage\r\n ) => {\r\n const startIndex = page * rowsPerPage;\r\n const endIndex = (page + 1) * rowsPerPage;\r\n return (\r\n \r\n \r\n \r\n Loading\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n );\r\n },\r\n textLabels: {\r\n body: {\r\n noMatch: \"Loading\",\r\n }\r\n }\r\n };\r\n\r\n const GotoNotificationItem = (data: number) => {\r\n let message = CurrentMessages.filter(v => v.messageId === data)[0];\r\n\r\n\r\n\r\n if (message.description === 'user') {\r\n history.push(`/notification-item/${message.messageId}`);\r\n };\r\n\r\n if (message.description === 'admit') {\r\n history.push(`/admit-notification/${message.messageId}`);\r\n };\r\n\r\n if (message.description === 'discharge') {\r\n history.push(`/discharge-notification/${message.messageId}`);\r\n };\r\n }\r\n\r\n const newMessage = () => {\r\n history.push(\"/compose-new-message\");\r\n };\r\n\r\n\r\n if ((isLoading || !isLoaded)) {\r\n return (\r\n
\r\n \r\n \r\n \r\n If immediate attention is required contact us at 855-489-8141\r\n \r\n\r\n \r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n If immediate attention is required contact us at 855-489-8141\r\n \r\n\r\n \r\n \r\n
\r\n \r\n {\r\n\r\n return [item.messageId, formatSubject(item), formatSender(item), formatDate(item.createdDate), item.messageReadDate, item.isOutbound];\r\n })}\r\n columns={columns}\r\n options={options}\r\n />\r\n \r\n
\r\n
\r\n\r\n\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(NotifcationsTable as any);\r\n\r\n","import React from 'react';\r\nimport { Paper , Slide} from '@material-ui/core';\r\nimport NotificationsTable from './NotificationsTable';\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { Console } from 'console';\r\nimport './style.css';\r\nimport './Notifications.css';\r\n\r\nconst Notifications = () => {\r\n\r\n return (\r\n \r\n
\r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default Notifications;","import React from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { Button } from \"@material-ui/core\";\r\nimport { Mail } from \"@material-ui/icons\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\n\r\nconst ProgramAdministrator = (props: any) => {\r\n let { patientEncounterId } = props;\r\n let contact: APIStore.HNIProviderContact = props.ProviderContact;\r\n const history = useHistory();\r\n\r\n let { type, displayName, email } = contact;\r\n\r\n const handleNameClick = (email: string) => {\r\n history.push(\"/compose-new-message-admin\", { receiverId: 'programmanagers@hnihc.com', patientEncounterId: patientEncounterId });\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n\r\n );\r\n};\r\n\r\nexport default ProgramAdministrator;","import React from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { Button } from \"@material-ui/core\";\r\nimport { Mail } from \"@material-ui/icons\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport ProgramAdministrator from \"./ProgramAdministrator\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\n\r\nconst PhysicianNameComponent = (props: any) => {\r\n let { patientEncounterId } = props;\r\n let contact: APIStore.HNIProviderContact = props.ProviderContact;\r\n\r\n const history = useHistory();\r\n\r\n const handleNameClick = (email: string) => {\r\n history.push(\"/compose-new-message\", { receiverId: email });\r\n };\r\n\r\n let { displayName, email, type } = contact;\r\n\r\n if (type.toLowerCase().startsWith('program')) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n {type}:{\" \"}\r\n \r\n {displayName}\r\n \r\n\r\n\r\n \r\n \r\n );\r\n};\r\n\r\nexport default PhysicianNameComponent;\r\n","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\n\r\nconst DateDisplay = (props: any) => {\r\n let { Label, DateNullText, DateValue } = props;\r\n\r\n const formatDate = (dateVal: string) => {\r\n dateVal=dateVal.replace(\"T\", \" \");\r\n return dateVal;\r\n };\r\n\r\n\r\n if (!DateValue) {\r\n return (\r\n \r\n \r\n {DateNullText}\r\n \r\n \r\n );\r\n }\r\n\r\n\r\n return (\r\n \r\n \r\n {`${Label}: `} \r\n \r\n {formatDate(DateValue)}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default DateDisplay;\r\n","\r\nimport React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../../store\";\r\n\r\nexport type DiagnosisCodeHccProps = {\r\n dxCode: APIStore.PatientDiagnosis\r\n} \r\n\r\nconst DiagnosisCodeHcc = (props: DiagnosisCodeHccProps) => {\r\n let { dxCode } = props;\r\n\r\n return (\r\n \r\n {`${dxCode.diagnosis.diagnosisCodeValue} - ${dxCode.shortDescription} `}\r\n HCC CAT {dxCode.diagnosis.hccCategory}\r\n \r\n )\r\n\r\n};\r\n\r\nexport default DiagnosisCodeHcc","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport DiagnosisCodeHcc from './DiagnosisCodeHcc'\r\n\r\nexport interface DiagnosisListProps {\r\n diagnosisCodes: APIStore.PatientDiagnosis[],\r\n listLabel: string\r\n}\r\n\r\n\r\nconst DiagnosisList = (props : DiagnosisListProps) => {\r\n let { diagnosisCodes, listLabel } = props;\r\n\r\n if (!diagnosisCodes || !diagnosisCodes.length) {\r\n return ( No Diagnosis Codes)\r\n }\r\n\r\n return (\r\n
\r\n \r\n {listLabel}:\r\n \r\n {\r\n diagnosisCodes.map(val => {\r\n if(val.diagnosis.isRiskAdjusted) {\r\n return \r\n }\r\n if(val.shortDescription) {\r\n return (\r\n \r\n {val.diagnosis.diagnosisCodeValue} - {val.shortDescription}\r\n )\r\n } else {\r\n return (\r\n \r\n {val.diagnosis.diagnosisCodeValue}\r\n )\r\n }\r\n \r\n })\r\n }\r\n
\r\n );\r\n}\r\n\r\nexport default DiagnosisList;\r\n","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport Paper from '@material-ui/core/Paper';\r\nimport NextSiteOfCare from './NextSiteOfCare'\r\nimport DateDisplay from \"../common/DateDisplay\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport { Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from \"@material-ui/core\";\r\n\r\nimport moment from 'moment';\r\n\r\nexport interface EncounterListProps {\r\n encounters: APIStore.Encounter[] | null,\r\n isLoading: boolean\r\n}\r\n\r\nconst formatDate = (date : string, dateOnly:boolean) => {\r\n if (!date) {\r\n return null;\r\n }\r\n if (dateOnly) {\r\n return moment(date).format(\"MM-DD-YYYY\");\r\n }\r\n return moment(date).format(\"hh:mm:ss A MM-DD-YYYY\");\r\n}\r\n\r\n\r\nconst EncounterList = (props: EncounterListProps) => {\r\n let { encounters, isLoading } = props;\r\n\r\n if(isLoading) {\r\n return (\r\n
\r\n \r\n\r\n
\r\n

    

\r\n
\r\n
\r\n \r\n\r\n
\r\n

    

\r\n
\r\n
\r\n \r\n\r\n
\r\n

    

\r\n
\r\n
\r\n
)\r\n }\r\n\r\n return (\r\n
\r\n \r\n Admission History:\r\n \r\n \r\n \r\n \r\n \r\n Facility\r\n Admitted\r\n Discharged\r\n \r\n \r\n \r\n {encounters.map((val) => (\r\n \r\n \r\n {val.facility.facilityName}\r\n \r\n \r\n {formatDate(val.encounterStart, true)}\r\n\r\n \r\n \r\n\r\n {formatDate(val.encounterEnd, true)}\r\n\r\n\r\n \r\n \r\n ))}\r\n \r\n
\r\n
\r\n
\r\n )\r\n}\r\n\r\n\r\nexport default EncounterList;\r\n","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport { useState, useEffect } from \"react\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Button } from \"@material-ui/core\";\r\nimport moment from 'moment';\r\nimport RequestAccessToken from '../../util/authService';\r\nimport { Link, useHistory } from \"react-router-dom\";\r\nimport CircularProgress from '@material-ui/core/CircularProgress';\r\n\r\nexport interface DocumentsByPatientsProps {\r\n patientDocuments: APIStore.PatientDocument[],\r\n apiHost: string\r\n}\r\n\r\nconst formatDate = (date: string, dateOnly: boolean) => {\r\n if (!date) {\r\n return null;\r\n }\r\n if (dateOnly) {\r\n return moment(date).format(\"MM-DD-YYYY\");\r\n }\r\n return moment(date).format(\"hh:mm:ss A MM-DD-YYYY\");\r\n}\r\n\r\n\r\nconst DocumentsIndex = (props: DocumentsByPatientsProps) => {\r\n let { patientDocuments, apiHost } = props;\r\n let [downloadingState, setDownloadState] = useState('');\r\n\r\n let [tokenState, setTokenState] = useState();\r\n\r\n const history = useHistory();\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n const downloadDocument = (documentId: string, documentName: string, extension: string, path : string, accessToken: string, document: any) => {\r\n\r\n setDownloadState(documentName);\r\n\r\n let request = {\r\n DocumentId: documentId,\r\n Name: documentName,\r\n Extension: extension,\r\n Path :path\r\n }\r\n debugger;\r\n\r\n const options = {\r\n method: \"POST\",\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(request)\r\n };\r\n\r\n fetch(`https://${apiHost}/api/AzureStorage/PatientDocuments/`, options)\r\n .then((res) => { return res.blob(); })\r\n .then((data) => {\r\n let a = document.createElement(\"a\")\r\n a.href = window.URL.createObjectURL(data);\r\n a.download = documentName;\r\n a.click();\r\n setDownloadState('');;\r\n }).catch((err) => {\r\n setDownloadState('');\r\n })\r\n }\r\n\r\n const downloadDoc = (e:any, documentId:string, documentFileName : string, extension: string, path : sstring) => {\r\n e.preventDefault();\r\n \r\n if(tokenState) {\r\n downloadDocument(documentId, documentFileName, extension,path, tokenState.accessToken, document)\r\n }\r\n };\r\n\r\n if (!patientDocuments?.length) {\r\n return (
\r\n \r\n Documents: None\r\n \r\n\r\n
);\r\n }\r\n\r\n return (\r\n
\r\n \r\n Documents:\r\n \r\n \r\n \r\n \r\n \r\n Name\r\n Created By\r\n Date\r\n \r\n \r\n \r\n \r\n\r\n {patientDocuments.map((val: APIStore.PatientDocument) => (\r\n\r\n \r\n \r\n\r\n\r\n { downloadDoc(e, val.id, val.name, val.extension, val.path) }} to={val.path}>\r\n \r\n {val.displayName}\r\n \r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n \r\n {val.createdBy}\r\n \r\n \r\n\r\n {formatDate(val.createdDate, true)}\r\n\r\n \r\n \r\n\r\n {val.name == downloadingState ? : }\r\n\r\n \r\n \r\n ))}\r\n \r\n \r\n {\r\n\r\n }\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(DocumentsIndex as any);\r\n","import moment from 'moment';\r\n\r\nexport const formatDate = (date : any, dateOnly: any) => {\r\n if (!date) {\r\n return null;\r\n }\r\n\r\n if (dateOnly) {\r\n return moment(date).format(\"MM-DD-YYYY\");\r\n }\r\n\r\n let dt = moment(date);\r\n\r\n return (dt.hours() === 0 && dt.minutes() === 0 && dt.seconds() === 0 ? dt.format('MM/DD/YYYY') : dt.format('hh:mm:ss A MM-DD-YYYY'));\r\n}","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport DiagnosisCodeHcc from './DiagnosisCodeHcc'\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport DateDisplay from '../common/DateDisplay'\r\nimport {formatDate} from '../common/DateHelper'\r\n\r\nexport interface PatientDischargeDisplayProps {\r\n encounter: APIStore.Encounter,\r\n\r\n}\r\n\r\n\r\nconst PatientDischargeDisplay = (props : PatientDischargeDisplayProps) => {\r\n let {encounter} = props;\r\n if(encounter.encounterEnd) {\r\n return (\r\n \r\n \r\n\r\n \r\n Discharge Date:{\" \"}\r\n \r\n {encounter.encounterEnd}\r\n \r\n \r\n \r\n )\r\n }\r\n\r\n let {daysUntilDischarge} = encounter;\r\n if(daysUntilDischarge > 10000) { // TODO error codes\r\n return (\r\n \r\n \r\n Days to Discharge:{\" \"}\r\n \r\n N/A\r\n \r\n \r\n \r\n )\r\n }\r\n return (\r\n \r\n \r\n Days to Discharge:{\" \"}\r\n \r\n {daysUntilDischarge}\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default PatientDischargeDisplay\r\n","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\n\r\nexport interface PatientRoomDisplayProps {\r\n encounter: APIStore.Encounter,\r\n}\r\n\r\nconst PatientRoomDisplay = (props: PatientRoomDisplayProps) => {\r\n let { roomNumber } = props.encounter;\r\n if (!roomNumber) {\r\n return <>\r\n }\r\n\r\n return (\r\n <>\r\n \r\n Room Number:{\" \"}\r\n \r\n {roomNumber}\r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default PatientRoomDisplay","import React from \"react\";\r\nimport { Slide, Paper, Card, Divider, Box } from \"@material-ui/core\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport { useState, useEffect } from \"react\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { useRouteMatch } from \"react-router-dom\";\r\nimport PhysicianNameComponent from \"./common/PhysicianNameComponent\";\r\nimport DateDisplay from \"./common/DateDisplay\";\r\n\r\nimport DiagnosisList from \"./patient/DiagnosisList\";\r\nimport RequestAccessToken from '../util/authService';\r\nimport EncounterList from './patient/EncounterList'\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { practiceCoordinatorLoaded } from './common/ProfileHelper'\r\nimport DocumentsIndex from './patient/DocumentIndex'\r\n\r\nimport './style.css';\r\nimport '@fontsource/roboto/300.css';\r\nimport '@fontsource/roboto/400.css';\r\nimport PatientDischargeDisplay from \"./patient/PatientDischargeDisplay\";\r\nimport {formatDate} from './common/DateHelper'\r\nimport PatientRoomDisplay from \"./patient/PatientRoomDisplay\"\r\n\r\ntype PatientsByIdProps = {\r\n FocusPatient: APIStore.FocusPatientState,\r\n apiHost: string,\r\n userPracticeCoordinatorProfile : APIStore.PracticeCoordinatorState,\r\n userRefMdProfile : APIStore.RefMDProfileState\r\n} &\r\n typeof APIStore.actionCreators &\r\n RouteComponentProps<{ PtId: string }>;\r\n\r\n\r\nconst Patient = (props: PatientsByIdProps) => {\r\n let {\r\n requestConsolidatedPatientById,\r\n FocusPatient,\r\n requestMessageContactsForPractice,\r\n requestMessageContactsUser,\r\n requestCurrentUserCareCoordinatorProfile,\r\n apiHost\r\n } = props;\r\n\r\n let userPracticeCoordinatorProfile: APIStore.PracticeCoordinatorState = props.userPracticeCoordinatorProfile;\r\n let userRefMdProfile: APIStore.RefMDProfileState = props.userRefMdProfile;\r\n\r\n let [tokenState, setTokenState] = useState();\r\n const history = useHistory();\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n let ptidNumber = parseInt(props.match.params.PtId) || 0;\r\n if (tokenState?.accessToken) {\r\n requestConsolidatedPatientById(ptidNumber, tokenState.accessToken);\r\n }\r\n\r\n }, [tokenState]);\r\n\r\n\r\n useEffect(() => {\r\n if (tokenState && !practiceCoordinatorLoaded(userPracticeCoordinatorProfile) && !userPracticeCoordinatorProfile.notFound) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n }\r\n\r\n if (userPracticeCoordinatorProfile.notFound) {\r\n requestMessageContactsUser(tokenState?.accessToken)\r\n }\r\n\r\n if (userPracticeCoordinatorProfile.isLoaded) {\r\n requestMessageContactsForPractice(tokenState?.accessToken, userPracticeCoordinatorProfile.coordinatorProfile?.defaultPractice.practiceId);\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n if (!FocusPatient || FocusPatient.isLoading || !(FocusPatient ?? patient.encounters)) {\r\n return (\r\n \r\n
\r\n \r\n \r\n
\r\n          \r\n
\r\n
\r\n \r\n
\r\n          \r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n \r\n
\r\n

     

\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n

     

\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n

     

\r\n
\r\n
\r\n
\r\n \r\n \r\n\r\n
\r\n

    

\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n
\r\n

    

\r\n
\r\n
\r\n
\r\n \r\n\r\n \r\n
\r\n

    

\r\n
\r\n
\r\n \r\n
\r\n

    

\r\n
\r\n
\r\n \r\n
\r\n
\r\n )\r\n }\r\n\r\n let {\r\n firstName,\r\n lastName,\r\n mrn,\r\n mbi,\r\n facilityName,\r\n drgDesc,\r\n referringMDName,\r\n encounters,\r\n patientEncounterId\r\n }: APIStore.Patient = FocusPatient.patient;\r\n\r\n let encounter = encounters[0];\r\n\r\n let { primaryProviderContact, encounterInsurance, patientDiagnosisList, dateOfBirth, patientDocuments, daysToDischarge, roomNumber }: APIStore.Encounter = encounter;\r\n\r\n let companyNameFromFacility = 'N/A';\r\n\r\n if (encounterInsurance) {\r\n companyNameFromFacility = encounterInsurance.companyNameFromFacility\r\n }\r\n\r\n return (\r\n \r\n
\r\n \r\n {lastName}, {firstName}\r\n \r\n \r\n {facilityName}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n MRN:{\" \"}\r\n \r\n {mrn}\r\n \r\n \r\n \r\n \r\n \r\n Policy No:{\" \"}\r\n \r\n {mbi}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n\r\n \r\n }\r\n \r\n \r\n \r\n \r\n \r\n Insurance:{\" \"}\r\n \r\n {companyNameFromFacility}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n\r\n \r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(Patient as any);","import { createTheme } from '@material-ui/core/styles';\r\nimport { Pagination } from '@material-ui/lab';\r\nimport { ENGINE_METHOD_NONE } from 'constants';\r\n\r\n\r\n\r\nconst defaultTheme = createTheme();\r\n\r\nconst VitalsMDTheme = createTheme({\r\n palette: {\r\n primary: {\r\n main: '#00AAD1', /*TEAL*/\r\n light: '#ff0000',/*RED*/\r\n dark: '#038365' /*GREEN*/\r\n },\r\n secondary: {\r\n main: '#60C0AB' /*LIGHT GREEN*/\r\n }\r\n },\r\n overrides: {\r\n MuiCssBaseline: {\r\n '@global': {\r\n a: {\r\n color: 'rgba(0, 0, 0, .87)',\r\n textDecoration: 'none',\r\n cursor: 'pointer',\r\n '&:hover': {\r\n color: '#00AAD1',\r\n textDecoration: 'none'\r\n }\r\n },\r\n body: {\r\n backgroundColor: '#ffffff'\r\n },\r\n },\r\n },\r\n MuiTypography: {\r\n caption: {\r\n color: 'rgba(0,0,0,0.4)',\r\n lineHeight: 1\r\n },\r\n h5: {\r\n color: '#000'\r\n },\r\n h6: {\r\n fontWeight: 500 /*main titles */\r\n },\r\n body1: {\r\n fontSize: '0.875rem'\r\n },\r\n body2: {\r\n fontWeight: 300,\r\n color: '#2C3137' /*DARK GRAY BODY and TITLES*/\r\n },\r\n overline: {\r\n fontSize: '0.875rem',\r\n fontWeight: 300\r\n },\r\n smalldate: {\r\n fontSize: '0.175rem',\r\n fontWeight: 300\r\n }\r\n },\r\n MuiContainer: {\r\n root: {\r\n [defaultTheme.breakpoints.up('sm')]: {\r\n paddingLeft: '24px',\r\n paddingRight: '24px'\r\n },\r\n paddingLeft: '16px',\r\n paddingRight: '16px'\r\n }\r\n },\r\n MuiAppBar: {\r\n colorPrimary: {\r\n color: '#fff',\r\n backgroundColor: '#2C3137',\r\n boxShadow: 'none',\r\n borderBottom: '0'\r\n }\r\n },\r\n MuiDrawer: {\r\n paper: {\r\n backgroundColor: '#2C3137'\r\n }\r\n },\r\n MuiIconButton: {\r\n root: {\r\n\r\n }\r\n },\r\n\r\n MuiListItemText: {\r\n root: {\r\n color: 'white',\r\n opacity: 0.4,\r\n fill: 'white',\r\n '&:hover': {\r\n color: 'white',\r\n opacity: 1,\r\n fill: 'white'\r\n }\r\n }\r\n },\r\n MuiListItemIcon: {\r\n root: {\r\n color: 'white',\r\n opacity: 0.4,\r\n fill: 'white',\r\n '&:hover': {\r\n color: 'white',\r\n opacity: 1,\r\n fill: 'white'\r\n }\r\n }\r\n },\r\n MuiBottomNavigation: {\r\n root: {\r\n position: 'fixed',\r\n bottom: 0,\r\n width: '100%',\r\n marginTop: '56px',\r\n backgroundColor: '#2C3137'\r\n }\r\n },\r\n MuiBottomNavigationAction: {\r\n root: {\r\n color: 'white',\r\n opacity: 0.4,\r\n '&:hover': {\r\n color: 'white',\r\n opacity: 1\r\n },\r\n '&$selected': {\r\n color: 'white',\r\n opacity: 1\r\n }\r\n },\r\n label: {\r\n '&$selected': {\r\n fontSize: '0.75rem'\r\n }\r\n }\r\n },\r\n MuiBadge: {\r\n badge: {\r\n backgroundColor: '#EE3526',\r\n color: 'white'\r\n }\r\n },\r\n MuiTab: {\r\n wrapper: {\r\n letterSpacing: '1px'\r\n }\r\n },\r\n MuiTabs: {\r\n root: {\r\n backgroundColor: 'white'\r\n }\r\n },\r\n MuiButton: {\r\n contained: {\r\n color: 'white',\r\n backgroundColor: '#00AAD1',\r\n '&:hover': {\r\n backgroundColor: '#00CFFF'\r\n }\r\n },\r\n text: {\r\n color: 'white',\r\n '&:hover': {\r\n backgroundColor: 'rgba(0, 170, 209, 0.04)'\r\n }\r\n }\r\n },\r\n\r\n MuiInput: {\r\n underline: {\r\n '&:hover:not($disabled):before': {\r\n borderBottom: '2px solid #00AAD1'\r\n }\r\n }\r\n },\r\n MuiOutlinedInput: {\r\n root: {\r\n backgroundColor: 'white',\r\n borderColor: 'rgba(0,0,0,0.4)',\r\n '&:hover:not($disabled):not($focused):not($error) $notchedOutline': {\r\n borderColor: '#00AAD1',\r\n // Reset on touch devices, it doesn't add specificity\r\n '@media (hover: none)': {\r\n borderColor: 'rgba(0, 0, 0, 0.23)',\r\n },\r\n },\r\n '&$focused $notchedOutline': {\r\n borderColor: '#00AAD1',\r\n }\r\n }\r\n },\r\n MuiFormControl: {\r\n root: {\r\n minWidth: '100%',\r\n flexDirection: 'column'\r\n }\r\n },\r\n MuiFormLabel: {\r\n root: {\r\n '&$focused': {\r\n color: '#00AAD1'\r\n }\r\n },\r\n asterisk: {\r\n color: 'transparent'\r\n }\r\n },\r\n MUIDataTableSelectCell: {\r\n root: {\r\n backgroundColor: \"transparent\",\r\n },\r\n headerCell: {\r\n backgroundColor: \"transparent\",\r\n }\r\n },\r\n\r\n MuiTableCell: {\r\n root: {\r\n padding: '16px'\r\n }\r\n },\r\n\r\n MUIDataTableHeadCell: {\r\n fixedHeader: {\r\n backgroundColor: \"transparent\",\r\n }\r\n },\r\n MUIDataTable: {\r\n paper: {\r\n backgroundColor: \"white\",\r\n borderRadius: '0',\r\n boxShadow: 'none',\r\n transition: 'none'\r\n }\r\n },\r\n MUIDataTableSearch: {\r\n main: {\r\n display: 'inline-flex',\r\n padding: '8px 16px'\r\n }\r\n }\r\n }\r\n});\r\n\r\n\r\nexport default VitalsMDTheme;","export default __webpack_public_path__ + \"static/media/vitalsmd-portal-nav-logo.18b2e4f4.svg\";","import React from \"react\";\r\nimport { useMsal, useIsAuthenticated } from \"@azure/msal-react\";\r\nimport { loginRequest } from \"../util/authConfig\";\r\nimport { Button, FormControlLabel, Checkbox, Box, Link } from '@material-ui/core';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { BorderColor } from \"@material-ui/icons\";\r\nimport { spacing } from '@material-ui/system';\r\n\r\n\r\n/**\r\n * Renders a button which, when selected, will open a popup for login\r\n */\r\nconst LoginButton = (props : any) => {\r\n const {inProgress, instance } = useMsal();\r\n const history = useHistory();\r\n const [checked, setChecked] = React.useState(false);\r\n const handleChange = (event) => {\r\n setChecked(event.target.checked);\r\n };\r\n const isAuthenticated = useIsAuthenticated();\r\n console.log(\"authenticated = \" + isAuthenticated);\r\n const handleLogin = (instance) => {\r\n if (checked) {\r\n if (isAuthenticated) {\r\n if (props.redirect === undefined ) {\r\n history.push(\"/dashboard\");\r\n }\r\n else {\r\n console.log(\"redirect path: \" + props.redirect);\r\n history.push(props.redirect);\r\n }\r\n \r\n }\r\n else {\r\n instance.loginRedirect(loginRequest)\r\n .then(() => {\r\n\r\n if (props.redirect === undefined) {\r\n history.push(\"/dashboard\");\r\n }\r\n else {\r\n console.log(\"redirect path: \" + props.redirect);\r\n history.push(props.redirect);\r\n }\r\n \r\n })\r\n .catch(e => {\r\n console.error(\"dev caught error\");\r\n console.error(e);\r\n });\r\n\r\n }\r\n }\r\n }\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n }\r\n label={\r\n
By checking and logging in, user accepts Terms of Use. Read Terms
\r\n }\r\n />\r\n
\r\n\r\n
\r\n );\r\n}\r\n\r\nexport default LoginButton","\r\nimport React, { Component, useEffect } from \"react\";\r\nimport { Button, Grid, ThemeProvider } from '@material-ui/core';\r\nimport VitalsMDTheme from './VitalsMDTheme';\r\nimport navlogo from '../images/vitalsmd-portal-nav-logo.svg';\r\nimport './LoginPage.css';\r\nimport LoginButton from \"./LoginButton\";\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport { Label } from \"@material-ui/icons\";\r\nimport { getGlobalIsDemoMode } from '../store/APIStore';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n color: \"#fff\",\r\n fontSize: \"0.875rem\",\r\n textAlign: \"center\",\r\n marginBottom: \"2\"\r\n },\r\n}));\r\n\r\nconst LoginPage = (props : any) => {\r\n const classes = useStyles();\r\n console.log(\"hello\");\r\n console.log(props.location.pathname)\r\n const redirectPath = props.location.pathname;\r\n const isDemoMode = getGlobalIsDemoMode();\r\n\r\n console.log(\"Demo mode? \" + isDemoMode);\r\n\r\n\r\n \r\n\r\n useEffect(() => {\r\n document.title = \"VitalsMD Portal\"\r\n }, []);\r\n\r\n\r\n return (\r\n \r\n
\r\n \r\n\r\n \r\n \"Logo\"\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n\r\n}\r\n\r\nexport default LoginPage;\r\n\r\n\r\n","import React from \"react\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { Badge } from '@material-ui/core';\r\nimport { NotificationsNone } from '@material-ui/icons';\r\nimport ReportProblemIcon from '@material-ui/icons/ReportProblem';\r\nimport HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';\r\nimport { yellow } from '@material-ui/core/colors';\r\n\r\nexport interface DrawerBadgeProps {\r\n notificationState: APIStore.NotificationCountState,\r\n}\r\n\r\nexport const DrawerBadge = (props: DrawerBadgeProps) => {\r\n\r\n let { UnreadCount, isLoaded, isErrored, isLoading } = props.notificationState;\r\n\r\n if (isLoaded && !isErrored) {\r\n return (\r\n \r\n \r\n )\r\n }\r\n\r\n if (isLoading) {\r\n return (\r\n \r\n \r\n )\r\n }\r\n\r\n if (isErrored) {\r\n return (\r\n \r\n \r\n )\r\n }\r\n\r\n\r\n return (\r\n \r\n \r\n )\r\n}","import { BottomNavigation, BottomNavigationAction, AppBar, SvgIcon, Badge } from '@material-ui/core';\r\nimport { ApplicationState } from '../store';\r\nimport { NotificationsNone, AccountCircle, PeopleOutlined, AssessmentOutlined, LocalHospital } from '@material-ui/icons';\r\nimport * as React from 'react';\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { DrawerBadge } from './DrawerBadge';\r\n\r\nimport { NavLink } from 'react-router-dom';\r\nimport './BottomNav.css';\r\n\r\nconst BottomNav = (props:any) => {\r\n const [value, setValue] = React.useState('patients');\r\n let {getUnreadMessageCount, NotificationCount} = props;\r\n const handleChange = (e: any) => {\r\n\r\n setValue(e.target.value);\r\n\r\n };\r\n\r\n return (\r\n \r\n \r\n } />\r\n } />\r\n } />\r\n } />\r\n } />\r\n \r\n \r\n );\r\n}\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(BottomNav as any);\r\n\r\n\r\n","export default __webpack_public_path__ + \"static/media/vitalsmd-portal-square-logo.9133c9a3.svg\";","import React from \"react\";\r\nimport { useMsal } from \"@azure/msal-react\";\r\nimport { Button, Hidden } from '@material-ui/core';\r\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\r\n\r\nfunction handleLogout(instance:any) {\r\n instance.logoutPopup().catch(e => {\r\n console.error(e);\r\n });\r\n}\r\n\r\n/**\r\n * Renders a button which, when selected, will open a popup for logout\r\n */\r\nexport const LogoutButton = () => {\r\n const { instance } = useMsal();\r\n\r\n return (\r\n \r\n );\r\n}\r\n\r\nexport default LogoutButton","import React, { useEffect, useState } from 'react';\r\nimport clsx from 'clsx';\r\nimport {\r\n createStyles,\r\n makeStyles,\r\n useTheme,\r\n Theme\r\n} from '@material-ui/core/styles';\r\nimport { Drawer, Box, Badge } from '@material-ui/core';\r\nimport AppBar from '@material-ui/core/AppBar';\r\nimport Toolbar from '@material-ui/core/Toolbar';\r\nimport List from '@material-ui/core/List';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Divider from '@material-ui/core/Divider';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport MenuIcon from '@material-ui/icons/Menu';\r\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\r\nimport ListItem from '@material-ui/core/ListItem';\r\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\r\nimport ListItemText from '@material-ui/core/ListItemText';\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport RequestAccessToken from '../util/authService';\r\nimport { DrawerBadge } from './DrawerBadge'\r\nimport { refMDLoaded, practiceCoordinatorLoaded, shouldTryRefMDProfile, shouldTryCareCoordinatorProfile } from './common/ProfileHelper'\r\n\r\n{/* BEGIN WENDY ADDED EDITED */ }\r\nimport VitalsMDTheme from './VitalsMDTheme';\r\nimport './Drawer.css';\r\nimport { SvgIcon } from '@material-ui/core';\r\nimport { NotificationsNone, AccountCircle, PeopleOutlined, MenuOpen, BeachAccess, Storage, ExitToApp, AssessmentOutlined, LocalHospital } from '@material-ui/icons';\r\nimport navlogo from '../images/vitalsmd-portal-nav-logo.svg';\r\nimport squarelogo from '../images/vitalsmd-portal-square-logo.svg';\r\nimport Button from '@material-ui/core/Button';\r\nimport SettingsIcon from '@material-ui/icons/Settings';\r\nimport { Link, NavLink, useLocation } from 'react-router-dom';\r\nimport LogoutButton from './LogoutButton';\r\n\r\nconst drawerWidth = 240;\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n },\r\n appBar: {\r\n zIndex: theme.zIndex.drawer + 1,\r\n transition: theme.transitions.create(['width', 'margin'], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.leavingScreen,\r\n }),\r\n },\r\n appBarShift: {\r\n marginLeft: drawerWidth,\r\n width: `calc(100% - ${drawerWidth}px)`,\r\n transition: theme.transitions.create(['width', 'margin'], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.enteringScreen,\r\n }),\r\n },\r\n menuButton: {\r\n marginRight: 36,\r\n },\r\n hide: {\r\n display: 'none',\r\n },\r\n drawer: {\r\n width: drawerWidth,\r\n flexShrink: 0,\r\n whiteSpace: 'nowrap',\r\n },\r\n drawerOpen: {\r\n width: drawerWidth,\r\n transition: theme.transitions.create('width', {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.enteringScreen,\r\n }),\r\n },\r\n drawerClose: {\r\n transition: theme.transitions.create('width', {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.leavingScreen,\r\n }),\r\n overflowX: 'hidden',\r\n width: theme.spacing(7) + 1,\r\n [theme.breakpoints.up('sm')]: {\r\n width: theme.spacing(9) + 1,\r\n },\r\n },\r\n toolbar: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'flex-end',\r\n padding: theme.spacing(0, 1),\r\n // necessary for content to be below app bar\r\n ...theme.mixins.toolbar,\r\n },\r\n content: {\r\n flexGrow: 1,\r\n padding: theme.spacing(3),\r\n },\r\n title: {\r\n flexGrow: 1,\r\n textAlign: 'center',\r\n },\r\n }),\r\n);\r\n\r\n\r\nconst MiniDrawer = (props: any) => {\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const [open, setOpen] = React.useState(true);\r\n let [tokenState, setTokenState] = useState(null);\r\n\r\n let {\r\n getUnreadMessageCount,\r\n NotificationCount } = props;\r\n\r\n let { isLoading, isLoaded } = NotificationCount\r\n\r\n const handleDrawerOpen = () => {\r\n setOpen(true);\r\n };\r\n\r\n const handleDrawerClose = () => {\r\n setOpen(false);\r\n };\r\n const pathname = useLocation().pathname;\r\n let friendlyPath = pathname.replace(\"/\", \"\").replaceAll(\"-\", \" \").split(\"/\")[0];\r\n if (friendlyPath.includes(\"account\"))\r\n friendlyPath = \"account\";\r\n if (friendlyPath.includes(\"patient list\"))\r\n friendlyPath = \"patient list\";\r\n if (friendlyPath.includes(\"compose new message\"))\r\n friendlyPath = \"compose new message\";\r\n const { children } = props;\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken) {\r\n if (tokenState?.accessToken) {\r\n getUnreadMessageCount(tokenState.accessToken);\r\n }\r\n }\r\n }, [tokenState])\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n {/* Collapsed Logo */}\r\n \"Logo\"\r\n\r\n \r\n\r\n \r\n \r\n \r\n {friendlyPath}\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n
\r\n \r\n\r\n {/* Expanded Logo */}\r\n \"Logo\"\r\n \r\n \r\n
\r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n
\r\n {children}\r\n
\r\n\r\n
\r\n );\r\n}\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(MiniDrawer as any);\r\n","import React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\r\nimport AppBar from '@material-ui/core/AppBar';\r\nimport Toolbar from '@material-ui/core/Toolbar';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Button from '@material-ui/core/Button';\r\nimport SettingsIcon from '@material-ui/icons/Settings';\r\nimport LogoutButton from './LogoutButton';\r\n\r\nimport { useLocation } from 'react-router-dom';\r\n\r\n\r\n\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n flexGrow: 1,\r\n },\r\n menuButton: {\r\n marginRight: theme.spacing(2),\r\n },\r\n title: {\r\n flexGrow: 1,\r\n textAlign: 'center'\r\n },\r\n }),\r\n);\r\n\r\nexport default function ButtonAppBar() {\r\n const classes = useStyles();\r\n const pathname = useLocation().pathname;\r\n let friendlyPath = pathname.replace(\"/\", \"\").replace(\"-\", \" \");\r\n\r\n\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n {friendlyPath}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n\r\n\r\n\r\n","import * as React from 'react';\r\nimport { CssBaseline } from '@material-ui/core';\r\n// import { Container } from 'reactstrap';\r\n\r\nimport { Container } from '@material-ui/core';\r\nimport { ThemeProvider, makeStyles } from '@material-ui/core/styles';\r\nimport VitalsMDTheme from './VitalsMDTheme';\r\n//import NavMenu from './NavMenu';\r\nimport BottomNav from './BottomNav';\r\nimport Drawer from './Drawer';\r\nimport AppBar from './AppBar';\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport { useSelector } from 'react-redux';\r\nimport Box from '@material-ui/core/Box';\r\nimport './style.css';\r\n\r\nexport default class Layout extends React.PureComponent<{}, { children?: React.ReactNode }> {\r\n public render() {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {this.props.children}\r\n \r\n \r\n\r\n \r\n \r\n {this.props.children}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\n//const Layout: React.FC<{}, { children?: React.ReactNode }> = ({ children }) => {\r\n// const oidc = useSelector((state: any) => state.oidc);\r\n// const userLoggedIn = oidc == null ? false : oidc.user;\r\n\r\n// return (\r\n// \r\n// \r\n// \r\n// {userLoggedIn\r\n// &&\r\n// \r\n// }\r\n// \r\n// {children}\r\n// \r\n// {userLoggedIn\r\n// &&\r\n// \r\n// }\r\n// \r\n// \r\n// );\r\n//}\r\n\r\n//export default Layout;","\r\nimport React from \"react\";\r\nimport { Route, useHistory, Redirect } from \"react-router-dom\";\r\nimport PropTypes from \"prop-types\";\r\nimport { connect } from \"react-redux\";\r\nimport LoginPage from \"../LoginPage\";\r\nimport Layout from '../Layout';\r\nimport {useIsAuthenticated } from \"@azure/msal-react\";\r\n\r\nconst PrivateRoute = ({ component: Component\r\n , ...rest }) => {\r\n const history = useHistory();\r\n const isAuthenticated = useIsAuthenticated();\r\n return (\r\n {\r\n if (!isAuthenticated) {\r\n return ;\r\n } else {\r\n return ;\r\n }\r\n }}\r\n />\r\n );\r\n};\r\n\r\nexport default PrivateRoute;","import { createUserManager } from \"redux-oidc\";\r\n\r\nconst clientId = \"57d78c7b-0c9f-416e-8c5a-0ac66f04cf48\"; //GUID Client Application ID\r\nconst tenantId = \"6aa88db0-b38c-43a9-83a7-18c2294002e5\"; //GUID Azure Tenant ID\r\nconst resourceId = \"api://5ba09613-bfc9-4988-93b4-90999978e29d\"; //GUID API Application ID\r\n\r\nconst userManagerConfig = {\r\n authority: `https://login.microsoftonline.com/${tenantId}/.well-known/openid-configuration`,\r\n client_id: clientId,\r\n redirect_uri: `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : \"\"}/callback`,\r\n post_logout_redirect_uri: `${window.location.protocol}//${window.location.hostname}${window.location.port ? `:${window.location.port}` : \"\"}`,\r\n automaticSilentRenew: false,\r\n filterProtocolClaims: true,\r\n loadUserInfo: false,\r\n scope: \"openid profile\",\r\n response_type: \"token id_token\",\r\n //response_type: \"code\",\r\n extraQueryParams: {\r\n resource: resourceId\r\n },\r\n signingKeys: [\r\n ]\r\n};\r\n\r\nconst userManager = createUserManager(userManagerConfig);\r\n\r\nexport default userManager;","\r\nimport React, { Component } from \"react\";\r\nimport { connect } from \"react-redux\";\r\nimport { CallbackComponent } from \"redux-oidc\";\r\nimport userManager from \"../util/userManager\";\r\nimport PropTypes from \"prop-types\";\r\nimport { useHistory } from \"react-router-dom\";\r\n//import { push } from \"react-router-redux\";\r\n\r\n//class CallbackPage extends Component {\r\n// render() {\r\n// return (\r\n// {\r\n// this.props.dispatch(push(\"/home\"));\r\n// }}\r\n// errorCallback={error => {\r\n// this.props.dispatch(push(\"/\"));\r\n// console.error(error);\r\n// }}\r\n// >\r\n//
Redirecting...
\r\n// \r\n// );\r\n// }\r\n//}\r\n\r\n//CallbackPage.propTypes = {\r\n// dispatch: PropTypes.func.isRequired\r\n//};\r\n\r\n//export default connect()(CallbackPage);\r\n\r\n\r\nconst CallbackPage = () => {\r\n const history = useHistory();\r\n return (\r\n {\r\n history.push(\"/home\");\r\n }}\r\n errorCallback={error => {\r\n history.push(\"/error\");\r\n console.error(error);\r\n }}\r\n >\r\n
Redirecting...
\r\n \r\n\r\n );\r\n}\r\nexport default CallbackPage;","\r\nimport React, { Component, useEffect } from \"react\";\r\nimport userManager from \"../util/userManager\";\r\n\r\nconst LogoutPage = () => {\r\n\r\n useEffect(() => {\r\n userManager.signoutRedirect();\r\n });\r\n\r\n\r\n return (\r\n
\r\n

Log out

\r\n
\r\n );\r\n\r\n}\r\n\r\nexport default LogoutPage;","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nimport Button from '@material-ui/core/Button';\r\nimport DialogTitle from '@material-ui/core/DialogTitle';\r\nimport DialogContent from '@material-ui/core/DialogContent';\r\nimport DialogActions from '@material-ui/core/DialogActions';\r\nimport Dialog from '@material-ui/core/Dialog';\r\nimport { Paper } from '@material-ui/core'\r\n\r\nconst ConfirmDialog = (props) => {\r\n const { title, question, onClose, value: valueProp, open, ...other } = props;\r\n const [value, setValue] = React.useState(valueProp);\r\n\r\n\r\n React.useEffect(() => {\r\n if (!open) {\r\n setValue(valueProp);\r\n }\r\n }, [valueProp, open]);\r\n\r\n\r\n\r\n const handleCancel = () => {\r\n onClose();\r\n };\r\n\r\n const handleOk = () => {\r\n onClose(value);\r\n };\r\n\r\n const handleChange = (event) => {\r\n setValue(event.target.value);\r\n };\r\n\r\n return (\r\n
\r\n \r\n {title}\r\n \r\n {question}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nexport default ConfirmDialog\r\n","import * as APIStore from \"../../store/APIStore\";\r\nimport React, { useEffect, useState } from \"react\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { connect } from \"react-redux\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\n\r\nexport interface DirectProps {\r\n message: APIStore.Message;\r\n subjectPatient: APIStore.Patient;\r\n}\r\n\r\n\r\ntype NotificationPatientProps = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators &\r\n DirectProps\r\n\r\nconst formatPcn = (pcnVal:string) => {\r\n if (!pcnVal) {\r\n return \"N/A\";\r\n }\r\n\r\n return pcnVal;\r\n}\r\nconst NotificationPatient = (props: NotificationPatientProps) => {\r\n let patient: APIStore.Patient = props?.message.patient;\r\n if (!patient?.patientEncounterId) {\r\n patient = props?.FocusPatient.patient;\r\n }\r\n\r\n let { firstName, lastName, encounters, patientEncounterId } = patient;\r\n\r\n let subjectEncounter: APIStore.Encounter = encounters\r\n .filter(e => e.encounterId === patientEncounterId || e.patientId === patientEncounterId)[0];\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n Patient\r\n \r\n \r\n \r\n \r\n {lastName}, {firstName}\r\n \r\n \r\n \r\n \r\n PCN {formatPcn(subjectEncounter.pcn)}\r\n \r\n \r\n \r\n \r\n Policy No {formatPcn(subjectEncounter.mbi)}\r\n \r\n \r\n \r\n \r\n {subjectEncounter.facility.facilityName}\r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\n\r\n\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(NotificationPatient as any);","import React, { useState } from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport FileCopyIcon from '@material-ui/icons/FileCopy';\r\nimport RequestAccessToken from \"../util/authService\";\r\nimport CircularProgress from '@material-ui/core/CircularProgress';\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\n\r\nconst MessageAttachment = (props: any) => {\r\n let { documentFileName, documentId, apiHost } = props;\r\n const history = useHistory();\r\n let [tokenState, setTokenState] = useState(null);\r\n let [downloadingState, setDownloadState] = useState(false);\r\n let [downloadErrorState, setDownloadErrorState] = useState(false);\r\n let [errorMessage, setErrorMessage] = useState('');\r\n\r\n let tokenStatePr = RequestAccessToken().then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n\r\n const downloadDocument = (documentId: string, documentName: string, accessToken: string, document: any) => {\r\n setDownloadState(true);\r\n setDownloadErrorState(false);\r\n\r\n let request = {\r\n DocumentId: documentId,\r\n Name: documentName\r\n }\r\n\r\n const options = {\r\n method: \"POST\",\r\n headers: {\r\n Accept: \"application/json\",\r\n 'Content-Type': 'application/json;',\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(request)\r\n };\r\n\r\n fetch(`https://${apiHost}/api/AzureStorage/GetBlob/`, options)\r\n .then((res) => { return res.blob(); })\r\n .then((data) => {\r\n let a = document.createElement(\"a\")\r\n a.href = window.URL.createObjectURL(data);\r\n a.download = documentName;\r\n a.click();\r\n setDownloadState(false);;\r\n }).catch((err) => {\r\n \r\n setDownloadErrorState(true);\r\n setDownloadState(false);\r\n setErrorMessage(err.message)\r\n })\r\n }\r\n\r\n if (!documentFileName) {\r\n return ()\r\n }\r\n\r\n const downloadDoc = (e) => {\r\n e.preventDefault();\r\n downloadDocument(documentId, documentFileName, tokenState.accessToken, document)\r\n };\r\n\r\n if (downloadingState) {\r\n return \r\n \r\n

{`Downloading ${documentFileName} ...`}

\r\n \r\n
\r\n
\r\n }\r\n\r\n\r\n if(downloadErrorState) {\r\n return (\r\n \r\n \r\n

{errorMessage}

\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n

{documentFileName}

\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default MessageAttachment;\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { Slide, Button, Box } from \"@material-ui/core\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { connect } from \"react-redux\";\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { Reply, Forward, Delete, Send, Cancel } from \"@material-ui/icons\";\r\nimport ConfirmDialog from \"./ConfirmDialog\";\r\nimport { useHistory, useParams } from \"react-router-dom\";\r\nimport moment from 'moment';\r\nimport RequestAccessToken from '../util/authService';\r\nimport Snackbar from '@material-ui/core/Snackbar';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport CloseIcon from '@material-ui/icons/Close';\r\nimport ErrorIcon from '@material-ui/icons/Error';\r\nimport NotificationPatient from './notification/NotificationPatient'\r\nimport { DetailedPatientStateType } from './notification/MessagePatientLoadState';\r\nimport './style.css';\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport MessageAttachment from \"./MessageAttachment\";\r\n\r\ntype NotificationItemProps = {\r\n Messages : APIStore.MessageState,\r\n FocusPatient : APIStore.FocusPatientState,\r\n Patients : APIStore.PatientState,\r\n apiHost: string\r\n\r\n \r\n} & typeof APIStore.actionCreators & RouteComponentProps<{ MessageId: string }>;\r\n\r\n\r\nconst formatDate = (date : any) => {\r\n return moment(date).format(\"hh:mm:ss A MM-DD-YYYY\");\r\n}\r\n\r\n\r\nconst findErrorsForMessage = (messageId: number, Errors: APIStore.MessageStateError[]) => {\r\n let errors = Errors.filter(val => val.messageId === messageId);\r\n if (errors.length) {\r\n return errors[0];\r\n }\r\n}\r\n\r\nconst MessageIsAdmitNotification = (message: APIStore.Message) => {\r\n if(!message) {\r\n return false;\r\n }\r\n if (message.description === 'admit') {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nconst MessageIsDischargeNotification = (message: APIStore.Message) => {\r\n if(!message) {\r\n return false;\r\n }\r\n if (message.description === 'discharge') {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nconst messageIsSystemNotification = (message: APIStore.Message) => {\r\n if (MessageIsAdmitNotification(message) || MessageIsDischargeNotification(message)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nconst formatSender = (sender : string) => {\r\n // format physician names\r\n // potentially display phone\r\n // properly display VitalsMD symbol\r\n\r\n if (sender === 'RefMD') {\r\n return 'System'\r\n }\r\n\r\n return sender;\r\n}\r\n\r\nconst NotifcationItem = (props: NotificationItemProps) => {\r\n let { Messages, archiveMessage, apiHost, requestProviderMessage, markMessageAsRead, clearSentMessageState, requestConsolidatedPatientById, FocusPatient } = props;\r\n let { Errors, SendMessageState, FocusMessage, failedLoading }: APIStore.MessageState = Messages;\r\n let [tokenState, setTokenState] = useState();\r\n let [readNotification, setReadNotification] = useState(false);\r\n const [deleteDialogOpen, setDeleteDialogOpen] = React.useState(false);\r\n\r\n\r\n let initial: DetailedPatientStateType = {\r\n patient: undefined,\r\n isLoaded: false,\r\n isLoading: false\r\n };\r\n\r\n let [detailedPatientState, setDetailedPatientState] = useState(initial);\r\n\r\n let Patients = props.Patients;\r\n\r\n\r\n let messageId = parseInt(props.match.params.MessageId) || 0;\r\n\r\n const handleClickListItem = () => {\r\n setDeleteDialogOpen(true);\r\n };\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (tokenState && tokenState.accessToken) {\r\n requestProviderMessage(tokenState.accessToken, messageId);\r\n }\r\n }, [tokenState, messageId]);\r\n\r\n useEffect(() => {\r\n if (FocusMessage?.messageId) {\r\n let patientEncounterId = FocusMessage.message?.ptId;\r\n if (tokenState?.accessToken && !detailedPatientState?.isLoaded && !detailedPatientState.isLoading) {\r\n requestConsolidatedPatientById(patientEncounterId, tokenState.accessToken);\r\n setDetailedPatientState({\r\n ...detailedPatientState,\r\n isLoading: true\r\n })\r\n }\r\n\r\n\r\n if (detailedPatientState.isLoading) {\r\n if (FocusPatient?.patient?.patientEncounterId) {\r\n setDetailedPatientState({ isLoaded: true, isLoading: false, patient: FocusPatient?.patient })\r\n }\r\n }\r\n }\r\n\r\n }, [tokenState, detailedPatientState, Patients.fullPatients, FocusMessage]);\r\n\r\n let fullMessage = FocusMessage?.message;\r\n\r\n if (!FocusMessage || !FocusMessage.message) {\r\n return ;\r\n }\r\n\r\n if (FocusMessage.isErrored) {\r\n return ;\r\n }\r\n\r\n let isSent, message, isErrored = null;\r\n let messageSent = false;\r\n let sentMessage = '';\r\n if (SendMessageState) {\r\n let { isSent, message, isErrored } = SendMessageState;\r\n messageSent = isSent;\r\n sentMessage = message;\r\n }\r\n\r\n let generalErrorMessage = '';\r\n if (Errors && Errors.length) {\r\n let generalError = Errors.filter(val => val.messageId < 1)[0];\r\n generalErrorMessage = generalError.error;\r\n }\r\n\r\n const handleClose = () => {\r\n if(fullMessage && tokenState) {\r\n archiveMessage(fullMessage, tokenState.accessToken);\r\n setDeleteDialogOpen(false);\r\n history.goBack();\r\n }\r\n };\r\n\r\n const handleCloseSnack = () => {\r\n debugger;\r\n isSent = false;\r\n messageSent = false;\r\n sentMessageSubject = '';\r\n clearSentMessageState();\r\n }\r\n\r\n const history = useHistory();\r\n const reply = () => {\r\n history.push(\"/notification-reply\", { message: fullMessage });\r\n };\r\n const goBack = () => {\r\n history.goBack();\r\n };\r\n\r\n if (FocusMessage.isLoading || !detailedPatientState?.isLoaded ) {\r\n return (\r\n\r\n
\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n

    

\r\n

    

\r\n
\r\n\r\n
\r\n \r\n

Loading...

\r\n
\r\n
\r\n\r\n
\r\n
\r\n )\r\n }\r\n\r\n if (FocusMessage.isErrored) {\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
From: N/A
\r\n
Subject: N/A
\r\n
Date: N/A
\r\n
\r\n\r\n
\r\n \r\n {FocusMessage.errorMessage}\r\n \r\n
\r\n
\r\n
\r\n
)\r\n }\r\n\r\n\r\n let statusStr = '';\r\n let error = APIStore.findMessage(fullMessage.messageId, Errors);\r\n if (error) {\r\n statusStr = `Error ${error.error}`;\r\n }\r\n\r\n if (SendMessageState && SendMessageState.isSent) {\r\n statusStr = `Message Sent '${SendMessageState.message.subject}''`\r\n }\r\n\r\n if (tokenState && tokenState.accessToken && !readNotification) {\r\n markMessageAsRead(tokenState.accessToken, fullMessage);\r\n setReadNotification(true);\r\n }\r\n\r\n\r\n let sentMessageSubject = '';\r\n if (sentMessage && sentMessage.subject) {\r\n sentMessageSubject = sentMessage.subject;\r\n }\r\n\r\n\r\n\r\n return (\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
From: {formatSender(fullMessage.senderId, fullMessage.type)}
\r\n
Subject: {fullMessage.subject}
\r\n
Date: {formatDate(fullMessage.createdDate)}
\r\n
\r\n \r\n
\r\n \r\n {fullMessage.message}\r\n \r\n \r\n
{statusStr}
\r\n
\r\n \r\n\r\n \r\n
\r\n
\r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n } />\r\n\r\n \r\n \r\n handleCloseSnack()}>\r\n \r\n \r\n \r\n }\r\n\r\n open={messageSent && !isErrored} message={`Message Sent: ${sentMessageSubject}`\r\n } />\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(NotifcationItem as any);\r\n","import React from \"react\";\r\nimport {\r\n Slide,\r\n Paper,\r\n Divider,\r\n ButtonGroup,\r\n Button,\r\n Box,\r\n TextField,\r\n} from \"@material-ui/core\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport { useState, useEffect } from \"react\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { useRouteMatch } from \"react-router-dom\";\r\nimport { Reply, Forward, Delete, Send, Cancel } from \"@material-ui/icons\";\r\nimport ConfirmDialog from \"./ConfirmDialog\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport RequestAccessToken from \"../util/authService\";\r\nimport NotificationPatient from \"./notification/NotificationPatient\";\r\nimport { DetailedPatientStateType } from './notification/MessagePatientLoadState';\r\n\r\n\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport './style.css';\r\nimport { refMDLoaded, practiceCoordinatorLoaded, shouldTryRefMDProfile, shouldTryCareCoordinatorProfile } from './common/ProfileHelper'\r\n\r\n\r\ntype NotificationItemReply = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators &\r\n RouteComponentProps<{ MessageId: string }>;\r\n\r\nconst makeReplyMessage = (\r\n orginalMessage: APIStore.Message,\r\n userId: string\r\n): APIStore.Message => {\r\n let ret: APIStore.Message = {\r\n ...orginalMessage,\r\n senderId: userId,\r\n receiverId: orginalMessage.senderId,\r\n subject: `RE ${orginalMessage.subject}`,\r\n };\r\n\r\n return ret;\r\n};\r\n\r\nconst NotificationReply = (props: NotificationItemReply) => {\r\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\r\n const initialMessageState: APIStore.Message = {};\r\n const [replyMessageState, setReplyMessageState] =\r\n useState(initialMessageState);\r\n let {\r\n location,\r\n Messages,\r\n submitReplyMessage,\r\n archiveMessage,\r\n requestConsolidatedPatientById,\r\n Patients,\r\n FocusPatient\r\n } = props;\r\n\r\n let userPracticeCoordinatorProfile = props.userPracticeCoordinatorProfile;\r\n let userRefMdProfile = props.userRefMdProfile;\r\n let { state } = location;\r\n let { message } = state;\r\n\r\n let { SendMessageState } = Messages;\r\n\r\n let initial: DetailedPatientStateType = {\r\n patient: undefined,\r\n isLoaded: false,\r\n isLoading: false\r\n };\r\n\r\n let [detailedPatientState, setDetailedPatientState] = useState(initial);\r\n\r\n let [tokenState, setTokenState] = useState(null);\r\n\r\n let tokenStatePr = RequestAccessToken().then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (message?.messageId) {\r\n if (practiceCoordinatorLoaded(userPracticeCoordinatorProfile)) {\r\n setReplyMessageState(makeReplyMessage(message, userPracticeCoordinatorProfile.coordinatorProfile?.azureAdAccount));\r\n } else if (refMDLoaded(userRefMdProfile)) {\r\n setReplyMessageState(makeReplyMessage(message, userRefMdProfile.refmdProfile?.email));\r\n }\r\n\r\n }\r\n }, [message]);\r\n\r\n\r\n\r\n useEffect(() => {\r\n if (message?.messageId) {\r\n let patientEncounterId = message?.ptId;\r\n if (tokenState?.accessToken && !detailedPatientState?.isLoaded && !detailedPatientState.isLoading) {\r\n requestConsolidatedPatientById(patientEncounterId, tokenState.accessToken);\r\n setDetailedPatientState({\r\n ...detailedPatientState,\r\n isLoading: true\r\n })\r\n }\r\n\r\n\r\n if (detailedPatientState.isLoading) {\r\n if (FocusPatient?.patient?.patientEncounterId) {\r\n setDetailedPatientState({ isLoaded: true, isLoading: false, patient: FocusPatient?.patient });\r\n }\r\n }\r\n }\r\n\r\n }, [tokenState, detailedPatientState, Patients.fullPatients, message]);\r\n\r\n const handleMessageChange = (e: any) => {\r\n setReplyMessageState({\r\n ...replyMessageState,\r\n Message: e.target.value\r\n });\r\n };\r\n const handleSubmit = () => {\r\n submitReplyMessage(replyMessageState, tokenState.accessToken);\r\n goBack();\r\n };\r\n\r\n const handleDelete = () => {\r\n archiveMessage(replyMessageState, tokenState.accessToken);\r\n setDeleteDialogOpen(true);\r\n };\r\n\r\n const handleClose = () => {\r\n archiveMessage(replyMessageState, tokenState.accessToken);\r\n setDeleteDialogOpen(false);\r\n };\r\n\r\n const history = useHistory();\r\n const goBack = () => {\r\n history.goBack();\r\n };\r\n\r\n if (!replyMessageState?.messageId || !detailedPatientState?.isLoaded) {\r\n return <>;\r\n }\r\n\r\n let statusStr = '';\r\n if (SendMessageState && SendMessageState.isErrored) {\r\n statusStr = SendMessageState.error;\r\n }\r\n if (SendMessageState && SendMessageState.isSent) {\r\n statusStr = `Message Sent ${SendMessageState.message.messageId}`\r\n }\r\n\r\n\r\n return (\r\n\r\n
\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {`${new Date()}`}

\r\n
To: {`${replyMessageState.receiverId}`}
\r\n
From: {`${replyMessageState.senderId}`}
\r\n
Subject: {`${replyMessageState.subject}`}
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(NotificationReply as any);\r\n","import React from \"react\";\r\nimport {\r\n Slide,\r\n Button,\r\n Box,\r\n TextField,\r\n Select,\r\n InputLabel,\r\n FormControl,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport { useState } from \"react\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { connect } from \"react-redux\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport { Send, Cancel } from \"@material-ui/icons\";\r\nimport Snackbar from \"@material-ui/core/Snackbar\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport CloseIcon from \"@material-ui/icons/Close\";\r\nimport ErrorIcon from \"@material-ui/icons/Error\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport RequestAccessToken from \"../../util/authService\";\r\nimport NotificationPatient from \"./NotificationPatient\";\r\n\r\nimport \"../style.css\";\r\nimport Hidden from \"@material-ui/core/Hidden\";\r\nimport { makeStyles } from '@material-ui/core/styles';\r\n\r\n\r\ntype NotificationComposeProps = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators &\r\n RouteComponentProps<{ receiverId: string }>;\r\n\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n '& .MuiTextField-root': {\r\n margin: theme.spacing(1),\r\n width: '25ch',\r\n },\r\n },\r\n input: {\r\n display: 'none',\r\n },\r\n}));\r\n\r\nconst NotificationCompose = (props: NotificationComposeProps) => {\r\n let {\r\n\r\n submitNewMessageWithAttachment,\r\n Messages,\r\n clearMessageState,\r\n\r\n } = props;\r\n\r\n let FocusPatient: APIStore.Patient = props?.FocusPatient?.patient;\r\n let location = props.location;\r\n let PatientPhysiciansContacts = props.PatientPhysiciansContacts;\r\n\r\n\r\n let newInitialState: APIStore.Message = {subject : `Patient: ${FocusPatient.lastName}`};\r\n let [tokenState, setTokenState] = useState(null);\r\n let [physicianSelectionState, setPhysicianSelectionState] = useState();\r\n const [newMessageState, setNewMessageState] = useState(newInitialState);\r\n\r\n let tokenStatePr = RequestAccessToken().then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n let { state } = location;\r\n\r\n let PatientPhysicians = PatientPhysiciansContacts.userPatientContacts;\r\n\r\n const classes = useStyles();\r\n\r\n let isErrored, error, message = null;\r\n\r\n let receiverId = null;\r\n if (state) {\r\n ({ receiverId } = state);\r\n }\r\n\r\n let messageError = \"\";\r\n let SendMessageState = Messages.SendMessageState;\r\n if (SendMessageState) {\r\n let { isErrored, error, message } = SendMessageState;\r\n }\r\n if (isErrored) {\r\n messageError = error;\r\n }\r\n\r\n if (receiverId && (!physicianSelectionState?.email)) {\r\n let physicianSelectionTemp = PatientPhysicians.filter(\r\n (val) => val.email === receiverId\r\n )[0];\r\n\r\n if(physicianSelectionTemp) {\r\n setPhysicianSelectionState(physicianSelectionTemp);\r\n\r\n setNewMessageState({\r\n ...newMessageState,\r\n receiverId: receiverId\r\n });\r\n } \r\n }\r\n\r\n const history = useHistory();\r\n const goBack = () => {\r\n history.goBack();\r\n };\r\n\r\n const handleMessageChange = (e: any) => {\r\n setNewMessageState({\r\n ...newMessageState,\r\n Message: e.target.value,\r\n });\r\n };\r\n\r\n const handleSubjectChange = (e: any) => {\r\n setNewMessageState({\r\n ...newMessageState,\r\n subject: e.target.value,\r\n });\r\n };\r\n\r\n const handleSend = () => {\r\n sendFormAndFileState();\r\n goBack();\r\n };\r\n\r\n const handleErrorClose = () => {\r\n clearMessageState();\r\n };\r\n\r\n const handleFileSelectChange = (e: any) => {\r\n let file = e.target.files[0];\r\n let fileName = file.name;\r\n\r\n setNewMessageState({\r\n ...newMessageState,\r\n document: file,\r\n documentFileName: fileName\r\n });\r\n }\r\n\r\n const sendFormAndFileState = () => {\r\n const formData = new FormData();\r\n for (var key in newMessageState) {\r\n if (key !== \"Document\") {\r\n formData.append(key, newMessageState[key])\r\n }\r\n }\r\n\r\n formData.append(\"PtId\", FocusPatient.patientEncounterId)\r\n formData.append(\"Document\", newMessageState.document)\r\n formData.append(\"DocumentFileName\", newMessageState.documentFileName)\r\n\r\n submitNewMessageWithAttachment(formData, tokenState.accessToken)\r\n }\r\n\r\n const handleReceiverChange = (e: any) => {\r\n let physicianSelectionTemp = PatientPhysicians.filter(\r\n (val) => val.email === e.target.value\r\n )[0];\r\n\r\n if(physicianSelectionTemp) {\r\n setPhysicianSelectionState(physicianSelectionTemp); \r\n }\r\n\r\n setNewMessageState({\r\n ...newMessageState,\r\n receiverId: e.target.value\r\n });\r\n };\r\n\r\n\r\n\r\n \r\n\r\n if (!physicianSelectionState || !physicianSelectionState?.email) {\r\n return ();\r\n }\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n To:\r\n {handleReceiverChange(e)}}\r\n labelId=\"demo-simple-select-label\"\r\n id=\"demo-simple-select\"\r\n label=\"To:\"\r\n >\r\n {PatientPhysicians.map((val) => {\r\n if (val.type.includes('Program')) {\r\n return (\r\n \r\n {val.displayName} - {val.type}\r\n \r\n );\r\n } else {\r\n return (\r\n \r\n {val.displayName}\r\n \r\n );\r\n }\r\n\r\n })}\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n />\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(NotificationCompose as any);\r\n","import React from \"react\";\r\nimport { useState, useEffect } from \"react\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport MUIDataTable from \"mui-datatables\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport moment from \"moment\";\r\nimport { TableFooter, TableCell, TableRow, Paper, Slide } from \"@material-ui/core\";\r\nimport { createTheme, ThemeProvider } from \"@material-ui/core/styles\";\r\nimport RequestAccessToken from \"../util/authService\";\r\nimport DoneAllIcon from '@material-ui/icons/DoneAll';\r\nimport { red } from '@material-ui/core/colors';\r\nimport { shouldTryRefMDProfile } from \"./common/ProfileHelper\";\r\nconst SPACED_DATE_FORMAT = \"MM-DD-YYYY\";\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport { Grid } from '@material-ui/core';\r\nimport { Typography } from \"@material-ui/core\";\r\nimport './style.css';\r\nimport './PatientsTable.css';\r\n\r\ntype PatientsByRefMDProps = {\r\n Patients : APIStore.PatientState,\r\n userRefMdProfile : APIStore.RefMDProfileState\r\n} &\r\n typeof APIStore.actionCreators &\r\n RouteComponentProps<{ RefMdId: string }>;\r\n\r\nconst fetchPatientsForRefMD = (\r\n accessToken: string,\r\n refMDIdStr: string,\r\n actionMethod: Function\r\n) => {\r\n const refMDIdArg = parseInt(refMDIdStr) || 0;\r\n actionMethod(refMDIdArg, -6, true, accessToken);\r\n};\r\n\r\nconst formatDate = (date: string | undefined, dateOnly: any) => {\r\n if (!date) {\r\n return 'N/A';\r\n }\r\n if (dateOnly) {\r\n return moment(date).format(\"MM-DD-YYYY\");\r\n }\r\n return moment(date).format(\"hh:mm:ss A MM-DD-YYYY\");\r\n};\r\n\r\nconst getMuiTheme = () =>\r\n createTheme({\r\n\r\n });\r\n\r\nconst PatientsTable = (props: PatientsByRefMDProps) => {\r\n let [patientsState, setPatientState] = useState({});\r\n let [tokenState, setTokenState] = useState();\r\n\r\n let { requestPatientsByRefMDIdWithDays, Patients, requestConsolidatedPatientById, requestVitalsMdProfile, requestMessageContactsUser } = props;\r\n\r\n let userRefMdProfile: APIStore.RefMDProfileState = props.userRefMdProfile;\r\n\r\n let { patientsByRefMDId, isLoading, isLoaded, isError, errorMessage, fullPatients } = Patients;\r\n\r\n const tableColumns = [\r\n {\r\n name: \"Readmit\",\r\n options: {\r\n display: true,\r\n setCellProps: () => ({ style: { minWidth: \"50px\", maxWidth: \"50px\" } }),\r\n filter: false\r\n },\r\n },\r\n {\r\n name: \"id\",\r\n options: {\r\n display: false,\r\n filter: false\r\n }\r\n },\r\n {\r\n name: \"Facility\",\r\n options: {\r\n filterType: 'checkbox'\r\n }\r\n },\r\n {\r\n name: \"First Name\",\r\n options: {\r\n filter: false\r\n }\r\n },\r\n {\r\n name: \"Last Name\",\r\n options: {\r\n filter: false\r\n }\r\n },\r\n {\r\n name: \"AdmitDate\",\r\n label: \"Admit Date\",\r\n options: {\r\n sort: true,\r\n customBodyRender: value => {\r\n let dt = moment(new Date(value));\r\n\r\n\r\n if (dt.isValid()) {\r\n return dt.format(SPACED_DATE_FORMAT);;\r\n } else {\r\n return 'N/A'\r\n }\r\n },\r\n filter: false\r\n }\r\n },\r\n {\r\n name: \"DischargeDate\",\r\n label: \"Days to Discharge\",\r\n options: {\r\n filter: false\r\n }\r\n },\r\n {\r\n name: \"Policy No\",\r\n options: {\r\n filter: false\r\n }\r\n }\r\n ];\r\n\r\n let tokenStatePr = RequestAccessToken().then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if ((shouldTryRefMDProfile(userRefMdProfile)) && tokenState?.accessToken) {\r\n requestVitalsMdProfile(tokenState.accessToken);\r\n }\r\n }, [tokenState]);\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken && userRefMdProfile.isLoaded) {\r\n requestMessageContactsUser(tokenState.accessToken)\r\n fetchPatientsForRefMD(\r\n tokenState.accessToken,\r\n props.match.params.RefMdId,\r\n requestPatientsByRefMDIdWithDays\r\n );\r\n }\r\n }, [tokenState, userRefMdProfile]);\r\n\r\n const options = {\r\n onRowClick: (\r\n rowData: string[],\r\n rowMeta: { dataIndex: number; rowIndex: number }\r\n ) => patientRowClick(rowData, rowMeta),\r\n elevation: 0,\r\n filter: true,\r\n viewColumns: false,\r\n selectableRows: false,\r\n print: true,\r\n delete: false,\r\n download: true,\r\n searchAlwaysOpen: false,\r\n responsive: 'vertical',\r\n customRowRender: (data, dataIndex, rowIndex) => {\r\n if (data[0] > 0) {\r\n return (\r\n patientRowClick(data)} >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n data[3]\r\n } \r\n {\r\n data[4]\r\n }\r\n \r\n \r\n\r\n \r\n \r\n Admitted: {\r\n data[5]\r\n }\r\n \r\n \r\n \r\n \r\n Days to Discharge: {\r\n data[6]\r\n }\r\n \r\n \r\n \r\n \r\n Policy No: {\r\n data[7]\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n {\r\n data[3]\r\n }\r\n \r\n \r\n {\r\n data[4]\r\n }\r\n \r\n \r\n {\r\n data[5]\r\n }\r\n \r\n \r\n {\r\n data[6]\r\n }\r\n \r\n \r\n {\r\n data[7]\r\n }\r\n \r\n \r\n \r\n )\r\n }\r\n return (\r\n patientRowClick(data)} >\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n data[3]\r\n } \r\n {\r\n data[4]\r\n }\r\n \r\n \r\n\r\n \r\n \r\n Admitted: {\r\n data[5]\r\n }\r\n \r\n \r\n \r\n \r\n Days to Discharge: {\r\n data[6]\r\n }\r\n \r\n \r\n \r\n \r\n Policy No: {\r\n data[7]\r\n }\r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n {\r\n data[3]\r\n }\r\n \r\n \r\n {\r\n data[4]\r\n }\r\n \r\n \r\n {\r\n data[5]\r\n }\r\n \r\n \r\n {\r\n data[6]\r\n }\r\n \r\n \r\n {\r\n data[7]\r\n }\r\n \r\n \r\n );\r\n\r\n }\r\n };\r\n\r\n const loadingOptions = {\r\n filter: false,\r\n viewColumns: false,\r\n print: false,\r\n elevation: 0,\r\n sort: false,\r\n download: false,\r\n customRowRender: (data, dataIndex, rowIndex) => {\r\n if (dataIndex === 0) {\r\n return (\r\n\r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n\r\n \r\n );\r\n },\r\n\r\n customFooter: (count, page, rowsPerPage, changeRowsPerPage, changePage) => {\r\n const startIndex = page * rowsPerPage;\r\n const endIndex = (page + 1) * rowsPerPage;\r\n return (\r\n \r\n \r\n Loading\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n searchAlwaysOpen: true,\r\n textLabels: {\r\n body: {\r\n noMatch: \"Loading\",\r\n },\r\n },\r\n };\r\n\r\n\r\n const errorOptions = {\r\n filter: false,\r\n viewColumns: false,\r\n print: false,\r\n elevation: 0,\r\n sort: false,\r\n download: false,\r\n\r\n customFooter: (count, page, rowsPerPage, changeRowsPerPage, changePage) => {\r\n const startIndex = page * rowsPerPage;\r\n const endIndex = (page + 1) * rowsPerPage;\r\n return (\r\n \r\n \r\n {`Error: ${errorMessage}`}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n searchAlwaysOpen: false,\r\n textLabels: {\r\n body: {\r\n noMatch: \"Error\",\r\n },\r\n },\r\n };\r\n\r\n const history = useHistory();\r\n\r\n\r\n const patientRowClick = (\r\n rowData: string[]\r\n ) => {\r\n let ptId = rowData[1];\r\n history.push(`/Patient/${ptId}`);\r\n };\r\n\r\n if (isLoading || !isLoaded) {\r\n return (\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n if (isError) {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n return (\r\n \r\n
\r\n
\r\n {\r\n\r\n return [\r\n item.recentAdmits,\r\n item.ptId,\r\n item.facilityName,\r\n item.firstName,\r\n item.lastName,\r\n formatDate(item.admitDate, true),\r\n item.daysToDischarge,\r\n item.mbi\r\n ];\r\n })}\r\n columns={tableColumns}\r\n options={options}\r\n />\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(PatientsTable as any);\r\n","\r\nimport React from 'react';\r\n\r\n\r\nimport {\r\n Slide,\r\n TextField,\r\n Grid,\r\n FormControl,\r\n InputLabel,\r\n FormHelperText,\r\n Input,\r\n FormLabel,\r\n FormGroup,\r\n FormControlLabel,\r\n Checkbox,\r\n Button,\r\n Paper\r\n} from \"@material-ui/core\";\r\n\r\nimport { Select, MenuItem } from '@material-ui/core';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport '../style.css';\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n '& .MuiTextField-root': {\r\n margin: theme.spacing(1),\r\n width: '25ch',\r\n },\r\n },\r\n input: {\r\n display: 'none',\r\n },\r\n}));\r\n\r\nconst DirectAdmitRequest = () => {\r\n const classes = useStyles();\r\n const [facility, setFacility] = React.useState('');\r\n const handleFacilityChange = (event) => {\r\n setFacility(event.target.value);\r\n };\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n First Name\r\n \r\n \r\n \r\n \r\n \r\n Last Name\r\n \r\n \r\n \r\n \r\n \r\n Date of Birth\r\n \r\n \r\n \r\n \r\n \r\n Email Address\r\n \r\n \r\n \r\n \r\n \r\n Phone Number\r\n \r\n \r\n \r\n\r\n \r\n \r\n Facility\r\n \r\n St. Joseph's\r\n Memorial\r\n Sacred Heart\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n \r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default DirectAdmitRequest;","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport Box from \"@material-ui/core/Box\"\r\n\r\nexport interface SelectableTextProps {\r\n textSelected: boolean,\r\n textVal: string,\r\n}\r\n\r\nconst SelectableText = (props: SelectableTextProps) => {\r\n let { textSelected, textVal } = props;\r\n\r\n if (textSelected) {\r\n return (<>\r\n \r\n {textVal}\r\n \r\n )\r\n }\r\n\r\n return (<>\r\n \r\n {textVal}\r\n \r\n )\r\n}\r\n\r\nexport default SelectableText","import React from \"react\";\r\nimport { useState, useEffect } from \"react\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { Slide, Typography } from \"@material-ui/core\";\r\nimport MUIDataTable from \"mui-datatables\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport moment from \"moment\";\r\nimport { TableFooter, TableCell, TableRow, Paper } from \"@material-ui/core\";\r\nimport { createTheme, ThemeProvider } from \"@material-ui/core/styles\";\r\nimport RequestAccessToken from \"../util/authService\";\r\nimport DoneAllIcon from '@material-ui/icons/DoneAll';\r\nimport { red } from '@material-ui/core/colors';\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport { Grid } from '@material-ui/core';\r\nimport './style.css';\r\nimport './PatientsTable.css';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport Button from '@material-ui/core/Button';\r\nimport ButtonGroup from '@material-ui/core/ButtonGroup';\r\nimport SelectableText from './common/SelectableText'\r\n\r\ntype PatientsByRefMDProps = {\r\n Patients: APIStore.PatientState,\r\n userPracticeCoordinatorProfile: APIStore.PracticeCoordinatorState,\r\n APIToken: APIStore.TokenType\r\n} &\r\n typeof APIStore.actionCreators;\r\n\r\nconst fetchPatientsForPractice = (\r\n accessToken: string,\r\n practiceId: number,\r\n practiceCoordId: number,\r\n daysBack: number,\r\n actionMethod: Function\r\n) => {\r\n actionMethod(practiceId, practiceCoordId, daysBack, accessToken);\r\n};\r\n\r\nconst SPACED_DATE_FORMAT = \"MM-DD-YYYY\";\r\nconst ADMIT_STAMP_COL_NUM = 10;\r\n\r\nconst formatDate = (date: string, dateOnly: boolean) => {\r\n if (!date) {\r\n return 'N/A';\r\n }\r\n if (dateOnly) {\r\n return moment(date).format(\"MM-DD-YYYY\");\r\n }\r\n return moment(date).format(\"hh:mm:ss A MM-DD-YYYY\");\r\n};\r\n\r\nconst formatPCPUserName = (userName: String) => {\r\n if (!userName) {\r\n return ''\r\n }\r\n\r\n userName = userName.trim()\r\n\r\n return userName;\r\n}\r\n\r\nconst formatAssignedMD = (contact: APIStore.HNIProviderContact) => {\r\n if (!contact) {\r\n return '';\r\n }\r\n if (contact.type.startsWith('Program')) {\r\n return '';\r\n }\r\n\r\n return contact.displayName;\r\n}\r\n\r\nconst useStyles = makeStyles({\r\n root: {\r\n width: 300,\r\n },\r\n});\r\n\r\nconst getMuiTheme = () =>\r\n createTheme({\r\n overrides: {\r\n MUIDataTableBodyCell: {\r\n root: {\r\n backgroundColor: \"#FFFFFF\",\r\n padding: \"1em\",\r\n },\r\n },\r\n\r\n MuiInput: {\r\n underline: {\r\n color: \"#00AAD1\",\r\n },\r\n colorSecondary: {\r\n color: \"#00AAD1\",\r\n },\r\n },\r\n MUIDataTablePagination: {\r\n root: {\r\n backgroundColor: \"rgba(53, 162, 235, 0.1)\",\r\n },\r\n },\r\n },\r\n });\r\n\r\n\r\nconst PracticeCoordinatorPatientsTable = (props: PatientsByRefMDProps) => {\r\n let [tokenState, setTokenState] = useState();\r\n let [daysBack, setDaysBack] = useState(30);\r\n\r\n\r\n let {\r\n requestPatientsByPracticeIdWithDays,\r\n Patients,\r\n requestConsolidatedPatientById,\r\n requestCurrentUserCareCoordinatorProfile,\r\n requestMessageContactsForPractice,\r\n receiveTokenResponse,\r\n APIToken\r\n } = props;\r\n let userPracticeCoordinatorProfile: APIStore.PracticeCoordinatorState = props.userPracticeCoordinatorProfile;\r\n\r\n let { patientsByPracticeId, isLoading, isLoaded, isError, errorMessage, fullPatients }: APIStore.PatientState = Patients;\r\n\r\n const classes = useStyles();\r\n\r\n const tableColumns = [\r\n {\r\n name: \"Readmit\",\r\n options: {\r\n display: true,\r\n setCellProps: () => ({ style: { minWidth: \"50px\", maxWidth: \"50px\" } }),\r\n filter: false\r\n },\r\n },\r\n {\r\n name: \"id\",\r\n options: {\r\n display: false,\r\n filter: false\r\n }\r\n },\r\n\r\n {\r\n name: \"Facility\",\r\n\r\n options: {\r\n filterType: 'checkbox'\r\n },\r\n },\r\n {\r\n name: \"First Name\",\r\n options: {\r\n filter: false\r\n },\r\n },\r\n {\r\n name: \"Last Name\",\r\n options: {\r\n filter: false\r\n },\r\n },\r\n {\r\n name: \"AdmitDate\",\r\n label: \"Admit Date\",\r\n options: {\r\n sort: true,\r\n customBodyRender: value => {\r\n let dt = moment(new Date(value).getTime());\r\n if (dt.isValid()) {\r\n return dt.format(SPACED_DATE_FORMAT);;\r\n } else {\r\n return 'N/A'\r\n }\r\n },\r\n filter: true\r\n }\r\n },\r\n {\r\n name: \"Days To Discharge\",\r\n options: {\r\n filter: true,\r\n customBodyRender: value => {\r\n if (value == 10001) {\r\n return 'N/A'\r\n }\r\n\r\n if (value == 10002) {\r\n return 'DISC'\r\n }\r\n\r\n return value;\r\n },\r\n }\r\n },\r\n {\r\n name: \"Assigned MD\",\r\n options: {\r\n filter: true\r\n },\r\n },\r\n {\r\n name: \"primaryCareProvider\",\r\n label: \"Primary Care Physician\",\r\n options: {\r\n filter: true,\r\n display: true\r\n },\r\n },\r\n {\r\n name: \"payer\",\r\n label: \"Payer\",\r\n options: {\r\n filter: true,\r\n display: true\r\n },\r\n },\r\n {\r\n name: \"Room\",\r\n label: \"Room\",\r\n options: {\r\n filter: true,\r\n display: true\r\n },\r\n },\r\n {\r\n name: \"AdmitStamp\",\r\n options: {\r\n display: false,\r\n filter: false\r\n\r\n },\r\n },\r\n\r\n ];\r\n\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n receiveTokenResponse(token);\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (APIToken && !tokenState?.accessToken) {\r\n setTokenState(APIToken);\r\n }\r\n\r\n }, [APIToken, tokenState])\r\n\r\n\r\n useEffect(() => {\r\n if (userPracticeCoordinatorProfile) {\r\n let { isErrored, notFound, isLoaded } = userPracticeCoordinatorProfile\r\n if ((!isErrored && !notFound && !isLoaded) && tokenState?.accessToken) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n\r\n } else {\r\n if (isLoaded && tokenState?.accessToken) {\r\n let coordinatorProfile = userPracticeCoordinatorProfile.coordinatorProfile;\r\n requestMessageContactsForPractice(tokenState.accessToken, coordinatorProfile.defaultPractice.practiceId);\r\n fetchPatientsForPractice(\r\n tokenState?.accessToken,\r\n coordinatorProfile.defaultPractice.practiceId,\r\n coordinatorProfile.practiceCareCoordinatorId,\r\n daysBack,\r\n requestPatientsByPracticeIdWithDays\r\n );\r\n }\r\n\r\n }\r\n }\r\n\r\n }, [tokenState, userPracticeCoordinatorProfile.coordinatorProfile, daysBack]);\r\n\r\n useEffect(() => {\r\n if (!isLoading && !isLoaded) {\r\n if (patientsByPracticeId && patientsByPracticeId.length > 0 && tokenState) {\r\n for (let pt of patientsByPracticeId) {\r\n let fps = fullPatients.filter(fm => fm.patientEncounterId === pt.ptId);\r\n if (!fps.length) {\r\n requestConsolidatedPatientById(pt.ptId, tokenState.accessToken)\r\n }\r\n }\r\n }\r\n }\r\n\r\n }, [patientsByPracticeId, userPracticeCoordinatorProfile]);\r\n\r\n\r\n useEffect(() => {\r\n if (userPracticeCoordinatorProfile.notFound) {\r\n history.push('/patient-list');\r\n }\r\n\r\n }, [userPracticeCoordinatorProfile])\r\n\r\n const options = {\r\n onRowClick: (\r\n rowData: string[],\r\n rowMeta: { dataIndex: number; rowIndex: number }\r\n ) => patientRowClick(rowData, rowMeta),\r\n elevation: 0,\r\n filter: true,\r\n viewColumns: false,\r\n selectableRows: false,\r\n customSort: (data, colIndex, order) => {\r\n return data.sort((a, b) => {\r\n if (colIndex == 5) {\r\n if (order === \"asc\") {\r\n return a.data[ADMIT_STAMP_COL_NUM] - b.data[ADMIT_STAMP_COL_NUM]\r\n\r\n } else {\r\n return b.data[ADMIT_STAMP_COL_NUM] - a.data[ADMIT_STAMP_COL_NUM]\r\n }\r\n }\r\n return (\r\n (a.data[colIndex].length < b.data[colIndex].length ? -1 : 1) *\r\n (order === \"desc\" ? 1 : -1)\r\n );\r\n });\r\n },\r\n print: true,\r\n delete: false,\r\n download: true,\r\n searchAlwaysOpen: true,\r\n responsive: 'vertical',\r\n customRowRender: (data, dataIndex, rowIndex) => {\r\n if (data[0] > 0) {\r\n return (\r\n patientRowClick(data)} >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n data[3]\r\n } \r\n {\r\n data[4]\r\n }\r\n \r\n \r\n\r\n \r\n \r\n Admitted: {\r\n data[5]\r\n }\r\n \r\n \r\n \r\n \r\n Days To Discharge: {\r\n data[6]\r\n }\r\n \r\n \r\n \r\n \r\n Assigned MD: {\r\n data[7]\r\n }\r\n \r\n \r\n \r\n \r\n PCP: {\r\n data[8]\r\n }\r\n \r\n \r\n \r\n \r\n Payer:{\r\n data[9]\r\n }\r\n \r\n \r\n \r\n \r\n Room:{\r\n data[10]\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n {\r\n data[3]\r\n }\r\n \r\n \r\n {\r\n data[4]\r\n }\r\n \r\n \r\n {\r\n data[5]\r\n }\r\n \r\n \r\n {\r\n data[6]\r\n }\r\n \r\n \r\n {\r\n data[7]\r\n }\r\n \r\n \r\n {\r\n data[8]\r\n }\r\n \r\n \r\n {\r\n data[9]\r\n }\r\n \r\n \r\n {\r\n data[10]\r\n }\r\n \r\n \r\n \r\n )\r\n }\r\n return (\r\n patientRowClick(data)} >\r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n \r\n \r\n {\r\n data[3]\r\n } \r\n {\r\n data[4]\r\n }\r\n \r\n \r\n\r\n \r\n \r\n Admitted: {\r\n data[5]\r\n }\r\n \r\n \r\n \r\n \r\n Days To Discharge: {\r\n data[6]\r\n }\r\n \r\n \r\n \r\n \r\n Assigned MD: {\r\n data[7]\r\n }\r\n \r\n \r\n \r\n \r\n PCP: {\r\n data[8]\r\n }\r\n \r\n \r\n \r\n \r\n Payer: {\r\n data[9]\r\n }\r\n \r\n \r\n \r\n \r\n Room: {\r\n data[10]\r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {\r\n data[2]\r\n }\r\n \r\n \r\n {\r\n data[3]\r\n }\r\n \r\n \r\n {\r\n data[4]\r\n }\r\n \r\n \r\n {\r\n data[5]\r\n }\r\n \r\n \r\n {\r\n data[6]\r\n }\r\n \r\n \r\n {\r\n data[7]\r\n }\r\n \r\n \r\n {\r\n data[8]\r\n }\r\n \r\n \r\n {\r\n data[9]\r\n }\r\n \r\n \r\n {\r\n data[10]\r\n }\r\n \r\n \r\n );\r\n }\r\n };\r\n\r\n const loadingOptions = {\r\n filter: false,\r\n viewColumns: false,\r\n print: false,\r\n elevation: 0,\r\n sort: false,\r\n download: false,\r\n customRowRender: (data, dataIndex, rowIndex) => {\r\n if (dataIndex === 0) {\r\n return (\r\n\r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n \r\n  \r\n \r\n\r\n \r\n );\r\n },\r\n searchAlwaysOpen: false,\r\n\r\n customFooter: (count, page, rowsPerPage, changeRowsPerPage, changePage) => {\r\n const startIndex = page * rowsPerPage;\r\n const endIndex = (page + 1) * rowsPerPage;\r\n return (\r\n \r\n \r\n Loading\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n\r\n textLabels: {\r\n body: {\r\n noMatch: \"Loading\",\r\n },\r\n },\r\n };\r\n\r\n\r\n const errorOptions = {\r\n filter: false,\r\n viewColumns: false,\r\n print: false,\r\n elevation: 0,\r\n sort: false,\r\n download: false,\r\n\r\n customFooter: (count, page, rowsPerPage, changeRowsPerPage, changePage) => {\r\n const startIndex = page * rowsPerPage;\r\n const endIndex = (page + 1) * rowsPerPage;\r\n return (\r\n \r\n \r\n {`Error: ${errorMessage}`}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n },\r\n searchAlwaysOpen: false,\r\n textLabels: {\r\n body: {\r\n noMatch: \"Error\",\r\n },\r\n },\r\n };\r\n\r\n const history = useHistory();\r\n\r\n const patientRowClick = (\r\n rowData: string[]\r\n ) => {\r\n let ptId = rowData[1];\r\n history.push(`/Patient/${ptId}`);\r\n };\r\n\r\n\r\n if (isLoading || !isLoaded || !userPracticeCoordinatorProfile.isLoaded) {\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n if (isError) {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n\r\n\r\n let chartTitle = `Patients for ${userPracticeCoordinatorProfile.coordinatorProfile.defaultPractice.practiceName}`;\r\n\r\n\r\n return (\r\n\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n\r\n {\r\n\r\n return [\r\n item.recentAdmits,\r\n item.ptId,\r\n item.facilityName,\r\n item.firstName,\r\n item.lastName,\r\n formatDate(item.admitDate, true),\r\n item.daysToDischarge,\r\n formatAssignedMD(item.primaryProviderContact),\r\n formatPCPUserName(item.primaryCareProvider),\r\n item.payer,\r\n item.roomNumber,\r\n item.admitStamp\r\n ];\r\n })}\r\n columns={tableColumns}\r\n options={options}\r\n />\r\n
\r\n
\r\n
\r\n\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(PracticeCoordinatorPatientsTable as any);\r\n","import React from \"react\";\r\nimport {\r\n Slide,\r\n TextField,\r\n Grid,\r\n FormControl,\r\n InputLabel,\r\n FormHelperText,\r\n Input,\r\n FormLabel,\r\n FormGroup,\r\n FormControlLabel,\r\n Checkbox,\r\n Button,\r\n Paper\r\n} from \"@material-ui/core\";\r\nimport { connect, useSelector } from \"react-redux\";\r\nimport { ApplicationState } from \"../store\";\r\nimport * as APIStore from \"../store/APIStore\";\r\nimport { useState, useEffect } from \"react\";\r\nimport RequestAccessToken from '../util/authService';\r\nimport Select from \"@material-ui/core/Select\";\r\nimport MenuItem from \"@material-ui/core/MenuItem\";\r\n\r\nconst CareCoordinatorAccount = (props: any) => {\r\n let {\r\n userPracticeCoordinatorProfile,\r\n requestCurrentUserCareCoordinatorProfile,\r\n submitCareCoordinator\r\n } = props;\r\n\r\n let [tokenState, setTokenState] = useState();\r\n let [profileState, setProfileState] = useState(\r\n {} as APIStore.CareCoordinatorModel\r\n );\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n\r\n useEffect(() => {\r\n if (userPracticeCoordinatorProfile) {\r\n let { isErrored, notFound, isLoaded, coordinatorProfile } : APIStore.PracticeCoordinatorState = userPracticeCoordinatorProfile\r\n if ((!isErrored && !notFound && !isLoaded) && tokenState?.accessToken) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n }\r\n else {\r\n if(coordinatorProfile?.azureAdAccount) {\r\n setProfileState(coordinatorProfile)\r\n } \r\n }\r\n }\r\n \r\n }, [tokenState, userPracticeCoordinatorProfile]);\r\n\r\n if (!userPracticeCoordinatorProfile || !userPracticeCoordinatorProfile.isLoaded) {\r\n return ()\r\n }\r\n\r\n const submitUpdate = () => {\r\n submitCareCoordinator(profileState, tokenState?.accessToken);\r\n }\r\n\r\n const updateFirstName = (e: any) => {\r\n let newProfile = {\r\n ...profileState,\r\n firstName: e.target.value,\r\n };\r\n setProfileState(newProfile);\r\n };\r\n\r\n const updateLastName = (e: any) => {\r\n let newProfile = {\r\n ...profileState,\r\n lastName: e.target.value,\r\n };\r\n setProfileState(newProfile);\r\n };\r\n\r\n const updatePhone = (e: any) => {\r\n let newProfile = {\r\n ...profileState,\r\n phone: e.target.value,\r\n };\r\n setProfileState(newProfile);\r\n };\r\n\r\n const updateCell= (e: any) => {\r\n let newProfile = {\r\n ...profileState,\r\n cell: e.target.value,\r\n };\r\n setProfileState(newProfile);\r\n };\r\n\r\n const updatePractice = (e : any) => {\r\n\r\n }\r\n\r\n const handleAlertPref = (event: any) => {\r\n if (event.target.name === \"emailpreferred\") {\r\n setProfileState({\r\n ...profileState,\r\n emailPreferred: !profileState.emailPreferred,\r\n });\r\n }\r\n \r\n if (event.target.name === \"textpreferred\") {\r\n setProfileState({\r\n ...profileState,\r\n textPreferred: !profileState.textPreferred,\r\n });\r\n }\r\n };\r\n\r\n\r\n if (\r\n !profileState?.azureAdAccount\r\n ) {\r\n return (\r\n \r\n

Loading

\r\n
\r\n );\r\n }\r\n\r\n let { firstName, lastName, phone, cell, azureAdAccount, practices, defaultPractice } = profileState;\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n\r\n \r\n First Name\r\n \r\n \r\n \r\n\r\n \r\n \r\n Last Name\r\n \r\n \r\n \r\n \r\n \r\n Phone Number\r\n \r\n \r\n \r\n \r\n \r\n Cell\r\n \r\n \r\n \r\n\r\n \r\n \r\n HNI Email\r\n \r\n \r\n \r\n\r\n \r\n \r\n Practices\r\n }\r\n\r\n onChange={updatePractice}>\r\n { \r\n practices.map((practice) => (\r\n \r\n \r\n {practice.practiceName}\r\n \r\n ))\r\n }\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n Send me alerts on:\r\n \r\n \r\n }\r\n label=\"Email Preferred\"\r\n />\r\n \r\n }\r\n label=\"Text Preferred\"\r\n />\r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(CareCoordinatorAccount as any);","import * as APIStore from \"../../store/APIStore\";\r\n\r\nexport const formatGreetingByPractice = (curGreeting: String,\r\n practice: APIStore.Practice,\r\n memberPCPcontact: APIStore.HNIProviderContact,\r\n refMd: APIStore.HNIProviderContact) => {\r\n \r\n if (!curGreeting)\r\n return ''\r\n\r\n if (practice.isRosterPractice) {\r\n\r\n if (memberPCPcontact && memberPCPcontact.lastName) {\r\n return `Dear Dr. ${memberPCPcontact.lastName}`\r\n }\r\n\r\n if (refMd && refMd.lastName) {\r\n return `Dear Dr. ${refMd.lastName}`\r\n }\r\n }\r\n\r\n return curGreeting;\r\n}","import React, { useEffect, useState } from \"react\";\r\nimport { Slide, Button, Box } from \"@material-ui/core\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport { Reply, Cancel } from \"@material-ui/icons\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport DiagnosisList from \"../patient/DiagnosisList\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport moment from \"moment\";\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport { connect } from \"react-redux\";\r\nimport Snackbar from '@material-ui/core/Snackbar';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport CloseIcon from '@material-ui/icons/Close';\r\nimport ErrorIcon from '@material-ui/icons/Error';\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport RequestAccessToken from '../../util/authService';\r\nimport { DetailedPatientStateType } from './MessagePatientLoadState';\r\nimport { refMDLoaded, practiceCoordinatorLoaded, shouldTryRefMDProfile, shouldTryCareCoordinatorProfile } from '../common/ProfileHelper'\r\nimport { formatGreetingByPractice } from './Helpers'\r\n\r\nexport interface DirectProps {\r\n message: APIStore.Message;\r\n userRefMdProfile: APIStore.RefMdProfile;\r\n}\r\n\r\ntype AdmitNotificationProps = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators &\r\n RouteComponentProps<{ MessageId: string }> &\r\n DirectProps\r\n\r\nconst formatDate = (date) => {\r\n if (!date) {\r\n return null;\r\n }\r\n\r\n let dt = moment(date);\r\n\r\n return (dt.hours() === 0 && dt.minutes() === 0 && dt.seconds() === 0 ? dt.format('MM/DD/YYYY') : dt.format('hh:mm:ss A MM-DD-YYYY'));\r\n}\r\n\r\nconst AdmitNotificationItem = (props: AdmitNotificationProps) => {\r\n let {\r\n clearSentMessageState,\r\n requestConsolidatedPatientById,\r\n requestCurrentUserCareCoordinatorProfile,\r\n requestVitalsMdProfile,\r\n requestProviderMessage,\r\n userRefMdProfile,\r\n userPracticeCoordinatorProfile,\r\n markMessageAsRead,\r\n FocusPatient } = props;\r\n\r\n let Patients = props.Patients;\r\n let Messages = props.Messages;\r\n\r\n let { Errors, SendMessageState, failedLoading, FocusMessage, isLoaded: MessagesQueueLoaded } = Messages;\r\n\r\n let initial: DetailedPatientStateType = {\r\n patient: undefined,\r\n isLoaded: false,\r\n isLoading: false\r\n };\r\n\r\n let [detailedPatientState, setDetailedPatientState] = useState(initial);\r\n let [userGreetStr, setUserGreetStr] = useState();\r\n let [tokenState, setTokenState] = useState();\r\n let [readNotification, setReadNotification] = useState(false);\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n let messageId = parseInt(props.match?.params.MessageId) || 0;\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken && messageId > 0) {\r\n requestProviderMessage(tokenState.accessToken, messageId);\r\n }\r\n }, [tokenState, messageId]);\r\n\r\n useEffect(() => {\r\n if (FocusMessage?.messageId === messageId) {\r\n patientEncounterId = FocusMessage.message?.ptId;\r\n if (tokenState?.accessToken && !detailedPatientState?.isLoaded && !detailedPatientState.isLoading) {\r\n requestConsolidatedPatientById(patientEncounterId, tokenState.accessToken);\r\n setDetailedPatientState({\r\n ...detailedPatientState,\r\n isLoading: true\r\n })\r\n }\r\n\r\n if (detailedPatientState.isLoading) {\r\n if (FocusPatient?.patient?.patientEncounterId) {\r\n setDetailedPatientState({ isLoaded: true, isLoading: false, patient: FocusPatient?.patient })\r\n }\r\n }\r\n }\r\n\r\n }, [tokenState, detailedPatientState.patient, Patients, FocusMessage?.messageId]);\r\n\r\n useEffect(() => {\r\n if (shouldTryRefMDProfile(userRefMdProfile) && tokenState?.accessToken && userPracticeCoordinatorProfile.notFound) {\r\n requestVitalsMdProfile(tokenState.accessToken);\r\n }\r\n\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile])\r\n\r\n useEffect(() => {\r\n if (shouldTryCareCoordinatorProfile(userPracticeCoordinatorProfile) && tokenState?.accessToken) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken) {\r\n if (practiceCoordinatorLoaded(userPracticeCoordinatorProfile)) {\r\n setUserGreetStr(`Attention: ${userPracticeCoordinatorProfile.coordinatorProfile.defaultPractice.practiceName}`)\r\n }\r\n if (refMDLoaded(userRefMdProfile)) {\r\n setUserGreetStr(`Dear Dr. ${userRefMdProfile.refmdProfile.lastName}`);\r\n }\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n\r\n const history = useHistory();\r\n\r\n\r\n if (!detailedPatientState?.isLoaded || !userGreetStr || !detailedPatientState.isLoaded) {\r\n return (\r\n
\r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n

    

\r\n

    

\r\n
\r\n\r\n
\r\n \r\n

Loading...

\r\n
\r\n
\r\n\r\n
\r\n
\r\n )\r\n }\r\n\r\n let message = FocusMessage?.message;\r\n\r\n let { firstName, lastName, dateOfBirth, encounters, mrn, patientEncounterId } = detailedPatientState.patient;\r\n\r\n let encounter = encounters[0];\r\n\r\n let {\r\n patientDiagnosisList,\r\n primaryProviderContact,\r\n encounterStart,\r\n pcpFromRosterContact,\r\n referringMD,\r\n facility }: APIStore.Encounter = encounter;\r\n\r\n let { facilityName } = facility;\r\n\r\n let { displayName, email: assignedProviderEmail } = primaryProviderContact;\r\n\r\n\r\n let assignedProviderFormatted = \"\";\r\n if (!primaryProviderContact.type.toLocaleLowerCase().startsWith('program')) {\r\n assignedProviderFormatted = displayName;\r\n }\r\n\r\n const goBack = () => {\r\n history.goBack();\r\n };\r\n\r\n const handleReply = () => {\r\n let replyMessage = {\r\n ...message,\r\n messageType: null,\r\n senderId: assignedProviderEmail,\r\n patient: {\r\n ...message.patient\r\n }\r\n }\r\n history.push(\"/notification-reply\", { message: replyMessage });\r\n };\r\n\r\n const handleCloseSnack = () => {\r\n isSent = false;\r\n messageSent = false;\r\n sentMessageSubject = '';\r\n clearSentMessageState();\r\n }\r\n\r\n let isSent, isErrored = null;\r\n let messageSent = false;\r\n let sentMessage = '';\r\n if (SendMessageState) {\r\n let { isSent, message, isErrored } = SendMessageState;\r\n messageSent = isSent;\r\n sentMessage = message;\r\n }\r\n\r\n let generalErrorMessage = '';\r\n if (Errors && Errors.length) {\r\n let generalError = Errors.filter(val => val.messageId < 1)[0];\r\n generalErrorMessage = generalError.error;\r\n }\r\n\r\n let sentMessageSubject = '';\r\n if (sentMessage && sentMessage.subject) {\r\n sentMessageSubject = sentMessage.subject;\r\n }\r\n\r\n if (tokenState && tokenState.accessToken && !readNotification) {\r\n markMessageAsRead(tokenState.accessToken, message);\r\n\r\n setReadNotification(true);\r\n }\r\n\r\n if (!FocusMessage?.messageId) {\r\n return ()\r\n }\r\n\r\n return (\r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
From: VitalsMD™ Admit notification on behalf of{\" \"}\r\n {displayName}
\r\n
Subject: {message.subject}
\r\n
Date:{formatDate(message.createdDate)}
\r\n
\r\n\r\n \r\n

\r\n {\r\n formatGreetingByPractice(userGreetStr, userPracticeCoordinatorProfile.coordinatorProfile.defaultPractice, pcpFromRosterContact, referringMD)\r\n }\r\n

\r\n
\r\n \r\n

\r\n Thank you for the referral of the following patient:\r\n \r\n {` ${lastName}`}, {firstName}\r\n {\" \"}\r\n at {facilityName} on {formatDate(encounterStart)}\r\n

\r\n

Date of Birth: {formatDate(dateOfBirth)}

\r\n\r\n
\r\n \r\n \r\n \r\n \r\n

\r\n Our goal is to provide the highest quality care and maintain\r\n open communication with the primary care physicians of our\r\n patients. We believe communication is essential in providing\r\n your patient with continuity of care and the best possible\r\n outcomes. Once your patient is discharged, you will be provided\r\n a discharge summary and any other pertinent information you\r\n should need. In addition, you are welcome to contact us any time\r\n if you have any questions or concerns about your patient or our\r\n hospitalist program.\r\n

\r\n
\r\n \r\n \r\n

Respectfully,

\r\n

HNI Healthcare Hospitalists Group

\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n handleCloseSnack()}>\r\n \r\n \r\n \r\n } />\r\n\r\n \r\n \r\n handleCloseSnack()}>\r\n \r\n \r\n \r\n }\r\n\r\n open={messageSent && !isErrored} message={`Message Sent: ${sentMessageSubject}`\r\n } />\r\n
\r\n\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(AdmitNotificationItem as any);\r\n","import React from \"react\";\r\nimport Typography from \"@material-ui/core/Typography\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport Paper from '@material-ui/core/Paper';\r\n\r\nexport interface NextSiteOfCareProps {\r\n nextSiteOfCare: APIStore.NextSiteOfCare\r\n}\r\n\r\nconst NextSiteOfCare = (props: NextSiteOfCareProps) => {\r\n let { nextSiteOfCare } = props;\r\n if (!nextSiteOfCare) {\r\n return (

No next site of care

)\r\n }\r\n return (\r\n
\r\n \r\n Next Site Of Care:\r\n \r\n {\r\n nextSiteOfCare.name\r\n }\r\n
\r\n )\r\n}\r\nexport default NextSiteOfCare;\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { Slide, Button, Box } from \"@material-ui/core\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport { Reply, Cancel } from \"@material-ui/icons\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport DiagnosisList from \"../patient/DiagnosisList\";\r\nimport moment from 'moment';\r\nimport { connect } from \"react-redux\";\r\nimport NextSiteOfCare from '../patient/NextSiteOfCare'\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport Paper from \"@material-ui/core/Paper\";\r\nimport RequestAccessToken from '../../util/authService';\r\nimport Snackbar from '@material-ui/core/Snackbar';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport CloseIcon from '@material-ui/icons/Close';\r\nimport { DetailedPatientStateType } from './MessagePatientLoadState'\r\nimport { refMDLoaded, practiceCoordinatorLoaded, shouldTryRefMDProfile, shouldTryCareCoordinatorProfile } from '../common/ProfileHelper'\r\nimport { formatGreetingByPractice } from './Helpers'\r\n\r\nexport interface DirectProps {\r\n message: APIStore.Message,\r\n userRefMdProfile: APIStore.RefMdProfile\r\n}\r\n\r\ntype DischargeNotificationProps = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators &\r\n RouteComponentProps<{ MessageId: string }> &\r\n DirectProps\r\n\r\nconst formatDate = (date) => {\r\n if (!date) {\r\n return null;\r\n }\r\n\r\n let dt = moment(date);\r\n\r\n return (dt.hours() === 0 && dt.minutes() === 0 && dt.seconds() === 0 ? dt.format('MM/DD/YYYY') : dt.format('hh:mm:ss A MM-DD-YYYY'));\r\n}\r\n\r\nconst DischargeNotificationItem = (props: DischargeNotificationProps) => {\r\n let {\r\n userRefMdProfile,\r\n userPracticeCoordinatorProfile,\r\n requestVitalsMdProfile,\r\n clearSentMessageState,\r\n requestProviderMessage,\r\n requestConsolidatedPatientById,\r\n requestCurrentUserCareCoordinatorProfile,\r\n markMessageAsRead,\r\n FocusPatient } = props;\r\n\r\n let Patients = props.Patients;\r\n let Messages = props.Messages;\r\n\r\n let [tokenState, setTokenState] = useState();\r\n let initial: DetailedPatientStateType = {\r\n patient: undefined,\r\n isLoaded: false,\r\n isLoading: false\r\n };\r\n\r\n let [detailedPatientState, setDetailedPatientState] = useState(initial);\r\n let [userGreetStr, setUserGreetStr] = useState();\r\n let [readNotification, setReadNotification] = useState(false);\r\n\r\n let tokenStatePr = RequestAccessToken()\r\n .then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n let messageId = parseInt(props.match?.params.MessageId) || 0;\r\n\r\n let { Errors, SendMessageState, failedLoading, FocusMessage, isLoaded: MessagesQueueLoaded } = Messages;\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken && messageId > 0) {\r\n requestProviderMessage(tokenState.accessToken, messageId);\r\n }\r\n }, [tokenState, messageId]);\r\n\r\n\r\n\r\n useEffect(() => {\r\n if (shouldTryRefMDProfile(userRefMdProfile) && tokenState?.accessToken && userPracticeCoordinatorProfile.notFound) {\r\n requestVitalsMdProfile(tokenState.accessToken);\r\n }\r\n\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile])\r\n\r\n useEffect(() => {\r\n let patientEncounterId: number = FocusMessage?.message?.ptId;\r\n if (FocusMessage?.messageId === messageId) {\r\n if (tokenState?.accessToken && !detailedPatientState?.isLoaded && !detailedPatientState.isLoading && patientEncounterId) {\r\n requestConsolidatedPatientById(patientEncounterId, tokenState.accessToken);\r\n setDetailedPatientState({\r\n ...detailedPatientState,\r\n isLoading: true\r\n })\r\n }\r\n\r\n\r\n if (detailedPatientState.isLoading) {\r\n if (FocusPatient?.patient?.patientEncounterId) {\r\n setDetailedPatientState({ isLoaded: true, isLoading: false, patient: FocusPatient?.patient })\r\n }\r\n }\r\n\r\n }\r\n\r\n }, [tokenState, detailedPatientState.patient, Patients, FocusMessage?.messageId]);\r\n\r\n useEffect(() => {\r\n if (shouldTryCareCoordinatorProfile(userPracticeCoordinatorProfile) && tokenState?.accessToken) {\r\n requestCurrentUserCareCoordinatorProfile(tokenState.accessToken);\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken) {\r\n\r\n if (practiceCoordinatorLoaded(userPracticeCoordinatorProfile)) {\r\n setUserGreetStr(`Attention: ${userPracticeCoordinatorProfile.coordinatorProfile.defaultPractice.practiceName}`)\r\n }\r\n\r\n if (refMDLoaded(userRefMdProfile)) {\r\n setUserGreetStr(`Dear Dr. ${userRefMdProfile.refmdProfile.lastName}`);\r\n }\r\n }\r\n }, [tokenState, userRefMdProfile, userPracticeCoordinatorProfile]);\r\n\r\n const history = useHistory();\r\n\r\n if (!FocusMessage?.messageId || !userGreetStr || !detailedPatientState?.isLoaded) {\r\n return (\r\n
\r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n

    

\r\n

    

\r\n
\r\n\r\n
\r\n \r\n

Loading...

\r\n
\r\n
\r\n\r\n
\r\n
\r\n )\r\n }\r\n\r\n\r\n let message = FocusMessage?.message;\r\n\r\n\r\n let { patientEncounterId, lastName, firstName, dateOfBirth } = detailedPatientState.patient;\r\n\r\n let { encounters } = detailedPatientState.patient;\r\n\r\n let encounter: APIStore.Encounter = encounters[0];\r\n\r\n let {\r\n patientDiagnosisList,\r\n primaryProviderContact,\r\n encounterEnd,\r\n pcpFromRosterContact,\r\n facility, nextSiteOfCare, dischargingPhysician, referringMD } = encounter;\r\n\r\n\r\n\r\n let { facilityName } = facility;\r\n\r\n let { displayName, email } = primaryProviderContact;\r\n\r\n let assignedProviderFormatted = \"\";\r\n let dischargeProviderFormatted = \"\";\r\n if (!primaryProviderContact.type.toLocaleLowerCase().startsWith('program')) {\r\n assignedProviderFormatted = displayName;\r\n }\r\n\r\n if (dischargingPhysician) {\r\n dischargeProviderFormatted = dischargingPhysician.displayName;\r\n } else {\r\n dischargeProviderFormatted = \"\";\r\n }\r\n\r\n\r\n const goBack = () => {\r\n history.goBack();\r\n };\r\n\r\n const handleReply = () => {\r\n\r\n let replyMessage = {\r\n ...message,\r\n messageType: null,\r\n senderId: email,\r\n patient: {\r\n ...message.patient\r\n }\r\n }\r\n\r\n history.push(\"/notification-reply\", { message: replyMessage });\r\n };\r\n\r\n const handleCloseSnack = () => {\r\n isSent = false;\r\n messageSent = false;\r\n sentMessageSubject = '';\r\n clearSentMessageState();\r\n }\r\n\r\n let isSent, isErrored = null;\r\n let messageSent = false;\r\n let sentMessage = '';\r\n\r\n if (SendMessageState) {\r\n let { isSent, message, isErrored } = SendMessageState;\r\n messageSent = isSent;\r\n sentMessage = message;\r\n }\r\n\r\n let generalErrorMessage = '';\r\n if (Errors && Errors.length) {\r\n let generalError = Errors.filter(val => val.messageId < 1)[0];\r\n generalErrorMessage = generalError.error;\r\n }\r\n\r\n let sentMessageSubject = '';\r\n if (sentMessage && sentMessage.subject) {\r\n sentMessageSubject = sentMessage.subject;\r\n }\r\n\r\n if (tokenState && tokenState.accessToken && !readNotification) {\r\n markMessageAsRead(tokenState.accessToken, message);\r\n setReadNotification(true);\r\n }\r\n\r\n return (\r\n \r\n \r\n
\r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n
From: VitalsMD™ Discharge notification on behalf of{\" \"}\r\n {assignedProviderFormatted}
\r\n
Subject: {message.subject}
\r\n
Date: {formatDate(message.createdDate)}
\r\n
\r\n \r\n

\r\n {\r\n formatGreetingByPractice(userGreetStr, userPracticeCoordinatorProfile.coordinatorProfile.defaultPractice, pcpFromRosterContact, referringMD)\r\n }\r\n

\r\n
\r\n \r\n

The following patients have been discharged:\r\n {` ${lastName}`}, {firstName} at {facilityName} on {formatDate(encounterEnd)}

\r\n

Date of Birth: {formatDate(dateOfBirth)}

\r\n

Assigned Provider: {assignedProviderFormatted}

\r\n

Discharging Provider: {dischargeProviderFormatted}

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n

Our goal is to provide the highest quality care and maintain open communication with the\r\n primary care physicians of our patients. We believe communication is essential in\r\n providing your patient with continuity of care and the best possible outcomes.\r\n Once your patient is discharged, you will be provided a discharge summary and any\r\n other pertinent information you should need. In addition, you are welcome to contact us\r\n any time if you have any questions or concerns about your patient or our hospitalist\r\n program.

\r\n
\r\n \r\n \r\n

Respectfully,

\r\n

HNI Healthcare\r\n Hospitalists Group

\r\n
\r\n\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n \r\n handleCloseSnack()}>\r\n \r\n \r\n \r\n }\r\n\r\n open={messageSent && !isErrored} message={`Message Sent: ${sentMessageSubject}`\r\n } />\r\n
\r\n\r\n
\r\n\r\n
\r\n )\r\n}\r\n\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(DischargeNotificationItem as any);","import React, { useEffect } from \"react\";\r\nimport {\r\n Slide,\r\n Button,\r\n Box,\r\n TextField,\r\n Select,\r\n InputLabel,\r\n FormControl,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport Grid from \"@material-ui/core/Grid\";\r\nimport { useState } from \"react\";\r\nimport { RouteComponentProps } from \"react-router\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { connect } from \"react-redux\";\r\nimport { ApplicationState } from \"../../store\";\r\nimport * as APIStore from \"../../store/APIStore\";\r\nimport { Send, Cancel } from \"@material-ui/icons\";\r\nimport RequestAccessToken from \"../../util/authService\";\r\nimport NotificationPatient from \"./NotificationPatient\";\r\nimport Hidden from \"@material-ui/core/Hidden\";\r\nimport { makeStyles } from '@material-ui/core/styles';\r\n\r\ntype NotificationComposeSingleProps = APIStore.HNIContextState &\r\n typeof APIStore.actionCreators &\r\n RouteComponentProps<{ receiverId: string, patientEncounterId: string }>;\r\n\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n '& .MuiTextField-root': {\r\n margin: theme.spacing(1),\r\n width: '25ch',\r\n },\r\n },\r\n input: {\r\n display: 'none',\r\n },\r\n}));\r\n\r\nconst NotificationComposeSingle = (props: NotificationComposeSingleProps) => {\r\n\r\n let {\r\n submitNewMessageWithAttachment,\r\n clearMessageState,\r\n requestConsolidatedPatientById,\r\n FocusPatient,\r\n PatientPhysiciansContacts\r\n } = props;\r\n\r\n \r\n let location = props.location;\r\n let newInitialState: APIStore.Message= {};\r\n let [tokenState, setTokenState] = useState();\r\n let [receiverContact, setReceiverContact] = useState();\r\n const [newMessageState, setNewMessageState] = useState(newInitialState);\r\n\r\n let tokenStatePr = RequestAccessToken().then((token) => {\r\n if (token && !tokenState) {\r\n setTokenState(token);\r\n }\r\n });\r\n\r\n const classes = useStyles();\r\n const history = useHistory();\r\n\r\n let { state } = location;\r\n\r\n let PatientPhysicians = PatientPhysiciansContacts.userPatientContacts;\r\n\r\n\r\n let receiverId, patientEncounterId = null;\r\n\r\n if (state) {\r\n ({ receiverId, patientEncounterId } = state);\r\n } else {\r\n history.push(`/notifications/`);\r\n }\r\n\r\n\r\n useEffect(() => {\r\n if (tokenState?.accessToken && !FocusPatient?.patient) {\r\n requestConsolidatedPatientById(patientEncounterId, tokenState.accessToken);\r\n }\r\n\r\n }, [patientEncounterId]);\r\n\r\n useEffect(() => {\r\n if (FocusPatient?.patient) { \r\n setNewMessageState({\r\n ...newMessageState,\r\n patient: FocusPatient.patient,\r\n subject: `Patient ${FocusPatient.patient.lastName}`\r\n })\r\n } \r\n }, [FocusPatient, receiverId]);\r\n\r\n useEffect(() => {\r\n if(receiverId && PatientPhysicians.length) {\r\n let singleContact: APIStore.HNIProviderContact = PatientPhysicians.filter(v => v.email === receiverId)[0];\r\n setReceiverContact(singleContact);\r\n if(FocusPatient?.patient) \r\n {\r\n setNewMessageState({\r\n ...newMessageState,\r\n receiverId: receiverId,\r\n subject: `Patient ${FocusPatient.patient.lastName}`\r\n })\r\n } else {\r\n setNewMessageState({\r\n ...newMessageState,\r\n receiverId: receiverId,\r\n subject: `Patient N/A`\r\n })\r\n }\r\n \r\n }\r\n }, [receiverId, FocusPatient])\r\n\r\n\r\n\r\n const goBack = () => {\r\n history.goBack();\r\n };\r\n\r\n const handleMessageChange = (e: any) => {\r\n setNewMessageState({\r\n ...newMessageState,\r\n Message: e.target.value,\r\n });\r\n };\r\n\r\n const handleSubjectChange = (e: any) => {\r\n setNewMessageState({\r\n ...newMessageState,\r\n subject: e.target.value,\r\n });\r\n };\r\n\r\n const handleSend = () => {\r\n sendFormAndFileState();\r\n goBack();\r\n };\r\n\r\n const handleErrorClose = () => {\r\n clearMessageState();\r\n };\r\n\r\n const handleFileSelectChange = (e: any) => {\r\n let file = e.target.files[0];\r\n let fileName = file.name;\r\n\r\n setNewMessageState({\r\n ...newMessageState,\r\n document: file,\r\n documentFileName: fileName\r\n });\r\n }\r\n\r\n const sendFormAndFileState = () => {\r\n const formData = new FormData();\r\n for (var key in newMessageState) {\r\n if (key !== \"Document\") {\r\n formData.append(key, newMessageState[key])\r\n }\r\n }\r\n\r\n formData.append(\"PtId\", patientEncounterId)\r\n formData.append(\"Document\", newMessageState.document)\r\n formData.append(\"DocumentFileName\", newMessageState.documentFileName)\r\n\r\n submitNewMessageWithAttachment(formData, tokenState.accessToken)\r\n }\r\n\r\n if (!newMessageState || !receiverContact?.email) {\r\n return ();\r\n }\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n {handleSubjectChange(e)}}\r\n value={newMessageState.subject}\r\n label=\"Subject\"\r\n variant=\"standard\"\r\n />\r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n
\r\n
\r\n );\r\n\r\n\r\n};\r\nexport default connect(\r\n (state: ApplicationState) => state.vitalsContext,\r\n APIStore.actionCreators\r\n)(NotificationComposeSingle as any);\r\n","import * as React from 'react';\r\nimport { BrowserRouter as Router, Route, Redirect, Switch } from 'react-router-dom';\r\nimport Layout from './components/Layout';\r\nimport Home from './components/Home';\r\nimport Counter from './components/Counter';\r\nimport FetchData from './components/FetchData';\r\n\r\nimport Account from './components/Account';\r\nimport Notifications from './components/Notifications';\r\nimport Patient from './components/Patient';\r\n\r\nimport PrivateRoute from \"./components/common/PrivateRoute\";\r\nimport CallbackPage from \"./components/CallbackPage\";\r\nimport LoginPage from \"./components/LoginPage\";\r\nimport LogoutPage from \"./components/LogoutPage\";\r\nimport NotificationItem from \"./components/NotificationItem\";\r\nimport NotificationReply from \"./components/NotificationReply\";\r\nimport NotificationCompose from \"./components/notification/NotificationCompose\";\r\nimport PatientsTable from './components/PatientsTable'\r\nimport DocumentIndex from './components/patient/DocumentIndex'\r\nimport DirectAdmitRequest from './components/directadmit/DirectAdmitRequest'\r\nimport PracticeCoordinatorPatientsTable from './components/PracticeCoordinatorPatientsTable';\r\nimport CareCoordinatorAccount from './components/CareCoordinatorAccount';\r\nimport AdmitNotificationItem from './components/notification/AdmitNotificationItem';\r\nimport DischargeNotificationItem from './components/notification/DischargeNotificationItem';\r\nimport NotificationComposeSingle from './components/notification/NotificationComposeSingle';\r\n\r\nexport default () => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);","import 'bootstrap/dist/css/bootstrap.css';\r\n\r\n//import \"@fontsource/roboto/300.css\";\r\nimport \"@fontsource/roboto/400.css\";\r\nimport \"@fontsource/roboto/500.css\";\r\nimport \"@fontsource/roboto/700.css\";\r\n\r\n\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { Provider } from 'react-redux';\r\n\r\nimport { ConnectedRouter } from \"connected-react-router\";\r\n//import { ConnectedRouter } from \"react-router-redux\";\r\n\r\nimport { createBrowserHistory } from 'history';\r\nimport configureStore from './store/configureStore';\r\nimport App from './App';\r\nimport registerServiceWorker from './registerServiceWorker';\r\n\r\n//import { OidcProvider } from \"redux-oidc\";\r\n//import userManager from \"./util/userManager\";\r\n\r\nimport { PublicClientApplication } from \"@azure/msal-browser\";\r\nimport { MsalProvider } from \"@azure/msal-react\";\r\nimport { msalConfig } from \"./util/authConfig\";\r\nconst msalInstance = new PublicClientApplication(msalConfig);\r\n\r\n// Create browser history to use in the Redux store\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href') as string;\r\nconst history = createBrowserHistory({ basename: baseUrl });\r\n\r\n// Get the application-wide store instance, prepopulating with state from the server where available.\r\n\r\nconst store = configureStore(history);\r\n\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById('root'));\r\n\r\n//registerServiceWorker();\r\n","import { applyMiddleware, combineReducers, compose, createStore } from 'redux';\r\nimport thunk from 'redux-thunk';\r\nimport { connectRouter, routerMiddleware } from 'connected-react-router';\r\nimport { History } from 'history';\r\nimport { ApplicationState, reducers } from './';\r\n\r\n//export default function configureStore(history: History, initialState?: ApplicationState) {\r\nexport default function configureStore(history: History, initialState?) {\r\n const middleware = [\r\n thunk,\r\n routerMiddleware(history)\r\n ];\r\n\r\n const rootReducer = combineReducers({\r\n ...reducers,\r\n router: connectRouter(history)\r\n });\r\n\r\n const enhancers = [];\r\n const windowIfDefined = typeof window === 'undefined' ? null : window as any; // eslint-disable-line @typescript-eslint/no-explicit-any\r\n if (windowIfDefined && windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__) {\r\n enhancers.push(windowIfDefined.__REDUX_DEVTOOLS_EXTENSION__());\r\n }\r\n\r\n const store = createStore(\r\n rootReducer,\r\n initialState,\r\n compose(applyMiddleware(...middleware), ...enhancers)\r\n );\r\n return store;\r\n}\r\n"],"sourceRoot":""}