Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/user-guide/resources-construction.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ snapshot_structure_def = {
"max": "1",
"type": [{"code": "string"}],
"definition": "A legacy patient's full name",
"base": {"path": "Resource", "min": 0, "max": "*"},
"base": {"path": "Element", "min": 0, "max": "1"},
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/age.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Age(Quantity):
_type = "Quantity"

@model_validator(mode="after")
def FHIR_age_1_constraint_model_validator(self):
def FHIR_age_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value.hasValue().not() or value > 0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Attachment(Element):
)

@model_validator(mode="after")
def FHIR_att_1_constraint_model_validator(self):
def FHIR_att_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="data.empty() or contentType.exists()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ContactPoint(Element):
)

@model_validator(mode="after")
def FHIR_cpt_2_constraint_model_validator(self):
def FHIR_cpt_2_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="value.empty() or system.exists()",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/count.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Count(Quantity):
_type = "Quantity"

@model_validator(mode="after")
def FHIR_cnt_3_constraint_model_validator(self):
def FHIR_cnt_3_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (code.empty() or code = '1') and (value.empty() or value.hasValue().not() or value.toString().contains('.').not())",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Distance(Quantity):
_type = "Quantity"

@model_validator(mode="after")
def FHIR_dis_1_constraint_model_validator(self):
def FHIR_dis_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="(code.exists() or value.empty()) and (system.empty() or system = %ucum)",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/duration.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Duration(Quantity):
_type = "Quantity"

@model_validator(mode="after")
def FHIR_drt_1_constraint_model_validator(self):
def FHIR_drt_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="code.exists() implies ((system = %ucum) and value.exists())",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Element(FHIRBaseModel):
)

@model_validator(mode="after")
def FHIR_ele_1_constraint_model_validator(self):
def FHIR_ele_1_constraint_validator(self):
return fhir_validators.validate_element_constraint(
self,
elements=(list(self.__class__.model_fields.keys())),
Expand Down
30 changes: 15 additions & 15 deletions fhircraft/fhir/resources/datatypes/R4/complex/element_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,7 @@ def FHIR_eld_12_constraint_validator(self):
)

@model_validator(mode="after")
def FHIR_ele_1_constraint_model_validator(self):
def FHIR_ele_1_constraint_validator(self):
return validate_model_constraint(
self,
expression="hasValue() or (children().count() > id.count())",
Expand Down Expand Up @@ -2342,7 +2342,7 @@ def maxValue_type_choice_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_2_constraint_model_validator(self):
def FHIR_eld_2_constraint_validator(self):
return validate_model_constraint(
self,
expression="min.empty() or max.empty() or (max = '*') or iif(max != '*', min <= max.toInteger())",
Expand All @@ -2352,7 +2352,7 @@ def FHIR_eld_2_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_5_constraint_model_validator(self):
def FHIR_eld_5_constraint_validator(self):
return validate_model_constraint(
self,
expression="contentReference.empty() or (type.empty() and defaultValue.empty() and fixed.empty() and pattern.empty() and example.empty() and minValue.empty() and maxValue.empty() and maxLength.empty() and binding.empty())",
Expand All @@ -2362,7 +2362,7 @@ def FHIR_eld_5_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_6_constraint_model_validator(self):
def FHIR_eld_6_constraint_validator(self):
return validate_model_constraint(
self,
expression="fixed.empty() or (type.count() <= 1)",
Expand All @@ -2372,7 +2372,7 @@ def FHIR_eld_6_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_7_constraint_model_validator(self):
def FHIR_eld_7_constraint_validator(self):
return validate_model_constraint(
self,
expression="pattern.empty() or (type.count() <= 1)",
Expand All @@ -2382,7 +2382,7 @@ def FHIR_eld_7_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_8_constraint_model_validator(self):
def FHIR_eld_8_constraint_validator(self):
return validate_model_constraint(
self,
expression="pattern.empty() or fixed.empty()",
Expand All @@ -2392,7 +2392,7 @@ def FHIR_eld_8_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_11_constraint_model_validator(self):
def FHIR_eld_11_constraint_validator(self):
return validate_model_constraint(
self,
expression="binding.empty() or type.code.empty() or type.select((code = 'code') or (code = 'Coding') or (code='CodeableConcept') or (code = 'Quantity') or (code = 'string') or (code = 'uri')).exists()",
Expand All @@ -2402,7 +2402,7 @@ def FHIR_eld_11_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_13_constraint_model_validator(self):
def FHIR_eld_13_constraint_validator(self):
return validate_model_constraint(
self,
expression="type.select(code).isDistinct()",
Expand All @@ -2412,7 +2412,7 @@ def FHIR_eld_13_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_14_constraint_model_validator(self):
def FHIR_eld_14_constraint_validator(self):
return validate_model_constraint(
self,
expression="constraint.select(key).isDistinct()",
Expand All @@ -2422,7 +2422,7 @@ def FHIR_eld_14_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_15_constraint_model_validator(self):
def FHIR_eld_15_constraint_validator(self):
return validate_model_constraint(
self,
expression="defaultValue.empty() or meaningWhenMissing.empty()",
Expand All @@ -2432,7 +2432,7 @@ def FHIR_eld_15_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_16_constraint_model_validator(self):
def FHIR_eld_16_constraint_validator(self):
return validate_model_constraint(
self,
expression="sliceName.empty() or sliceName.matches('^[a-zA-Z0-9\\/\\-_\\[\\]\\@]+$')",
Expand All @@ -2442,7 +2442,7 @@ def FHIR_eld_16_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_18_constraint_model_validator(self):
def FHIR_eld_18_constraint_validator(self):
return validate_model_constraint(
self,
expression="(isModifier.exists() and isModifier) implies isModifierReason.exists()",
Expand All @@ -2452,7 +2452,7 @@ def FHIR_eld_18_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_19_constraint_model_validator(self):
def FHIR_eld_19_constraint_validator(self):
return validate_model_constraint(
self,
expression="""path.matches('^[^\\s\\.,:;\\\'"\\/|?!@#$%&*()\\[\\]{}]{1,64}(\\.[^\\s\\.,:;\\\'"\\/|?!@#$%&*()\\[\\]{}]{1,64}(\\[x\\])?(\\:[^\\s\\.]+)?)*$')""",
Expand All @@ -2462,7 +2462,7 @@ def FHIR_eld_19_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_20_constraint_model_validator(self):
def FHIR_eld_20_constraint_validator(self):
return validate_model_constraint(
self,
expression="""path.matches('^[A-Za-z][A-Za-z0-9]*(\\.[a-z][A-Za-z0-9]*(\\[x])?)*$')""",
Expand All @@ -2472,7 +2472,7 @@ def FHIR_eld_20_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_eld_22_constraint_model_validator(self):
def FHIR_eld_22_constraint_validator(self):
return validate_model_constraint(
self,
expression="sliceIsConstraining.exists() implies sliceName.exists()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Expression(Element):
)

@model_validator(mode="after")
def FHIR_exp_1_constraint_model_validator(self):
def FHIR_exp_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="expression.exists() or reference.exists()",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def value(self):
)

@model_validator(mode="after")
def FHIR_ext_1_constraint_model_validator(self):
def FHIR_ext_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="extension.exists() != value.exists()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MoneyQuantity(Quantity):
_type = "Quantity"

@model_validator(mode="after")
def FHIR_mqty_1_constraint_model_validator(self):
def FHIR_mqty_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="(code.exists() or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Period(Element):
)

@model_validator(mode="after")
def FHIR_per_1_constraint_model_validator(self):
def FHIR_per_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="start.hasValue().not() or end.hasValue().not() or (start <= end)",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Quantity(Element):
)

@model_validator(mode="after")
def FHIR_qty_3_constraint_model_validator(self):
def FHIR_qty_3_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="code.empty() or system.exists()",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Range(Element):
)

@model_validator(mode="after")
def FHIR_rng_2_constraint_model_validator(self):
def FHIR_rng_2_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="low.empty() or high.empty() or (low <= high)",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/ratio.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Ratio(Element):
)

@model_validator(mode="after")
def FHIR_rat_1_constraint_model_validator(self):
def FHIR_rat_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="(numerator.empty() xor denominator.exists()) and (numerator.exists() or extension.exists())",
Expand Down
2 changes: 1 addition & 1 deletion fhircraft/fhir/resources/datatypes/R4/complex/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Reference(Element):
)

@model_validator(mode="after")
def FHIR_ref_1_constraint_model_validator(self):
def FHIR_ref_1_constraint_validator(self):
if not self._root_resource or not self._resource:
return self
return fhir_validators.validate_model_constraint(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SimpleQuantity(Quantity):
_type = "Quantity"

@model_validator(mode="after")
def FHIR_sqty_1_constraint_model_validator(self):
def FHIR_sqty_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="comparator.empty()",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def timing_type_choice_validator(self):
)

@model_validator(mode="after")
def FHIR_trd_1_constraint_model_validator(self):
def FHIR_trd_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="data.empty() or timing.empty()",
Expand All @@ -81,7 +81,7 @@ def FHIR_trd_1_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_trd_2_constraint_model_validator(self):
def FHIR_trd_2_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="condition.exists() implies data.exists()",
Expand All @@ -91,7 +91,7 @@ def FHIR_trd_2_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_trd_3_constraint_model_validator(self):
def FHIR_trd_3_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="(type = 'named-event' implies name.exists()) and (type = 'periodic' implies timing.exists()) and (type.startsWith('data-') implies data.exists())",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def product_type_choice_validator(self):
)

@model_validator(mode="after")
def FHIR_adf_0_constraint_model_validator(self):
def FHIR_adf_0_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="name.matches('[A-Z]([A-Za-z0-9_]){0,254}')",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def onset_type_choice_validator(self):
)

@model_validator(mode="after")
def FHIR_ait_1_constraint_model_validator(self):
def FHIR_ait_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="verificationStatus.coding.where(system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-verification' and code = 'entered-in-error').exists() or clinicalStatus.exists()",
Expand All @@ -237,7 +237,7 @@ def FHIR_ait_1_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_ait_2_constraint_model_validator(self):
def FHIR_ait_2_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="verificationStatus.coding.where(system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-verification' and code = 'entered-in-error').empty() or clinicalStatus.empty()",
Expand Down
6 changes: 3 additions & 3 deletions fhircraft/fhir/resources/datatypes/R4/core/appointment.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def FHIR_app_1_constraint_validator(self):
)

@model_validator(mode="after")
def FHIR_app_2_constraint_model_validator(self):
def FHIR_app_2_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="start.exists() = end.exists()",
Expand All @@ -243,7 +243,7 @@ def FHIR_app_2_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_app_3_constraint_model_validator(self):
def FHIR_app_3_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="(start.exists() and end.exists()) or (status in ('proposed' | 'cancelled' | 'waitlist'))",
Expand All @@ -253,7 +253,7 @@ def FHIR_app_3_constraint_model_validator(self):
)

@model_validator(mode="after")
def FHIR_app_4_constraint_model_validator(self):
def FHIR_app_4_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="Appointment.cancelationReason.exists() implies (Appointment.status='no-show' or Appointment.status='cancelled')",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class AppointmentResponse(DomainResource):
)

@model_validator(mode="after")
def FHIR_apr_1_constraint_model_validator(self):
def FHIR_apr_1_constraint_validator(self):
return fhir_validators.validate_model_constraint(
self,
expression="participantType.exists() or actor.exists()",
Expand Down
Loading
Loading