Skip to content

Commit a4b10ac

Browse files
committed
NRL-786 add extension to parent model
1 parent dcf3a83 commit a4b10ac

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

layer/nrlf/core/parent_model.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
from pydantic import BaseModel, ConfigDict
1+
from typing import Annotated, List, Optional
2+
3+
from consumer.fhir.r4.model import CodeableConcept
4+
from pydantic import BaseModel, ConfigDict, Field
5+
6+
7+
class Extension(BaseModel):
8+
model_config = ConfigDict(regex_engine="python-re", extra="forbid")
9+
valueCodeableConcept: Annotated[
10+
Optional[CodeableConcept],
11+
Field(
12+
description="A name which details the functional use for this link – see [http://www.iana.org/assignments/link–relations/link–relations.xhtml#link–relations–1](http://www.iana.org/assignments/link–relations/link–relations.xhtml#link–relations–1)."
13+
),
14+
] = None
15+
url: Annotated[
16+
Optional[str],
17+
Field(description="The reference details for the link.", pattern="\\S*"),
18+
] = None
219

320

421
class Parent(BaseModel):
522
model_config = ConfigDict(regex_engine="python-re", extra="forbid")
23+
extension: Annotated[
24+
Optional[List[Extension]], Field(description="A list of relevant extensions")
25+
]

0 commit comments

Comments
 (0)