Design: Case Analysis¶
This document describes the software design of the cases_analysis module.
Module Responsibilities¶
This module has the following responsibilities:
- Maintain the database records for
case analysis activity for a case and potentially multiple analysist user, and
case analysis sessions for per case and analyst user
Provide the CRUD operations on these records
Synopsis¶
Cases may be analyzed multiple times, e.g., when the index is sequenced, then again when the parents are added, and maybe at a later point in time. Such reanalyses are generally also reimbursed by health insurances. State may be kept for each analysis activity. Within one case analysis activity, multiple users may have a case analysis session where we also may need to manage state.
For the initial implementation, we only introduce the necessary entity levels to support multiple activities. This module is a point for future extension. We currently only support a single case analysis session for each user and case. Once a user lists the case analysis or case analysis activities, they are implicitely created.
The analysis of any variant type by a user, e.g., sequence variants, occurs inside a case analysis session.
Database Entities¶
This section describes the database entities maintained by this module.
External Entities¶
The database entities in this module refer to the following external entities:
User(central user model)cases.Case
Module Entities¶
CaseAnalysisdescribes the analysis activity of a single case (e.g., first analysis or reanalysis). In principle, one
Casecan have multipleCaseAnalysisrecords, but we restrict ourselves to at most oneCaseAnalysisperCase. Increasing the cardinality is a future improvement.CaseAnalysisSessiondescribes the analysis of a case by a single user within one
CaseAnalysis. Again, in principle oneCaseAnalysiscan have multipleCaseAnalysisSessionrecords perUser. We restrict ourselves to at most oneCaseAnalysisSessionperCaseAnalysisandUser. Increasing the cardinality is a future improvement.
The following ER diagram shows the relationships between the entities:
erDiagram
Case ||..o{ CaseAnalysis : has
CaseAnalysis ||..o{ CaseAnalysisSession : has
CaseAnalysisSession }o..|| User : has
ER diagram of the cases_analysis module.¶
User Stories¶
- User lists case analysis activities
As a user, I want to list all case analysis activities for a case. For the initial implementation, only one case analysis will exist and this is implicitely created on listing.
- User lists case analysis sessions
As a user, I want to list all case analysis sessions for a case. For the initial implementation, only one case analysis session will exist and this is implicitely created on listing together with its case analysis activity.
REST Endpoints¶
The cases_analysis module provides the following endpoints:
- List
CaseAnalysis List all case analysis records. This will implicitely create single
CaseAnalysisfor the case unless it exists.- List CaseAnalysisSession
This will implicitely create single
CaseAnalysisSessionand correspondingCaseAnalysisfor theCaseandUserunless it exists already.