Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Risk calculation #671

Merged
merged 7 commits into from
Jan 12, 2022
Merged

Conversation

keiji
Copy link
Collaborator

@keiji keiji commented Jan 10, 2022

Issue 番号 / Issue ID

#668 に依存する変更。

目的 / Purpose

  • 接触データからリスク値を算出する機構を実装する

破壊的変更をもたらしますか / Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request の種類 / Pull Request type

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

検証方法 / How to test

コードの入手 / Get the code

git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
dotnet restore

コードの検証 / Test the code


確認事項 / What to check

その他 / Other information

@keiji keiji added the COCOA2 label Jan 10, 2022
@keiji keiji self-assigned this Jan 10, 2022
@keiji keiji marked this pull request as ready for review January 10, 2022 14:33
@keiji keiji mentioned this pull request Jan 11, 2022
Comment on lines 60 to 95
[Fact]
public void HighRiskExposureTest()
{

var dailySummary = new DailySummary()
{
DateMillisSinceEpoch = 0,
DaySummary = new ExposureSummaryData()
{
ScoreSum = 2000.0
},
ConfirmedClinicalDiagnosisSummary = new ExposureSummaryData(),
ConfirmedTestSummary = new ExposureSummaryData(),
RecursiveSummary = new ExposureSummaryData(),
SelfReportedSummary = new ExposureSummaryData()
};

var exposureWindows = new List<ExposureWindow>()
{
new ExposureWindow()
{
CalibrationConfidence = CalibrationConfidence.High,
DateMillisSinceEpoch = 0,
Infectiousness = Infectiousness.High,
ReportType = ReportType.Unknown,
ScanInstances = new List<ScanInstance>()
}
};

IExposureRiskCalculationService service = CreateService();

RiskLevel result = service.CalcRiskLevel(dailySummary, exposureWindows);

Assert.Equal(RiskLevel.High, result);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

テストの実装がパラメータと期待値以外は同じなので、LowRiskExposureTestとTheoryでまとめた方がよいかと思います。

        [Theory]
        [InlineData(1999, RiskLevel.Low)]
        [InlineData(2000, RiskLevel.High)]
         public void CalcRiskLevelTest(double scoreSum, RiskLevel expected)

// TODO: refine
private const double THRESHOLD_SCORE_SUM = 2000.0;

public RiskLevel CalcRiskLevel(DailySummary dailySummary, List<ExposureWindow> exposureWindowList)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

引数として渡しているexposureWindowListを使っていないですが後日利用予定でしょう?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

はい。後々ScanInstanceとかも使う予定があるので渡します

@keiji
Copy link
Collaborator Author

keiji commented Jan 12, 2022

@kazuhiro4949 調整しました!

@kazuhiro4949 kazuhiro4949 merged commit 6af2214 into cocoa-mhlw:feature/cocoa2 Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants