Skip to content

Commit 64e6312

Browse files
NRL-518 Remove extension from CodeableConcept
1 parent d48ab5a commit 64e6312

File tree

5 files changed

+273
-301
lines changed

5 files changed

+273
-301
lines changed

api/consumer/swagger.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,11 +1153,6 @@ components:
11531153
type: string
11541154
pattern: "[ \\r\\n\\t\\S]+"
11551155
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.
1156-
extension:
1157-
type: array
1158-
items:
1159-
$ref: "#/components/schemas/Extension"
1160-
description: Additional content defined by implementations.
11611156
Coding:
11621157
type: object
11631158
properties:

api/producer/swagger.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,11 +1718,6 @@ components:
17181718
type: string
17191719
pattern: "[ \\r\\n\\t\\S]+"
17201720
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.
1721-
extension:
1722-
type: array
1723-
items:
1724-
$ref: "#/components/schemas/Extension"
1725-
description: Additional content defined by implementations.
17261721
Coding:
17271722
type: object
17281723
properties:

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

Lines changed: 94 additions & 100 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-12-11T16:30:20+00:00
3+
# timestamp: 2024-12-12T13:19:56+00:00
44

55
from __future__ import annotations
66

@@ -450,6 +450,43 @@ class RequestHeaderCorrelationId(RootModel[str]):
450450
root: Annotated[str, Field(examples=["11C46F5F-CDEF-4865-94B2-0EE0EDCC26DA"])]
451451

452452

453+
class CodeableConcept(BaseModel):
454+
id: Annotated[
455+
Optional[str],
456+
Field(
457+
description="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
458+
pattern="[A-Za-z0-9\\-\\.]{1,64}",
459+
),
460+
] = None
461+
coding: Optional[List[Coding]] = None
462+
text: Annotated[
463+
Optional[str],
464+
Field(
465+
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.",
466+
pattern="[ \\r\\n\\t\\S]+",
467+
),
468+
] = None
469+
470+
471+
class Extension(BaseModel):
472+
valueCodeableConcept: Annotated[
473+
Optional[CodeableConcept],
474+
Field(
475+
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)."
476+
),
477+
] = None
478+
url: Annotated[
479+
Optional[str],
480+
Field(description="The reference details for the link.", pattern="\\S*"),
481+
] = None
482+
483+
484+
class ContentStabilityExtensionValueCodeableConcept(CodeableConcept):
485+
coding: Annotated[
486+
List[ContentStabilityExtensionCoding], Field(max_length=1, min_length=1)
487+
]
488+
489+
453490
class RequestHeader(BaseModel):
454491
odsCode: RequestHeaderOdsCode
455492

@@ -474,6 +511,52 @@ class CountRequestParams(BaseModel):
474511
]
475512

476513

514+
class OperationOutcomeIssue(BaseModel):
515+
id: Annotated[
516+
Optional[str],
517+
Field(
518+
description="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
519+
pattern="[A-Za-z0-9\\-\\.]{1,64}",
520+
),
521+
] = None
522+
severity: Annotated[
523+
str,
524+
Field(
525+
description="Indicates whether the issue indicates a variation from successful processing.",
526+
pattern="[^\\s]+(\\s[^\\s]+)*",
527+
),
528+
]
529+
code: Annotated[
530+
str,
531+
Field(
532+
description="Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.",
533+
pattern="[^\\s]+(\\s[^\\s]+)*",
534+
),
535+
]
536+
details: Annotated[
537+
Optional[CodeableConcept],
538+
Field(
539+
description="Additional details about the error. This may be a text description of the error or a system code that identifies the error."
540+
),
541+
] = None
542+
diagnostics: Annotated[
543+
Optional[str],
544+
Field(
545+
description="Additional diagnostic information about the issue.",
546+
pattern="[ \\r\\n\\t\\S]+",
547+
),
548+
] = None
549+
location: Optional[List[LocationItem]] = None
550+
expression: Optional[List[ExpressionItem]] = None
551+
552+
553+
class ContentStabilityExtension(Extension):
554+
url: Literal[
555+
"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability"
556+
]
557+
valueCodeableConcept: ContentStabilityExtensionValueCodeableConcept
558+
559+
477560
class OperationOutcome(BaseModel):
478561
resourceType: Literal["OperationOutcome"]
479562
id: Annotated[
@@ -512,43 +595,29 @@ class OperationOutcome(BaseModel):
512595
issue: Annotated[List[OperationOutcomeIssue], Field(min_length=1)]
513596

514597

515-
class OperationOutcomeIssue(BaseModel):
598+
class DocumentReferenceContent(BaseModel):
516599
id: Annotated[
517600
Optional[str],
518601
Field(
519602
description="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
520603
pattern="[A-Za-z0-9\\-\\.]{1,64}",
521604
),
522605
] = None
523-
severity: Annotated[
524-
str,
606+
attachment: Annotated[
607+
Attachment,
525608
Field(
526-
description="Indicates whether the issue indicates a variation from successful processing.",
527-
pattern="[^\\s]+(\\s[^\\s]+)*",
609+
description="The document or URL of the document along with critical metadata to prove content has integrity."
528610
),
529611
]
530-
code: Annotated[
531-
str,
612+
format: Annotated[
613+
NRLFormatCode,
532614
Field(
533-
description="Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.",
534-
pattern="[^\\s]+(\\s[^\\s]+)*",
615+
description="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType."
535616
),
536617
]
537-
details: Annotated[
538-
Optional[CodeableConcept],
539-
Field(
540-
description="Additional details about the error. This may be a text description of the error or a system code that identifies the error."
541-
),
542-
] = None
543-
diagnostics: Annotated[
544-
Optional[str],
545-
Field(
546-
description="Additional diagnostic information about the issue.",
547-
pattern="[ \\r\\n\\t\\S]+",
548-
),
549-
] = None
550-
location: Optional[List[LocationItem]] = None
551-
expression: Optional[List[ExpressionItem]] = None
618+
extension: Annotated[
619+
List[ContentStabilityExtension], Field(max_length=1, min_length=1)
620+
]
552621

553622

554623
class DocumentReference(BaseModel):
@@ -841,31 +910,6 @@ class DocumentReferenceContext(BaseModel):
841910
related: Optional[List[Reference]] = None
842911

843912

844-
class DocumentReferenceContent(BaseModel):
845-
id: Annotated[
846-
Optional[str],
847-
Field(
848-
description="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
849-
pattern="[A-Za-z0-9\\-\\.]{1,64}",
850-
),
851-
] = None
852-
attachment: Annotated[
853-
Attachment,
854-
Field(
855-
description="The document or URL of the document along with critical metadata to prove content has integrity."
856-
),
857-
]
858-
format: Annotated[
859-
NRLFormatCode,
860-
Field(
861-
description="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType."
862-
),
863-
]
864-
extension: Annotated[
865-
List[ContentStabilityExtension], Field(max_length=1, min_length=1)
866-
]
867-
868-
869913
class DocumentReferenceRelatesTo(BaseModel):
870914
id: Annotated[
871915
Optional[str],
@@ -886,38 +930,6 @@ class DocumentReferenceRelatesTo(BaseModel):
886930
]
887931

888932

889-
class CodeableConcept(BaseModel):
890-
id: Annotated[
891-
Optional[str],
892-
Field(
893-
description="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
894-
pattern="[A-Za-z0-9\\-\\.]{1,64}",
895-
),
896-
] = None
897-
coding: Optional[List[Coding]] = None
898-
text: Annotated[
899-
Optional[str],
900-
Field(
901-
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.",
902-
pattern="[ \\r\\n\\t\\S]+",
903-
),
904-
] = None
905-
extension: Optional[List[Extension]] = None
906-
907-
908-
class Extension(BaseModel):
909-
valueCodeableConcept: Annotated[
910-
Optional[CodeableConcept],
911-
Field(
912-
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)."
913-
),
914-
] = None
915-
url: Annotated[
916-
Optional[str],
917-
Field(description="The reference details for the link.", pattern="\\S*"),
918-
] = None
919-
920-
921933
class Identifier(BaseModel):
922934
id: Annotated[
923935
Optional[str],
@@ -1051,27 +1063,9 @@ class Signature(BaseModel):
10511063
] = None
10521064

10531065

1054-
class ContentStabilityExtensionValueCodeableConcept(CodeableConcept):
1055-
coding: Annotated[
1056-
List[ContentStabilityExtensionCoding], Field(max_length=1, min_length=1)
1057-
]
1058-
1059-
1060-
class ContentStabilityExtension(Extension):
1061-
url: Literal[
1062-
"https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability"
1063-
]
1064-
valueCodeableConcept: ContentStabilityExtensionValueCodeableConcept
1065-
1066-
1067-
OperationOutcome.model_rebuild()
1068-
OperationOutcomeIssue.model_rebuild()
10691066
DocumentReference.model_rebuild()
10701067
Bundle.model_rebuild()
10711068
BundleEntry.model_rebuild()
10721069
DocumentReferenceContext.model_rebuild()
1073-
DocumentReferenceContent.model_rebuild()
10741070
DocumentReferenceRelatesTo.model_rebuild()
1075-
CodeableConcept.model_rebuild()
10761071
Identifier.model_rebuild()
1077-
ContentStabilityExtensionValueCodeableConcept.model_rebuild()

0 commit comments

Comments
 (0)