{"version":3,"sources":["webpack:///src/C:/BuildAgent/work/709799f7b218f10/src/services/dashboard-service.ts","webpack:///src/C:/BuildAgent/work/709799f7b218f10/src/pages/home/my-dashboard/dashboard-header.ts","webpack:///./src/pages/home/my-dashboard/dashboard-header.html","webpack:///src/C:/BuildAgent/work/709799f7b218f10/src/pages/home/my-dashboard/medication-alerts.ts","webpack:///./src/pages/home/my-dashboard/medication-alerts.html","webpack:///src/C:/BuildAgent/work/709799f7b218f10/src/pages/home/my-dashboard/my-dashboard.ts","webpack:///./src/pages/home/my-dashboard/my-dashboard.html","webpack:///src/C:/BuildAgent/work/709799f7b218f10/src/pages/home/my-dashboard/news-and-updates.ts","webpack:///./src/pages/home/my-dashboard/news-and-updates.html","webpack:///./src/pages/home/my-dashboard/task-card-content.html","webpack:///src/C:/BuildAgent/work/709799f7b218f10/src/pages/home/my-dashboard/todays-tasks.ts","webpack:///./src/pages/home/my-dashboard/todays-tasks.html","webpack:///src/C:/BuildAgent/work/709799f7b218f10/src/pages/home/my-dashboard/unread-messages.ts","webpack:///./src/pages/home/my-dashboard/unread-messages.html"],"names":["DashboardService","httpClient","_baseUrl","this","_httpClient","build","fetch","DashboardHeader","accountsService","today","isError","isLoading","userPrimaryProvider","_accountsService","getAccountInfo","startClock","console","log","accountInfo","_interval","setInterval","clearInterval","curHr","parseInt","format","address","userPrimaryBranch","providers","forEach","provider","locations","find","location","isPrimaryLocation","name","mainLocationInfo","isMainLocation","tz","guess","defaultBindingMode","oneWay","module","exports","MedicationAlerts","enumsService","messageService","ea","_messageSubscriptions","isAuthorized","medAlertConversationId","pageNumber","pageLength","conversationTypeEnumMap","medicationAlertsTotal","_enumsService","_messageService","_ea","getConversationType","conversationTypeEnum","getUnreadConversations","initSubscriptions","push","subscribe","NewMessage","HasUnreadMessage","page","conversationType","Number","getEnumValue","result","conversations","items","length","medicationAlerts","id","getUnReadMessages","splice","error","status","sub","dispose","MyDashboard","usersService","currentUserService","isPalliativeCareView","selectedBranches","medAlertsCredentials","showMedAlerts","_usersService","_currentUserService","getUserInfo","getIsPalliativeAccount","getUser","userInfo","user","credentials","getCredentials","credentialsEnum","credentialsEnumMap","userCredentials","some","credential","credentialValue","getEnumName","includes","NewsAndUpdates","dashboardService","news","_dashboardService","fetchNews","getNews","TodaysTasks","taskService","bindingEngine","_documentTypeEnum","_documentTypeEnumMap","taskDate","taskList","_taskService","_bindingEngine","getScheduleStatus","scheduleStatusEnums","scheduleStatusEnumMap","getDocumentType","getTaskList","_locationSubscription","collectionObserver","query","date","locationIds","getTaskForCurrentUser","slice","task","patientFirstName","documentType","defaultBinding","toView","UnreadMessages","_pageNumber","_pageLength","unreadConversations","itemCount"],"mappings":"s9CAOaA,EAAb,WAII,WAAmBC,I,4FAAyB,SAFpC,KAAAC,SAAmB,oBAGvBC,KAAKC,YAAcH,CACtB,C,UANL,O,EAAA,G,EAAA,iC,kJASe,O,SAAME,KAAKC,YACbC,MADQ,UACCF,KAAKD,SADN,UAERI,Q,uFACR,M,2BAZL,KAAaN,EAAgB,GAD5B,uB,uBAK+C,mB,OAAA,IAAb,kCAAa,YAJnCA,E,o9CCUAO,EAAb,WAsDI,WAAmBC,I,4FAAgC,SAjD5C,KAAAC,MAAgB,IAEhB,KAAAC,SAAmB,EACnB,KAAAC,WAAqB,EACrB,KAAAC,oBAA8B,GA8CjCT,KAAKU,iBAAmBL,CAC3B,C,UAxDL,O,EAAA,E,EAAA,kC,kJA8DY,O,SAFAL,KAAKQ,WAAY,E,SAEXR,KAAKW,iB,OACXX,KAAKY,a,gDAGLC,QAAQC,IAAR,M,yBAEAd,KAAKQ,WAAY,E,2EAExB,GAtEL,uC,qLA2EK,GA3EL,uC,kJA8E2B,O,SAAMR,KAAKU,iBAAiBC,iB,OAA/CX,KAAKe,Y,OACLF,QAAQC,IAAId,KAAKe,a,+CACpB,GAhFL,mCAkFsB,WACdf,KAAKgB,UAAYC,aAAY,WACzB,EAAKX,MAAQ,GAChB,GAAE,IACN,GAtFL,iCAyFQY,cA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"aurelia-framework\";\r\n\r\nimport { HospiceClient } from \"../common/hospice-client\";\r\n\r\nimport { INews } from \"../interfaces/i-news\";\r\n\r\n@autoinject()\r\nexport class DashboardService {\r\n private _httpClient: HospiceClient;\r\n private _baseUrl: string = \"/api/v1/dashboard\";\r\n\r\n public constructor(httpClient: HospiceClient) {\r\n this._httpClient = httpClient;\r\n }\r\n\r\n public async getNews() {\r\n return await this._httpClient\r\n .build(`${this._baseUrl}/news`)\r\n .fetch();\r\n }\r\n}\r\n","import \"./dashboard-header.scss\";\r\nimport \"moment-timezone\";\r\n\r\nimport { bindingMode, computedFrom } from \"aurelia-binding\";\r\nimport { autoinject, bindable, containerless } from \"aurelia-framework\";\r\nimport { Moment } from \"moment\";\r\nimport * as moment from \"moment\";\r\n\r\nimport nameof from \"../../../common/nameof\";\r\nimport { IAddress } from \"../../../interfaces/i-address\";\r\nimport { IGetUserSlimInfoResult } from \"../../../interfaces/i-user\";\r\nimport { Account } from \"../../../models/account\";\r\nimport { AccountsService } from \"../../../services/accounts-service\";\r\nimport { Location } from \"../../../models/location\";\r\n\r\n@autoinject\r\n@containerless\r\nexport class DashboardHeader {\r\n @bindable({ defaultBindingMode: bindingMode.oneWay })\r\n public userInfo: IGetUserSlimInfoResult;\r\n private _accountsService: AccountsService;\r\n private _interval: NodeJS.Timeout;\r\n public today: Moment = moment();\r\n public accountInfo: Account;\r\n public isError: boolean = false;\r\n public isLoading: boolean = false;\r\n public userPrimaryProvider: string = \"\";\r\n\r\n @computedFrom(nameof(\"today\"))\r\n public get greetingMessage() {\r\n let curHr = parseInt(this.today.format(\"H\"), 10);\r\n if (curHr < 12) {\r\n return \"Good Morning\";\r\n } else if (curHr < 18) {\r\n return \"Good Afternoon\";\r\n } else {\r\n return \"Good Evening\";\r\n }\r\n }\r\n\r\n @computedFrom(`${nameof(\"accountInfo\")}`)\r\n public get accountLocation() {\r\n if (!this.accountInfo) {\r\n return null;\r\n }\r\n let address: IAddress;\r\n let userPrimaryBranch: Location;\r\n this.accountInfo.providers.forEach((provider) => {\r\n userPrimaryBranch = provider?.locations.find((location) => location.isPrimaryLocation);\r\n if (!!userPrimaryBranch) {\r\n this.userPrimaryProvider = provider.name;\r\n }\r\n });\r\n if (!!userPrimaryBranch) {\r\n address = userPrimaryBranch.address;\r\n } else {\r\n let mainLocationInfo = this.accountInfo.providers[0].locations.find((location) => {\r\n return location.isMainLocation;\r\n });\r\n if (!!mainLocationInfo) {\r\n address = mainLocationInfo?.address;\r\n }\r\n }\r\n return address;\r\n }\r\n\r\n @computedFrom(nameof(\"today\"))\r\n public get timeZone() {\r\n return moment(this.today).tz(moment.tz.guess()).format(\"z\");\r\n }\r\n\r\n public constructor(accountsService: AccountsService) {\r\n this._accountsService = accountsService;\r\n }\r\n\r\n public async attached() {\r\n try {\r\n this.isLoading = true;\r\n // await this.getWeatherInfo();\r\n await this.getAccountInfo();\r\n this.startClock();\r\n } catch (e) {\r\n // this.isError = true;\r\n console.log(e);\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n private async getWeatherInfo() {\r\n // Get current weather\r\n // Get weather forecast\r\n }\r\n\r\n private async getAccountInfo() {\r\n this.accountInfo = await this._accountsService.getAccountInfo();\r\n console.log(this.accountInfo);\r\n }\r\n\r\n private startClock() {\r\n this._interval = setInterval(() => {\r\n this.today = moment();\r\n }, 1000);\r\n }\r\n\r\n public detached(): void {\r\n clearInterval(this._interval);\r\n }\r\n}\r\n","module.exports = \"\\r\\n\";","import { MessageService } from \"../../../services/message-service\";\r\nimport { autoinject } from \"aurelia-framework\";\r\nimport { EventAggregator, Subscription } from \"aurelia-event-aggregator\";\r\nimport { IMessageItem } from \"../../../interfaces/i-message\";\r\nimport { SignalrEvent } from \"../../../signalr/hubs-container\";\r\nimport { MessageListEvent } from \"../../message-center/conversation/messages-renderer\";\r\nimport { EnumMap } from \"../../../common/utilities/enum-map\";\r\nimport { EnumsService } from \"../../../services/enums-service\";\r\n\r\n@autoinject\r\nexport class MedicationAlerts {\r\n private _enumsService: EnumsService;\r\n private _messageService: MessageService;\r\n private _ea: EventAggregator;\r\n private _messageSubscriptions: Subscription[] = [];\r\n public isLoading: boolean = false;\r\n public isError: boolean = false;\r\n public isAuthorized: boolean = false;\r\n public medAlertConversationId: string = \"\";\r\n public pageNumber: number = 1;\r\n public pageLength: number = 5;\r\n public conversationTypeEnumMap: EnumMap = new EnumMap([]);\r\n public medicationAlerts: IMessageItem[];\r\n public medicationAlertsTotal: number = null;\r\n\r\n public constructor(enumsService: EnumsService, messageService: MessageService, ea: EventAggregator) {\r\n this._enumsService = enumsService;\r\n this._messageService = messageService;\r\n this._ea = ea;\r\n }\r\n\r\n public async attached() {\r\n let conversationTypeEnum = await this._enumsService.getConversationType();\r\n this.conversationTypeEnumMap = new EnumMap(conversationTypeEnum);\r\n await this.getUnreadConversations();\r\n this.initSubscriptions();\r\n }\r\n\r\n public initSubscriptions() {\r\n this._messageSubscriptions.push(\r\n this._ea.subscribe(SignalrEvent.NewMessage, () => {\r\n this.getUnreadConversations();\r\n })\r\n );\r\n this._messageSubscriptions.push(\r\n this._ea.subscribe(MessageListEvent.HasUnreadMessage, () => {\r\n this.getUnreadConversations();\r\n })\r\n );\r\n }\r\n\r\n public async getUnreadConversations() {\r\n try {\r\n this.isError = false;\r\n this.isAuthorized = true;\r\n this.isLoading = true;\r\n let result = await this._messageService.getUnreadConversations({\r\n page: this.pageNumber,\r\n pageLength: this.pageLength,\r\n conversationType: Number(this.conversationTypeEnumMap.getEnumValue(\"Medication Alert\"))\r\n });\r\n let conversations = result.items ? result.items : [];\r\n if (!conversations.length) {\r\n this.medicationAlerts = [];\r\n return;\r\n }\r\n this.medAlertConversationId = conversations[0]?.id;\r\n this.medicationAlerts = await this._messageService.getUnReadMessages(this.medAlertConversationId, true);\r\n this.medicationAlertsTotal = this.medicationAlerts?.length;\r\n if (this.medicationAlerts?.length > 3) {\r\n this.medicationAlerts = this.medicationAlerts.splice(0, 3);\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n this.isError = true;\r\n if (e.status === 403) {\r\n this.isAuthorized = false;\r\n }\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n public detached() {\r\n if (this._messageSubscriptions.length > 0) {\r\n this._messageSubscriptions.forEach((sub) => sub.dispose());\r\n }\r\n }\r\n}\r\n","module.exports = \"\\r\\n\";","// import \"./my-dashboard.scss\";\r\nimport { autoinject } from \"aurelia-framework\";\r\nimport { IGetUserSlimInfoResult } from \"../../../interfaces/i-user\";\r\nimport { CurrentUserService } from \"../../../services/current-user-service\";\r\nimport { AccountsService } from \"./../../../services/accounts-service\";\r\nimport { UsersService } from \"../../../services/users-service\";\r\nimport { EnumMap } from \"../../../common/utilities/enum-map\";\r\nimport { EnumsService } from \"../../../services/enums-service\";\r\n\r\n@autoinject\r\nexport class MyDashboard {\r\n private _enumsService: EnumsService;\r\n private _usersService: UsersService;\r\n private _currentUserService: CurrentUserService;\r\n private _accountsService: AccountsService;\r\n public userInfo: IGetUserSlimInfoResult;\r\n public isPalliativeCareView: boolean = false;\r\n public selectedBranches: string[] = [];\r\n public medAlertsCredentials: string[] = [\"RN\", \"LPN\", \"LVN\", \"NP\"];\r\n public showMedAlerts: boolean = false;\r\n\r\n public constructor(\r\n enumsService: EnumsService,\r\n usersService: UsersService,\r\n currentUserService: CurrentUserService,\r\n accountsService: AccountsService\r\n ) {\r\n this._enumsService = enumsService;\r\n this._usersService = usersService;\r\n this._currentUserService = currentUserService;\r\n this._accountsService = accountsService;\r\n }\r\n\r\n public async activate() {\r\n await this.getUserInfo();\r\n this.isPalliativeCareView = await this._accountsService.getIsPalliativeAccount();\r\n let user = await this._usersService.getUser(this.userInfo?.id);\r\n if (!!user?.credentials?.length) {\r\n let credentialsEnum = await this._enumsService.getCredentials();\r\n let credentialsEnumMap = new EnumMap(credentialsEnum);\r\n let userCredentials = user.credentials;\r\n this.showMedAlerts = userCredentials.some((credential) => {\r\n let credentialValue = credentialsEnumMap.getEnumName(credential) as string;\r\n return this.medAlertsCredentials.includes(credentialValue);\r\n });\r\n }\r\n }\r\n\r\n private async getUserInfo() {\r\n this.userInfo = await this._currentUserService.getUser();\r\n }\r\n}\r\n","module.exports = \"\\r\\n\";","import \"./news-and-updates.scss\";\r\n\r\nimport { autoinject, customElement } from \"aurelia-framework\";\r\n\r\nimport { INews } from \"../../../interfaces/i-news\";\r\nimport { DashboardService } from \"../../../services/dashboard-service\";\r\n\r\n@autoinject\r\n@customElement(\"news-and-updates\")\r\nexport class NewsAndUpdates {\r\n private _dashboardService: DashboardService;\r\n public news: INews[] = [];\r\n public isLoading: boolean = true;\r\n public isError: boolean;\r\n\r\n public constructor(dashboardService: DashboardService) {\r\n this._dashboardService = dashboardService;\r\n }\r\n\r\n public attached() {\r\n this.fetchNews();\r\n }\r\n\r\n public async fetchNews() {\r\n try {\r\n this.isError = false;\r\n this.isLoading = true;\r\n this.news = await this._dashboardService.getNews();\r\n } catch (e) {\r\n this.isError = true;\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n}\r\n","module.exports = \"\";","module.exports = \"\\r\\n\";","import \"./todays-tasks.scss\";\r\n\r\nimport { BindingEngine, Disposable, autoinject, bindable, bindingMode } from \"aurelia-framework\";\r\nimport * as moment from \"moment\";\r\n\r\nimport { EnumMap } from \"../../../common/utilities/enum-map\";\r\nimport { IGetCurrentUserTaskResponse } from \"../../../interfaces/i-schedule\";\r\nimport { IGetUserSlimInfoResult } from \"../../../interfaces/i-user\";\r\nimport { EnumsService } from \"../../../services/enums-service\";\r\nimport { TaskService } from \"../../../services/task-service\";\r\nimport { IEnumResponse } from \"../../../interfaces/i-enum\";\r\n\r\n@autoinject\r\nexport class TodaysTasks {\r\n @bindable({ defaultBinding: bindingMode.toView })\r\n public selectedBranches: string[] = [];\r\n @bindable({ defaultBindingMode: bindingMode.oneWay })\r\n public userInfo: IGetUserSlimInfoResult;\r\n private readonly _enumsService: EnumsService;\r\n private readonly _taskService: TaskService;\r\n private _locationSubscription: Disposable;\r\n private _bindingEngine: BindingEngine;\r\n private _documentTypeEnum: IEnumResponse[] = [];\r\n private _documentTypeEnumMap: EnumMap = new EnumMap([]);\r\n public taskDate: string = moment().format(\"MMM DD YYYY\");\r\n public taskList: IGetCurrentUserTaskResponse[] = [];\r\n public isError: boolean = false;\r\n public isAuthorized: boolean = true;\r\n public isLoading: boolean = false;\r\n public scheduleStatusEnumMap: EnumMap;\r\n\r\n public constructor(taskService: TaskService, enumsService: EnumsService, bindingEngine: BindingEngine) {\r\n this._taskService = taskService;\r\n this._enumsService = enumsService;\r\n this._bindingEngine = bindingEngine;\r\n }\r\n\r\n public async bind() {\r\n const scheduleStatusEnums = await this._enumsService.getScheduleStatus();\r\n this.scheduleStatusEnumMap = new EnumMap(scheduleStatusEnums);\r\n this._documentTypeEnum = await this._enumsService.getDocumentType();\r\n this._documentTypeEnumMap = new EnumMap(this._documentTypeEnum);\r\n }\r\n\r\n public async attached() {\r\n await this.getTaskList();\r\n this.initSubscriptions();\r\n }\r\n\r\n public initSubscriptions() {\r\n this._locationSubscription = this._bindingEngine.collectionObserver(this.selectedBranches).subscribe(() => {\r\n this.getTaskList();\r\n });\r\n }\r\n\r\n public async getTaskList() {\r\n try {\r\n this.isError = false;\r\n this.isAuthorized = true;\r\n this.isLoading = true;\r\n let query = {\r\n date: moment(this.taskDate).format(\"MM/DD/YYYY\"),\r\n locationIds: this.selectedBranches\r\n };\r\n let taskList = await this._taskService.getTaskForCurrentUser(query);\r\n this.taskList = taskList.slice(0, 6);\r\n } catch (e) {\r\n this.isError = true;\r\n if (e.status === 403) {\r\n this.isAuthorized = false;\r\n }\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n public getTaskRoute(task: IGetCurrentUserTaskResponse) {\r\n if (!task) {\r\n return \"\";\r\n }\r\n if (!task?.patientFirstName && !!this.userInfo?.id) {\r\n if (this._documentTypeEnumMap.getEnumValue(\"VolunteerActivity\") === task?.documentType) {\r\n return `/notes/volunteer-activity-note/${task.id}?employeeId=${this.userInfo.id}`;\r\n } else {\r\n return `/notes/non-patient-activity-note/${task.id}?employeeId=${this.userInfo.id}`;\r\n }\r\n }\r\n return `/note/${task.id}`;\r\n }\r\n\r\n public detached() {\r\n this._locationSubscription?.dispose();\r\n }\r\n}\r\n","module.exports = \"\\r\\n\";","import { EventAggregator, Subscription } from \"aurelia-event-aggregator\";\r\nimport { autoinject, customElement } from \"aurelia-framework\";\r\n\r\nimport { IConversationNavOptions } from \"../../../interfaces/i-message\";\r\nimport { MessageService } from \"../../../services/message-service\";\r\nimport { SignalrEvent } from \"../../../signalr/hubs-container\";\r\nimport { MessageListEvent } from \"../../message-center/conversation/messages-renderer\";\r\n\r\n@autoinject\r\n@customElement(\"unread-messages\")\r\nexport class UnreadMessages {\r\n private _ea: EventAggregator;\r\n private _pageNumber: number = 1;\r\n private _pageLength: number = 3;\r\n private _messageService: MessageService;\r\n private _messageSubscriptions: Subscription[] = [];\r\n public conversations: IConversationNavOptions[] = [];\r\n public unreadConversations: number = 0;\r\n public isLoading: boolean = true;\r\n public isError: boolean = false;\r\n public isAuthorized: boolean = true;\r\n\r\n public constructor(messageService: MessageService, ea: EventAggregator) {\r\n this._messageService = messageService;\r\n this._ea = ea;\r\n }\r\n\r\n public async attached() {\r\n await this.getUnreadConversations();\r\n this._messageSubscriptions.push(\r\n this._ea.subscribe(SignalrEvent.NewMessage, () => {\r\n this.getUnreadConversations();\r\n })\r\n );\r\n this._messageSubscriptions.push(\r\n this._ea.subscribe(MessageListEvent.HasUnreadMessage, () => {\r\n this.getUnreadConversations();\r\n })\r\n );\r\n }\r\n\r\n public async getUnreadConversations() {\r\n try {\r\n this.isError = false;\r\n this.isAuthorized = true;\r\n this.isLoading = true;\r\n let result = await this._messageService.getUnreadConversations({\r\n page: this._pageNumber,\r\n pageLength: this._pageLength\r\n });\r\n this.conversations = result.items ? result.items : [];\r\n this.unreadConversations = result.itemCount;\r\n } catch (e) {\r\n this.isError = true;\r\n if (e.status === 403) {\r\n this.isAuthorized = false;\r\n }\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n }\r\n\r\n public detached() {\r\n if (this._messageSubscriptions.length > 0) {\r\n this._messageSubscriptions.forEach((sub) => sub.dispose());\r\n }\r\n }\r\n}\r\n","module.exports = \"\\r\\n\";"],"sourceRoot":""}