Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Components: Contains Blazor UI Components. Notable is 'ActionCard.razor(.cs)', 'PatientCard.razor(.cs)' and 'PatientSessionsCard.razor(.cs)' that retrieves data and display displays the information cards for a selected patient. Most of the components are made with a code-behind approach, where the view (.razor file) is separated from the logic in separate files (.razor.cs file).

  • Extensions: Contains a few helpful extension methods.

  • Mappers: Contains mappers to convert between data types.

  • Pages: Contains the pages that can be reached by an URL.

  • Services: Contains application services. A service is an abstraction level above the Noah Cloud API, that can contain validation or business logic and makes it easy to retrieve and store data. It is the services that are injected into the Blazor components. The project has following services:

    • IPatientService: Provides patient related CRUD operations.

    • IActionService: Provides action and session related CRUD operations.

    • IGlobalSettingsService: Provides read operations for global settings and data types.

    • IUserAccountService: Provides user account related CRUD operations.

    • IAppService: Provides app scope related CRUD operations.

    • IUserContext: Provides information about the authenticated user.

    • IETagService: Provides caching of ETags. The ETag (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag ) header is cached when the CallApi method is called in NoahCloudServiceBase.cs if an ObjectToETagCacheKeyConverter is registered for the returned object type. ObjectToETagCacheKeyConverter provides conversion from object to ETag cache keys, so an object of an object type which a ObjectToETagCacheKeyConverter is registered for, can be used to retrieve and store ETags. A list of ObjectToETagCacheKeyConverter is registered with the ETagService in Program.cs.

    • IAppStateService: Manages app state and makes necessary app connection operations. AppStateService has one method DetermineAppState which determines the current app state and makes app connections requests to:

      • Request initial app connection.

      • Request new permissions.

      • Determine if app has sufficient permissions to continue.

    • IRtmEventService: Provides operations to set up RTM event listening. SignalR (https://docs.microsoft.com/en-us/aspnet/core/signalr/introduction?view=aspnetcore-6.0 ) is used to handle event subscription. A HubConnection is started in App.razor. RtmSetupComponent.razor contains logic to check the current app state and start listening for events using the IRtmService. The RtmSetupComponent.razor component is created in MainLayout.razor. Also created in MainLayout.razor is the RtmEventHandlerComponent.razor component, which subscribes to events and handles them. To subscribe to events call the hub method "SubscribeTenant" with the tenant id and event subscription id as arguments. There are 2 types of event subscriptions:

      • App connection event subscription used when app is not connected with tenant. To subscribe invoke "SubscribeTenant" with the tenant id and client id as arguments.

      • Noah event subscription used when app is connected with tenant. To subscribe invoke "SubscribeTenant" with the tenant id and event subscription id as arguments. The app is responsible for creating an event subscription with the events it’s interested in.

  • Shared: Contains the main layout of the app.

...