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

感染性のある期間を有症状の場合は症状発生から10日、無症状の場合は検査日から7日とする #841

Merged
merged 13 commits into from Mar 17, 2022

Conversation

keiji
Copy link
Collaborator

@keiji keiji commented Feb 2, 2022

Issue 番号 / Issue ID

目的 / Purpose

  • 感染性のある期間を有症状の場合は症状発生から10日、無症状の場合は検査日から7日とする

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

[x] Yes
[ ] No

Pull Request の種類 / Pull Request type

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] 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

実装方針としては、次の通り。

  • アプリは、症状の有無をサーバーに送信する
  • 症状がある場合は、サーバーは症状発生から10日分のTEKを保存する
  • 症状がない場合は、サーバーは症状発生から7日分のTEKを保存する

運用中に値が変わることが想定されるため、Azure FunctionsのConfigurationに次の値を新しく追加した。

  • InfectiousFilterDaysSinceOnsetOfSymptomsFrom(有症状時に保存するTEKの DaysSinceOnsetOfSymptom の値の起点)
  • InfectiousFilterDaysSinceOnsetOfSymptomsTo(有症状時に保存するTEKの DaysSinceOnsetOfSymptom の値の終点)
  • InfectiousFilterDaysSinceTestFrom(無症状時に保存するTEKの DaysSinceOnsetOfSymptom の値の起点)
  • InfectiousFilterDaysSinceTestTo(無症状時に保存するTEKの DaysSinceOnsetOfSymptom の値の終点)

これらの値を変えることで、コードのリリース無しに、保存する(フィルターする)TEKの日付の範囲を運用レベルで変更できるようにしている。

@keiji keiji self-assigned this Feb 2, 2022
Comment on lines 32 to 33
string hasSymptom = submission.HasSymptom ? "HasSymptom" : "NoSymptom";
return string.Join("|", submission.AppPackageName, submission.OnSetOfSymptomOrTestDate, hasSymptom, GetKeyString(submission.Keys), GetRegionString(submission.Regions), submission.VerificationPayload);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

症状の有無(HasSymptom)をDeviceVerificationのNonceのseedに含める。

Comment on lines 11 to 15
[JsonProperty("symptomOnsetDate")]
public string SymptomOnsetDate { get; set; }
[JsonProperty("hasSymptom")]
public bool HasSymptom { get; set; }

[JsonProperty("onSetOfSymptomOrTestDate")]
public string OnSetOfSymptomOrTestDate { get; set; }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

SymptomOnsetDateをOnSetOfSymptomOrTestDateにリネーム。
症状の有無を hasSymptomで送る。

サーバー側( src/Covid19Radar.Api/Models/V3DiagnosisSubmissionParameter )と合わせる。

Comment on lines +19 to +20
private const string EXPECTED_CLEAR_TEXT_V3_HASSYMPTOM = "jp.go.mhlw.cocoa.unit_test|2021-12-19T19:02:00.000+09:00|HasSymptom|S2V5RGF0YTE=.10000.140.1,S2V5RGF0YTI=.20000.141.1,S2V5RGF0YTM=.30000.142.1,S2V5RGF0YTQ=.40000.143.1,S2V5RGF0YTU=.50000.70.1|440,441|VerificationPayload THIS STRING IS MEANINGLESS";
private const string EXPECTED_CLEAR_TEXT_V3_NOSYMPTOM = "jp.go.mhlw.cocoa.unit_test|2021-12-19T19:02:00.000+09:00|NoSymptom|S2V5RGF0YTE=.10000.140.1,S2V5RGF0YTI=.20000.141.1,S2V5RGF0YTM=.30000.142.1,S2V5RGF0YTQ=.40000.143.1,S2V5RGF0YTU=.50000.70.1|440,441|VerificationPayload THIS STRING IS MEANINGLESS";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

症状の有無でDeviceVerificaitonのClearTextの内容が変わる。
アプリ側のテスト調整。

テストデータは src/Covid19Radar.Api.Tests/Models/V3DiagnosisSubmissionParameterTest のものと一致する。

Comment on lines -17 to +22
private const string EXPECTED_CLEAR_TEXT_V3 = "2021-12-19T19:02:00.000+09:00|jp.go.mhlw.cocoa.unit_test|S2V5RGF0YTE=.10000.140.1,S2V5RGF0YTI=.20000.141.1,S2V5RGF0YTM=.30000.142.1,S2V5RGF0YTQ=.40000.143.1,S2V5RGF0YTU=.50000.70.1|440,441|VerificationPayload THIS STRING IS MEANINGLESS";
private const string EXPECTED_TRANSACTION_ID_SEED_V3 = "2021-12-19T19:02:00.000+09:00jp.go.mhlw.cocoa.unit_testS2V5RGF0YTE=.10000.140.1,S2V5RGF0YTI=.20000.141.1,S2V5RGF0YTM=.30000.142.1,S2V5RGF0YTQ=.40000.143.1,S2V5RGF0YTU=.50000.70.1440,441";
private const string EXPECTED_CLEAR_TEXT_V3_HASSYMPTOM = "jp.go.mhlw.cocoa.unit_test|2021-12-19T19:02:00.000+09:00|HasSymptom|S2V5RGF0YTE=.10000.140.1,S2V5RGF0YTI=.20000.141.1,S2V5RGF0YTM=.30000.142.1,S2V5RGF0YTQ=.40000.143.1,S2V5RGF0YTU=.50000.70.1|440,441|VerificationPayload THIS STRING IS MEANINGLESS";
private const string EXPECTED_TRANSACTION_ID_SEED_V3_HASSYMPTOM = "jp.go.mhlw.cocoa.unit_test2021-12-19T19:02:00.000+09:00HasSymptomS2V5RGF0YTE=.10000.140.1,S2V5RGF0YTI=.20000.141.1,S2V5RGF0YTM=.30000.142.1,S2V5RGF0YTQ=.40000.143.1,S2V5RGF0YTU=.50000.70.1440,441";
private const string EXPECTED_CLEAR_TEXT_V3_NOSYMPTOM = "jp.go.mhlw.cocoa.unit_test|2021-12-19T19:02:00.000+09:00|NoSymptom|S2V5RGF0YTE=.10000.140.1,S2V5RGF0YTI=.20000.141.1,S2V5RGF0YTM=.30000.142.1,S2V5RGF0YTQ=.40000.143.1,S2V5RGF0YTU=.50000.70.1|440,441|VerificationPayload THIS STRING IS MEANINGLESS";
private const string EXPECTED_TRANSACTION_ID_SEED_V3_NOSYMPTOM = "jp.go.mhlw.cocoa.unit_test2021-12-19T19:02:00.000+09:00NoSymptomS2V5RGF0YTE=.10000.140.1,S2V5RGF0YTI=.20000.141.1,S2V5RGF0YTM=.30000.142.1,S2V5RGF0YTQ=.40000.143.1,S2V5RGF0YTU=.50000.70.1440,441";

private const string EXPECTED_CLEAR_TEXT_V3_NO_KEY = "2021-12-19T19:02:00.000+09:00|jp.go.mhlw.cocoa.unit_test||440,441|VerificationPayload THIS STRING IS MEANINGLESS";
private const string EXPECTED_TRANSACTION_ID_SEED_V3_NO_KEY = "2021-12-19T19:02:00.000+09:00jp.go.mhlw.cocoa.unit_test440,441";
private const string EXPECTED_CLEAR_TEXT_V3_NO_KEY = "jp.go.mhlw.cocoa.unit_test|2021-12-19T19:02:00.000+09:00|HasSymptom||440,441|VerificationPayload THIS STRING IS MEANINGLESS";
private const string EXPECTED_TRANSACTION_ID_SEED_V3_NO_KEY = "jp.go.mhlw.cocoa.unit_test2021-12-19T19:02:00.000+09:00HasSymptom440,441";
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

症状の有無でDeviceVerificaitonのClearTextの内容が変わる。

サーバー側のテスト調整。

テストデータは Covid19Radar/Tests/Covid19Radar.UnitTests/Common/DeviceVerifierUtilsTests のものと一致する。

Comment on lines -39 to -68
[DataTestMethod]
[DataRow("KEYDATA", 0, 0, 0, true)]
[DataRow("KEYDATA", 145, 0, 0, false)]
[DataRow("KEYDATA", 144, -15, 0, false)]
[DataRow("KEYDATA", 144, -14, 0, true)]
[DataRow("KEYDATA", 144, -6, 0, true)]
[DataRow("KEYDATA", 144, -5, 0, true)]
[DataRow("KEYDATA", 144, -4, 0, true)]
[DataRow("KEYDATA", 144, -3, 0, true)]
[DataRow("KEYDATA", 144, -2, 0, true)]
[DataRow("KEYDATA", 144, -1, 0, true)]
[DataRow("KEYDATA", 144, 0, 0, true)]
[DataRow("KEYDATA", 144, 0, -14, true)]
[DataRow("KEYDATA", 144, 0, 14, true)]
[DataRow("KEYDATA", 144, 0, -15, false)]
[DataRow("KEYDATA", 144, 0, 15, false)]
[DataRow("KEYDATA", 144, 1, 0, false)]
public void KeyValidationTest(string keyData, int rollingPeriod, int rollingStartNummberDayOffset, int daysSinceOnsetOfSymptoms, bool isValid)
{
var dateTime = DateTime.UtcNow.Date;

var key = CreateDiagnosisKey(
keyData,
(int)dateTime.AddDays(rollingStartNummberDayOffset).ToRollingStartNumber(),
rollingPeriod,
1,
daysSinceOnsetOfSymptoms
);
Assert.AreEqual(isValid, key.IsValid());
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

V3DiagnosisSubmissionParameter.KeyのIsValidは廃止。

TemporaryExposureKeyValidationServiceとして実装する。

Comment on lines -265 to +294
Assert.AreEqual(-7, resultParameter.Keys[0].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-6, resultParameter.Keys[1].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-5, resultParameter.Keys[2].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-4, resultParameter.Keys[3].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-3, resultParameter.Keys[4].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-2, resultParameter.Keys[5].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-1, resultParameter.Keys[6].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(0, resultParameter.Keys[7].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(1, resultParameter.Keys[8].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(2, resultParameter.Keys[9].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(3, resultParameter.Keys[10].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(4, resultParameter.Keys[11].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(5, resultParameter.Keys[12].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(6, resultParameter.Keys[13].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(7, resultParameter.Keys[14].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-8, resultParameter.Keys[0].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-7, resultParameter.Keys[1].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-6, resultParameter.Keys[2].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-5, resultParameter.Keys[3].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-4, resultParameter.Keys[4].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-3, resultParameter.Keys[5].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-2, resultParameter.Keys[6].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(-1, resultParameter.Keys[7].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(0, resultParameter.Keys[8].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(1, resultParameter.Keys[9].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(2, resultParameter.Keys[10].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(3, resultParameter.Keys[11].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(4, resultParameter.Keys[12].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(5, resultParameter.Keys[13].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(6, resultParameter.Keys[14].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(7, resultParameter.Keys[15].DaysSinceOnsetOfSymptoms);
Assert.AreEqual(8, resultParameter.Keys[16].DaysSinceOnsetOfSymptoms);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

KeyがValidかどうかのテストは src/Covid19Radar.Api.Tests/Services/TemporaryExposureKeyValidationServiceTest が担当するので、このテストでフィルタリングについて考慮する必要はない。

Comment on lines +43 to +74
public static int InfectiousFilterDaysSinceOnsetOfSymptomsFrom(this IConfiguration config)
{
if (int.TryParse(config["InfectiousFilterDaysSinceOnsetOfSymptomsFrom"], out int result))
{
return result;
}
return Constants.MIN_DAYS_SINCE_ONSET_OF_SYMPTOMS;
}
public static int InfectiousFilterDaysSinceOnsetOfSymptomsTo(this IConfiguration config)
{
if (int.TryParse(config["InfectiousFilterDaysSinceOnsetOfSymptomsTo"], out int result))
{
return result;
}
return Constants.MAX_DAYS_SINCE_ONSET_OF_SYMPTOMS;
}
public static int InfectiousFilterDaysSinceTestFrom(this IConfiguration config)
{
if (int.TryParse(config["InfectiousFilterDaysSinceTestFrom"], out int result))
{
return result;
}
return Constants.MIN_DAYS_SINCE_ONSET_OF_SYMPTOMS;
}
public static int InfectiousFilterDaysSinceTestTo(this IConfiguration config)
{
if (int.TryParse(config["InfectiousFilterDaysSinceTestTo"], out int result))
{
return result;
}
return Constants.MAX_DAYS_SINCE_ONSET_OF_SYMPTOMS;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Azure FunctionsのConfigurationに設定する値。

  • InfectiousFilterDaysSinceOnsetOfSymptomsFrom
  • InfectiousFilterDaysSinceOnsetOfSymptomsTo
  • InfectiousFilterDaysSinceTestFrom
  • InfectiousFilterDaysSinceTestTo

Copy link
Contributor

Choose a reason for hiding this comment

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

local.settings.json.exampleこちらに追加していただくと追加があることが把握しやすいです。
ローカルで動かす際もこのファイルをベースにlocal.settings.jsonを作成しますので、その意味でも追加していただけると助かります。

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

6784b8d で対応しました!

Copy link
Contributor

Choose a reason for hiding this comment

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

確認しました。ありがとうございます。

Comment on lines 19 to 20
[JsonProperty("onSetOfSymptomOrTestDate")]
public string OnSetOfSymptomOrTestDate { get; set; }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

症状の有無(hasSymptom )と症状が現れた日・または診断日(onSetOfSymptomOrTestDate )。

Covid19Radar/Covid19Radar/Model/DiagnosisSubmissionParameter と合わせる。

Comment on lines -134 to -158
/// <summary>
/// Validation
/// </summary>
/// <returns>true if valid</returns>
public bool IsValid()
{
if (string.IsNullOrWhiteSpace(KeyData)) return false;
if (RollingPeriod > Constants.ActiveRollingPeriod) return false;

var dateTime = DateTime.UtcNow.Date;
var todayRollingStartNumber = dateTime.ToRollingStartNumber();

var oldestRollingStartNumber = dateTime.AddDays(Constants.OutOfDateDays).ToRollingStartNumber();
if (RollingStartNumber < oldestRollingStartNumber || RollingStartNumber > todayRollingStartNumber)
{
return false;
}

if (DaysSinceOnsetOfSymptoms < MIN_DAYS_SINCE_ONSET_OF_SYMPTOMS
|| DaysSinceOnsetOfSymptoms > MAX_DAYS_SINCE_ONSET_OF_SYMPTOMS)
{
return false;
}
return true;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

廃止してTemporaryExposureKeyValidationServiceに任せる。

V1, V2は移動させない。DeviceVerificationと方針が異なるのはAttestations Apiなどは外部環境の変化(Attestation APIのアップグレードや仕様変更)があるのにたいして、この点についてはコントローラブルなので各バージョンの処理を別に定義しても差し支えないと考えたため。
ぜんぶのバージョンのValidationをここに集めるのが一番きれいなので、時間があればやりたい。

Comment on lines +117 to +140
if (hasSymptom)
{
_logger.LogDebug("hasSymptom");

if (_infectiousFilterDaysSinceOnsetOfSymptomsFrom > key.DaysSinceOnsetOfSymptoms
|| _infectiousFilterDaysSinceOnsetOfSymptomsTo < key.DaysSinceOnsetOfSymptoms
)
{
_logger.LogInformation($"key.DaysSinceOnsetOfSymptoms must be in {_infectiousFilterDaysSinceOnsetOfSymptomsFrom} to {_infectiousFilterDaysSinceOnsetOfSymptomsTo} but {key.DaysSinceOnsetOfSymptoms}");
return false;
}
}
else
{
_logger.LogDebug("diagnosis");

if (_infectiousFilterDaysSinceTestFrom > key.DaysSinceOnsetOfSymptoms
|| _infectiousFilterDaysSinceTestTo < key.DaysSinceOnsetOfSymptoms
)
{
_logger.LogInformation($"key.DaysSinceOnsetOfSymptoms must be in {_infectiousFilterDaysSinceTestFrom} to {_infectiousFilterDaysSinceTestTo} but {key.DaysSinceOnsetOfSymptoms}");
return false;
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

症状の有無によってvalid/invalidを判定する

@keiji
Copy link
Collaborator Author

keiji commented Feb 2, 2022

動作テスト

Azure Functionsの管理画面からConfigurationに次の値を設定した。

  • InfectiousFilterDaysSinceOnsetOfSymptomsTo : 10
  • InfectiousFilterDaysSinceTestTo : 7

症状有りの場合は症状が現れた日から10日分のTEKが登録されること

「症状有り」を選択した上で、次のTEKを診断キーとして登録した。

HasSymptom: true
2022年01月19日(UTCに補正済み)
 0 2022年01月19日 TemporaryExposureKey: RollingStartIntervalNumber: 2737584(1642550400), RollingPeriod: 144
 1 2022年01月20日 TemporaryExposureKey: RollingStartIntervalNumber: 2737728(1642636800), RollingPeriod: 144
 2 2022年01月21日 TemporaryExposureKey: RollingStartIntervalNumber: 2737872(1642723200), RollingPeriod: 144
 3 2022年01月22日 TemporaryExposureKey: RollingStartIntervalNumber: 2738016(1642809600), RollingPeriod: 144
 4 2022年01月23日 TemporaryExposureKey: RollingStartIntervalNumber: 2738160(1642896000), RollingPeriod: 144
 5 2022年01月24日 TemporaryExposureKey: RollingStartIntervalNumber: 2738304(1642982400), RollingPeriod: 144
 6 2022年01月25日 TemporaryExposureKey: RollingStartIntervalNumber: 2738448(1643068800), RollingPeriod: 144
 7 2022年01月26日 TemporaryExposureKey: RollingStartIntervalNumber: 2738592(1643155200), RollingPeriod: 144
 8 2022年01月27日 TemporaryExposureKey: RollingStartIntervalNumber: 2738736(1643241600), RollingPeriod: 144
 9 2022年01月28日 TemporaryExposureKey: RollingStartIntervalNumber: 2738880(1643328000), RollingPeriod: 144
10 2022年01月29日 TemporaryExposureKey: RollingStartIntervalNumber: 2739024(1643414400), RollingPeriod: 144
11 2022年01月30日 TemporaryExposureKey: RollingStartIntervalNumber: 2739168(1643500800), RollingPeriod: 144
12 2022年01月31日 TemporaryExposureKey: RollingStartIntervalNumber: 2739312(1643587200), RollingPeriod: 144
13 2022年02月01日 TemporaryExposureKey: RollingStartIntervalNumber: 2739456(1643673600), RollingPeriod: 144

陽性情報登録完了後、Cosmos DBの TemporaryExposureKey テーブルを確認した。

TemporaryExposureKey

[
{
"id": "408eadff3dedabdd0e82af0ee0d4cd7a3df97226aff8b42e3f7437238b2524cf",
"PartitionKey": "440",
"KeyData": "oW20c9TXO7vojvSV1avydw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2737584,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 0,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lRAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lRAAAAAAAAAA==/",
"_etag": ""d000f9fc-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "8be8be8d002928fa1ac27f15e932281654d2651c7445503f3384c08f3fe242b7",
"PartitionKey": "440",
"KeyData": "elSv1Xo5r32wEMRLcMbbbw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2737728,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 1,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lSAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lSAAAAAAAAAA==/",
"_etag": ""d000fcfc-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "8d8148fbef3bf048bd0c59f931d078cadbee60b7250d462a8e9e97ebc8b1a373",
"PartitionKey": "440",
"KeyData": "S92By2W8klWXWPVAIDhNUw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2737872,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 2,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lTAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lTAAAAAAAAAA==/",
"_etag": ""d000fdfc-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "224d68d65ab3cb87079378d43414bbf5e56a2294839a891dc674050df2235ab8",
"PartitionKey": "440",
"KeyData": "5amu1d0kMu7sr38UMZj2Fg==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738016,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 3,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lUAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lUAAAAAAAAAA==/",
"_etag": ""d000fefc-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "6d93374424262a61bcb19304b5ed2648ad8200b896c13e0ed94608ddd239edb4",
"PartitionKey": "440",
"KeyData": "Q81HwcMS7BMP2vau1HUWvw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738160,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 4,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lVAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lVAAAAAAAAAA==/",
"_etag": ""d00000fd-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "e6805715f4d1a15b501e4b91f6804905f6583b7e511bc3c208efbd7908a23506",
"PartitionKey": "440",
"KeyData": "ri2eE8WprwRNqAHpFHPnnA==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738304,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 5,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lWAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lWAAAAAAAAAA==/",
"_etag": ""d00001fd-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "302efa0e95b2f41b4d0751884cf7d49b18191e8067db4be5a1dc015549c16da3",
"PartitionKey": "440",
"KeyData": "wfGjUcRVZF3Jt5TQ8FWscA==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738448,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 6,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lXAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lXAAAAAAAAAA==/",
"_etag": ""d00005fd-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "c9a8ede0fbfa7d28d811aa72e1939d6265af2994547cf331dbf46fec6e466f79",
"PartitionKey": "440",
"KeyData": "DxqAxxHQHCOoFBqB0Z7VGg==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738592,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 7,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lYAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lYAAAAAAAAAA==/",
"_etag": ""d00006fd-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "e832704fdd5035bd39314f93b8ca91f5f4608f7daf588f6d9f9a106451ebaabf",
"PartitionKey": "440",
"KeyData": "46mUGcI+DDUERwXKN9zHXQ==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738736,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 8,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lZAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lZAAAAAAAAAA==/",
"_etag": ""d00007fd-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "94084bea253972105a95a65c6ec32c9b6a9c50495fa870db908ad0fcc7f61795",
"PartitionKey": "440",
"KeyData": "vBxr0L5cztf+T1225KZwyg==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738880,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 9,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7laAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7laAAAAAAAAAA==/",
"_etag": ""d00009fd-0000-0700-0000-61fa4cac0000"",
"_attachments": "attachments/",
"_ts": 1643793580
},
{
"id": "dbe5aa0cb9e9cff6615c431fdd805cfafa69b5f6323e9153ef5c63d4f53c92f4",
"PartitionKey": "440",
"KeyData": "v8+g6jiyB+vv2FUdPEI6Dw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2739024,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 10,
"Timestamp": 1643793578,
"Exported": false,
"_rid": "ARE3AN9pq7lbAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lbAAAAAAAAAA==/",
"_etag": ""d0000afd-0000-0700-0000-61fa4cad0000"",
"_attachments": "attachments/",
"_ts": 1643793581
}
]

所見

10を超えるDaysSinceOnsetOfSymptomsのTEKは、フィルタリングされた結果登録されていない。

症状無しの場合は検査日から7日分のTEKが登録されること

「症状無し」を選択した上で、次のTEKを診断キーとして登録した。

HasSymptom: false
2022年01月19日(UTCに補正済み)
 0 2022年01月19日 TemporaryExposureKey: RollingStartIntervalNumber: 2737584(1642550400), RollingPeriod: 144
 1 2022年01月20日 TemporaryExposureKey: RollingStartIntervalNumber: 2737728(1642636800), RollingPeriod: 144
 2 2022年01月21日 TemporaryExposureKey: RollingStartIntervalNumber: 2737872(1642723200), RollingPeriod: 144
 3 2022年01月22日 TemporaryExposureKey: RollingStartIntervalNumber: 2738016(1642809600), RollingPeriod: 144
 4 2022年01月23日 TemporaryExposureKey: RollingStartIntervalNumber: 2738160(1642896000), RollingPeriod: 144
 5 2022年01月24日 TemporaryExposureKey: RollingStartIntervalNumber: 2738304(1642982400), RollingPeriod: 144
 6 2022年01月25日 TemporaryExposureKey: RollingStartIntervalNumber: 2738448(1643068800), RollingPeriod: 144
 7 2022年01月26日 TemporaryExposureKey: RollingStartIntervalNumber: 2738592(1643155200), RollingPeriod: 144
 8 2022年01月27日 TemporaryExposureKey: RollingStartIntervalNumber: 2738736(1643241600), RollingPeriod: 144
 9 2022年01月28日 TemporaryExposureKey: RollingStartIntervalNumber: 2738880(1643328000), RollingPeriod: 144
10 2022年01月29日 TemporaryExposureKey: RollingStartIntervalNumber: 2739024(1643414400), RollingPeriod: 144
11 2022年01月30日 TemporaryExposureKey: RollingStartIntervalNumber: 2739168(1643500800), RollingPeriod: 144
12 2022年01月31日 TemporaryExposureKey: RollingStartIntervalNumber: 2739312(1643587200), RollingPeriod: 144
13 2022年02月01日 TemporaryExposureKey: RollingStartIntervalNumber: 2739456(1643673600), RollingPeriod: 144

陽性情報登録完了後、Cosmos DBの TemporaryExposureKey テーブルを確認した。

TemporaryExposureKey

[
{
"id": "9377b2d98ff53613b58c099a4639cd111a5fdccb8838158f0fb7b181857d2f71",
"PartitionKey": "440",
"KeyData": "oW20c9TXO7vojvSV1avydw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2737584,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 0,
"Timestamp": 1643793907,
"Exported": false,
"_rid": "ARE3AN9pq7lcAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lcAAAAAAAAAA==/",
"_etag": ""d1003004-0000-0700-0000-61fa4df30000"",
"_attachments": "attachments/",
"_ts": 1643793907
},
{
"id": "06c7074006e4cff7f78a5ca7a94aa9589996ae47cdf475d3983e24f4c2eefce9",
"PartitionKey": "440",
"KeyData": "elSv1Xo5r32wEMRLcMbbbw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2737728,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 1,
"Timestamp": 1643793907,
"Exported": false,
"_rid": "ARE3AN9pq7ldAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7ldAAAAAAAAAA==/",
"_etag": ""d1003104-0000-0700-0000-61fa4df30000"",
"_attachments": "attachments/",
"_ts": 1643793907
},
{
"id": "94fb48b78c28bab409757ba9735d4199d33a05f0622d0cbdd803641c368e8f97",
"PartitionKey": "440",
"KeyData": "S92By2W8klWXWPVAIDhNUw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2737872,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 2,
"Timestamp": 1643793907,
"Exported": false,
"_rid": "ARE3AN9pq7leAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7leAAAAAAAAAA==/",
"_etag": ""d1003404-0000-0700-0000-61fa4df30000"",
"_attachments": "attachments/",
"_ts": 1643793907
},
{
"id": "ff1be973063d34d8977edb10559e647765fc4ee7652d01053b937e1a96c6ea5a",
"PartitionKey": "440",
"KeyData": "5amu1d0kMu7sr38UMZj2Fg==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738016,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 3,
"Timestamp": 1643793907,
"Exported": false,
"_rid": "ARE3AN9pq7lfAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lfAAAAAAAAAA==/",
"_etag": ""d1003504-0000-0700-0000-61fa4df30000"",
"_attachments": "attachments/",
"_ts": 1643793907
},
{
"id": "53a085d22c6c3f259c846b1e70a01edcb72ad7b48296d9161bcbb9ad579a9a00",
"PartitionKey": "440",
"KeyData": "Q81HwcMS7BMP2vau1HUWvw==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738160,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 4,
"Timestamp": 1643793907,
"Exported": false,
"_rid": "ARE3AN9pq7lgAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lgAAAAAAAAAA==/",
"_etag": ""d1003604-0000-0700-0000-61fa4df30000"",
"_attachments": "attachments/",
"_ts": 1643793907
},
{
"id": "f2db683976da606d26830694696e56cb089666fafb675c94e425d591828e1b8a",
"PartitionKey": "440",
"KeyData": "ri2eE8WprwRNqAHpFHPnnA==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738304,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 5,
"Timestamp": 1643793907,
"Exported": false,
"_rid": "ARE3AN9pq7lhAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7lhAAAAAAAAAA==/",
"_etag": ""d1003704-0000-0700-0000-61fa4df30000"",
"_attachments": "attachments/",
"_ts": 1643793907
},
{
"id": "cd705cfc2135c27f93431fc5ce53013706aa56b3820da6fab578b12c373bc6df",
"PartitionKey": "440",
"KeyData": "wfGjUcRVZF3Jt5TQ8FWscA==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738448,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 6,
"Timestamp": 1643793907,
"Exported": false,
"_rid": "ARE3AN9pq7liAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7liAAAAAAAAAA==/",
"_etag": ""d1003804-0000-0700-0000-61fa4df30000"",
"_attachments": "attachments/",
"_ts": 1643793907
},
{
"id": "7e325dd6efc76ac76c86bdce96f2591ce48eba55a545b93bbe74f94a0bf52baf",
"PartitionKey": "440",
"KeyData": "DxqAxxHQHCOoFBqB0Z7VGg==",
"RollingPeriod": 144,
"RollingStartIntervalNumber": 2738592,
"TransmissionRiskLevel": 4,
"ReportType": 1,
"DaysSinceOnsetOfSymptoms": 7,
"Timestamp": 1643793907,
"Exported": false,
"_rid": "ARE3AN9pq7ljAAAAAAAAAA==",
"_self": "dbs/ARE3AA==/colls/ARE3AN9pq7k=/docs/ARE3AN9pq7ljAAAAAAAAAA==/",
"_etag": ""d1003904-0000-0700-0000-61fa4df30000"",
"_attachments": "attachments/",
"_ts": 1643793907
}
]

所見

7を超えるDaysSinceOnsetOfSymptomsのTEKは、フィルタリングされた結果登録されていない。

以上のことから、改修染みのV3DiagnosisApiは想定通り動作していると考えます。
そのほかの動作については TemporaryExposureKeyValidationServiceTest を参照してください。

@keiji keiji marked this pull request as ready for review February 2, 2022 15:21
@keiji keiji marked this pull request as draft February 2, 2022 15:24
@keiji
Copy link
Collaborator Author

keiji commented Feb 3, 2022

OnSetOfSymptomOrTestDateとかOnSetって書いてあるけど on setじゃなくて onset という単語なので、Onsetとするのが正しい。
あとでリファクタリング入れます…

@keiji keiji marked this pull request as ready for review February 10, 2022 14:23
@cocoa-dev006 cocoa-dev006 merged commit fae51f5 into develop Mar 17, 2022
@keiji keiji deleted the feature/switch_7or10_symptom branch June 26, 2022 08:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants