Skip to content

Commit e795211

Browse files
authored
fix: change dateTime field type from date to datetime in Consent model
1 parent 71fd897 commit e795211

3 files changed

Lines changed: 67 additions & 1 deletion

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"status": "active",
3+
"scope": {
4+
"coding": [
5+
{
6+
"system": "http://terminology.hl7.org/CodeSystem/consentscope",
7+
"code": "research"
8+
}
9+
]
10+
},
11+
"category": [
12+
{
13+
"coding": [
14+
{
15+
"system": "http://loinc.org",
16+
"code": "57016-8"
17+
}
18+
]
19+
},
20+
{
21+
"coding": [
22+
{
23+
"system": "https://www.medizininformatik-initiative.de/fhir/modul-consent/CodeSystem/mii-cs-consent-consent_category",
24+
"code": "2.16.840.1.113883.3.1937.777.24.2.184"
25+
}
26+
]
27+
}
28+
],
29+
"patient": {
30+
"reference": "Patient/9b4a702d-162c-428a-8c5d-8b98af21b693"
31+
},
32+
"dateTime": "2026-03-27T11:27:01+01:00",
33+
"policy": [
34+
{
35+
"uri": "urn:oid:2.16.840.1.113883.3.1937.777.24.2.1791"
36+
}
37+
],
38+
"provision": {
39+
"type": "deny",
40+
"period": {
41+
"start": "2020-09-01",
42+
"end": "2050-08-31"
43+
},
44+
"provision": [
45+
{
46+
"code": [
47+
{
48+
"coding": [
49+
{
50+
"system": "urn:oid:2.16.840.1.113883.3.1937.777.24.5.3",
51+
"code": "2.16.840.1.113883.3.1937.777.24.5.3.1",
52+
"display": "PATDAT_erheben_speichern_nutzen"
53+
}
54+
]
55+
}
56+
],
57+
"type": "permit",
58+
"period": {
59+
"start": "2020-09-01",
60+
"end": "2025-08-31"
61+
}
62+
}
63+
]
64+
}
65+
}

packages/grz-pydantic-models/src/grz_pydantic_models/mii/consent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class Consent(StrictIgnoringBaseModel):
9696
scope: CodeableConcept
9797
category: Annotated[list[CodeableConcept], Field(min_length=2)]
9898
patient: Patient
99-
date_time: date
99+
date_time: datetime
100100
policy: Annotated[list[Policy], Field(min_length=1)]
101101
provision: RootConsentProvision | None = None
102102

packages/grz-pydantic-models/tests/test_metadata.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ def test_file_extensions():
316316
(
317317
("minimal_consented", True),
318318
("minimal_consented_with_datetime", True),
319+
("minimal_consented_with_nonzero_datetime", True),
319320
("extra_consented", True),
320321
("minimal_nonconsented", True),
321322
("minimal_consented_expired", True),

0 commit comments

Comments
 (0)