(jsonContent);
24 | FhirJsonSerializationSettings serializationSettings = new FhirJsonSerializationSettings
25 | {
26 | Pretty = true
27 | };
28 | return resource.ToJson(serializationSettings);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests.shproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 19e3e7a2-17a6-4708-b9f2-04a2c9968c83
5 | 14.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/R4OnlyResource/Account-R4-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Account",
3 | "id": "698d54f0494528a759f19c8e87a9f99e75a5881b9267ee3926bcf62c992d84ba",
4 | "meta": {
5 | "security": [
6 | {
7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
8 | "code": "REDACTED",
9 | "display": "redacted"
10 | },
11 | {
12 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
13 | "code": "CRYTOHASH",
14 | "display": "cryptographic hash function"
15 | },
16 | {
17 | "code": "PERTURBED",
18 | "display": "exact value is replaced with another exact value"
19 | }
20 | ]
21 | },
22 | "identifier": [
23 | {
24 | "system": "urn:oid:0.1.2.3.4.5.6.7"
25 | }
26 | ],
27 | "status": "active",
28 | "type": {
29 | "coding": [
30 | {
31 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode"
32 | }
33 | ]
34 | },
35 | "subject": [
36 | {
37 | "reference": "Patient/698d54f0494528a759f19c8e87a9f99e75a5881b9267ee3926bcf62c992d84ba"
38 | }
39 | ],
40 | "servicePeriod": {
41 | "start": "2015-12-12",
42 | "end": "2016-06-10"
43 | },
44 | "coverage": [
45 | {
46 | "coverage": {
47 | "reference": "Coverage/e283f9c81456ca81a304457d977616b5ce48a214267a0b73010e38fb90081b5c"
48 | },
49 | "priority": 1
50 | }
51 | ],
52 | "owner": {
53 | "reference": "Organization/0c3eb5d8a74155bcdddabf5dfa60b71304c5e192198f5d3b90fc4e046003b8fb"
54 | }
55 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/R4OnlyResource/Account-R4.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Account",
3 | "id": "example",
4 | "text": {
5 | "status": "generated",
6 | "div": "HACC Funded Billing for Peter James Chalmers
"
7 | },
8 | "identifier": [
9 | {
10 | "system": "urn:oid:0.1.2.3.4.5.6.7",
11 | "value": "654321"
12 | }
13 | ],
14 | "status": "active",
15 | "type": {
16 | "coding": [
17 | {
18 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
19 | "code": "PBILLACCT",
20 | "display": "patient billing account"
21 | }
22 | ],
23 | "text": "patient"
24 | },
25 | "name": "HACC Funded Billing for Peter James Chalmers",
26 | "subject": [
27 | {
28 | "reference": "Patient/example",
29 | "display": "Peter James Chalmers"
30 | }
31 | ],
32 | "servicePeriod": {
33 | "start": "2016-01-01",
34 | "end": "2016-06-30"
35 | },
36 | "coverage": [
37 | {
38 | "coverage": {
39 | "reference": "Coverage/7546D"
40 | },
41 | "priority": 1
42 | }
43 | ],
44 | "owner": {
45 | "reference": "Organization/hl7"
46 | },
47 | "description": "Hospital charges"
48 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/Stu3OnlyResource/Account-Stu3-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Account",
3 | "id": "698d54f0494528a759f19c8e87a9f99e75a5881b9267ee3926bcf62c992d84ba",
4 | "meta": {
5 | "security": [
6 | {
7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
8 | "code": "REDACTED",
9 | "display": "redacted"
10 | },
11 | {
12 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
13 | "code": "CRYTOHASH",
14 | "display": "cryptographic hash function"
15 | },
16 | {
17 | "code": "PERTURBED",
18 | "display": "exact value is replaced with another exact value"
19 | }
20 | ]
21 | },
22 | "identifier": [
23 | {
24 | "system": "urn:oid:0.1.2.3.4.5.6.7"
25 | }
26 | ],
27 | "status": "active",
28 | "type": {
29 | "coding": [
30 | {
31 | "system": "http://hl7.org/fhir/v3/ActCode"
32 | }
33 | ]
34 | },
35 | "subject": {
36 | "reference": "Patient/698d54f0494528a759f19c8e87a9f99e75a5881b9267ee3926bcf62c992d84ba"
37 | },
38 | "period": {
39 | "start": "2015-12-12",
40 | "end": "2016-06-10"
41 | },
42 | "active": {
43 | "start": "2015-12-12",
44 | "end": "2016-06-10"
45 | },
46 | "balance": {
47 | "value": -1200,
48 | "unit": "USD",
49 | "system": "urn:iso:std:iso:4217",
50 | "code": "USD"
51 | },
52 | "coverage": [
53 | {
54 | "coverage": {
55 | "reference": "Coverage/e283f9c81456ca81a304457d977616b5ce48a214267a0b73010e38fb90081b5c"
56 | },
57 | "priority": 1
58 | }
59 | ],
60 | "owner": {
61 | "reference": "Organization/0c3eb5d8a74155bcdddabf5dfa60b71304c5e192198f5d3b90fc4e046003b8fb"
62 | }
63 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/Stu3OnlyResource/Account-Stu3.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Account",
3 | "id": "example",
4 | "text": {
5 | "status": "generated",
6 | "div": "HACC Funded Billing for Peter James Chalmers
"
7 | },
8 | "identifier": [
9 | {
10 | "system": "urn:oid:0.1.2.3.4.5.6.7",
11 | "value": "654321"
12 | }
13 | ],
14 | "status": "active",
15 | "type": {
16 | "coding": [
17 | {
18 | "system": "http://hl7.org/fhir/v3/ActCode",
19 | "code": "PBILLACCT",
20 | "display": "patient billing account"
21 | }
22 | ],
23 | "text": "patient"
24 | },
25 | "name": "HACC Funded Billing for Peter James Chalmers",
26 | "subject": {
27 | "reference": "Patient/example",
28 | "display": "Peter James Chalmers"
29 | },
30 | "period": {
31 | "start": "2016-01-01",
32 | "end": "2016-06-30"
33 | },
34 | "active": {
35 | "start": "2016-01-01",
36 | "end": "2016-06-30"
37 | },
38 | "balance": {
39 | "value": -1200,
40 | "unit": "USD",
41 | "system": "urn:iso:std:iso:4217",
42 | "code": "USD"
43 | },
44 | "coverage": [
45 | {
46 | "coverage": {
47 | "reference": "Coverage/7546D"
48 | },
49 | "priority": 1
50 | }
51 | ],
52 | "owner": {
53 | "reference": "Organization/hl7"
54 | },
55 | "description": "Hospital charges"
56 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/Stu3OnlyResource/DeviceComponent-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "DeviceComponent",
3 | "id": "698d54f0494528a759f19c8e87a9f99e75a5881b9267ee3926bcf62c992d84ba",
4 | "meta": {
5 | "security": [
6 | {
7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
8 | "code": "REDACTED",
9 | "display": "redacted"
10 | },
11 | {
12 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
13 | "code": "CRYTOHASH",
14 | "display": "cryptographic hash function"
15 | },
16 | {
17 | "code": "PERTURBED",
18 | "display": "exact value is replaced with another exact value"
19 | }
20 | ]
21 | },
22 | "type": {
23 | "coding": [
24 | {
25 | "system": "urn:iso:std:iso:11073:10101"
26 | }
27 | ]
28 | },
29 | "lastSystemChange": "2014-09-17T00:00:00+00:00",
30 | "source": {
31 | "reference": "Device/23b01b6be3759d4b617ad00809a30e57e35a911d56f36083fa0f01a097a87a26"
32 | },
33 | "parent": {
34 | "reference": "DeviceComponent/4c0f2bfe36833c9e88f276db8122710cfb0f811ee62a9dfd42131c20d50035d0"
35 | },
36 | "operationalStatus": [
37 | {
38 | "coding": [
39 | {
40 | "system": "urn:iso:std:iso:11073:10101"
41 | }
42 | ]
43 | }
44 | ],
45 | "parameterGroup": {
46 | "coding": [
47 | {
48 | "system": "urn:iso:std:iso:11073:10101"
49 | }
50 | ]
51 | },
52 | "measurementPrinciple": "optical",
53 | "languageCode": {
54 | "coding": [
55 | {
56 | "system": "http://tools.ietf.org/html/bcp47"
57 | }
58 | ]
59 | }
60 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/Stu3OnlyResource/ProcessRequest-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "ProcessRequest",
3 | "id": "b5e38ee79ad5c587fe56a273b27cbe52c923bff2399222d383d3961fcd2fa9f6",
4 | "meta": {
5 | "security": [
6 | {
7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
8 | "code": "REDACTED",
9 | "display": "redacted"
10 | },
11 | {
12 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
13 | "code": "CRYTOHASH",
14 | "display": "cryptographic hash function"
15 | },
16 | {
17 | "code": "PERTURBED",
18 | "display": "exact value is replaced with another exact value"
19 | }
20 | ]
21 | },
22 | "identifier": [
23 | {
24 | "system": "http://happyvalley.com/processrequest"
25 | }
26 | ],
27 | "status": "active",
28 | "action": "poll",
29 | "created": "2014-08-08",
30 | "organization": {
31 | "reference": "Organization/ccc8c71905806db18c0241b58a8e36e949ab8a45961041b4226b2a4284568e69"
32 | }
33 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/Stu3OnlyResource/ProcessRequest.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "ProcessRequest",
3 | "id": "1110",
4 | "text": {
5 | "status": "generated",
6 | "div": "A human-readable rendering of the Poll ProcessRequest
"
7 | },
8 | "identifier": [
9 | {
10 | "system": "http://happyvalley.com/processrequest",
11 | "value": "110"
12 | }
13 | ],
14 | "status": "active",
15 | "action": "poll",
16 | "created": "2014-08-16",
17 | "organization": {
18 | "reference": "Organization/1"
19 | }
20 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/Stu3OnlyResource/ProcessResponse-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "ProcessResponse",
3 | "id": "e6d4ae054f078e1674237de9e14c5700cb31cca0a9e2d059b4e6b5b7f0d852dc",
4 | "meta": {
5 | "security": [
6 | {
7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
8 | "code": "REDACTED",
9 | "display": "redacted"
10 | },
11 | {
12 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
13 | "code": "CRYTOHASH",
14 | "display": "cryptographic hash function"
15 | },
16 | {
17 | "code": "PERTURBED",
18 | "display": "exact value is replaced with another exact value"
19 | }
20 | ]
21 | },
22 | "identifier": [
23 | {
24 | "system": "http://www.BenefitsInc.com/fhir/processresponse"
25 | }
26 | ],
27 | "status": "active",
28 | "created": "2014-09-23",
29 | "organization": {
30 | "reference": "Organization/8b808a62f8893cf1ce0f44fb62b433e3c21a4f5605687689d9f0bb1a3524439b"
31 | },
32 | "request": {
33 | "reference": "60a9e4bc1586eea5e4f281c2924cd5e2d080ca774ba45d39b6a867e12c7eb6f5"
34 | },
35 | "outcome": {
36 | "coding": [
37 | {
38 | "system": "http://hl7.org/fhir/processoutcomecodes"
39 | }
40 | ]
41 | },
42 | "requestOrganization": {
43 | "reference": "Organization/ccc8c71905806db18c0241b58a8e36e949ab8a45961041b4226b2a4284568e69"
44 | }
45 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/Stu3OnlyResource/ProcessResponse.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "ProcessResponse",
3 | "id": "SR2500",
4 | "text": {
5 | "status": "generated",
6 | "div": "A human-readable rendering of the ProcessResponse
"
7 | },
8 | "identifier": [
9 | {
10 | "system": "http://www.BenefitsInc.com/fhir/processresponse",
11 | "value": "881234"
12 | }
13 | ],
14 | "status": "active",
15 | "created": "2014-08-16",
16 | "organization": {
17 | "reference": "Organization/2"
18 | },
19 | "request": {
20 | "reference": "http://happyvalley.com/fhir/claim/12345"
21 | },
22 | "outcome": {
23 | "coding": [
24 | {
25 | "system": "http://hl7.org/fhir/processoutcomecodes",
26 | "code": "complete"
27 | }
28 | ]
29 | },
30 | "disposition": "Adjudication processing completed, ClaimResponse and EOB ready for retrieval.",
31 | "requestOrganization": {
32 | "reference": "Organization/1"
33 | }
34 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/bundle-empty.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Bundle",
3 | "meta": {
4 | "security": [
5 | {
6 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
7 | "code": "REDACTED",
8 | "display": "redacted"
9 | }
10 | ]
11 | }
12 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/bundle-redact-all-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Bundle",
3 | "meta": {
4 | "security": [
5 | {
6 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
7 | "code": "REDACTED",
8 | "display": "redacted"
9 | }
10 | ]
11 | },
12 | "entry": [
13 | {
14 | "resource": {
15 | "resourceType": "Patient",
16 | "meta": {
17 | "security": [
18 | {
19 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
20 | "code": "REDACTED",
21 | "display": "redacted"
22 | }
23 | ]
24 | }
25 | }
26 | },
27 | {
28 | "resource": {
29 | "resourceType": "Patient",
30 | "meta": {
31 | "security": [
32 | {
33 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
34 | "code": "REDACTED",
35 | "display": "redacted"
36 | }
37 | ]
38 | }
39 | }
40 | },
41 | {
42 | "resource": {
43 | "resourceType": "Observation",
44 | "meta": {
45 | "security": [
46 | {
47 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
48 | "code": "REDACTED",
49 | "display": "redacted"
50 | }
51 | ]
52 | }
53 | }
54 | }
55 | ]
56 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/bundle-without-entry-resource-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Bundle",
3 | "id": "bundle-transaction",
4 | "meta": {
5 | "lastUpdated": "2014-08-25T00:00:00+00:00",
6 | "security": [
7 | {
8 | "code": "PERTURBED",
9 | "display": "exact value is replaced with another exact value"
10 | }
11 | ],
12 | "tag": [
13 | {
14 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
15 | "code": "HTEST",
16 | "display": "test health data"
17 | }
18 | ]
19 | },
20 | "type": "transaction",
21 | "entry": [
22 | {
23 | "request": {
24 | "method": "GET",
25 | "url": "Patient/12334",
26 | "ifNoneMatch": "W/\"4\"",
27 | "ifModifiedSince": "2015-09-07T00:00:00+10:00"
28 | }
29 | }
30 | ]
31 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/bundle-without-entry-resource.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Bundle",
3 | "id": "bundle-transaction",
4 | "meta": {
5 | "lastUpdated": "2014-08-18T01:43:30Z",
6 | "tag": [
7 | {
8 | "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
9 | "code": "HTEST",
10 | "display": "test health data"
11 | }
12 | ]
13 | },
14 | "type": "transaction",
15 | "entry": [
16 | {
17 | "request": {
18 | "method": "GET",
19 | "url": "Patient/12334",
20 | "ifNoneMatch": "W/\"4\"",
21 | "ifModifiedSince": "2015-08-31T08:14:33+10:00"
22 | }
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/condition-empty.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Condition",
3 | "meta": {
4 | "security": [
5 | {
6 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
7 | "code": "REDACTED",
8 | "display": "redacted"
9 | }
10 | ]
11 | }
12 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/contained-basic-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Condition",
3 | "meta": {
4 | "security": [
5 | {
6 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
7 | "code": "REDACTED",
8 | "display": "redacted"
9 | }
10 | ]
11 | },
12 | "contained": [
13 | {
14 | "resourceType": "Practitioner",
15 | "id": "p1"
16 | }
17 | ],
18 | "asserter": {
19 | "reference": "#p1"
20 | }
21 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/contained-basic.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Condition",
3 | "contained": [
4 | {
5 | "resourceType": "Practitioner",
6 | "id": "p1",
7 | "name": [
8 | {
9 | "family": "Person",
10 | "given": [ "Patricia" ]
11 | }
12 | ]
13 | }
14 | ],
15 | "asserter": {
16 | "reference": "#p1"
17 | }
18 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/contained-in-bundle-redact-all-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Bundle",
3 | "meta": {
4 | "security": [
5 | {
6 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
7 | "code": "REDACTED",
8 | "display": "redacted"
9 | }
10 | ]
11 | },
12 | "entry": [
13 | {
14 | "resource": {
15 | "resourceType": "Condition",
16 | "meta": {
17 | "security": [
18 | {
19 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
20 | "code": "REDACTED",
21 | "display": "redacted"
22 | }
23 | ]
24 | },
25 | "contained": [
26 | {
27 | "resourceType": "Practitioner"
28 | }
29 | ]
30 | }
31 | }
32 | ]
33 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/contained-in-bundle-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Bundle",
3 | "id": "bundle-references",
4 | "meta": {
5 | "security": [
6 | {
7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
8 | "code": "REDACTED",
9 | "display": "redacted"
10 | }
11 | ]
12 | },
13 | "type": "collection",
14 | "entry": [
15 | {
16 | "resource": {
17 | "resourceType": "Condition",
18 | "meta": {
19 | "security": [
20 | {
21 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
22 | "code": "REDACTED",
23 | "display": "redacted"
24 | }
25 | ]
26 | },
27 | "contained": [
28 | {
29 | "resourceType": "Practitioner",
30 | "id": "p1"
31 | }
32 | ],
33 | "asserter": {
34 | "reference": "#p1"
35 | }
36 | }
37 | }
38 | ]
39 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/contained-in-bundle.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Bundle",
3 | "id": "bundle-references",
4 | "type": "collection",
5 | "entry": [
6 | {
7 | "fullUrl": "http://example.org/fhir/Condition/123",
8 | "resource": {
9 | "resourceType": "Condition",
10 | "contained": [
11 | {
12 | "resourceType": "Practitioner",
13 | "id": "p1",
14 | "name": [
15 | {
16 | "family": "Person",
17 | "given": [ "Patricia" ]
18 | }
19 | ]
20 | }
21 | ],
22 | "asserter": {
23 | "reference": "#p1"
24 | }
25 | }
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/contained-redact-all-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Condition",
3 | "meta": {
4 | "security": [
5 | {
6 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
7 | "code": "REDACTED",
8 | "display": "redacted"
9 | }
10 | ]
11 | },
12 | "contained": [ { "resourceType": "Practitioner" } ]
13 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/contained-substitute-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Condition",
3 | "meta": {
4 | "security": [
5 | {
6 | "code": "SUBSTITUTED",
7 | "display": "exact value is replaced with a predefined value"
8 | }
9 | ]
10 | },
11 | "contained": [
12 | {
13 | "resourceType": "Patient",
14 | "id": "p1",
15 | "name": [
16 | {
17 | "family": "example",
18 | "given": [
19 | "test",
20 | "testing"
21 | ]
22 | }
23 | ]
24 | },
25 | {
26 | "resourceType": "Patient",
27 | "id": "p2",
28 | "name": [
29 | {
30 | "family": "example",
31 | "given": [
32 | "test",
33 | "testing"
34 | ],
35 | "period": {
36 | "start": "2020-01-01",
37 | "end": "2021-01-01"
38 | }
39 | }
40 | ]
41 | }
42 | ],
43 | "asserter": {
44 | "reference": "#p1"
45 | }
46 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/contained-substitute.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Condition",
3 | "contained": [
4 | {
5 | "resourceType": "Patient",
6 | "id": "p1",
7 | "name": [
8 | {
9 | "family": "Family1",
10 | "given": [
11 | "Patricia"
12 | ]
13 | }
14 | ]
15 | },
16 | {
17 | "resourceType": "Patient",
18 | "id": "p2",
19 | "name": [
20 | {
21 | "family": "Family2",
22 | "given": [
23 | "Patricia",
24 | "Jim"
25 | ],
26 | "period": {
27 | "start": "1999-01-01"
28 | }
29 | }
30 | ]
31 | }
32 | ],
33 | "asserter": {
34 | "reference": "#p1"
35 | }
36 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/patient-empty.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Patient",
3 | "meta": {
4 | "security": [
5 | {
6 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
7 | "code": "REDACTED",
8 | "display": "redacted"
9 | }
10 | ]
11 | }
12 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/patient-no-partial-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Patient",
3 | "id": "698d54f0494528a759f19c8e87a9f99e75a5881b9267ee3926bcf62c992d84ba",
4 | "meta": {
5 | "security": [
6 | {
7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
8 | "code": "REDACTED",
9 | "display": "redacted"
10 | },
11 | {
12 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
13 | "code": "CRYTOHASH",
14 | "display": "cryptographic hash function"
15 | }
16 | ]
17 | },
18 | "active": true,
19 | "name": [
20 | { "use": "official" },
21 | { "use": "usual" },
22 | {
23 | "use": "maiden"
24 | }
25 | ],
26 | "gender": "male",
27 | "deceasedBoolean": false,
28 | "address": [
29 | {
30 | "state": "TestState"
31 | },
32 | {
33 | "use": "home",
34 | "type": "both",
35 | "text": "123 Test St Test1, Test2, Test3 1234",
36 | "line": [
37 | "123 Test St"
38 | ],
39 | "city": "KeepTest",
40 | "district": "TestRegion",
41 | "state": "TestState",
42 | "postalCode": "12345",
43 | "period": {
44 | "start": "2000-01-01"
45 | }
46 | }
47 | ],
48 | "contact": [
49 | {
50 | "relationship": [
51 | {
52 | "coding": [
53 | {
54 | "system": "http://terminology.hl7.org/CodeSystem/v2-0131",
55 | "code": "N"
56 | }
57 | ]
58 | }
59 | ],
60 | "address": {
61 | "state": "TestState"
62 | },
63 | "gender": "female"
64 | }
65 | ],
66 | "managingOrganization": {
67 | "reference": "Organization/1"
68 | }
69 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/patient-redact-all-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Patient",
3 | "meta": {
4 | "security": [
5 | {
6 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
7 | "code": "REDACTED",
8 | "display": "redacted"
9 | }
10 | ]
11 | }
12 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Shared.FunctionalTests/TestResources/patient-special-content-target.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Patient",
3 | "id": "698d54f0494528a759f19c8e87a9f99e75a5881b9267ee3926bcf62c992d84ba",
4 | "meta": {
5 | "security": [
6 | {
7 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
8 | "code": "REDACTED",
9 | "display": "redacted"
10 | },
11 | {
12 | "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue",
13 | "code": "CRYTOHASH",
14 | "display": "cryptographic hash function"
15 | },
16 | {
17 | "code": "PERTURBED",
18 | "display": "exact value is replaced with another exact value"
19 | }
20 | ]
21 | },
22 | "identifier": [ { "period": { "start": "2001-02-11" } } ],
23 | "active": true,
24 | "name": [ { "use": "official" } ],
25 | "gender": "male",
26 | "birthDate": "1940-02-11",
27 | "_birthDate": {
28 | "extension": [
29 | {
30 | "url": "http://hl7.org/fhir/StructureDefinition/patient-birthTime",
31 | "valueDateTime": "1940-02-11T00:00:00-01:00"
32 | }
33 | ]
34 | },
35 | "address": [
36 | {
37 | "use": "home",
38 | "text": "Abc ŴΉЙ一 Abc ŴΉЙ一 Abc ŴΉЙ一 Abc ŴΉЙ一",
39 | "line": [ "Abc ŴΉЙ一 Abc ŴΉЙ一 Abc ŴΉЙ一 Abc ŴΉЙ一" ],
40 | "city": "KeepTest",
41 | "district": "Abc ŴΉЙ",
42 | "state": "Abc ŴΉЙ",
43 | "postalCode": "123456789",
44 | "period": { "start": "2000-01-01" }
45 | }
46 | ]
47 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.AzureDataFactoryPipeline.UnitTests/Microsoft.Health.Fhir.Anonymizer.Stu3.AzureDataFactoryPipeline.UnitTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 |
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 | all
14 | runtime; build; native; contentfiles; analyzers; buildtransitive
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.AzureDataFactoryPipeline/AzureDataFactorySettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "dataFactoryName": "DataFactoryName",
3 | "resourceLocation": "WestUS",
4 | "sourceStorageAccountName": "sourceStorageAccountName",
5 | "sourceStorageAccountKey": "sourceStorageAccountKey",
6 | "destinationStorageAccountName": "destinationStorageAccountName",
7 | "destinationStorageAccountKey": "destinationStorageAccountKey",
8 | "sourceStorageContainerName": "sourceStorageContainerName",
9 | "destinationStorageContainerName": "destinationStorageContainerName",
10 | "sourceContainerFolderPath": "",
11 | "destinationContainerFolderPath": "",
12 | "activityContainerName": "customactivityContainerName"
13 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.AzureDataFactoryPipeline/Microsoft.Health.Fhir.Anonymizer.Stu3.AzureDataFactoryPipeline.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | false
7 |
8 |
9 |
10 |
11 | PreserveNewest
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.CommandLineTool/Microsoft.Health.Fhir.Anonymizer.Stu3.CommandLineTool.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | PreserveNewest
21 |
22 |
23 |
24 |
25 |
26 | PreserveNewest
27 |
28 |
29 | PreserveNewest
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.Core.UnitTests/Microsoft.Health.Fhir.Anonymizer.Stu3.Core.UnitTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 |
6 | false
7 |
8 |
9 |
10 |
11 | all
12 | runtime; build; native; contentfiles; analyzers; buildtransitive
13 |
14 |
15 |
16 |
17 |
18 |
19 | all
20 | runtime; build; native; contentfiles; analyzers; buildtransitive
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.Core/Constants.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Microsoft.Health.Fhir.Anonymizer.Core
4 | {
5 | internal static partial class Constants
6 | {
7 | internal const string SupportedVersion = "STU3";
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.Core/Microsoft.Health.Fhir.Anonymizer.Stu3.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Library
5 | net6.0
6 | true
7 | MIT
8 | Copyright © Microsoft Corporation. All rights reserved.
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.Core/Processors/PerturbProcessor.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Hl7.Fhir.Model;
3 |
4 | namespace Microsoft.Health.Fhir.Anonymizer.Core.Processors
5 | {
6 | public partial class PerturbProcessor : IAnonymizerProcessor
7 | {
8 | private static readonly HashSet s_quantityTypeNames = new HashSet
9 | {
10 | FHIRAllTypes.Age.ToString(),
11 | FHIRAllTypes.Count.ToString(),
12 | FHIRAllTypes.Duration.ToString(),
13 | FHIRAllTypes.Distance.ToString(),
14 | FHIRAllTypes.Money.ToString(),
15 | FHIRAllTypes.Quantity.ToString(),
16 | FHIRAllTypes.SimpleQuantity.ToString()
17 | };
18 | }
19 | }
--------------------------------------------------------------------------------
/FHIR/src/Microsoft.Health.Fhir.Anonymizer.Stu3.FunctionalTests/Microsoft.Health.Fhir.Anonymizer.Stu3.FunctionalTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 |
6 | false
7 |
8 |
9 |
10 |
11 | all
12 | runtime; build; native; contentfiles; analyzers; buildtransitive
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | all
21 | runtime; build; native; contentfiles; analyzers; buildtransitive
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | PreserveNewest
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/GeoPol.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 | ]>
8 |
9 |
10 |
11 | &GitRepoName;
12 |
13 |
14 |
15 | .
16 |
17 |
18 |
19 |
20 | .gitignore
21 | GeoPol.xml
22 |
23 |
24 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------