Skip to content

Commit 03e79f5

Browse files
committed
NRL-786 add other classes needed
1 parent ccbdfab commit 03e79f5

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

layer/nrlf/core/parent_model.py

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,69 @@
22

33
from pydantic import BaseModel, ConfigDict, Field
44

5-
from nrlf.consumer.fhir.r4.model import CodeableConcept
5+
6+
class Coding(BaseModel):
7+
model_config = ConfigDict(regex_engine="python-re", extra="forbid")
8+
id: Annotated[
9+
Optional[str],
10+
Field(
11+
description="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
12+
pattern="[A-Za-z0-9\\-\\.]{1,64}",
13+
),
14+
] = None
15+
system: Annotated[
16+
Optional[str],
17+
Field(
18+
description="The identification of the code system that defines the meaning of the symbol in the code.",
19+
pattern="\\S*",
20+
),
21+
] = None
22+
version: Annotated[
23+
Optional[str],
24+
Field(
25+
description="The version of the code system which was used when choosing this code. Note that a well–maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.",
26+
pattern="[ \\r\\n\\t\\S]+",
27+
),
28+
] = None
29+
code: Annotated[
30+
Optional[str],
31+
Field(
32+
description="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post–coordination).",
33+
pattern="[^\\s]+(\\s[^\\s]+)*",
34+
),
35+
] = None
36+
display: Annotated[
37+
Optional[str],
38+
Field(
39+
description="A representation of the meaning of the code in the system, following the rules of the system.",
40+
pattern="[ \\r\\n\\t\\S]+",
41+
),
42+
] = None
43+
userSelected: Annotated[
44+
Optional[bool],
45+
Field(
46+
description="Indicates that this coding was chosen by a user directly – e.g. off a pick list of available items (codes or displays)."
47+
),
48+
] = None
49+
50+
51+
class CodeableConcept(BaseModel):
52+
model_config = ConfigDict(regex_engine="python-re", extra="forbid")
53+
id: Annotated[
54+
Optional[str],
55+
Field(
56+
description="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
57+
pattern="[A-Za-z0-9\\-\\.]{1,64}",
58+
),
59+
] = None
60+
coding: Optional[List[Coding]] = None
61+
text: Annotated[
62+
Optional[str],
63+
Field(
64+
description="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.",
65+
pattern="[ \\r\\n\\t\\S]+",
66+
),
67+
] = None
668

769

870
class Extension(BaseModel):

0 commit comments

Comments
 (0)