Skip to content

Commit d7d3c78

Browse files
NRL-518 Update models with mandatory fields
1 parent bc84952 commit d7d3c78

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
lines changed

api/consumer/swagger.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,7 @@ components:
10741074
description: Additional content defined by implementations.
10751075
required:
10761076
- attachment
1077+
- format
10771078
DocumentReferenceRelatesTo:
10781079
type: object
10791080
properties:
@@ -1100,7 +1101,7 @@ components:
11001101
description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
11011102
contentType:
11021103
type: string
1103-
pattern: "[^\\s]+(\\s[^\\s]+)*"
1104+
pattern: "^(application|audio|image|message|model|multipart|text|video)/[a-zA-Z0-9!#$&^_+.-]+(;[a-zA-Z0-9!#$&^_+.-]+=[a-zA-Z0-9!#$&^_+.-]+)*$"
11041105
description: Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.
11051106
language:
11061107
type: string
@@ -1130,6 +1131,9 @@ components:
11301131
type: string
11311132
pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?
11321133
description: The date that the attachment was first created.
1134+
required:
1135+
- contentType
1136+
- url
11331137
CodeableConcept:
11341138
type: object
11351139
properties:

api/producer/swagger.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,7 @@ components:
16391639
description: Additional content defined by implementations.
16401640
required:
16411641
- attachment
1642+
- format
16421643
DocumentReferenceRelatesTo:
16431644
type: object
16441645
properties:
@@ -1665,7 +1666,7 @@ components:
16651666
description: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
16661667
contentType:
16671668
type: string
1668-
pattern: "[^\\s]+(\\s[^\\s]+)*"
1669+
pattern: "^(application|audio|image|message|model|multipart|text|video)/[a-zA-Z0-9!#$&^_+.-]+(;[a-zA-Z0-9!#$&^_+.-]+=[a-zA-Z0-9!#$&^_+.-]+)*$"
16691670
description: Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.
16701671
language:
16711672
type: string
@@ -1695,6 +1696,9 @@ components:
16951696
type: string
16961697
pattern: ([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?
16971698
description: The date that the attachment was first created.
1699+
required:
1700+
- contentType
1701+
- url
16981702
CodeableConcept:
16991703
type: object
17001704
properties:

layer/nrlf/consumer/fhir/r4/model.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: swagger.yaml
3-
# timestamp: 2024-11-20T09:43:58+00:00
3+
# timestamp: 2024-11-26T15:05:35+00:00
44

55
from __future__ import annotations
66

@@ -133,12 +133,12 @@ class Attachment(BaseModel):
133133
),
134134
] = None
135135
contentType: Annotated[
136-
Optional[str],
136+
str,
137137
Field(
138138
description="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.",
139-
pattern="[^\\s]+(\\s[^\\s]+)*",
139+
pattern="^(application|audio|image|message|model|multipart|text|video)/[a-zA-Z0-9!#$&^_+.-]+(;[a-zA-Z0-9!#$&^_+.-]+=[a-zA-Z0-9!#$&^_+.-]+)*$",
140140
),
141-
] = None
141+
]
142142
language: Annotated[
143143
Optional[str],
144144
Field(
@@ -154,9 +154,9 @@ class Attachment(BaseModel):
154154
),
155155
] = None
156156
url: Annotated[
157-
Optional[str],
157+
str,
158158
Field(description="A location where the data can be accessed.", pattern="\\S*"),
159-
] = None
159+
]
160160
size: Annotated[
161161
Optional[int],
162162
Field(
@@ -833,11 +833,11 @@ class DocumentReferenceContent(BaseModel):
833833
),
834834
]
835835
format: Annotated[
836-
Optional[Coding],
836+
Coding,
837837
Field(
838838
description="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType."
839839
),
840-
] = None
840+
]
841841
extension: Optional[List[Extension]] = None
842842

843843

layer/nrlf/producer/fhir/r4/model.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: swagger.yaml
3-
# timestamp: 2024-11-20T10:10:52+00:00
3+
# timestamp: 2024-11-26T15:05:33+00:00
44

55
from __future__ import annotations
66

@@ -133,12 +133,12 @@ class Attachment(BaseModel):
133133
),
134134
] = None
135135
contentType: Annotated[
136-
Optional[str],
136+
str,
137137
Field(
138138
description="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.",
139-
pattern="[^\\s]+(\\s[^\\s]+)*",
139+
pattern="^(application|audio|image|message|model|multipart|text|video)/[a-zA-Z0-9!#$&^_+.-]+(;[a-zA-Z0-9!#$&^_+.-]+=[a-zA-Z0-9!#$&^_+.-]+)*$",
140140
),
141-
] = None
141+
]
142142
language: Annotated[
143143
Optional[str],
144144
Field(
@@ -154,9 +154,9 @@ class Attachment(BaseModel):
154154
),
155155
] = None
156156
url: Annotated[
157-
Optional[str],
157+
str,
158158
Field(description="A location where the data can be accessed.", pattern="\\S*"),
159-
] = None
159+
]
160160
size: Annotated[
161161
Optional[int],
162162
Field(
@@ -817,11 +817,11 @@ class DocumentReferenceContent(BaseModel):
817817
),
818818
]
819819
format: Annotated[
820-
Optional[Coding],
820+
Coding,
821821
Field(
822822
description="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType."
823823
),
824-
] = None
824+
]
825825
extension: Optional[List[Extension]] = None
826826

827827

layer/nrlf/producer/fhir/r4/strict_model.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: swagger.yaml
3-
# timestamp: 2024-11-20T10:10:54+00:00
3+
# timestamp: 2024-11-26T15:05:34+00:00
44

55
from __future__ import annotations
66

@@ -126,11 +126,11 @@ class Attachment(BaseModel):
126126
),
127127
] = None
128128
contentType: Annotated[
129-
Optional[StrictStr],
129+
StrictStr,
130130
Field(
131131
description="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate."
132132
),
133-
] = None
133+
]
134134
language: Annotated[
135135
Optional[StrictStr],
136136
Field(
@@ -144,9 +144,8 @@ class Attachment(BaseModel):
144144
),
145145
] = None
146146
url: Annotated[
147-
Optional[StrictStr],
148-
Field(description="A location where the data can be accessed."),
149-
] = None
147+
StrictStr, Field(description="A location where the data can be accessed.")
148+
]
150149
size: Annotated[
151150
Optional[StrictInt],
152151
Field(
@@ -721,11 +720,11 @@ class DocumentReferenceContent(BaseModel):
721720
),
722721
]
723722
format: Annotated[
724-
Optional[Coding],
723+
Coding,
725724
Field(
726725
description="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType."
727726
),
728-
] = None
727+
]
729728
extension: Optional[List[Extension]] = None
730729

731730

0 commit comments

Comments
 (0)