diff --git a/cc/google/fhir/fhir_path/BUILD b/cc/google/fhir/fhir_path/BUILD index 4ff634a5a..d110563ad 100644 --- a/cc/google/fhir/fhir_path/BUILD +++ b/cc/google/fhir/fhir_path/BUILD @@ -1,9 +1,9 @@ +load("//bazel:antlr4_cc.bzl", "antlr4_cc_lexer", "antlr4_cc_parser") + licenses(["notice"]) package(default_visibility = ["//visibility:public"]) -load("//bazel:antlr4_cc.bzl", "antlr4_cc_lexer", "antlr4_cc_parser") - antlr4_cc_lexer( name = "fhir_path_lexer", src = "FhirPath.g4", @@ -63,6 +63,8 @@ cc_test( deps = [ ":fhir_path", "//cc/google/fhir/status", + "//proto/r4/core:datatypes_cc_proto", + "//proto/r4/core/resources:encounter_cc_proto", "//proto/stu3:codes_cc_proto", "//proto/stu3:datatypes_cc_proto", "//proto/stu3:resources_cc_proto", diff --git a/cc/google/fhir/fhir_path/FhirPath.g4 b/cc/google/fhir/fhir_path/FhirPath.g4 index 45ba568ca..b80f1b830 100644 --- a/cc/google/fhir/fhir_path/FhirPath.g4 +++ b/cc/google/fhir/fhir_path/FhirPath.g4 @@ -1,5 +1,6 @@ grammar FhirPath; +// TODO: upgrade to the 2019 FHIRPath grammar (http://hl7.org/fhirpath/2019May/grammar.html) // Grammar rules //prog: line (line)*; diff --git a/cc/google/fhir/fhir_path/fhir_path.cc b/cc/google/fhir/fhir_path/fhir_path.cc index 090ee4ef6..1e3e16b08 100644 --- a/cc/google/fhir/fhir_path/fhir_path.cc +++ b/cc/google/fhir/fhir_path/fhir_path.cc @@ -39,17 +39,20 @@ namespace fhir_path { using ::google::protobuf::Descriptor; using ::google::protobuf::FieldDescriptor; using ::google::protobuf::Message; +using ::google::protobuf::MessageOptions; using ::google::protobuf::Reflection; using ::google::protobuf::util::MessageDifferencer; // Used to wrap primitives in protobuf messages, and // can be used against multiple versions of FHIR, not just R4. using ::google::fhir::r4::core::Boolean; +using ::google::fhir::r4::core::DateTime; using ::google::fhir::r4::core::Decimal; using ::google::fhir::r4::core::Integer; using ::google::fhir::r4::core::String; using antlr4::ANTLRInputStream; +using antlr4::BaseErrorListener; using antlr4::CommonTokenStream; using antlr4::tree::TerminalNode; @@ -87,9 +90,10 @@ StatusOr MessagesToBoolean(const std::vector& messages) { return InvalidArgument("Expression did not evaluate to boolean"); } -// Supported funtions. -const char kExistsFunction[] = "exists"; -const char kNotFunction[] = "not"; +// Supported functions. +constexpr char kExistsFunction[] = "exists"; +constexpr char kNotFunction[] = "not"; +constexpr char kHasValueFunction[] = "hasValue"; // Expression node that returns literals wrapped in the corresponding // protbuf wrapper @@ -261,6 +265,45 @@ class NotFunction : public ExpressionNode { const std::shared_ptr child_; }; +// Implements the FHIRPath .hasValue() function, which returns true +// if and only if the child is a single primitive value. +class HasValueFunction : public ExpressionNode { + public: + explicit HasValueFunction(const std::shared_ptr& child) + : child_(child) {} + + Status Evaluate(WorkSpace* work_space, + std::vector* results) const override { + std::vector child_results; + + FHIR_RETURN_IF_ERROR(child_->Evaluate(work_space, &child_results)); + + Boolean* result = new Boolean(); + work_space->DeleteWhenFinished(result); + + if (child_results.size() != 1) { + result->set_value(false); + } else { + const MessageOptions& options = + child_results[0]->GetDescriptor()->options(); + result->set_value( + options.HasExtension(proto::structure_definition_kind) && + (options.GetExtension(proto::structure_definition_kind) == + proto::StructureDefinitionKindValue::KIND_PRIMITIVE_TYPE)); + } + + results->push_back(result); + return Status::OK(); + } + + const Descriptor* ReturnType() const override { + return Boolean::descriptor(); + } + + private: + const std::shared_ptr child_; +}; + // Base class for FHIRPath binary operators. class BinaryOperator : public ExpressionNode { public: @@ -395,6 +438,11 @@ class ComparisonOperator : public BinaryOperator { IsMessageType(*right_result)) { EvalStringComparison(dynamic_cast(left_result), dynamic_cast(right_result), result); + } else if (IsMessageType(*left_result) && + IsMessageType(*right_result)) { + FHIR_RETURN_IF_ERROR(EvalDateTimeComparison( + dynamic_cast(left_result), + dynamic_cast(right_result), result)); } else { return InvalidArgument("Unsupported comparison value types"); } @@ -416,8 +464,8 @@ class ComparisonOperator : public BinaryOperator { void EvalIntegerComparison(const Integer* left_wrapper, const Integer* right_wrapper, Boolean* result) const { - int32_t left = left_wrapper->value(); - int32_t right = right_wrapper->value(); + const int32_t left = left_wrapper->value(); + const int32_t right = right_wrapper->value(); switch (comparison_type_) { case kLessThan: @@ -506,48 +554,60 @@ class ComparisonOperator : public BinaryOperator { } } - ComparisonType comparison_type_; -}; - -// Base class for FHIRPath binary boolean operators. -class BooleanOperator : public BinaryOperator { - public: - Status EvaluateOperator( - const std::vector& left_results, - const std::vector& right_results, WorkSpace* work_space, - std::vector* out_results) const override { - // Per the FHIRPath spec, boolean operators propagate empty results. - if (left_results.empty() || right_results.empty()) { - return Status::OK(); + Status EvalDateTimeComparison(const DateTime* left_message, + const DateTime* right_message, + Boolean* result) const { + // TODO: consider support for cross-timezone comparisons. + if (left_message->timezone() != right_message->timezone()) { + return InvalidArgument( + "Date comparisons only supported in same timezone"); } - FHIR_ASSIGN_OR_RETURN(bool left_result, MessagesToBoolean(left_results)); - FHIR_ASSIGN_OR_RETURN(bool right_result, MessagesToBoolean(right_results)); - bool eval_result = EvaluateBool(left_result, right_result); + const int64_t left = left_message->value_us(); + const int64_t right = right_message->value_us(); - Boolean* result = new Boolean(); - work_space->DeleteWhenFinished(result); - result->set_value(eval_result); - - out_results->push_back(result); + switch (comparison_type_) { + case kLessThan: + result->set_value(left < right); + break; + case kGreaterThan: + result->set_value(left > right); + break; + case kLessThanEqualTo: + result->set_value(left <= right); + break; + case kGreaterThanEqualTo: + result->set_value(left >= right); + break; + } return Status::OK(); } + ComparisonType comparison_type_; +}; + +// Base class for FHIRPath binary boolean operators. +class BooleanOperator : public ExpressionNode { + public: const Descriptor* ReturnType() const override { return Boolean::descriptor(); } BooleanOperator(std::shared_ptr left, std::shared_ptr right) - : BinaryOperator(left, right) {} + : left_(left), right_(right) {} - // Perform the actual boolean evaluation. - virtual bool EvaluateBool(bool left, bool right) const = 0; + protected: + void SetResult(bool eval_result, WorkSpace* work_space, + std::vector* results) const { + Boolean* result = new Boolean(); + work_space->DeleteWhenFinished(result); + result->set_value(eval_result); + results->push_back(result); + } - private: const std::shared_ptr left_; - const std::shared_ptr right_; }; @@ -557,8 +617,40 @@ class OrOperator : public BooleanOperator { std::shared_ptr right) : BooleanOperator(left, right) {} - bool EvaluateBool(bool left, bool right) const override { - return left || right; + Status Evaluate(WorkSpace* work_space, + std::vector* results) const override { + // Logic from truth table spec: http://hl7.org/fhirpath/#boolean-logic + // Short circuit and return true on the first true result. + std::vector left_results; + FHIR_RETURN_IF_ERROR(left_->Evaluate(work_space, &left_results)); + if (!left_results.empty()) { + FHIR_ASSIGN_OR_RETURN(bool left_result, MessagesToBoolean(left_results)); + if (left_result) { + SetResult(true, work_space, results); + return Status::OK(); + } + } + + std::vector right_results; + FHIR_RETURN_IF_ERROR(right_->Evaluate(work_space, &right_results)); + if (!right_results.empty()) { + FHIR_ASSIGN_OR_RETURN(bool right_result, + MessagesToBoolean(right_results)); + if (right_result) { + SetResult(true, work_space, results); + return Status::OK(); + } + } + + if (!left_results.empty() && !right_results.empty()) { + // Both children must be false to get here, so return false. + SetResult(false, work_space, results); + return Status::OK(); + } + + // Neither child is true and at least one is empty, so propagate + // empty per the FHIRPath spec. + return Status::OK(); } }; @@ -568,8 +660,40 @@ class AndOperator : public BooleanOperator { std::shared_ptr right) : BooleanOperator(left, right) {} - bool EvaluateBool(bool left, bool right) const override { - return left && right; + Status Evaluate(WorkSpace* work_space, + std::vector* results) const override { + // Logic from truth table spec: http://hl7.org/fhirpath/#boolean-logic + // Short circuit and return false on the first false result. + std::vector left_results; + FHIR_RETURN_IF_ERROR(left_->Evaluate(work_space, &left_results)); + if (!left_results.empty()) { + FHIR_ASSIGN_OR_RETURN(bool left_result, MessagesToBoolean(left_results)); + if (!left_result) { + SetResult(false, work_space, results); + return Status::OK(); + } + } + + std::vector right_results; + FHIR_RETURN_IF_ERROR(right_->Evaluate(work_space, &right_results)); + if (!right_results.empty()) { + FHIR_ASSIGN_OR_RETURN(bool right_result, + MessagesToBoolean(right_results)); + if (!right_result) { + SetResult(false, work_space, results); + return Status::OK(); + } + } + + if (!left_results.empty() && !right_results.empty()) { + // Both children must be true to get here, so return true. + SetResult(true, work_space, results); + return Status::OK(); + } + + // Neither child is false and at least one is empty, so propagate + // empty per the FHIRPath spec. + return Status::OK(); } }; @@ -608,7 +732,7 @@ struct InvocationDefinition { class FhirPathCompilerVisitor : public FhirPathBaseVisitor { public: explicit FhirPathCompilerVisitor(const Descriptor* descriptor) - : descriptor_(descriptor) {} + : error_listener_(this), descriptor_(descriptor) {} antlrcpp::Any visitInvocationExpression( FhirPathParser::InvocationExpressionContext* node) override { @@ -826,6 +950,8 @@ class FhirPathCompilerVisitor : public FhirPathBaseVisitor { string GetError() { return error_message_; } + BaseErrorListener* GetErrorListener() { return &error_listener_; } + private: // Returns an ExpressionNode that implements the // specified FHIRPath function. @@ -836,6 +962,8 @@ class FhirPathCompilerVisitor : public FhirPathBaseVisitor { return std::make_shared(child_expression); } else if (function_name == kNotFunction) { return std::make_shared(child_expression); + } else if (function_name == kHasValueFunction) { + return std::make_shared(child_expression); } else { // TODO: Implement set of functions for initial use cases. SetError(absl::StrCat("The function ", function_name, @@ -845,8 +973,26 @@ class FhirPathCompilerVisitor : public FhirPathBaseVisitor { } } + // ANTLR listener to report syntax errors. + class FhirPathErrorListener : public BaseErrorListener { + public: + FhirPathErrorListener(FhirPathCompilerVisitor* visitor) + : visitor_(visitor) {} + + void syntaxError(antlr4::Recognizer* recognizer, + antlr4::Token* offending_symbol, size_t line, + size_t position_in_line, const string& message, + std::exception_ptr e) override { + visitor_->SetError(message); + } + + private: + FhirPathCompilerVisitor* visitor_; + }; + void SetError(const string& error_message) { error_message_ = error_message; } + FhirPathErrorListener error_listener_; const Descriptor* descriptor_; string error_message_; }; @@ -947,6 +1093,7 @@ StatusOr CompiledExpression::Compile( FhirPathParser parser(&tokens); internal::FhirPathCompilerVisitor visitor(descriptor); + parser.addErrorListener(visitor.GetErrorListener()); antlrcpp::Any result = visitor.visit(parser.expression()); if (result.isNotNull()) { @@ -987,6 +1134,23 @@ MessageValidator::ConstraintsFor(const Descriptor* descriptor) { auto constraints = absl::make_unique(); + int ext_size = + descriptor->options().ExtensionSize(proto::fhir_path_message_constraint); + + for (int i = 0; i < ext_size; ++i) { + const string& fhir_path = descriptor->options().GetExtension( + proto::fhir_path_message_constraint, i); + auto constraint = CompiledExpression::Compile(descriptor, fhir_path); + if (constraint.ok()) { + CompiledExpression expression = constraint.ValueOrDie(); + constraints->message_expressions_.push_back(expression); + } + + // TODO: Unsupported FHIRPath expressions are simply not + // validated for now; this should produce an error once we support + // all of FHIRPath. + } + for (int i = 0; i < descriptor->field_count(); i++) { const FieldDescriptor* field = descriptor->field(i); @@ -1004,7 +1168,7 @@ MessageValidator::ConstraintsFor(const Descriptor* descriptor) { auto constraint = CompiledExpression::Compile(field_type, fhir_path); if (constraint.ok()) { - constraints->expressions_.push_back( + constraints->field_expressions_.push_back( std::make_pair(field, constraint.ValueOrDie())); } @@ -1033,7 +1197,8 @@ MessageValidator::ConstraintsFor(const Descriptor* descriptor) { // Nested fields that directly or transitively have constraints // are retained and used when applying constraints. - if (!child_constraints->expressions_.empty() || + if (!child_constraints->message_expressions_.empty() || + !child_constraints->field_expressions_.empty() || !child_constraints->nested_with_constraints_.empty()) { constraints_local->nested_with_constraints_.push_back(field); } @@ -1053,14 +1218,36 @@ Status MessageValidator::Validate(const Message& message) { return Validate(message, HaltOnErrorHandler); } +// Validates that the given message satisfies the +// the given FHIRPath expression, invoking the handler in case +// of failure. +Status ValidateMessageConstraint(const Message& message, + const CompiledExpression& expression, + const ViolationHandlerFunc handler, + bool* halt_validation) { + FHIR_ASSIGN_OR_RETURN(const EvaluationResult expr_result, + expression.Evaluate(message)); + + if (!expr_result.GetBoolean().ValueOrDie()) { + string err_msg = absl::StrCat("fhirpath-constraint-violation-", + message.GetDescriptor()->name()); + + *halt_validation = handler(message, nullptr, expression.fhir_path()); + return ::tensorflow::errors::FailedPrecondition(err_msg); + } + + return Status::OK(); +} + // Validates that the given field in the given parent satisfies the // the given FHIRPath expression, invoking the handler in case // of failure. -Status ValidateConstraint(const Message& parent, const FieldDescriptor* field, - const Message& field_value, - const CompiledExpression& expression, - const ViolationHandlerFunc handler, - bool* halt_validation) { +Status ValidateFieldConstraint(const Message& parent, + const FieldDescriptor* field, + const Message& field_value, + const CompiledExpression& expression, + const ViolationHandlerFunc handler, + bool* halt_validation) { FHIR_ASSIGN_OR_RETURN(const EvaluationResult expr_result, expression.Evaluate(field_value)); @@ -1107,8 +1294,18 @@ Status MessageValidator::Validate(const Message& message, // Keep the first failure to return to the caller. Status accumulative_status = Status::OK(); + // Validate the constraints attached to the message root. + for (const CompiledExpression& expr : constraints->message_expressions_) { + UpdateStatus( + &accumulative_status, + ValidateMessageConstraint(message, expr, handler, halt_validation)); + if (*halt_validation) { + return accumulative_status; + } + } + // Validate the constraints attached to the message's fields. - for (auto expression : constraints->expressions_) { + for (auto expression : constraints->field_expressions_) { if (*halt_validation) { return accumulative_status; } @@ -1118,8 +1315,8 @@ Status MessageValidator::Validate(const Message& message, ForEachMessageHalting(message, field, [&](const Message& child) { UpdateStatus(&accumulative_status, - ValidateConstraint(message, field, child, expr, handler, - halt_validation)); + ValidateFieldConstraint(message, field, child, expr, handler, + halt_validation)); return *halt_validation; }); diff --git a/cc/google/fhir/fhir_path/fhir_path.h b/cc/google/fhir/fhir_path/fhir_path.h index c3c5887b0..8811528f4 100644 --- a/cc/google/fhir/fhir_path/fhir_path.h +++ b/cc/google/fhir/fhir_path/fhir_path.h @@ -224,7 +224,8 @@ class CompiledExpression { // The handler is provided with: // * The message on which the FHIRPath violation occurred. This // may be the root message or a child structure. -// * The field in the above message that caused the violation. +// * The field in the above message that caused the violation, or +// nullptr if the error occured on the root of the message. // This is the field on which the FHIRPath constraint is defined. // * The FHIRPath constraint expression that triggered the violation. typedef std::function message_expressions_; + + // FHIRPath constraints on fields std::vector< std::pair> - expressions_; + field_expressions_; + // Nested messages that have constraints, so the evaluation logic + // knows to check them. std::vector nested_with_constraints_; }; diff --git a/cc/google/fhir/fhir_path/fhir_path_test.cc b/cc/google/fhir/fhir_path/fhir_path_test.cc index cb72fa807..691719569 100644 --- a/cc/google/fhir/fhir_path/fhir_path_test.cc +++ b/cc/google/fhir/fhir_path/fhir_path_test.cc @@ -20,6 +20,8 @@ #include "gtest/gtest.h" #include "absl/strings/str_cat.h" #include "google/fhir/status/status.h" +#include "proto/r4/core/datatypes.pb.h" +#include "proto/r4/core/resources/encounter.pb.h" #include "proto/stu3/codes.pb.h" #include "proto/stu3/datatypes.pb.h" #include "proto/stu3/resources.pb.h" @@ -27,6 +29,9 @@ #include "proto/stu3/uscore_codes.pb.h" #include "tensorflow/core/lib/core/errors.h" +using ::google::fhir::r4::core::Period; +using ::google::fhir::r4::core::Quantity; + using ::google::fhir::stu3::proto::Code; using ::google::fhir::stu3::proto::Coding; using ::google::fhir::stu3::proto::Encounter; @@ -62,7 +67,7 @@ Encounter ValidEncounter() { status { value: TRIAGED } id { value: "123" } period { - start: { value_us: 1556750153000 timezone: "America/Los_Angelas" } + start: { value_us: 1556750153000 timezone: "America/Los_Angeles" } } )proto"); } @@ -231,6 +236,82 @@ TEST(FhirPathTest, TestFunctionNotExistsNegation) { EXPECT_TRUE(result.GetBoolean().ValueOrDie()); } +TEST(FhirPathTest, TestFunctionHasValue) { + auto expr = CompiledExpression::Compile(Encounter::descriptor(), + "period.start.hasValue()") + .ValueOrDie(); + + Encounter test_encounter = ValidEncounter(); + + EvaluationResult result = expr.Evaluate(test_encounter).ValueOrDie(); + + EXPECT_TRUE(result.GetBoolean().ValueOrDie()); +} + +TEST(FhirPathTest, TestFunctionHasValueNegation) { + auto expr = CompiledExpression::Compile(Encounter::descriptor(), + "period.start.hasValue().not()") + .ValueOrDie(); + + Encounter test_encounter = ValidEncounter(); + + EvaluationResult has_value_result = + expr.Evaluate(test_encounter).ValueOrDie(); + EXPECT_FALSE(has_value_result.GetBoolean().ValueOrDie()); + + test_encounter.mutable_period()->clear_start(); + EvaluationResult no_value_result = expr.Evaluate(test_encounter).ValueOrDie(); + EXPECT_TRUE(no_value_result.GetBoolean().ValueOrDie()); +} + +TEST(FhirPathTest, TestFunctionHasValueComplex) { + auto expr = + CompiledExpression::Compile(Encounter::descriptor(), "period.hasValue()") + .ValueOrDie(); + + Encounter test_encounter = ValidEncounter(); + + EvaluationResult result = expr.Evaluate(test_encounter).ValueOrDie(); + + // hasValue should return false for non-primitive types. + EXPECT_FALSE(result.GetBoolean().ValueOrDie()); +} + +TEST(FhirPathTest, TestOrShortCircuit) { + auto expr = + CompiledExpression::Compile(Quantity::descriptor(), + "value.hasValue().not() or value < 100") + .ValueOrDie(); + Quantity quantity; + EvaluationResult result = expr.Evaluate(quantity).ValueOrDie(); + EXPECT_TRUE(result.GetBoolean().ValueOrDie()); +} + +TEST(FhirPathTest, TestMultiOrShortCircuit) { + auto expr = + CompiledExpression::Compile( + Period::descriptor(), + "start.hasValue().not() or end.hasValue().not() or start <= end") + .ValueOrDie(); + + Period no_end_period = ParseFromString(R"proto( + start: { value_us: 1556750000000 timezone: "America/Los_Angeles" } + )proto"); + + EvaluationResult result = expr.Evaluate(no_end_period).ValueOrDie(); + + EXPECT_TRUE(result.GetBoolean().ValueOrDie()); +} + +TEST(FhirPathTest, TestOrFalseWithEmptyReturnsEmpty) { + auto expr = CompiledExpression::Compile(Quantity::descriptor(), + "value.hasValue() or value < 100") + .ValueOrDie(); + Quantity quantity; + EvaluationResult result = expr.Evaluate(quantity).ValueOrDie(); + EXPECT_TRUE(result.GetMessages().empty()); +} + TEST(FhirPathTest, TestOrOneIsTrue) { auto expr = CompiledExpression::Compile( Encounter::descriptor(), @@ -257,6 +338,25 @@ TEST(FhirPathTest, TestOrNeitherAreTrue) { EXPECT_FALSE(result.GetBoolean().ValueOrDie()); } +TEST(FhirPathTest, TestAndShortCircuit) { + auto expr = CompiledExpression::Compile(Quantity::descriptor(), + "value.hasValue() and value < 100") + .ValueOrDie(); + Quantity quantity; + EvaluationResult result = expr.Evaluate(quantity).ValueOrDie(); + EXPECT_FALSE(result.GetBoolean().ValueOrDie()); +} + +TEST(FhirPathTest, TestAndTrueWithEmptyReturnsEmpty) { + auto expr = + CompiledExpression::Compile(Quantity::descriptor(), + "value.hasValue().not() and value < 100") + .ValueOrDie(); + Quantity quantity; + EvaluationResult result = expr.Evaluate(quantity).ValueOrDie(); + EXPECT_TRUE(result.GetMessages().empty()); +} + TEST(FhirPathTest, TestAndOneIsTrue) { auto expr = CompiledExpression::Compile( Encounter::descriptor(), @@ -478,6 +578,77 @@ TEST(FhirPathTest, NestedConstraintSatisfied) { EXPECT_TRUE(validator.Validate(value_set).ok()); } +TEST(FhirPathTest, TimeComparison) { + auto start_before_end = + CompiledExpression::Compile(Period::descriptor(), "start <= end") + .ValueOrDie(); + + Period start_before_end_period = ParseFromString(R"proto( + start: { value_us: 1556750000000 timezone: "America/Los_Angeles" } + end: { value_us: 1556750153000 timezone: "America/Los_Angeles" } + )proto"); + EvaluationResult start_before_end_result = + start_before_end.Evaluate(start_before_end_period).ValueOrDie(); + EXPECT_TRUE(start_before_end_result.GetBoolean().ValueOrDie()); + + Period end_before_start_period = ParseFromString(R"proto( + start: { value_us: 1556750153000 timezone: "America/Los_Angeles" } + end: { value_us: 1556750000000 timezone: "America/Los_Angeles" } + )proto"); + EvaluationResult end_before_start_result = + start_before_end.Evaluate(end_before_start_period).ValueOrDie(); + EXPECT_FALSE(end_before_start_result.GetBoolean().ValueOrDie()); +} + +TEST(FhirPathTest, MessageLevelConstraint) { + Period period = ParseFromString(R"proto( + start: { value_us: 1556750000000 timezone: "America/Los_Angeles" } + end: { value_us: 1556750153000 timezone: "America/Los_Angeles" } + )proto"); + + MessageValidator validator; + EXPECT_TRUE(validator.Validate(period).ok()); +} + +TEST(FhirPathTest, MessageLevelConstraintViolated) { + Period end_before_start_period = ParseFromString(R"proto( + start: { value_us: 1556750153000 timezone: "America/Los_Angeles" } + end: { value_us: 1556750000000 timezone: "America/Los_Angeles" } + )proto"); + + MessageValidator validator; + EXPECT_FALSE(validator.Validate(end_before_start_period).ok()); +} + +TEST(FhirPathTest, NestedMessageLevelConstraint) { + auto start_with_no_end_encounter = + ParseFromString<::google::fhir::r4::core::Encounter>(R"proto( + status { value: TRIAGED } + id { value: "123" } + period { + start: { value_us: 1556750153000 timezone: "America/Los_Angeles" } + } + )proto"); + + MessageValidator validator; + EXPECT_TRUE(validator.Validate(start_with_no_end_encounter).ok()); +} + +TEST(FhirPathTest, NestedMessageLevelConstraintViolated) { + auto end_before_start_encounter = + ParseFromString<::google::fhir::r4::core::Encounter>(R"proto( + status { value: TRIAGED } + id { value: "123" } + period { + start: { value_us: 1556750153000 timezone: "America/Los_Angeles" } + end: { value_us: 1556750000000 timezone: "America/Los_Angeles" } + } + )proto"); + + MessageValidator validator; + EXPECT_FALSE(validator.Validate(end_before_start_encounter).ok()); +} + TEST(FhirPathTest, ProfiledEmptyExtension) { UsCorePatient patient = ValidUsCorePatient(); MessageValidator validator; diff --git a/java/src/main/java/com/google/fhir/stu3/ProtoFilePrinter.java b/java/src/main/java/com/google/fhir/stu3/ProtoFilePrinter.java index 4e8643b97..2888bd98c 100644 --- a/java/src/main/java/com/google/fhir/stu3/ProtoFilePrinter.java +++ b/java/src/main/java/com/google/fhir/stu3/ProtoFilePrinter.java @@ -77,6 +77,7 @@ public class ProtoFilePrinter { Annotations.valueRegex, Annotations.fhirProfileBase, Annotations.fhirStructureDefinitionUrl, + Annotations.fhirPathMessageConstraint, Annotations.isChoiceType, Annotations.fhirFixedSystem); diff --git a/java/src/main/java/com/google/fhir/stu3/ProtoGenerator.java b/java/src/main/java/com/google/fhir/stu3/ProtoGenerator.java index 01ddfd0cd..dd4b037e3 100644 --- a/java/src/main/java/com/google/fhir/stu3/ProtoGenerator.java +++ b/java/src/main/java/com/google/fhir/stu3/ProtoGenerator.java @@ -117,10 +117,36 @@ public class ProtoGenerator { "positiveInt", FieldDescriptorProto.Type.TYPE_UINT32, "unsignedInt", FieldDescriptorProto.Type.TYPE_UINT32); + // Exclude constraints from the DomainResource until we refactor + // them to a common place rather on every resource. + // TODO: remove these with the above refactoring. + private static final ImmutableSet DOMAIN_RESOURCE_CONSTRAINTS = + ImmutableSet.of( + "contained.contained.empty()", + "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()", + "contained.where((('#'+id in (%resource.descendants().reference" + + " | %resource.descendants().as(canonical) | %resource.descendants().as(uri)" + + " | %resource.descendants().as(url))) or descendants().where(reference = '#')" + + ".exists() or descendants().where(as(canonical) = '#').exists() or" + + " descendants().where(as(canonical) = '#').exists()).not())" + + ".trace('unmatched', id).empty()", + "text.div.exists()", + "contained.meta.security.empty()"); + // FHIR elements may have core constraint definitions that do not add // value to protocol buffers, so we exclude them. private static final ImmutableSet EXCLUDED_FHIR_CONSTRAINTS = - ImmutableSet.of("hasValue() | (children().count() > id.count())"); + ImmutableSet.builder() + .addAll(DOMAIN_RESOURCE_CONSTRAINTS) + .add( + "hasValue() | (children().count() > id.count())", + "hasValue() or (children().count() > id.count())", + // Exclude the FHIR-provided element name regex, since field names are known at + // compile time + "path.matches('[^\\\\s\\\\.,:;\\\\\\'\"\\\\/|?!@#$%&*()\\\\[\\\\]{}]{1,64}" + + "(\\\\.[^\\\\s\\\\.,:;\\\\\\'\"\\\\/|?!@#$%&*()\\\\[\\\\]{}]{1,64}" + + "(\\\\[x\\\\])?(\\\\:[^\\\\s\\\\.]+)?)*')") + .build(); // Should we use custom types for constrained references? private static final boolean USE_TYPED_REFERENCES = false; @@ -594,6 +620,12 @@ private DescriptorProto generateMessage( // Get the name of this message builder.setName(nameFromQualifiedName(getContainerType(currentElement, elementList))); + // Add message-level constraints. + List expressions = getFhirPathConstraints(currentElement); + if (!expressions.isEmpty()) { + builder.getOptionsBuilder().setExtension(Annotations.fhirPathMessageConstraint, expressions); + } + // When generating a descriptor for a primitive type, the value part may already be present. int nextTag = builder.getFieldCount() + 1; @@ -696,7 +728,19 @@ private void buildAndAddField( .getTypeName() .replace(fhirVersion.coreProtoPackage, packageInfo.getProtoPackage())) .build(); + } else { + // There is no submessage defined for this field, so apply constraints to the field itself. + List expressions = getFhirPathConstraints(element); + if (!expressions.isEmpty()) { + field = + field.toBuilder() + .setOptions( + field.getOptions().toBuilder() + .setExtension(Annotations.fhirPathConstraint, expressions)) + .build(); + } } + builder.addField(field); } else if (!element.getPath().getValue().equals("Extension.extension") && !element.getPath().getValue().equals("Extension.value[x]")) { @@ -781,10 +825,22 @@ private Optional getChoiceTypeIfRequired( .filter(type -> uniqueTypes.add(type.getCode().getValue())) .map(type -> baseChoiceType.getField(baseTypesToIndex.get(type.getCode().getValue()))) .collect(Collectors.toList()); + // TODO: If a choice type is a slice of another choice type (not a pure // constraint, but actual slice) we'll need to update the name and type name as well. - return Optional.of( - baseChoiceType.toBuilder().clearField().addAllField(matchingFields).build()); + DescriptorProto.Builder newChoiceType = + baseChoiceType.toBuilder().clearField().addAllField(matchingFields); + + // Constraints may be on the choice base element rather than the value element, + // so reflect that here. + List expressions = getFhirPathConstraints(element); + if (!expressions.isEmpty()) { + newChoiceType.setOptions( + baseChoiceType.getOptions().toBuilder() + .setExtension(Annotations.fhirPathMessageConstraint, expressions)); + } + + return Optional.of(newChoiceType.build()); } if (isChoiceType(element)) { return Optional.of(makeChoiceType(element, elementList, field)); @@ -1341,8 +1397,6 @@ private Optional buildField( ProtoGeneratorAnnotations.fieldDescription, element.getShort().getValue()); } - addFhirPathConstraints(element, options); - // Is this field required? if (element.getMin().getValue() == 1) { options.setExtension( @@ -1438,19 +1492,13 @@ private Optional buildField( return Optional.of(fieldBuilder.build()); } - // Adds any FHIRPath constraints from the definition. - private static void addFhirPathConstraints( - ElementDefinition element, FieldOptions.Builder options) { - List expressions = - element.getConstraintList().stream() - .filter(constraint -> constraint.hasExpression()) - .map(constraint -> constraint.getExpression().getValue()) - .filter(expression -> !EXCLUDED_FHIR_CONSTRAINTS.contains(expression)) - .collect(Collectors.toList()); - - if (!expressions.isEmpty()) { - options.setExtension(Annotations.fhirPathConstraint, expressions); - } + // Returns the FHIRPath constraints on the given element, if any. + private static List getFhirPathConstraints(ElementDefinition element) { + return element.getConstraintList().stream() + .filter(constraint -> constraint.hasExpression()) + .map(constraint -> constraint.getExpression().getValue()) + .filter(expression -> !EXCLUDED_FHIR_CONSTRAINTS.contains(expression)) + .collect(Collectors.toList()); } private static FieldDescriptorProto.Label getFieldSize(ElementDefinition element) { @@ -1597,6 +1645,15 @@ private DescriptorProto makeChoiceType( DescriptorProto.newBuilder() .setName(nameFromQualifiedName(getContainerType(element, elementList))); choiceType.getOptionsBuilder().setExtension(Annotations.isChoiceType, true); + + // Add constraints on choice types. + List expressions = getFhirPathConstraints(element); + if (!expressions.isEmpty()) { + choiceType + .getOptionsBuilder() + .setExtension(Annotations.fhirPathMessageConstraint, expressions); + } + // TODO: Remove legacy renaming rules prior to V1.0 OneofDescriptorProto.Builder oneof = choiceType diff --git a/java/src/test/java/com/google/fhir/stu3/ProtoGeneratorTest.java b/java/src/test/java/com/google/fhir/stu3/ProtoGeneratorTest.java index b33641476..44c59a265 100644 --- a/java/src/test/java/com/google/fhir/stu3/ProtoGeneratorTest.java +++ b/java/src/test/java/com/google/fhir/stu3/ProtoGeneratorTest.java @@ -149,6 +149,7 @@ public void setUp() throws IOException { registry.add(Annotations.fhirInlinedExtensionUrl); registry.add(Annotations.fhirOneofIsOptional); registry.add(Annotations.fhirPathConstraint); + registry.add(Annotations.fhirPathMessageConstraint); registry.add(Annotations.fhirProfileBase); registry.add(Annotations.fhirReferenceType); registry.add(Annotations.sourceCodeSystem); diff --git a/proto/annotations.proto b/proto/annotations.proto index d0fdbb364..cfb92646d 100644 --- a/proto/annotations.proto +++ b/proto/annotations.proto @@ -81,6 +81,11 @@ extend google.protobuf.MessageOptions { string fhir_fixed_system = 255621907; + // FHIRPath-based constraints that apply to the message in question. + // These constraints are propagated from the constraint.expression + // field on the FHIR ElementDefinition and may be used for data validation. + repeated string fhir_path_message_constraint = 276863075; + // DEPRECATED: use fhir_profile_base to identify extension, and // fhir_structure_definition_url to get the extension url. string fhir_extension_url = 177048773 [deprecated = true]; diff --git a/proto/r4/core/datatypes.proto b/proto/r4/core/datatypes.proto index 07df5b0ae..9e5c714a1 100644 --- a/proto/r4/core/datatypes.proto +++ b/proto/r4/core/datatypes.proto @@ -550,6 +550,10 @@ message Age { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Age"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value.hasValue().not() or value > 0)"; // Unique id for inter-element referencing String id = 1; @@ -631,6 +635,8 @@ message Attachment { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Attachment"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "data.empty() or contentType.exists()"; // Unique id for inter-element referencing String id = 1; @@ -760,6 +766,8 @@ message ContactPoint { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ContactPoint"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or system.exists()"; // Unique id for inter-element referencing String id = 1; @@ -855,6 +863,10 @@ message Count { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Count"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(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())"; // Unique id for inter-element referencing String id = 1; @@ -943,6 +955,9 @@ message DataRequirement { // What codes are expected message CodeFilter { + option (.google.fhir.proto.fhir_path_message_constraint) = + "path.exists() xor searchParam.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -961,15 +976,13 @@ message DataRequirement { // What code is expected repeated Coding code = 6; } - repeated CodeFilter code_filter = 7 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "path.exists() xor searchParam.exists()" - ]; + repeated CodeFilter code_filter = 7; // What dates/date ranges are expected message DateFilter { + option (.google.fhir.proto.fhir_path_message_constraint) = + "path.exists() xor searchParam.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -994,12 +1007,7 @@ message DataRequirement { } ValueX value = 5; } - repeated DateFilter date_filter = 8 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "path.exists() xor searchParam.exists()" - ]; + repeated DateFilter date_filter = 8; // Number of results PositiveInt limit = 9; @@ -1034,9 +1042,7 @@ message DataRequirement { DirectionCode direction = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Sort sort = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Sort sort = 10; } // Auto-generated from StructureDefinition for Distance, last updated @@ -1046,6 +1052,10 @@ message Distance { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Distance"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(code.exists() or value.empty()) and (system.empty() or system = %ucum)"; // Unique id for inter-element referencing String id = 1; @@ -1169,9 +1179,7 @@ message Dosage { } RateX rate = 5; } - repeated DoseAndRate dose_and_rate = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DoseAndRate dose_and_rate = 13; // Upper limit on medication per unit of time Ratio max_dose_per_period = 14; @@ -1190,6 +1198,10 @@ message Duration { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Duration"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.exists() implies ((system = %ucum) and value.exists())"; // Unique id for inter-element referencing String id = 1; @@ -1233,6 +1245,32 @@ message ElementDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ElementDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "min.empty() or max.empty() or (max = '*') or iif(max != '*', min <= max.toInteger())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "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())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "pattern.empty() or (type.count() <= 1)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "fixed.empty() or (type.count() <= 1)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "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()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "sliceIsConstraining.exists() implies sliceName.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "pattern.empty() or fixed.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "constraint.select(key).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type.select(code).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "sliceName.empty() or sliceName.matches('^[a-zA-Z0-9\\\\/\\\\-_\\\\[\\\\]\\\\@]+$')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "defaultValue.empty() or meaningWhenMissing.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "isModifier implies isModifierReason.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "path.matches('[A-Za-z][A-Za-z0-9]*(\\\\.[a-z][A-Za-z0-9]*(\\\\[x])?)*')"; // Unique id for inter-element referencing String id = 1; @@ -1277,6 +1315,9 @@ message ElementDefinition { // This element is sliced - slices follow message Slicing { + option (.google.fhir.proto.fhir_path_message_constraint) = + "discriminator.exists() or description.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -1313,9 +1354,7 @@ message ElementDefinition { String path = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Discriminator discriminator = 3 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Discriminator discriminator = 3; // Text description of how slicing works (or not) String description = 4; @@ -1341,12 +1380,7 @@ message ElementDefinition { RulesCode rules = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Slicing slicing = 10 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "discriminator.exists() or description.exists()" - ]; + Slicing slicing = 10; // Concise definition for space-constrained presentation String short = 11; @@ -1390,14 +1424,18 @@ message ElementDefinition { String max = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Base base = 18 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Base base = 18; // Reference to definition of content for the element Uri content_reference = 19; // Data type and Profile for this element message TypeRef { + option (.google.fhir.proto.fhir_path_message_constraint) = + "aggregation.empty() or (code = 'Reference')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(code='Reference' or code = 'canonical') or targetProfile.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -1449,14 +1487,7 @@ message ElementDefinition { } VersioningCode versioning = 7; } - repeated TypeRef type = 20 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "aggregation.empty() or (code = 'Reference')", - (.google.fhir.proto.fhir_path_constraint) = - "(code='Reference' or code = 'canonical') or targetProfile.empty()" - ]; + repeated TypeRef type = 20; // Specified value if missing from instance message DefaultValueX { @@ -1709,9 +1740,7 @@ message ElementDefinition { ValueX value = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Example example = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Example example = 26; // Minimum Allowed Value (for some types) message MinValueX { @@ -1757,6 +1786,9 @@ message ElementDefinition { // Condition that must evaluate to true message Constraint { + option (.google.fhir.proto.fhir_path_message_constraint) = + "expression.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -1800,11 +1832,7 @@ message ElementDefinition { // Reference to original source of constraint Canonical source = 9; } - repeated Constraint constraint = 31 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = "expression.exists()" - ]; + repeated Constraint constraint = 31; // If the element must be supported Boolean must_support = 32; @@ -1820,6 +1848,9 @@ message ElementDefinition { // ValueSet details if this is coded message ElementDefinitionBinding { + option (.google.fhir.proto.fhir_path_message_constraint) = + "valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https') or valueSet.startsWith('urn:'))"; + // Unique id for inter-element referencing String id = 1; @@ -1850,12 +1881,7 @@ message ElementDefinition { // Source of value set Canonical value_set = 5; } - ElementDefinitionBinding binding = 36 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https') or valueSet.startsWith('urn:'))" - ]; + ElementDefinitionBinding binding = 36; // Map element to another set of definitions message Mapping { @@ -1897,9 +1923,7 @@ message ElementDefinition { // Comments about the mapping or its use String comment = 6; } - repeated Mapping mapping = 37 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Mapping mapping = 37; } // Auto-generated from StructureDefinition for Expression, last updated @@ -1909,6 +1933,8 @@ message Expression { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Expression"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "expression.exists() or reference.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2265,6 +2291,8 @@ message Period { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Period"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "start.hasValue().not() or end.hasValue().not() or (start <= end)"; // Unique id for inter-element referencing String id = 1; @@ -2444,6 +2472,8 @@ message Quantity { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Quantity"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2487,6 +2517,8 @@ message Range { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Range"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.empty() or high.empty() or (low <= high)"; // Unique id for inter-element referencing String id = 1; @@ -2508,6 +2540,8 @@ message Ratio { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Ratio"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(numerator.empty() xor denominator.exists()) and (numerator.exists() or extension.exists())"; // Unique id for inter-element referencing String id = 1; @@ -2763,9 +2797,7 @@ message SubstanceAmount { // Upper limit possible or expected Quantity high_limit = 4; } - ReferenceRange reference_range = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + ReferenceRange reference_range = 7; } // Auto-generated from StructureDefinition for Timing, last updated @@ -2790,6 +2822,25 @@ message Timing { // When the event is to occur message Repeat { + option (.google.fhir.proto.fhir_path_message_constraint) = + "offset.empty() or (when.exists() and ((when in ('C' | 'CM' | 'CD' | 'CV')).not()))"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "period.exists() implies period >= 0"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "periodMax.empty() or period.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "durationMax.empty() or duration.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "countMax.empty() or count.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "duration.empty() or durationUnit.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "timeOfDay.empty() or when.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "period.empty() or periodUnit.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "duration.exists() implies duration >= 0"; + // Unique id for inter-element referencing String id = 1; @@ -2906,28 +2957,7 @@ message Timing { // Minutes from event (before or after) UnsignedInt offset = 17; } - Repeat repeat = 5 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "offset.empty() or (when.exists() and ((when in ('C' | 'CM' | 'CD' | 'CV')).not()))", - (.google.fhir.proto.fhir_path_constraint) = - "period.exists() implies period >= 0", - (.google.fhir.proto.fhir_path_constraint) = - "periodMax.empty() or period.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "durationMax.empty() or duration.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "countMax.empty() or count.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "duration.empty() or durationUnit.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "timeOfDay.empty() or when.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "period.empty() or periodUnit.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "duration.exists() implies duration >= 0" - ]; + Repeat repeat = 5; // BID | TID | QID | AM | PM | QD | QOD | + CodeableConcept code = 6; @@ -2940,6 +2970,12 @@ message TriggerDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_COMPLEX_TYPE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/TriggerDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type = 'named-event' implies name.exists()) and (type = 'periodic' implies timing.exists()) and (type.startsWith('data-') implies data.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "condition.exists() implies data.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "data.empty() or timing.empty()"; // Unique id for inter-element referencing String id = 1; @@ -3041,6 +3077,10 @@ message MoneyQuantity { "http://hl7.org/fhir/StructureDefinition/Quantity"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/MoneyQuantity"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(code.exists() or value.empty()) and (system.empty() or system = 'urn:iso:std:iso:4217')"; // Unique id for inter-element referencing String id = 1; @@ -3086,6 +3126,10 @@ message SimpleQuantity { "http://hl7.org/fhir/StructureDefinition/Quantity"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "comparator.empty()"; // Unique id for inter-element referencing String id = 1; diff --git a/proto/r4/core/extensions.proto b/proto/r4/core/extensions.proto index f9d089a8f..319a6c154 100644 --- a/proto/r4/core/extensions.proto +++ b/proto/r4/core/extensions.proto @@ -34,6 +34,8 @@ message ValueSetExpression { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-expression"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -51,6 +53,8 @@ message ValueSetExpandRules { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-expand-rules"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -81,6 +85,8 @@ message AllergyIntoleranceManagement { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/openEHR-management"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -98,6 +104,8 @@ message MimeType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/mimeType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -133,6 +141,8 @@ message ObservationCopyNumberEvent { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsCopyNumberEvent"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -150,6 +160,8 @@ message HumanNameOwnName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/humanname-own-name"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -167,6 +179,8 @@ message ValueSetConceptOrder { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-conceptOrder"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -184,6 +198,8 @@ message QuestionnaireDisplayCategory { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -201,6 +217,8 @@ message ResearchStudyExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/workflow-researchStudy"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -220,6 +238,8 @@ message FamilyMemberHistorySibling { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-sibling"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -245,6 +265,8 @@ message ValueSetCaseSensitive { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-caseSensitive"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -262,6 +284,8 @@ message PatientBirthPlace { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-birthPlace"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -279,6 +303,8 @@ message CodeSystemConceptComments { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-concept-comments"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -297,6 +323,8 @@ message ServiceRequestQuestionnaireRequest { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/servicerequest-questionnaireRequest"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -315,6 +343,8 @@ message AnimalSpecies { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/practitioner-animalSpecies"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -332,6 +362,8 @@ message HumanLanguage { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/language"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -349,6 +381,8 @@ message ElementDefinitionObjectClassProperty { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/11179-objectClassProperty"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -366,6 +400,8 @@ message ConditionOutcome { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/condition-outcome"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -383,6 +419,8 @@ message AddressADXPPostBox { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -400,6 +438,8 @@ message CodeSystemAlternate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-alternate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -425,6 +465,8 @@ message DiagnosticReportSummaryOf { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/diagnosticReport-summaryOf"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -443,6 +485,8 @@ message TargetBodyStructure { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/procedure-targetBodyStructure"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -461,6 +505,8 @@ message AddressADXPHouseNumber { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -478,6 +524,8 @@ message ValueSetExpandGroup { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-expand-group"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -505,6 +553,8 @@ message QuestionnaireResponseAuthor { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-author"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -528,6 +578,8 @@ message ContactPointTELAddress { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -545,6 +597,8 @@ message QuestionnaireResponseReviewer { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-reviewer"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -564,6 +618,8 @@ message StructureDefinitionTemplateStatus { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-template-status"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -594,6 +650,8 @@ message AuditEventMPPS { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/auditevent-MPPS"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -611,6 +669,8 @@ message BasicRecipientLanguage { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-recipientLanguage"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -628,6 +688,8 @@ message AllergyIntoleranceAdministration { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/openEHR-administration"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -646,6 +708,8 @@ message PatientInterpreterRequired { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -663,6 +727,8 @@ message ApproachBodyStructure { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/procedure-approachBodyStructure"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -681,6 +747,8 @@ message ValueSetSourceReference { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-sourceReference"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -698,6 +766,8 @@ message UsageContextGroup { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/usagecontext-group"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -715,6 +785,8 @@ message StringMarkdown { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/rendering-markdown"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -732,6 +804,8 @@ message EpisodeOfCareExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/workflow-episodeOfCare"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -750,6 +824,8 @@ message ElementDefinitionIsCommonBinding { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -767,6 +843,8 @@ message OperationOutcomeDetectedIssue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/operationoutcome-detectedIssue"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -785,6 +863,8 @@ message PermittedValueConceptmap { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -802,6 +882,8 @@ message CapabilityStatementOauthUris { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -833,6 +915,8 @@ message CapabilityStatementExpectation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -863,6 +947,8 @@ message ValueSetConceptDefinition { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-concept-definition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -880,6 +966,8 @@ message PatientMothersMaidenName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -897,6 +985,8 @@ message GoalReasonRejected { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/goal-reasonRejected"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -914,6 +1004,8 @@ message QuestionnaireSignatureRequired { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-signatureRequired"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -931,6 +1023,8 @@ message NutritionOrderDoNotPerform { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/request-doNotPerform"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -948,6 +1042,8 @@ message ElementDefinitionMinValueSet { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-minValueSet"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -974,6 +1070,8 @@ message ElementStyle { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/rendering-style"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -991,6 +1089,8 @@ message ValueSetLabel { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-label"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1008,6 +1108,8 @@ message AuditEventAccession { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/auditevent-Accession"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1026,6 +1128,8 @@ message ElementDefinitionEquivalence { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-equivalence"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1056,6 +1160,8 @@ message QuantityUncertaintyType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-uncertaintyType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1086,6 +1192,8 @@ message HumanNameAssemblyOrder { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/humanname-assembly-order"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1116,6 +1224,8 @@ message QuestionnaireReferenceFilter { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1133,6 +1243,8 @@ message PractitionerRolePrimaryInd { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/practitionerrole-primaryInd"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1150,6 +1262,8 @@ message ValueSetWarning { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-warning"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1167,6 +1281,8 @@ message ReasonReference { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/workflow-reasonReference"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1191,6 +1307,8 @@ message Risk { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/diagnosticReport-risk"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1209,6 +1327,8 @@ message Regex { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/regex"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1226,6 +1346,8 @@ message ValueSetSystemRef { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-systemRef"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1243,6 +1365,8 @@ message QuestionnaireOptionExclusive { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-optionExclusive"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1260,6 +1384,8 @@ message DiagnosticReportGlstring { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-glstring"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1283,6 +1409,8 @@ message AddressADXPCareOf { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-careOf"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1300,6 +1428,8 @@ message CodeSystemWorkflowStatus { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-workflowStatus"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1317,6 +1447,8 @@ message AddressADXPDeliveryInstallationQualifier { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationQualifier"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1334,6 +1466,8 @@ message AddressADXPUnitType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1351,6 +1485,8 @@ message PatientGenderIdentity { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-genderIdentity"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1368,6 +1504,8 @@ message ContactPointLocal { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/contactpoint-local"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1385,6 +1523,8 @@ message QuestionnaireSliderStepValue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-sliderStepValue"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1402,6 +1542,8 @@ message DiagnosticReportReplaces { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/diagnosticReport-replaces"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1420,6 +1562,8 @@ message ObservationDelta { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-delta"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1437,6 +1581,8 @@ message QuestionnaireReferenceResource { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1467,6 +1613,8 @@ message ElementDefinitionTranslatable { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1484,6 +1632,8 @@ message ElementDefinitionSelector { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-selector"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1502,6 +1652,10 @@ message AllergyIntoleranceSubstanceExposureRisk { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/allergyintolerance-substanceExposureRisk"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "substanceExposureRisk.exists() and code.empty()"; // Unique id for inter-element referencing String id = 1; @@ -1527,6 +1681,8 @@ message DeviceRequestPatientInstruction { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/devicerequest-patientInstruction"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1552,6 +1708,8 @@ message ElementBodyStructureReference { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/bodySite"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1570,6 +1728,8 @@ message TaskCandidateList { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/task-candidateList"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1594,6 +1754,8 @@ message ElementDefinitionMaxValueSet { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1620,6 +1782,8 @@ message ValueSetReference { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-reference"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1637,6 +1801,8 @@ message FlagPriority { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/flag-priority"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1654,6 +1820,8 @@ message AllergyIntoleranceCertainty { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/allergyintolerance-certainty"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1671,6 +1839,8 @@ message StructureDefinitionCodegenSuper { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-codegen-super"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1688,6 +1858,8 @@ message ConsentLocation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/consent-location"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1706,6 +1878,8 @@ message ResourceNullFlavor { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1736,6 +1910,8 @@ message CapabilityStatementCapabilities { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1766,6 +1942,8 @@ message ValueSetMap { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-map"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1783,6 +1961,8 @@ message ValueSetWorkflowStatus { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-workflowStatus"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1800,6 +1980,8 @@ message AllergyIntoleranceReasonRefuted { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/allergyintolerance-reasonRefuted"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1817,6 +1999,8 @@ message CodeSystemLabel { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-label"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1835,6 +2019,8 @@ message QuestionnaireResponseCompletionMode { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-completionMode"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1852,6 +2038,8 @@ message TimingDayOfMonth { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/timing-dayOfMonth"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1869,6 +2057,8 @@ message ValueSetExpirationDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-expirationDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1886,6 +2076,8 @@ message RelatedArtifactExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/workflow-relatedArtifact"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1903,6 +2095,8 @@ message ObservationTimeOffset { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-timeOffset"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1920,6 +2114,8 @@ message StructureDefinitionDependencies { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-dependencies"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1937,6 +2133,8 @@ message QuestionnaireChoiceOrientation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1967,6 +2165,8 @@ message AddressADXPStreetAddressLine { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetAddressLine"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -1984,6 +2184,8 @@ message ProcedureSchedule { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/procedure-schedule"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2002,6 +2204,8 @@ message DiagnosticReportLocationPerformed { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/diagnosticReport-locationPerformed"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2020,6 +2224,8 @@ message BasicInitiatingPerson { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-initiatingPerson"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2043,6 +2249,8 @@ message PatientNationality { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-nationality"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2066,6 +2274,8 @@ message PatientCadavericDonor { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-cadavericDonor"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2083,6 +2293,8 @@ message ConditionDueTo { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/condition-dueTo"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2115,6 +2327,8 @@ message ValueSetKeyWord { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-keyWord"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2132,6 +2346,8 @@ message AddressADXPDirection { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-direction"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2150,6 +2366,8 @@ message AuditEventParticipantObjectContainsStudy { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/auditevent-ParticipantObjectContainsStudy"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2167,6 +2385,8 @@ message AddressADXPAdditionalLocator { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-additionalLocator"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2184,6 +2404,8 @@ message CodeSystemConceptOrder { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-conceptOrder"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2202,6 +2424,8 @@ message CommunicationRequestInitiatingLocation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/communicationrequest-initiatingLocation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2220,6 +2444,8 @@ message ElementWg { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2250,6 +2476,8 @@ message TaskReplaces { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/task-replaces"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2268,6 +2496,8 @@ message ContactPointCountry { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/contactpoint-country"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2285,6 +2515,8 @@ message DirectedBy { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/procedure-directedBy"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2316,6 +2548,8 @@ message AttachmentCitation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-citation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2333,6 +2567,8 @@ message CodeSystemUsage { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-usage"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2358,6 +2594,8 @@ message AddressADXPStreetNameBase { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameBase"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2375,6 +2613,8 @@ message MaxSize { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/maxSize"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2392,6 +2632,8 @@ message AddressADXPDeliveryMode { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryMode"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2409,6 +2651,8 @@ message IdentifierValidDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/identifier-validDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2426,6 +2670,8 @@ message PatientCitizenship { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-citizenship"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2449,6 +2695,8 @@ message QuestionnaireBaseType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-baseType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2479,6 +2727,8 @@ message HumanNamePartnerName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/humanname-partner-name"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2497,6 +2747,8 @@ message LocationBoundaryGeojson { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/location-boundary-geojson"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2514,6 +2766,8 @@ message AuditEventSOPClass { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/auditevent-SOPClass"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2532,6 +2786,8 @@ message ValueSetActivityStatusDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-activityStatusDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2549,6 +2805,8 @@ message ObservationAllele { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsAllele"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2577,6 +2835,8 @@ message HumanNameMothersFamily { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/humanname-mothers-family"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2594,6 +2854,8 @@ message OrganizationPeriod { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/organization-period"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2611,6 +2873,8 @@ message EncounterReasonCancelled { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/encounter-reasonCancelled"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2628,6 +2892,8 @@ message EffectivePeriod { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/resource-effectivePeriod"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2645,6 +2911,8 @@ message ElementDefinitionDisplayHint { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2662,6 +2930,8 @@ message ObservationVariant { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsVariant"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2691,6 +2961,8 @@ message DiagnosticReportAnalysis { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAnalysis"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2715,6 +2987,8 @@ message EntryFormat { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/entryFormat"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2732,6 +3006,8 @@ message NutritionOrderReplaces { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/request-replaces"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2750,6 +3026,8 @@ message ValueSetDeprecated { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-deprecated"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2767,6 +3045,8 @@ message CodeSystemWarning { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-warning"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2785,6 +3065,8 @@ message QuestionnaireUsageMode { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-usageMode"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2815,6 +3097,8 @@ message AllergyIntoleranceTest { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/openEHR-test"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2836,6 +3120,8 @@ message BasicEncounterType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-encounterType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2853,6 +3139,8 @@ message AttachmentStrengthOfRecommendation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2870,6 +3158,8 @@ message ValueSetToocostly { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-toocostly"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2887,6 +3177,8 @@ message CodingSctdescid { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/coding-sctdescid"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2904,6 +3196,8 @@ message MessageHeaderMessageheaderResponseRequest { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/messageheader-response-request"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2934,6 +3228,8 @@ message DiagnosticReportItem { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/servicerequest-geneticsItem"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2965,6 +3261,8 @@ message ElementDefinitionProfileElement { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -2982,6 +3280,8 @@ message PatientReligion { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-religion"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3000,6 +3300,8 @@ message AddressADXPDeliveryInstallationType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3017,6 +3319,8 @@ message ValueSetRulesText { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-rules-text"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3034,6 +3338,8 @@ message ConditionRuledOut { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/condition-ruledOut"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3052,6 +3358,8 @@ message ElementDefinitionQuestion { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-question"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3069,6 +3377,8 @@ message CodeSystemReplacedby { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-replacedby"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3086,6 +3396,8 @@ message ResourcePertainsToGoal { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/resource-pertainsToGoal"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3104,6 +3416,8 @@ message DesignNote { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/designNote"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3121,6 +3435,8 @@ message QuestionnaireReferenceProfile { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceProfile"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3138,6 +3454,8 @@ message BasicEncounterClass { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-encounterClass"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3155,6 +3473,8 @@ message ElementRelativeDateTime { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-relativeDateTime"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3210,6 +3530,8 @@ message BundleHttpResponseHeader { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/http-response-header"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3228,6 +3550,8 @@ message FamilyMemberHistoryParent { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-parent"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3253,6 +3577,8 @@ message ElementNarrativeLink { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/narrativeLink"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3270,6 +3596,8 @@ message ElementDefinitionBindingName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3287,6 +3615,8 @@ message BundleMatchGrade { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/match-grade"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3317,6 +3647,8 @@ message ObservationReplaces { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-replaces"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3336,6 +3668,8 @@ message ElementDefinitionHierarchy { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3353,6 +3687,8 @@ message ListChangeBase { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/list-changeBase"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3371,6 +3707,8 @@ message CodeSystemOtherName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-otherName"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3395,6 +3733,8 @@ message AllergyIntoleranceLocation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/openEHR-location"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3412,6 +3752,8 @@ message OperationDefinitionProfile { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/operationdefinition-profile"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3429,6 +3771,8 @@ message AuditEventNumberOfInstances { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/auditevent-NumberOfInstances"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3446,6 +3790,8 @@ message ObservationSequelTo { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-sequelTo"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3464,6 +3810,8 @@ message AddressADXPDeliveryAddressLine { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryAddressLine"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3481,6 +3829,8 @@ message FamilyMemberHistoryAbatement { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/familymemberhistory-abatement"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3509,6 +3859,8 @@ message CapabilityStatementSearchParameterCombination { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3533,6 +3885,8 @@ message DiagnosticReportExtends { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/diagnosticReport-extends"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3551,6 +3905,8 @@ message QuestionnaireSupportLink { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3568,6 +3924,8 @@ message BasicInitiatingOrganization { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-initiatingOrganization"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3586,6 +3944,8 @@ message ElementFmm { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3603,6 +3963,8 @@ message AuditEventInstance { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/auditevent-Instance"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3620,6 +3982,8 @@ message ElementExpression { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-expression"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3637,6 +4001,8 @@ message CapabilityStatementWebsocket { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/capabilitystatement-websocket"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3654,6 +4020,8 @@ message ConditionOccurredFollowing { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/condition-occurredFollowing"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3686,6 +4054,8 @@ message QuestionnaireItemControl { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3703,6 +4073,8 @@ message ValueSetUnclosed { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-unclosed"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3720,6 +4092,8 @@ message ResourcePreferred { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-preferred"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3737,6 +4111,8 @@ message AllergyIntoleranceAssertedDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/allergyintolerance-assertedDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3754,6 +4130,8 @@ message AllergyIntoleranceExposureDuration { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/openEHR-exposureDuration"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3771,6 +4149,8 @@ message ElementDefinitionBestpractice { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3797,6 +4177,8 @@ message QuestionnaireConstraint { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3848,6 +4230,8 @@ message PatientAdoptionInfo { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-adoptionInfo"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3865,6 +4249,8 @@ message EncounterModeOfArrival { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3882,6 +4268,8 @@ message ValueSetTrustedExpansion { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-trusted-expansion"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3900,6 +4288,8 @@ message ElementStandardsStatus { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3930,6 +4320,8 @@ message LastReviewDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/resource-lastReviewDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3947,6 +4339,8 @@ message ObservationGene { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3964,6 +4358,8 @@ message CodeSystemAuthor { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-author"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -3981,6 +4377,8 @@ message BasicReceivingPerson { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-receivingPerson"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4004,6 +4402,8 @@ message ServiceRequestPerformerOrder { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/request-performerOrder"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4021,6 +4421,8 @@ message ProcedureCausedBy { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/procedure-causedBy"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4051,6 +4453,8 @@ message ValueSetConceptComments { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-concept-comments"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4068,6 +4472,8 @@ message ObservationFocusCode { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-focusCode"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4085,6 +4491,8 @@ message AddressADXPDelimiter { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-delimiter"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4102,6 +4510,8 @@ message QuestionnaireFhirType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4120,6 +4530,8 @@ message ElementDefinitionInheritedExtensibleValueSet { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-inheritedExtensibleValueSet"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4147,6 +4559,8 @@ message AddressADXPBuildingNumberSuffix { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-buildingNumberSuffix"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4164,6 +4578,8 @@ message ValueSetExtensible { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-extensible"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4181,6 +4597,8 @@ message StatusReasonExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/request-statusReason"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4198,6 +4616,8 @@ message CanonicalDisplayName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/display"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4215,6 +4635,8 @@ message PatientCongregation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-congregation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4232,6 +4654,8 @@ message AllergyIntoleranceExposureDescription { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/openEHR-exposureDescription"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4249,6 +4673,8 @@ message PatientRelatedPerson { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-relatedPerson"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4267,6 +4693,8 @@ message QuestionnaireUnit { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-unit"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4284,6 +4712,8 @@ message HumanNameENUse { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-EN-use"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4314,6 +4744,8 @@ message MinLength { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/minLength"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4331,6 +4763,8 @@ message CodeSystemHistory { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-history"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4381,6 +4815,8 @@ message PerformerFunction { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/event-performerFunction"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4398,6 +4834,8 @@ message BasicSystemUserLanguage { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-systemUserLanguage"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4416,6 +4854,8 @@ message ObservationGenomicSourceClass { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4434,6 +4874,8 @@ message DiagnosticReportFamilyMemberHistory { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsFamilyMemberHistory"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4452,6 +4894,8 @@ message ElementCalculatedValue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-calculatedValue"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4469,6 +4913,8 @@ message CompositionSectionSubject { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/composition-section-subject"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4487,6 +4933,8 @@ message ObservationPrecondition { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-precondition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4505,6 +4953,8 @@ message CompositionValidityPeriod { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqm-ValidityPeriod"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4523,6 +4973,8 @@ message CompositionOtherConfidentiality { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-otherConfidentiality"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4540,6 +4992,8 @@ message QuestionnaireMaxValue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/maxValue"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4570,6 +5024,8 @@ message PatientAnimal { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-animal"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4597,6 +5053,8 @@ message PatientDisability { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-disability"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4614,6 +5072,8 @@ message HumanNameOwnPrefix { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/humanname-own-prefix"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4631,6 +5091,8 @@ message CodeSystemSourceReference { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-sourceReference"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4648,6 +5110,8 @@ message StringXhtml { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/rendering-xhtml"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4666,6 +5130,8 @@ message FamilyMemberHistoryObservation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-observation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4684,6 +5150,8 @@ message StructureDefinitionAncestor { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-ancestor"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4701,6 +5169,8 @@ message EncounterAssociatedEncounter { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/encounter-associatedEncounter"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4719,6 +5189,8 @@ message DiagnosticReportAddendumOf { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/diagnosticReport-addendumOf"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4737,6 +5209,8 @@ message ElementInitialValue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-initialValue"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4754,6 +5228,8 @@ message ConditionAssertedDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/condition-assertedDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4771,6 +5247,8 @@ message Namespace { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4788,6 +5266,8 @@ message ElementDefinitionJsonType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4805,6 +5285,8 @@ message ProcedureIncisionDateTime { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/procedure-incisionDateTime"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4822,6 +5304,8 @@ message StatusReason { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/event-statusReason"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4839,6 +5323,8 @@ message HumanNameENQualifier { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4869,6 +5355,8 @@ message QuestionnaireMinOccurs { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4886,6 +5374,8 @@ message Replaces { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/replaces"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4904,6 +5394,8 @@ message ValueSetAuthoritativeSource { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-authoritativeSource"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4921,6 +5413,8 @@ message SpecimenCollectionPriority { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/specimen-collectionPriority"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4938,6 +5432,8 @@ message ValueSetSupplement { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-supplement"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4955,6 +5451,8 @@ message AddressADXPUnitID { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitID"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4973,6 +5471,8 @@ message OrganizationAffiliationPrimaryInd { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/organizationaffiliation-primaryInd"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -4990,6 +5490,8 @@ message MaxDecimalPlaces { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5008,6 +5510,8 @@ message AddressADXPDeliveryInstallationArea { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationArea"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5025,6 +5529,8 @@ message AddressADXPStreetName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5042,6 +5548,8 @@ message InstantiatesUri { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/workflow-instantiatesUri"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5059,6 +5567,8 @@ message EventHistory { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/event-eventHistory"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5077,6 +5587,8 @@ message OperationOutcomeIssueSource { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-source"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5094,6 +5606,8 @@ message ValueSetUsage { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-usage"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5119,6 +5633,8 @@ message BasicSystemUserTaskContext { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-systemUserTaskContext"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5136,6 +5652,8 @@ message ProcedureMethod { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/procedure-method"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5154,6 +5672,8 @@ message DiagnosticReportReferences { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsReferences"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5180,6 +5700,8 @@ message StructureDefinitionCategory { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-category"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5197,6 +5719,8 @@ message SpecimenProcessingTime { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/specimen-processingTime"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5223,6 +5747,8 @@ message SpecimenSpecialHandling { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/specimen-specialHandling"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5240,6 +5766,8 @@ message InstantiatesCanonical { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/workflow-instantiatesCanonical"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5258,6 +5786,8 @@ message SpecimenSequenceNumber { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/specimen-sequenceNumber"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5275,6 +5805,8 @@ message BundleLocationDistance { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/location-distance"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5292,6 +5824,8 @@ message ValueSetParameterSource { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-parameterSource"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5332,6 +5866,8 @@ message ObservationSecondaryFinding { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-secondaryFinding"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5349,6 +5885,8 @@ message StringSCCoding { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5367,6 +5905,8 @@ message FamilyMemberHistoryPatientRecord { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/familymemberhistory-patient-record"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5385,6 +5925,8 @@ message ServiceRequestPrecondition { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/servicerequest-precondition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5403,6 +5945,8 @@ message StructureDefinitionNormativeVersion { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5433,6 +5977,8 @@ message ConsentWitness { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/consent-Witness"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5457,6 +6003,8 @@ message DiagnosticReportAssessedCondition { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAssessedCondition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5475,6 +6023,8 @@ message ElementDefinitionAllowedUnits { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5501,6 +6051,8 @@ message RenderedValue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/rendered-value"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5518,6 +6070,8 @@ message DeviceImplantStatus { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/device-implantStatus"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5549,6 +6103,8 @@ message ObservationInterpretation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsInterpretation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5567,6 +6123,8 @@ message ValueSetAuthor { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-author"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5584,6 +6142,8 @@ message ValueSetSystem { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-system"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5601,6 +6161,8 @@ message AllergyIntoleranceExposureDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/openEHR-exposureDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5618,6 +6180,8 @@ message AllergyIntoleranceDuration { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/allergyintolerance-duration"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5635,6 +6199,8 @@ message ElementStyleSensitive { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/rendering-styleSensitive"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5652,6 +6218,8 @@ message CodeSystemTrustedExpansion { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-trusted-expansion"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5670,6 +6238,8 @@ message DiagnosticReportMethod { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-method"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5687,6 +6257,8 @@ message AddressADXPPrecinct { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-precinct"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5705,6 +6277,8 @@ message ObservationAminoAcidChange { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsAminoAcidChange"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5728,6 +6302,8 @@ message QuestionnaireOptionPrefix { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-optionPrefix"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5745,6 +6321,8 @@ message OrganizationPreferredContact { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/organization-preferredContact"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5763,6 +6341,8 @@ message ElementDefinitionBestpracticeExplanation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5780,6 +6360,8 @@ message AddressADUse { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-AD-use"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5810,6 +6392,8 @@ message PatientProficiency { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-proficiency"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5833,6 +6417,8 @@ message ElementOriginalText { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/originalText"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5850,6 +6436,8 @@ message Translation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/translation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5883,6 +6471,8 @@ message GoalRelationship { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/goal-relationship"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5908,6 +6498,8 @@ message ElementDefinitionObjectClass { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/11179-objectClass"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5925,6 +6517,8 @@ message HumanNamePartnerPrefix { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/humanname-partner-prefix"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5943,6 +6537,8 @@ message StructureDefinitionSecurityCategory { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -5973,6 +6569,8 @@ message ElementDataAbsentReason { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/data-absent-reason"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6003,6 +6601,8 @@ message AllergyIntoleranceResolutionAge { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/allergyintolerance-resolutionAge"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6020,6 +6620,8 @@ message AllergyIntoleranceCareplan { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/openEHR-careplan"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6038,6 +6640,8 @@ message TimingExact { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/timing-exact"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6055,6 +6659,8 @@ message CodeSystemKeyWord { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-keyWord"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6072,6 +6678,8 @@ message PlanDefinitionCdsHooksEndpoint { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-cdsHooksEndpoint"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6089,6 +6697,8 @@ message StructureDefinitionSummary { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-summary"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6106,6 +6716,8 @@ message CapabilityStatementProhibited { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/capabilitystatement-prohibited"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6123,6 +6735,8 @@ message ObservationDNARegionName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6140,6 +6754,8 @@ message HumanNameFathersFamily { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/humanname-fathers-family"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6157,6 +6773,8 @@ message ReasonCode { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/workflow-reasonCode"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6174,6 +6792,8 @@ message FlagDetail { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/flag-detail"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6192,6 +6812,8 @@ message SupportingInfo { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/workflow-supportingInfo"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6210,6 +6832,8 @@ message NutritionOrderInsurance { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/request-insurance"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6231,6 +6855,8 @@ message ValueSetExpansionSource { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-expansionSource"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6248,6 +6874,8 @@ message AttachmentQualityOfEvidence { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6265,6 +6893,8 @@ message ConsentTranscriber { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/consent-Transcriber"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6289,6 +6919,8 @@ message AddressADXPDeliveryModeIdentifier { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryModeIdentifier"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6306,6 +6938,8 @@ message ValueSetSystemName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-systemName"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6323,6 +6957,8 @@ message DecimalPrecision { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/quantity-precision"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6340,6 +6976,8 @@ message QuestionnaireResponseSignature { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6357,6 +6995,8 @@ message QuestionnaireUnitValueSet { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-unitValueSet"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6374,6 +7014,8 @@ message ConditionRelated { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/condition-related"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6392,6 +7034,8 @@ message CodeSystemMap { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-map"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6409,6 +7053,8 @@ message DateTimezoneOffset { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/tz-offset"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6427,6 +7073,8 @@ message StructureDefinitionFmmNoWarnings { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-no-warnings"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6444,6 +7092,8 @@ message ConceptMapBidirectional { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/concept-bidirectional"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6461,6 +7111,8 @@ message ValueSetOtherName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-otherName"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6485,6 +7137,8 @@ message QuantityUncertainty { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-uncertainty"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6502,6 +7156,8 @@ message ValueSetEffectiveDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-effectiveDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6519,6 +7175,8 @@ message PermittedValueValueset { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/11179-permitted-value-valueset"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6536,6 +7194,8 @@ message AuditEventAnonymized { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/auditevent-Anonymized"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6553,6 +7213,8 @@ message ElementDefinitionIdentifier { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-identifier"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6570,6 +7232,8 @@ message DiagnosticReportHaploid { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-haploid"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6596,6 +7260,8 @@ message OperationOutcomeAuthority { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/operationoutcome-authority"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6613,6 +7279,8 @@ message QuestionnaireMinValue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/minValue"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6642,6 +7310,8 @@ message StructureDefinitionTableName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-table-name"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6660,6 +7330,8 @@ message CapabilityStatementSupportedSystem { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/capabilitystatement-supported-system"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6677,6 +7349,8 @@ message QuestionnaireResponseReason { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-reason"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6694,6 +7368,8 @@ message BasicReceivingOrganization { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-receivingOrganization"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6713,6 +7389,8 @@ message CompositionVersionNumber { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-versionNumber"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6731,6 +7409,8 @@ message ElementDefinitionExplicitTypeName { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6748,6 +7428,8 @@ message HumanNameENRepresentation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6779,6 +7461,8 @@ message ObservationSpecimenCode { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-specimenCode"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6796,6 +7480,8 @@ message DaysOfCycle { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6817,6 +7503,8 @@ message ConsentNotificationEndpoint { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/consent-NotificationEndpoint"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6834,6 +7522,8 @@ message ElementMeasureInfo { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-measureInfo"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6860,6 +7550,8 @@ message ObservationAncestry { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsAncestry"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6889,6 +7581,8 @@ message AddressADXPHouseNumberNumeric { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumberNumeric"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6906,6 +7600,8 @@ message StructureDefinitionXmlNoOrder { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6923,6 +7619,8 @@ message BodyPosition { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-bodyPosition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6940,6 +7638,8 @@ message AddressADXPStreetNameType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6957,6 +7657,8 @@ message AuditEventEncrypted { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/auditevent-Encrypted"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -6975,6 +7677,8 @@ message StructureDefinitionApplicableVersion { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-applicable-version"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7005,6 +7709,8 @@ message AddressADXPCensusTract { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-censusTract"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7022,6 +7728,8 @@ message PartOf { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/event-partOf"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7040,6 +7748,8 @@ message ObservationReagent { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-reagent"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7058,6 +7768,8 @@ message BasicSystemUserType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-systemUserType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7075,6 +7787,8 @@ message ElementDefinitionRdfType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7093,6 +7807,8 @@ message DiagnosticReportAlleleDatabase { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-allele-database"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7110,6 +7826,8 @@ message PatientBirthTime { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-birthTime"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7127,6 +7845,8 @@ message QuestionnaireHidden { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7144,6 +7864,8 @@ message ElementDefinitionXmlType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7161,6 +7883,8 @@ message QuestionnaireUnitOption { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7178,6 +7902,8 @@ message ProcedureProgressStatus { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/procedure-progressStatus"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7195,6 +7921,8 @@ message FamilyMemberHistorySeverity { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/familymemberhistory-severity"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7212,6 +7940,8 @@ message RelevantHistory { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/request-relevantHistory"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7230,6 +7960,8 @@ message FamilyMemberHistoryType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/familymemberhistory-type"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7247,6 +7979,8 @@ message ElementLibrary { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-library"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7264,6 +7998,8 @@ message ApprovalDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/resource-approvalDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7281,6 +8017,8 @@ message ValueSetSteward { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-steward"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7298,6 +8036,8 @@ message BasicRecipientType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-recipientType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7315,6 +8055,8 @@ message AddressGeolocation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/geolocation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7340,6 +8082,8 @@ message SpecialStatus { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/valueset-special-status"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7357,6 +8101,8 @@ message ContactPointArea { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/contactpoint-area"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7374,6 +8120,8 @@ message ConditionBasedOn { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/event-basedOn"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7392,6 +8140,8 @@ message LocationExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/event-location"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7410,6 +8160,8 @@ message ObservationGatewayDevice { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-gatewayDevice"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7428,6 +8180,8 @@ message GoalAcceptance { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/goal-acceptance"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7468,6 +8222,8 @@ message TimezoneCode { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/tz-code"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7502,6 +8258,8 @@ message PatientPreferenceType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-preferenceType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7519,6 +8277,8 @@ message QuestionnaireVariable { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/variable"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7537,6 +8297,8 @@ message NutritionOrderAdaptiveFeedingDevice { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/nutritionorder-adaptiveFeedingDevice"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7555,6 +8317,8 @@ message ObservationDeviceCode { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-deviceCode"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7572,6 +8336,8 @@ message CarePlanActivityTitle { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/careplan-activity-title"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7589,6 +8355,8 @@ message QuantityPQTranslation { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/iso21090-PQ-translation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7606,6 +8374,8 @@ message OrdinalValue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ordinalValue"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7623,6 +8393,8 @@ message RelativeDateCriteria { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/relative-date"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7675,6 +8447,8 @@ message CodeSystemEffectiveDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-effectiveDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7692,6 +8466,8 @@ message ParametersFullUrl { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/parameters-fullUrl"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7709,6 +8485,8 @@ message CommunicationMedia { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/communication-media"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7726,6 +8504,8 @@ message PatientImportance { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/patient-importance"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7743,6 +8523,8 @@ message SpecimenIsDryWeight { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/specimen-isDryWeight"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7760,6 +8542,8 @@ message ObservationPhaseSet { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsPhaseSet"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7789,6 +8573,8 @@ message CodeSystemExpirationDate { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/codesystem-expirationDate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7806,6 +8592,8 @@ message ContactPointExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/contactpoint-extension"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; @@ -7823,6 +8611,8 @@ message QuestionnaireMaxOccurs { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing String id = 1; diff --git a/proto/r4/core/profiles/actual_group.proto b/proto/r4/core/profiles/actual_group.proto index b7ff53ded..57475c75e 100644 --- a/proto/r4/core/profiles/actual_group.proto +++ b/proto/r4/core/profiles/actual_group.proto @@ -34,6 +34,8 @@ message ActualGroup { "http://hl7.org/fhir/StructureDefinition/Group"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/actualgroup"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "member.empty() or (actual = true)"; // Logical id of this artifact Id id = 1; @@ -139,7 +141,5 @@ message ActualGroup { // If member is no longer in group Boolean inactive = 6; } - repeated Member member = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Member member = 19; } diff --git a/proto/r4/core/profiles/cds_hooks_guidance_response.proto b/proto/r4/core/profiles/cds_hooks_guidance_response.proto index 9d611dfa4..8f81e64e2 100644 --- a/proto/r4/core/profiles/cds_hooks_guidance_response.proto +++ b/proto/r4/core/profiles/cds_hooks_guidance_response.proto @@ -155,8 +155,6 @@ message CDSHooksGuidanceResponse { (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/cqf-cdsHooksEndpoint", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/cds_hooks_request_group.proto b/proto/r4/core/profiles/cds_hooks_request_group.proto index bee2d1434..a7b6d5d0f 100644 --- a/proto/r4/core/profiles/cds_hooks_request_group.proto +++ b/proto/r4/core/profiles/cds_hooks_request_group.proto @@ -175,6 +175,9 @@ message CDSHooksRequestGroup { // Proposed actions, if any message Action { + option (.google.fhir.proto.fhir_path_message_constraint) = + "resource.exists() != action.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -252,9 +255,7 @@ message CDSHooksRequestGroup { // Boolean-valued expression Expression expression = 5; } - repeated Condition condition = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Condition condition = 11; // Relationship to another action message RelatedAction { @@ -301,9 +302,7 @@ message CDSHooksRequestGroup { } OffsetX offset = 6; } - repeated RelatedAction related_action = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedAction related_action = 12; // When the action should take place message TimingX { @@ -424,10 +423,5 @@ message CDSHooksRequestGroup { // Sub action repeated Action action = 22; } - repeated Action action = 27 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "resource.exists() != action.exists()" - ]; + repeated Action action = 27; } diff --git a/proto/r4/core/profiles/cds_hooks_service_plan_definition.proto b/proto/r4/core/profiles/cds_hooks_service_plan_definition.proto index 46e063ea8..abc32741f 100644 --- a/proto/r4/core/profiles/cds_hooks_service_plan_definition.proto +++ b/proto/r4/core/profiles/cds_hooks_service_plan_definition.proto @@ -35,6 +35,8 @@ message CDSHooksServicePlanDefinition { "http://hl7.org/fhir/StructureDefinition/PlanDefinition"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cdshooksserviceplandefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -234,13 +236,9 @@ message CDSHooksServicePlanDefinition { // Reach goal within Duration due = 6; } - repeated Target target = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Target target = 10; } - repeated Goal goal = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Goal goal = 39; // Action defined by the plan message Action { @@ -342,9 +340,7 @@ message CDSHooksServicePlanDefinition { // Boolean-valued expression Expression expression = 5; } - repeated Condition condition = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Condition condition = 15; // Input data requirements repeated DataRequirement input = 16; @@ -397,9 +393,7 @@ message CDSHooksServicePlanDefinition { } OffsetX offset = 6; } - repeated RelatedAction related_action = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedAction related_action = 18; // When the action should take place message TimingX { @@ -448,9 +442,7 @@ message CDSHooksServicePlanDefinition { // E.g. Nurse, Surgeon, Parent CodeableConcept role = 5; } - repeated Participant participant = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 20; // create | update | remove | fire-event CodeableConcept type = 21; @@ -571,24 +563,18 @@ message CDSHooksServicePlanDefinition { // An expression that provides the dynamic value for the customization Expression expression = 5; } - repeated DynamicValue dynamic_value = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DynamicValue dynamic_value = 29; // A sub-action repeated Action action = 30; } - repeated Action action = 40 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Action action = 40; // Service endpoint Uri cds_hooks_endpoint = 41 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/cqf-cdsHooksEndpoint", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/cholesterol.proto b/proto/r4/core/profiles/cholesterol.proto index 3ede93fbe..3986fae35 100644 --- a/proto/r4/core/profiles/cholesterol.proto +++ b/proto/r4/core/profiles/cholesterol.proto @@ -34,6 +34,10 @@ message Cholesterol { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cholesterol"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact Id id = 1; @@ -189,6 +193,9 @@ message Cholesterol { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -204,8 +211,6 @@ message Cholesterol { // A fixed quantity (no comparator) SimpleQuantity high = 5 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "code.empty() or system.exists()", (.google.fhir.proto.fhir_path_constraint) = "comparator.empty()" @@ -223,13 +228,8 @@ message Cholesterol { // Text based reference range in an observation String text = 9; } - ReferenceRange reference_range = 30 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + ReferenceRange reference_range = 30 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Observation.hasMember not present on profile. reserved 31; @@ -281,7 +281,5 @@ message Cholesterol { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; } diff --git a/proto/r4/core/profiles/clinical_document.proto b/proto/r4/core/profiles/clinical_document.proto index e60622bfb..04ea269e2 100644 --- a/proto/r4/core/profiles/clinical_document.proto +++ b/proto/r4/core/profiles/clinical_document.proto @@ -181,9 +181,7 @@ message ClinicalDocument { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated Attester attester = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Attester attester = 20; // Organization which maintains the composition Reference custodian = 21 @@ -231,9 +229,7 @@ message ClinicalDocument { TargetX target = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated RelatesTo relates_to = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatesTo relates_to = 22; // The clinical service(s) being documented message Event { @@ -256,12 +252,15 @@ message ClinicalDocument { repeated Reference detail = 6 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Event event = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Event event = 23; // Composition is broken into sections message Section { + option (.google.fhir.proto.fhir_path_message_constraint) = + "text.exists() or entry.exists() or section.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "emptyReason.empty() or entry.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -325,21 +324,12 @@ message ClinicalDocument { // Nested Section repeated Section section = 13; } - repeated Section section = 24 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "text.exists() or entry.exists() or section.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "emptyReason.empty() or entry.empty()" - ]; + repeated Section section = 24; // Version-specific identifier for composition repeated String version_number = 25 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-versionNumber", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/computable_plan_definition.proto b/proto/r4/core/profiles/computable_plan_definition.proto index 2627f8162..e706f7817 100644 --- a/proto/r4/core/profiles/computable_plan_definition.proto +++ b/proto/r4/core/profiles/computable_plan_definition.proto @@ -35,6 +35,8 @@ message ComputablePlanDefinition { "http://hl7.org/fhir/StructureDefinition/PlanDefinition"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/computableplandefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -235,13 +237,9 @@ message ComputablePlanDefinition { // Reach goal within Duration due = 6; } - repeated Target target = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Target target = 10; } - repeated Goal goal = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Goal goal = 39; // Action defined by the plan message Action { @@ -343,9 +341,7 @@ message ComputablePlanDefinition { // Boolean-valued expression Expression expression = 5; } - repeated Condition condition = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Condition condition = 15; // Input data requirements repeated DataRequirement input = 16; @@ -398,9 +394,7 @@ message ComputablePlanDefinition { } OffsetX offset = 6; } - repeated RelatedAction related_action = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedAction related_action = 18; // When the action should take place message TimingX { @@ -449,9 +443,7 @@ message ComputablePlanDefinition { // E.g. Nurse, Surgeon, Parent CodeableConcept role = 5; } - repeated Participant participant = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 20; // create | update | remove | fire-event CodeableConcept type = 21; @@ -572,14 +564,10 @@ message ComputablePlanDefinition { // An expression that provides the dynamic value for the customization Expression expression = 5; } - repeated DynamicValue dynamic_value = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DynamicValue dynamic_value = 29; // A sub-action repeated Action action = 30; } - repeated Action action = 40 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Action action = 40; } diff --git a/proto/r4/core/profiles/cqf_questionnaire.proto b/proto/r4/core/profiles/cqf_questionnaire.proto index 669803940..b34538c6e 100644 --- a/proto/r4/core/profiles/cqf_questionnaire.proto +++ b/proto/r4/core/profiles/cqf_questionnaire.proto @@ -35,6 +35,10 @@ message CQFQuestionnaire { "http://hl7.org/fhir/StructureDefinition/Questionnaire"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqf-questionnaire"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "descendants().linkId.isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -157,6 +161,29 @@ message CQFQuestionnaire { // Questions and sections within the Questionnaire message Item { + option (.google.fhir.proto.fhir_path_message_constraint) = + "type!='display' or readOnly.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type!='group' and type!='display') or initial.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type!='display' or (required.empty() and repeats.empty())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type ='choice' or type = 'open-choice' or type = 'decimal' or type = 'integer' or type = 'date' or type = 'dateTime' or type = 'time' or type = 'string' or type = 'quantity') or (answerValueSet.empty() and answerOption.empty())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "answerOption.empty() or answerValueSet.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type!='display' or code.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type in ('boolean' | 'decimal' | 'integer' | 'string' | 'text' | 'url' | 'open-choice')) or maxLength.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type='group' implies item.empty().not()) and (type.trace('type')='display' implies item.trace('item').empty())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "repeats=true or initial.count() <= 1"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "answerOption.empty() or initial.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "enableWhen.count() > 2 implies enableBehavior.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -202,6 +229,9 @@ message CQFQuestionnaire { // Only allow data when message EnableWhen { + option (.google.fhir.proto.fhir_path_message_constraint) = + "operator = 'exists' implies (answer is Boolean)"; + // Unique id for inter-element referencing String id = 1; @@ -254,12 +284,7 @@ message CQFQuestionnaire { AnswerX answer = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated EnableWhen enable_when = 10 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "operator = 'exists' implies (answer is Boolean)" - ]; + repeated EnableWhen enable_when = 10; // all | any message EnableBehaviorCode { @@ -324,9 +349,7 @@ message CQFQuestionnaire { // Whether option is selected by default Boolean initial_selected = 5; } - repeated AnswerOption answer_option = 17 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AnswerOption answer_option = 17; // Initial value(s) when item is first rendered message Initial { @@ -362,46 +385,17 @@ message CQFQuestionnaire { ValueX value = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Initial initial = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Initial initial = 18; // Nested questionnaire items repeated Item item = 19; } - repeated Item item = 31 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "type!='display' or readOnly.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "(type!='group' and type!='display') or initial.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "type!='display' or (required.empty() and repeats.empty())", - (.google.fhir.proto.fhir_path_constraint) = - "(type ='choice' or type = 'open-choice' or type = 'decimal' or type = 'integer' or type = 'date' or type = 'dateTime' or type = 'time' or type = 'string' or type = 'quantity') or (answerValueSet.empty() and answerOption.empty())", - (.google.fhir.proto.fhir_path_constraint) = - "answerOption.empty() or answerValueSet.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "type!='display' or code.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "(type in ('boolean' | 'decimal' | 'integer' | 'string' | 'text' | 'url' | 'open-choice')) or maxLength.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "(type='group' implies item.empty().not()) and (type.trace('type')='display' implies item.trace('item').empty())", - (.google.fhir.proto.fhir_path_constraint) = - "repeats=true or initial.count() <= 1", - (.google.fhir.proto.fhir_path_constraint) = - "answerOption.empty() or initial.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "enableWhen.count() > 2 implies enableBehavior.exists()" - ]; + repeated Item item = 31; // A library containing logic referenced by the questionnaire repeated Canonical library = 32 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/cqf-library", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/cql_library.proto b/proto/r4/core/profiles/cql_library.proto index 098835acf..aee64b068 100644 --- a/proto/r4/core/profiles/cql_library.proto +++ b/proto/r4/core/profiles/cql_library.proto @@ -34,6 +34,8 @@ message CQLLibrary { "http://hl7.org/fhir/StructureDefinition/Library"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/cqllibrary"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/profiles/data_element_constraint_on_element_definition_data_type.proto b/proto/r4/core/profiles/data_element_constraint_on_element_definition_data_type.proto index f472f4584..c018b3a5f 100644 --- a/proto/r4/core/profiles/data_element_constraint_on_element_definition_data_type.proto +++ b/proto/r4/core/profiles/data_element_constraint_on_element_definition_data_type.proto @@ -34,6 +34,32 @@ message DataElementConstraintOnElementDefinitionDataType { "http://hl7.org/fhir/StructureDefinition/ElementDefinition"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-de"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "min.empty() or max.empty() or (max = '*') or iif(max != '*', min <= max.toInteger())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "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())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "pattern.empty() or (type.count() <= 1)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "fixed.empty() or (type.count() <= 1)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "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()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "sliceIsConstraining.exists() implies sliceName.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "pattern.empty() or fixed.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "constraint.select(key).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type.select(code).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "sliceName.empty() or sliceName.matches('^[a-zA-Z0-9\\\\/\\\\-_\\\\[\\\\]\\\\@]+$')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "defaultValue.empty() or meaningWhenMissing.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "isModifier implies isModifierReason.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "path.matches('[A-Za-z][A-Za-z0-9]*(\\\\.[a-z][A-Za-z0-9]*(\\\\[x])?)*')"; // Unique id for inter-element referencing String id = 1; @@ -108,14 +134,18 @@ message DataElementConstraintOnElementDefinitionDataType { String max = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Base base = 18 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Base base = 18; // ElementDefinition.contentReference not present on profile. reserved 19; // Data type and Profile for this element message TypeRef { + option (.google.fhir.proto.fhir_path_message_constraint) = + "aggregation.empty() or (code = 'Reference')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(code='Reference' or code = 'canonical') or targetProfile.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -153,14 +183,7 @@ message DataElementConstraintOnElementDefinitionDataType { } VersioningCode versioning = 7; } - repeated TypeRef type = 20 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "aggregation.empty() or (code = 'Reference')", - (.google.fhir.proto.fhir_path_constraint) = - "(code='Reference' or code = 'canonical') or targetProfile.empty()" - ]; + repeated TypeRef type = 20; // Specified value if missing from instance message DefaultValueX { @@ -303,9 +326,7 @@ message DataElementConstraintOnElementDefinitionDataType { ValueX value = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Example example = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Example example = 26; // Minimum Allowed Value (for some types) message MinValueX { @@ -351,6 +372,9 @@ message DataElementConstraintOnElementDefinitionDataType { // Condition that must evaluate to true message Constraint { + option (.google.fhir.proto.fhir_path_message_constraint) = + "expression.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -394,11 +418,7 @@ message DataElementConstraintOnElementDefinitionDataType { // Reference to original source of constraint Canonical source = 9; } - repeated Constraint constraint = 31 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = "expression.exists()" - ]; + repeated Constraint constraint = 31; // If the element must be supported Boolean must_support = 32; @@ -414,6 +434,9 @@ message DataElementConstraintOnElementDefinitionDataType { // ValueSet details if this is coded message ElementDefinitionBinding { + option (.google.fhir.proto.fhir_path_message_constraint) = + "valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https') or valueSet.startsWith('urn:'))"; + // Unique id for inter-element referencing String id = 1; @@ -444,12 +467,7 @@ message DataElementConstraintOnElementDefinitionDataType { // Source of value set Canonical value_set = 5; } - ElementDefinitionBinding binding = 36 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https') or valueSet.startsWith('urn:'))" - ]; + ElementDefinitionBinding binding = 36; // Map element to another set of definitions message Mapping { @@ -491,9 +509,7 @@ message DataElementConstraintOnElementDefinitionDataType { // Comments about the mapping or its use String comment = 6; } - repeated Mapping mapping = 37 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Mapping mapping = 37; // Prompt for element phrased as question repeated String question = 38 [ diff --git a/proto/r4/core/profiles/datatypes.proto b/proto/r4/core/profiles/datatypes.proto index f472f4584..c018b3a5f 100644 --- a/proto/r4/core/profiles/datatypes.proto +++ b/proto/r4/core/profiles/datatypes.proto @@ -34,6 +34,32 @@ message DataElementConstraintOnElementDefinitionDataType { "http://hl7.org/fhir/StructureDefinition/ElementDefinition"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/elementdefinition-de"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "min.empty() or max.empty() or (max = '*') or iif(max != '*', min <= max.toInteger())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "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())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "pattern.empty() or (type.count() <= 1)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "fixed.empty() or (type.count() <= 1)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "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()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "sliceIsConstraining.exists() implies sliceName.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "pattern.empty() or fixed.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "constraint.select(key).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type.select(code).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "sliceName.empty() or sliceName.matches('^[a-zA-Z0-9\\\\/\\\\-_\\\\[\\\\]\\\\@]+$')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "defaultValue.empty() or meaningWhenMissing.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "isModifier implies isModifierReason.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "path.matches('[A-Za-z][A-Za-z0-9]*(\\\\.[a-z][A-Za-z0-9]*(\\\\[x])?)*')"; // Unique id for inter-element referencing String id = 1; @@ -108,14 +134,18 @@ message DataElementConstraintOnElementDefinitionDataType { String max = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Base base = 18 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Base base = 18; // ElementDefinition.contentReference not present on profile. reserved 19; // Data type and Profile for this element message TypeRef { + option (.google.fhir.proto.fhir_path_message_constraint) = + "aggregation.empty() or (code = 'Reference')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(code='Reference' or code = 'canonical') or targetProfile.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -153,14 +183,7 @@ message DataElementConstraintOnElementDefinitionDataType { } VersioningCode versioning = 7; } - repeated TypeRef type = 20 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "aggregation.empty() or (code = 'Reference')", - (.google.fhir.proto.fhir_path_constraint) = - "(code='Reference' or code = 'canonical') or targetProfile.empty()" - ]; + repeated TypeRef type = 20; // Specified value if missing from instance message DefaultValueX { @@ -303,9 +326,7 @@ message DataElementConstraintOnElementDefinitionDataType { ValueX value = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Example example = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Example example = 26; // Minimum Allowed Value (for some types) message MinValueX { @@ -351,6 +372,9 @@ message DataElementConstraintOnElementDefinitionDataType { // Condition that must evaluate to true message Constraint { + option (.google.fhir.proto.fhir_path_message_constraint) = + "expression.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -394,11 +418,7 @@ message DataElementConstraintOnElementDefinitionDataType { // Reference to original source of constraint Canonical source = 9; } - repeated Constraint constraint = 31 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = "expression.exists()" - ]; + repeated Constraint constraint = 31; // If the element must be supported Boolean must_support = 32; @@ -414,6 +434,9 @@ message DataElementConstraintOnElementDefinitionDataType { // ValueSet details if this is coded message ElementDefinitionBinding { + option (.google.fhir.proto.fhir_path_message_constraint) = + "valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https') or valueSet.startsWith('urn:'))"; + // Unique id for inter-element referencing String id = 1; @@ -444,12 +467,7 @@ message DataElementConstraintOnElementDefinitionDataType { // Source of value set Canonical value_set = 5; } - ElementDefinitionBinding binding = 36 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "valueSet.exists() implies (valueSet.startsWith('http:') or valueSet.startsWith('https') or valueSet.startsWith('urn:'))" - ]; + ElementDefinitionBinding binding = 36; // Map element to another set of definitions message Mapping { @@ -491,9 +509,7 @@ message DataElementConstraintOnElementDefinitionDataType { // Comments about the mapping or its use String comment = 6; } - repeated Mapping mapping = 37 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Mapping mapping = 37; // Prompt for element phrased as question repeated String question = 38 [ diff --git a/proto/r4/core/profiles/device_metric_observation_profile.proto b/proto/r4/core/profiles/device_metric_observation_profile.proto index e3beb1959..4482b8d5d 100644 --- a/proto/r4/core/profiles/device_metric_observation_profile.proto +++ b/proto/r4/core/profiles/device_metric_observation_profile.proto @@ -34,6 +34,10 @@ message DeviceMetricObservationProfile { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/devicemetricobservation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact Id id = 1; @@ -192,6 +196,9 @@ message DeviceMetricObservationProfile { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -219,12 +226,7 @@ message DeviceMetricObservationProfile { // Text based reference range in an observation String text = 9; } - ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + ReferenceRange reference_range = 30; // Related resource that belongs to the Observation group repeated Reference has_member = 31 @@ -278,7 +280,5 @@ message DeviceMetricObservationProfile { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; } diff --git a/proto/r4/core/profiles/diagnostic_report_genetics.proto b/proto/r4/core/profiles/diagnostic_report_genetics.proto index dc935386e..fb48cd537 100644 --- a/proto/r4/core/profiles/diagnostic_report_genetics.proto +++ b/proto/r4/core/profiles/diagnostic_report_genetics.proto @@ -175,9 +175,7 @@ message DiagnosticReportGenetics { (.google.fhir.proto.valid_reference_type) = "Media" ]; } - repeated Media media = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Media media = 24; // Clinical conclusion (interpretation) of test results String conclusion = 25; @@ -193,8 +191,6 @@ message DiagnosticReportGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAssessedCondition", json_name = "AssessedCondition", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -204,8 +200,6 @@ message DiagnosticReportGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsFamilyMemberHistory", json_name = "FamilyMemberHistory", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -215,8 +209,6 @@ message DiagnosticReportGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAnalysis", json_name = "Analysis", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -226,8 +218,6 @@ message DiagnosticReportGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsReferences", json_name = "References", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/ehrsfm_record_lifecycle_event_audit_event.proto b/proto/r4/core/profiles/ehrsfm_record_lifecycle_event_audit_event.proto index cab45c567..cd0bb5444 100644 --- a/proto/r4/core/profiles/ehrsfm_record_lifecycle_event_audit_event.proto +++ b/proto/r4/core/profiles/ehrsfm_record_lifecycle_event_audit_event.proto @@ -193,18 +193,13 @@ message EHRSFMRecordLifecycleEventAuditEvent { } TypeCode type = 5; } - Network network = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Network network = 13; // Reason given for this user repeated CodeableConcept purpose_of_use = 14; } - repeated Agent agent = 18 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Agent agent = 18 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Audit Event Reporter message Source { @@ -234,14 +229,14 @@ message EHRSFMRecordLifecycleEventAuditEvent { // The type of source where event originated repeated Coding type = 6; } - Source source = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + Source source = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Data or objects used message Entity { + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.empty() or query.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -302,13 +297,7 @@ message EHRSFMRecordLifecycleEventAuditEvent { ValueX value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Detail detail = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Detail detail = 12; } - repeated Entity entity = 20 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = "name.empty() or query.empty()" - ]; + repeated Entity entity = 20; } diff --git a/proto/r4/core/profiles/ehrsfm_record_lifecycle_event_provenance.proto b/proto/r4/core/profiles/ehrsfm_record_lifecycle_event_provenance.proto index 1b3979edd..b927da9e5 100644 --- a/proto/r4/core/profiles/ehrsfm_record_lifecycle_event_provenance.proto +++ b/proto/r4/core/profiles/ehrsfm_record_lifecycle_event_provenance.proto @@ -135,11 +135,8 @@ message EHRSFMRecordLifecycleEventProvenance { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated Agent agent = 17 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Agent agent = 17 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // An entity used in this activity message Entity { @@ -179,9 +176,7 @@ message EHRSFMRecordLifecycleEventProvenance { // Entity is attributed to this agent repeated Agent agent = 6; } - repeated Entity entity = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Entity entity = 18; // Signature on target repeated Signature signature = 19; diff --git a/proto/r4/core/profiles/evidence_synthesis_profile.proto b/proto/r4/core/profiles/evidence_synthesis_profile.proto index a7ae87101..127271071 100644 --- a/proto/r4/core/profiles/evidence_synthesis_profile.proto +++ b/proto/r4/core/profiles/evidence_synthesis_profile.proto @@ -34,6 +34,8 @@ message EvidenceSynthesisProfile { "http://hl7.org/fhir/StructureDefinition/Evidence"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/synthesis"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/profiles/group_definition.proto b/proto/r4/core/profiles/group_definition.proto index b9283515b..44bf98674 100644 --- a/proto/r4/core/profiles/group_definition.proto +++ b/proto/r4/core/profiles/group_definition.proto @@ -34,6 +34,8 @@ message GroupDefinition { "http://hl7.org/fhir/StructureDefinition/Group"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/groupdefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "member.empty() or (actual = true)"; // Logical id of this artifact Id id = 1; @@ -144,9 +146,7 @@ message GroupDefinition { // Period over which characteristic is tested Period period = 7; } - repeated Characteristic characteristic = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Characteristic characteristic = 18; // Group.member not present on profile. reserved 19; diff --git a/proto/r4/core/profiles/hdl_cholesterol.proto b/proto/r4/core/profiles/hdl_cholesterol.proto index a76b9a2d5..53180a97d 100644 --- a/proto/r4/core/profiles/hdl_cholesterol.proto +++ b/proto/r4/core/profiles/hdl_cholesterol.proto @@ -34,6 +34,10 @@ message HdlCholesterol { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/hdlcholesterol"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact Id id = 1; @@ -189,6 +193,9 @@ message HdlCholesterol { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -201,8 +208,6 @@ message HdlCholesterol { // A fixed quantity (no comparator) SimpleQuantity low = 4 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "code.empty() or system.exists()", (.google.fhir.proto.fhir_path_constraint) = "comparator.empty()" @@ -223,13 +228,8 @@ message HdlCholesterol { // Text based reference range in an observation String text = 9; } - ReferenceRange reference_range = 30 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + ReferenceRange reference_range = 30 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Observation.hasMember not present on profile. reserved 31; @@ -281,7 +281,5 @@ message HdlCholesterol { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; } diff --git a/proto/r4/core/profiles/ldl_cholesterol.proto b/proto/r4/core/profiles/ldl_cholesterol.proto index 5ee911005..8a6a180ee 100644 --- a/proto/r4/core/profiles/ldl_cholesterol.proto +++ b/proto/r4/core/profiles/ldl_cholesterol.proto @@ -34,6 +34,10 @@ message LdlCholesterol { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ldlcholesterol"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact Id id = 1; @@ -189,6 +193,9 @@ message LdlCholesterol { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -204,8 +211,6 @@ message LdlCholesterol { // A fixed quantity (no comparator) SimpleQuantity high = 5 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "code.empty() or system.exists()", (.google.fhir.proto.fhir_path_constraint) = "comparator.empty()" @@ -223,13 +228,8 @@ message LdlCholesterol { // Text based reference range in an observation String text = 9; } - ReferenceRange reference_range = 30 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + ReferenceRange reference_range = 30 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Observation.hasMember not present on profile. reserved 31; @@ -281,7 +281,5 @@ message LdlCholesterol { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; } diff --git a/proto/r4/core/profiles/lipid_profile.proto b/proto/r4/core/profiles/lipid_profile.proto index 189ffa94a..4da79f8c2 100644 --- a/proto/r4/core/profiles/lipid_profile.proto +++ b/proto/r4/core/profiles/lipid_profile.proto @@ -173,9 +173,7 @@ message LipidProfile { (.google.fhir.proto.valid_reference_type) = "Media" ]; } - repeated Media media = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Media media = 24; // Clinical Interpretation of Lipid Panel String conclusion = 25; diff --git a/proto/r4/core/profiles/observation_bmi.proto b/proto/r4/core/profiles/observation_bmi.proto index 87d230ea3..c19af7930 100644 --- a/proto/r4/core/profiles/observation_bmi.proto +++ b/proto/r4/core/profiles/observation_bmi.proto @@ -36,6 +36,12 @@ message ObservationBmi { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/bmi"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationBmi { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationBmi { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -217,6 +222,9 @@ message ObservationBmi { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -244,12 +252,7 @@ message ObservationBmi { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -270,6 +273,9 @@ message ObservationBmi { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -312,12 +318,7 @@ message ObservationBmi { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_bodyheight.proto b/proto/r4/core/profiles/observation_bodyheight.proto index 0e3ff6c41..9dfc3ca26 100644 --- a/proto/r4/core/profiles/observation_bodyheight.proto +++ b/proto/r4/core/profiles/observation_bodyheight.proto @@ -36,6 +36,12 @@ message ObservationBodyheight { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/bodyheight"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationBodyheight { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationBodyheight { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -216,6 +221,9 @@ message ObservationBodyheight { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -243,12 +251,7 @@ message ObservationBodyheight { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -269,6 +272,9 @@ message ObservationBodyheight { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -311,12 +317,7 @@ message ObservationBodyheight { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_bodytemp.proto b/proto/r4/core/profiles/observation_bodytemp.proto index 88c816aa4..9b42d1140 100644 --- a/proto/r4/core/profiles/observation_bodytemp.proto +++ b/proto/r4/core/profiles/observation_bodytemp.proto @@ -36,6 +36,12 @@ message ObservationBodytemp { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/bodytemp"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationBodytemp { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationBodytemp { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -216,6 +221,9 @@ message ObservationBodytemp { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -243,12 +251,7 @@ message ObservationBodytemp { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -269,6 +272,9 @@ message ObservationBodytemp { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -311,12 +317,7 @@ message ObservationBodytemp { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_bodyweight.proto b/proto/r4/core/profiles/observation_bodyweight.proto index 947f112d1..441a1f7e6 100644 --- a/proto/r4/core/profiles/observation_bodyweight.proto +++ b/proto/r4/core/profiles/observation_bodyweight.proto @@ -36,6 +36,12 @@ message ObservationBodyweight { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/bodyweight"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationBodyweight { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationBodyweight { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -216,6 +221,9 @@ message ObservationBodyweight { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -243,12 +251,7 @@ message ObservationBodyweight { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -269,6 +272,9 @@ message ObservationBodyweight { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -311,12 +317,7 @@ message ObservationBodyweight { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_bp.proto b/proto/r4/core/profiles/observation_bp.proto index 538ebc8ce..cde43c04f 100644 --- a/proto/r4/core/profiles/observation_bp.proto +++ b/proto/r4/core/profiles/observation_bp.proto @@ -36,6 +36,12 @@ message ObservationBp { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/bp"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationBp { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationBp { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -207,6 +212,9 @@ message ObservationBp { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -234,12 +242,7 @@ message ObservationBp { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -260,6 +263,9 @@ message ObservationBp { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -302,12 +308,7 @@ message ObservationBp { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_genetics.proto b/proto/r4/core/profiles/observation_genetics.proto index 52b966fb6..486f77b02 100644 --- a/proto/r4/core/profiles/observation_genetics.proto +++ b/proto/r4/core/profiles/observation_genetics.proto @@ -35,6 +35,10 @@ message ObservationGenetics { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/observation-genetics"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact Id id = 1; @@ -200,6 +204,9 @@ message ObservationGenetics { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -227,12 +234,7 @@ message ObservationGenetics { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Related resource that belongs to the Observation group repeated Reference has_member = 31 [ @@ -295,17 +297,13 @@ message ObservationGenetics { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; // HGNC gene symbol CodeableConcept gene = 34 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene", json_name = "Gene", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -315,8 +313,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName", json_name = "DNARegionName", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -326,8 +322,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsCopyNumberEvent", json_name = "CopyNumberEvent", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -337,8 +331,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass", json_name = "GenomicSourceClass", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -348,8 +340,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsInterpretation", json_name = "InterpretationSlice", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -359,8 +349,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsVariant", json_name = "Variant", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -370,8 +358,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsAminoAcidChange", json_name = "AminoAcidChange", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -381,8 +367,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsAllele", json_name = "Allele", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -392,8 +376,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsAncestry", json_name = "Ancestry", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -403,8 +385,6 @@ message ObservationGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/observation-geneticsPhaseSet", json_name = "PhaseSet", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/observation_headcircum.proto b/proto/r4/core/profiles/observation_headcircum.proto index 2d51ad41a..d52bf5b32 100644 --- a/proto/r4/core/profiles/observation_headcircum.proto +++ b/proto/r4/core/profiles/observation_headcircum.proto @@ -36,6 +36,12 @@ message ObservationHeadcircum { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/headcircum"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationHeadcircum { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationHeadcircum { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -216,6 +221,9 @@ message ObservationHeadcircum { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -243,12 +251,7 @@ message ObservationHeadcircum { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -269,6 +272,9 @@ message ObservationHeadcircum { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -311,12 +317,7 @@ message ObservationHeadcircum { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_heartrate.proto b/proto/r4/core/profiles/observation_heartrate.proto index 647a784a7..136e8c01a 100644 --- a/proto/r4/core/profiles/observation_heartrate.proto +++ b/proto/r4/core/profiles/observation_heartrate.proto @@ -36,6 +36,12 @@ message ObservationHeartrate { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/heartrate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationHeartrate { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationHeartrate { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -216,6 +221,9 @@ message ObservationHeartrate { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -243,12 +251,7 @@ message ObservationHeartrate { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -269,6 +272,9 @@ message ObservationHeartrate { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -311,12 +317,7 @@ message ObservationHeartrate { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_oxygensat.proto b/proto/r4/core/profiles/observation_oxygensat.proto index 08e46279d..a43958eaa 100644 --- a/proto/r4/core/profiles/observation_oxygensat.proto +++ b/proto/r4/core/profiles/observation_oxygensat.proto @@ -36,6 +36,12 @@ message ObservationOxygensat { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/oxygensat"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationOxygensat { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationOxygensat { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -216,6 +221,9 @@ message ObservationOxygensat { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -243,12 +251,7 @@ message ObservationOxygensat { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -269,6 +272,9 @@ message ObservationOxygensat { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -311,12 +317,7 @@ message ObservationOxygensat { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_resprate.proto b/proto/r4/core/profiles/observation_resprate.proto index 253664ded..2a1692c33 100644 --- a/proto/r4/core/profiles/observation_resprate.proto +++ b/proto/r4/core/profiles/observation_resprate.proto @@ -36,6 +36,12 @@ message ObservationResprate { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/resprate"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationResprate { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationResprate { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -216,6 +221,9 @@ message ObservationResprate { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -243,12 +251,7 @@ message ObservationResprate { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -269,6 +272,9 @@ message ObservationResprate { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -311,12 +317,7 @@ message ObservationResprate { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_vitalsigns.proto b/proto/r4/core/profiles/observation_vitalsigns.proto index fb07429e3..dddfa9683 100644 --- a/proto/r4/core/profiles/observation_vitalsigns.proto +++ b/proto/r4/core/profiles/observation_vitalsigns.proto @@ -34,6 +34,12 @@ message ObservationVitalsigns { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/vitalsigns"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -127,6 +133,8 @@ message ObservationVitalsigns { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -134,11 +142,8 @@ message ObservationVitalsigns { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -202,6 +207,9 @@ message ObservationVitalsigns { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -229,12 +237,7 @@ message ObservationVitalsigns { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -255,6 +258,9 @@ message ObservationVitalsigns { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -297,12 +303,7 @@ message ObservationVitalsigns { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/observation_vitalspanel.proto b/proto/r4/core/profiles/observation_vitalspanel.proto index 0a9b6cb06..8f59aec57 100644 --- a/proto/r4/core/profiles/observation_vitalspanel.proto +++ b/proto/r4/core/profiles/observation_vitalspanel.proto @@ -36,6 +36,12 @@ message ObservationVitalspanel { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/vitalspanel"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,8 @@ message ObservationVitalspanel { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -158,11 +166,8 @@ message ObservationVitalspanel { Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available Instant issued = 20; @@ -207,6 +212,9 @@ message ObservationVitalspanel { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -234,12 +242,7 @@ message ObservationVitalspanel { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated Reference has_member = 31 [ @@ -261,6 +264,9 @@ message ObservationVitalspanel { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -303,12 +309,7 @@ message ObservationVitalspanel { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept diff --git a/proto/r4/core/profiles/pico_element_profile.proto b/proto/r4/core/profiles/pico_element_profile.proto index 5d69bcfee..b66888cd8 100644 --- a/proto/r4/core/profiles/pico_element_profile.proto +++ b/proto/r4/core/profiles/pico_element_profile.proto @@ -34,6 +34,8 @@ message PICOElementProfile { "http://hl7.org/fhir/StructureDefinition/EvidenceVariable"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/picoelement"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -241,9 +243,6 @@ message PICOElementProfile { } GroupMeasureCode group_measure = 10; } - repeated Characteristic characteristic = 36 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Characteristic characteristic = 36 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/profiles/profile_for_catalog.proto b/proto/r4/core/profiles/profile_for_catalog.proto index b42d985cb..85f915bf6 100644 --- a/proto/r4/core/profiles/profile_for_catalog.proto +++ b/proto/r4/core/profiles/profile_for_catalog.proto @@ -171,9 +171,7 @@ message ProfileForCatalog { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated Attester attester = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Attester attester = 19; // Organization which maintains the composition Reference custodian = 20 @@ -221,9 +219,7 @@ message ProfileForCatalog { TargetX target = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated RelatesTo relates_to = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatesTo relates_to = 21; // The clinical service(s) being documented message Event { @@ -246,12 +242,15 @@ message ProfileForCatalog { repeated Reference detail = 6 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Event event = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Event event = 22; // Composition is broken into sections message Section { + option (.google.fhir.proto.fhir_path_message_constraint) = + "text.exists() or entry.exists() or section.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "emptyReason.empty() or entry.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -317,14 +316,7 @@ message ProfileForCatalog { // Nested Section repeated Section section = 13; } - repeated Section section = 23 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "text.exists() or entry.exists() or section.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "emptyReason.empty() or entry.empty()" - ]; + repeated Section section = 23; // The validity of the catalog DateTime validity_period = 24 [ @@ -332,8 +324,6 @@ message ProfileForCatalog { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/cqm-ValidityPeriod", json_name = "ValidityPeriod", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/profile_for_hla_genotyping_results.proto b/proto/r4/core/profiles/profile_for_hla_genotyping_results.proto index 6682408cf..1cf4ab27b 100644 --- a/proto/r4/core/profiles/profile_for_hla_genotyping_results.proto +++ b/proto/r4/core/profiles/profile_for_hla_genotyping_results.proto @@ -175,9 +175,7 @@ message ProfileForHLAGenotypingResults { (.google.fhir.proto.valid_reference_type) = "Media" ]; } - repeated Media media = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Media media = 24; // Clinical conclusion (interpretation) of test results String conclusion = 25; @@ -192,8 +190,6 @@ message ProfileForHLAGenotypingResults { CodeableConcept allele_database = 28 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-allele-database", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -202,8 +198,6 @@ message ProfileForHLAGenotypingResults { DiagnosticReportGlstring glstring = 29 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-glstring", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -212,8 +206,6 @@ message ProfileForHLAGenotypingResults { repeated DiagnosticReportHaploid haploid = 30 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-haploid", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -223,8 +215,6 @@ message ProfileForHLAGenotypingResults { CodeableConcept method = 31 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-method", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/provenance_relevant_history.proto b/proto/r4/core/profiles/provenance_relevant_history.proto index b198c3018..23e845ac7 100644 --- a/proto/r4/core/profiles/provenance_relevant_history.proto +++ b/proto/r4/core/profiles/provenance_relevant_history.proto @@ -137,11 +137,8 @@ message ProvenanceRelevantHistory { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated Agent agent = 17 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Agent agent = 17 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // An entity used in this activity message Entity { @@ -181,9 +178,7 @@ message ProvenanceRelevantHistory { // Entity is attributed to this agent repeated Agent agent = 6; } - repeated Entity entity = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Entity entity = 18; // Signature on target repeated Signature signature = 19; diff --git a/proto/r4/core/profiles/service_request_genetics.proto b/proto/r4/core/profiles/service_request_genetics.proto index 9d8f3f7ac..39a127b29 100644 --- a/proto/r4/core/profiles/service_request_genetics.proto +++ b/proto/r4/core/profiles/service_request_genetics.proto @@ -35,6 +35,8 @@ message ServiceRequestGenetics { "http://hl7.org/fhir/StructureDefinition/ServiceRequest"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/servicerequest-genetics"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "orderDetail.empty() or code.exists()"; // Logical id of this artifact Id id = 1; @@ -275,8 +277,6 @@ message ServiceRequestGenetics { (.google.fhir.proto.fhir_inlined_extension_url) = "http://hl7.org/fhir/StructureDefinition/servicerequest-geneticsItem", json_name = "Item", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; diff --git a/proto/r4/core/profiles/shareable_activity_definition.proto b/proto/r4/core/profiles/shareable_activity_definition.proto index 50a417e79..991efefd8 100644 --- a/proto/r4/core/profiles/shareable_activity_definition.proto +++ b/proto/r4/core/profiles/shareable_activity_definition.proto @@ -35,6 +35,8 @@ message ShareableActivityDefinition { "http://hl7.org/fhir/StructureDefinition/ActivityDefinition"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/shareableactivitydefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -285,9 +287,7 @@ message ShareableActivityDefinition { // E.g. Nurse, Surgeon, Parent, etc. CodeableConcept role = 5; } - repeated Participant participant = 46 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 46; // What's administered/supplied message ProductX { @@ -346,7 +346,5 @@ message ShareableActivityDefinition { Expression expression = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated DynamicValue dynamic_value = 55 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DynamicValue dynamic_value = 55; } diff --git a/proto/r4/core/profiles/shareable_code_system.proto b/proto/r4/core/profiles/shareable_code_system.proto index f2aca1f9b..2b8afcd27 100644 --- a/proto/r4/core/profiles/shareable_code_system.proto +++ b/proto/r4/core/profiles/shareable_code_system.proto @@ -34,6 +34,10 @@ message ShareableCodeSystem { "http://hl7.org/fhir/StructureDefinition/CodeSystem"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/shareablecodesystem"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "concept.code.combine($this.descendants().concept.code).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -219,9 +223,7 @@ message ShareableCodeSystem { String value = 7 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Filter filter = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Filter filter = 33; // Additional information supplied about each concept message Property { @@ -263,9 +265,7 @@ message ShareableCodeSystem { TypeCode type = 7 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Property property = 34 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Property property = 34; // Concepts in the code system message ConceptDefinition { @@ -309,9 +309,7 @@ message ShareableCodeSystem { String value = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Designation designation = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Designation designation = 7; // Property value for the concept message ConceptProperty { @@ -345,16 +343,11 @@ message ShareableCodeSystem { ValueX value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated ConceptProperty property = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ConceptProperty property = 8; // Child Concepts (is-a/contains/categorizes) repeated ConceptDefinition concept = 9; } - repeated ConceptDefinition concept = 35 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated ConceptDefinition concept = 35 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/profiles/shareable_library.proto b/proto/r4/core/profiles/shareable_library.proto index ce32eb367..145a3197f 100644 --- a/proto/r4/core/profiles/shareable_library.proto +++ b/proto/r4/core/profiles/shareable_library.proto @@ -34,6 +34,8 @@ message ShareableLibrary { "http://hl7.org/fhir/StructureDefinition/Library"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/shareablelibrary"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/profiles/shareable_measure.proto b/proto/r4/core/profiles/shareable_measure.proto index 2c2e2155a..9ab066629 100644 --- a/proto/r4/core/profiles/shareable_measure.proto +++ b/proto/r4/core/profiles/shareable_measure.proto @@ -34,6 +34,10 @@ message ShareableMeasure { "http://hl7.org/fhir/StructureDefinition/Measure"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/shareablemeasure"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "group.stratifier.all((code | description | criteria).exists() xor component.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -249,9 +253,7 @@ message ShareableMeasure { Expression criteria = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Population population = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Population population = 6; // Stratifier criteria for the measure message Stratifier { @@ -294,17 +296,11 @@ message ShareableMeasure { Expression criteria = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Component component = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 7; } - repeated Stratifier stratifier = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Stratifier stratifier = 7; } - repeated Group group = 49 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Group group = 49; // What other data should be reported with the measure message SupplementalData { @@ -330,7 +326,5 @@ message ShareableMeasure { Expression criteria = 7 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated SupplementalData supplemental_data = 50 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SupplementalData supplemental_data = 50; } diff --git a/proto/r4/core/profiles/shareable_plan_definition.proto b/proto/r4/core/profiles/shareable_plan_definition.proto index 5c975cc6f..c27d60ea2 100644 --- a/proto/r4/core/profiles/shareable_plan_definition.proto +++ b/proto/r4/core/profiles/shareable_plan_definition.proto @@ -35,6 +35,8 @@ message ShareablePlanDefinition { "http://hl7.org/fhir/StructureDefinition/PlanDefinition"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/shareableplandefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -239,13 +241,9 @@ message ShareablePlanDefinition { // Reach goal within Duration due = 6; } - repeated Target target = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Target target = 10; } - repeated Goal goal = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Goal goal = 39; // Action defined by the plan message Action { @@ -347,9 +345,7 @@ message ShareablePlanDefinition { // Boolean-valued expression Expression expression = 5; } - repeated Condition condition = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Condition condition = 15; // Input data requirements repeated DataRequirement input = 16; @@ -402,9 +398,7 @@ message ShareablePlanDefinition { } OffsetX offset = 6; } - repeated RelatedAction related_action = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedAction related_action = 18; // When the action should take place message TimingX { @@ -453,9 +447,7 @@ message ShareablePlanDefinition { // E.g. Nurse, Surgeon, Parent CodeableConcept role = 5; } - repeated Participant participant = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 20; // create | update | remove | fire-event CodeableConcept type = 21; @@ -576,14 +568,10 @@ message ShareablePlanDefinition { // An expression that provides the dynamic value for the customization Expression expression = 5; } - repeated DynamicValue dynamic_value = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DynamicValue dynamic_value = 29; // A sub-action repeated Action action = 30; } - repeated Action action = 40 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Action action = 40; } diff --git a/proto/r4/core/profiles/shareable_value_set.proto b/proto/r4/core/profiles/shareable_value_set.proto index 644fe923e..3afff7b5d 100644 --- a/proto/r4/core/profiles/shareable_value_set.proto +++ b/proto/r4/core/profiles/shareable_value_set.proto @@ -34,6 +34,8 @@ message ShareableValueSet { "http://hl7.org/fhir/StructureDefinition/ValueSet"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/shareablevalueset"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -151,6 +153,13 @@ message ShareableValueSet { // Include one or more codes from a code system or other value set(s) message ConceptSet { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(concept.exists() or filter.exists()) implies system.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "concept.empty() or filter.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "valueSet.exists() or system.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -205,13 +214,9 @@ message ShareableValueSet { String value = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Designation designation = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Designation designation = 6; } - repeated ConceptReference concept = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ConceptReference concept = 6; // Select codes/concepts by their properties (including relationships) message Filter { @@ -251,30 +256,18 @@ message ShareableValueSet { String value = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Filter filter = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Filter filter = 7; // Select the contents included in this value set repeated Canonical value_set = 8; } - repeated ConceptSet include = 6 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(concept.exists() or filter.exists()) implies system.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "concept.empty() or filter.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "valueSet.exists() or system.exists()" - ]; + repeated ConceptSet include = 6 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Explicitly exclude codes from a code system or other value sets repeated ConceptSet exclude = 7; } - Compose compose = 26 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Compose compose = 26; // Used when the value set is "expanded" message Expansion { @@ -331,12 +324,17 @@ message ShareableValueSet { } ValueX value = 5; } - repeated Parameter parameter = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Parameter parameter = 8; // Codes in the value set message Contains { + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.exists() or display.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.exists() or abstract = true"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -370,18 +368,7 @@ message ShareableValueSet { // Codes contained under this entry repeated Contains contains = 11; } - repeated Contains contains = 9 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "code.exists() or display.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "code.exists() or abstract = true", - (.google.fhir.proto.fhir_path_constraint) = - "code.empty() or system.exists()" - ]; + repeated Contains contains = 9; } - Expansion expansion = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Expansion expansion = 27; } diff --git a/proto/r4/core/profiles/triglyceride.proto b/proto/r4/core/profiles/triglyceride.proto index 787e7bb5a..5480acdf3 100644 --- a/proto/r4/core/profiles/triglyceride.proto +++ b/proto/r4/core/profiles/triglyceride.proto @@ -34,6 +34,10 @@ message Triglyceride { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/triglyceride"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact Id id = 1; @@ -189,6 +193,9 @@ message Triglyceride { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -217,13 +224,8 @@ message Triglyceride { // Text based reference range in an observation String text = 9; } - ReferenceRange reference_range = 30 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + ReferenceRange reference_range = 30 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Observation.hasMember not present on profile. reserved 31; @@ -275,7 +277,5 @@ message Triglyceride { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; } diff --git a/proto/r4/core/resources/account.proto b/proto/r4/core/resources/account.proto index c19ace6e6..3b2a6edc3 100644 --- a/proto/r4/core/resources/account.proto +++ b/proto/r4/core/resources/account.proto @@ -123,9 +123,7 @@ message Account { // The priority of the coverage in the context of this account PositiveInt priority = 5; } - repeated Coverage coverage = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Coverage coverage = 16; // Entity managing the Account Reference owner = 17 @@ -159,9 +157,7 @@ message Account { // Guarantee account during Period period = 6; } - repeated Guarantor guarantor = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Guarantor guarantor = 19; // Reference to a parent Account Reference part_of = 20 diff --git a/proto/r4/core/resources/activity_definition.proto b/proto/r4/core/resources/activity_definition.proto index abea5ce9c..711119859 100644 --- a/proto/r4/core/resources/activity_definition.proto +++ b/proto/r4/core/resources/activity_definition.proto @@ -33,6 +33,8 @@ message ActivityDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ActivityDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -278,9 +280,7 @@ message ActivityDefinition { // E.g. Nurse, Surgeon, Parent, etc. CodeableConcept role = 5; } - repeated Participant participant = 46 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 46; // What's administered/supplied message ProductX { @@ -339,7 +339,5 @@ message ActivityDefinition { Expression expression = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated DynamicValue dynamic_value = 55 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DynamicValue dynamic_value = 55; } diff --git a/proto/r4/core/resources/adverse_event.proto b/proto/r4/core/resources/adverse_event.proto index dfa9f9a67..fd6efc49c 100644 --- a/proto/r4/core/resources/adverse_event.proto +++ b/proto/r4/core/resources/adverse_event.proto @@ -195,13 +195,9 @@ message AdverseEvent { // ProbabilityScale | Bayesian | Checklist CodeableConcept method = 7; } - repeated Causality causality = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Causality causality = 5; } - repeated SuspectEntity suspect_entity = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SuspectEntity suspect_entity = 26; // AdverseEvent.subjectMedicalHistory repeated Reference subject_medical_history = 27 [ diff --git a/proto/r4/core/resources/allergy_intolerance.proto b/proto/r4/core/resources/allergy_intolerance.proto index f790e1e37..fdc5bb395 100644 --- a/proto/r4/core/resources/allergy_intolerance.proto +++ b/proto/r4/core/resources/allergy_intolerance.proto @@ -33,6 +33,10 @@ message AllergyIntolerance { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "verificationStatus='entered-in-error' or clinicalStatus.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "verificationStatus!='entered-in-error' or clinicalStatus.empty()"; // Logical id of this artifact Id id = 1; @@ -219,7 +223,5 @@ message AllergyIntolerance { // Text about event not captured in other fields repeated Annotation note = 10; } - repeated Reaction reaction = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Reaction reaction = 25; } diff --git a/proto/r4/core/resources/appointment.proto b/proto/r4/core/resources/appointment.proto index 0ed0831dd..b9c602444 100644 --- a/proto/r4/core/resources/appointment.proto +++ b/proto/r4/core/resources/appointment.proto @@ -34,6 +34,12 @@ message Appointment { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Appointment"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "Appointment.cancelationReason.exists() implies (Appointment.status='no-show' or Appointment.status='cancelled')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(start.exists() and end.exists()) or (status in ('proposed' | 'cancelled' | 'waitlist'))"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "start.exists() = end.exists()"; // Logical id of this artifact Id id = 1; @@ -151,6 +157,9 @@ message Appointment { // Participants involved in appointment message Participant { + option (.google.fhir.proto.fhir_path_message_constraint) = + "type.exists() or actor.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -212,13 +221,8 @@ message Appointment { // Participation period of the actor Period period = 8; } - repeated Participant participant = 30 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "type.exists() or actor.exists()" - ]; + repeated Participant participant = 30 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Potential date/time interval(s) requested to allocate the appointment // within diff --git a/proto/r4/core/resources/appointment_response.proto b/proto/r4/core/resources/appointment_response.proto index d29999e24..0d03006b1 100644 --- a/proto/r4/core/resources/appointment_response.proto +++ b/proto/r4/core/resources/appointment_response.proto @@ -33,6 +33,8 @@ message AppointmentResponse { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/AppointmentResponse"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "participantType.exists() or actor.exists()"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/resources/audit_event.proto b/proto/r4/core/resources/audit_event.proto index dfab7907a..96b07d8f5 100644 --- a/proto/r4/core/resources/audit_event.proto +++ b/proto/r4/core/resources/audit_event.proto @@ -191,18 +191,13 @@ message AuditEvent { } TypeCode type = 5; } - Network network = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Network network = 13; // Reason given for this user repeated CodeableConcept purpose_of_use = 14; } - repeated Agent agent = 18 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Agent agent = 18 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Audit Event Reporter message Source { @@ -232,14 +227,14 @@ message AuditEvent { // The type of source where event originated repeated Coding type = 6; } - Source source = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + Source source = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Data or objects used message Entity { + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.empty() or query.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -300,13 +295,7 @@ message AuditEvent { ValueX value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Detail detail = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Detail detail = 12; } - repeated Entity entity = 20 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = "name.empty() or query.empty()" - ]; + repeated Entity entity = 20; } diff --git a/proto/r4/core/resources/biologically_derived_product.proto b/proto/r4/core/resources/biologically_derived_product.proto index c078d5911..829422866 100644 --- a/proto/r4/core/resources/biologically_derived_product.proto +++ b/proto/r4/core/resources/biologically_derived_product.proto @@ -145,9 +145,7 @@ message BiologicallyDerivedProduct { } CollectedX collected = 6; } - Collection collection = 17 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Collection collection = 17; // Any processing of the product during collection message Processing { @@ -181,9 +179,7 @@ message BiologicallyDerivedProduct { } TimeX time = 7; } - repeated Processing processing = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Processing processing = 18; // Any manipulation of product post-collection message Manipulation { @@ -210,9 +206,7 @@ message BiologicallyDerivedProduct { } TimeX time = 5; } - Manipulation manipulation = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Manipulation manipulation = 19; // Product storage message Storage { @@ -251,7 +245,5 @@ message BiologicallyDerivedProduct { // Storage timeperiod Period duration = 7; } - repeated Storage storage = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Storage storage = 20; } diff --git a/proto/r4/core/resources/bundle_and_contained_resource.proto b/proto/r4/core/resources/bundle_and_contained_resource.proto index ce181627b..d9a9646f8 100644 --- a/proto/r4/core/resources/bundle_and_contained_resource.proto +++ b/proto/r4/core/resources/bundle_and_contained_resource.proto @@ -177,6 +177,24 @@ message Bundle { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Bundle"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type = 'history') or entry.where(fullUrl.exists()).select(fullUrl&resource.meta.versionId).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type = 'document' implies (identifier.system.exists() and identifier.value.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "entry.all(request.exists() = (%resource.type = 'batch' or %resource.type = 'transaction' or %resource.type = 'history'))"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "entry.all(response.exists() = (%resource.type = 'batch-response' or %resource.type = 'transaction-response' or %resource.type = 'history'))"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type = 'message' implies entry.first().resource.is(MessageHeader)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "total.empty() or (type = 'searchset') or (type = 'history')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "entry.search.empty() or (type = 'searchset')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type = 'document' implies entry.first().resource.is(Composition)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type = 'document' implies (meta.lastUpdated.hasValue())"; // Logical id of this artifact Id id = 1; @@ -237,12 +255,15 @@ message Bundle { Uri url = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Link link = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Link link = 9; // Entry in the bundle - will have a resource or information message Entry { + option (.google.fhir.proto.fhir_path_message_constraint) = + "fullUrl.contains('/_history/').not()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "resource.exists() or request.exists() or response.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -292,8 +313,7 @@ message Bundle { // Search ranking (between 0 and 1) Decimal score = 5; } - Search search = 7 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Search search = 7; // Additional execution information (transaction/batch/history) message Request { @@ -340,8 +360,7 @@ message Bundle { // For conditional creates String if_none_exist = 9; } - Request request = 8 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Request request = 8; // Results of execution (transaction/batch/history) message Response { @@ -370,18 +389,9 @@ message Bundle { // OperationOutcome with hints and warnings (for batch/transaction) ContainedResource outcome = 8; } - Response response = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Response response = 9; } - repeated Entry entry = 10 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "fullUrl.contains('/_history/').not()", - (.google.fhir.proto.fhir_path_constraint) = - "resource.exists() or request.exists() or response.exists()" - ]; + repeated Entry entry = 10; // Digital Signature Signature signature = 11; diff --git a/proto/r4/core/resources/capability_statement.proto b/proto/r4/core/resources/capability_statement.proto index d3864bb69..2246d4502 100644 --- a/proto/r4/core/resources/capability_statement.proto +++ b/proto/r4/core/resources/capability_statement.proto @@ -33,6 +33,22 @@ message CapabilityStatement { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/CapabilityStatement"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "document.select(profile&mode).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(kind!='requirements') or (implementation.exists().not() and software.exists().not())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(kind != 'capability') or (implementation.exists().not() and software.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "messaging.endpoint.empty() or kind = 'instance'"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(kind != 'instance') or implementation.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(description.count() + software.count() + implementation.count()) > 0"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "rest.exists() or messaging.exists() or document.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -164,9 +180,7 @@ message CapabilityStatement { // Date this version was released DateTime release_date = 6; } - Software software = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Software software = 27; // If this describes a specific instance message Implementation { @@ -190,9 +204,7 @@ message CapabilityStatement { Reference custodian = 6 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - Implementation implementation = 28 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Implementation implementation = 28; // FHIR Version the system supports message FhirVersionCode { @@ -257,6 +269,9 @@ message CapabilityStatement { // If the endpoint is a RESTful one message Rest { + option (.google.fhir.proto.fhir_path_message_constraint) = + "resource.select(type).isDistinct()"; + // Unique id for inter-element referencing String id = 1; @@ -307,12 +322,13 @@ message CapabilityStatement { // General description of how security works Markdown description = 6; } - Security security = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Security security = 6; // Resource served on the REST interface message Resource { + option (.google.fhir.proto.fhir_path_message_constraint) = + "searchParam.select(name).isDistinct()"; + // Unique id for inter-element referencing String id = 1; @@ -382,9 +398,7 @@ message CapabilityStatement { // Anything special about operation behavior Markdown documentation = 5; } - repeated ResourceInteraction interaction = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ResourceInteraction interaction = 8; // no-version | versioned | versioned-update message VersioningCode { @@ -512,9 +526,7 @@ message CapabilityStatement { // Server-specific usage Markdown documentation = 7; } - repeated SearchParam search_param = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SearchParam search_param = 19; // Definition of a resource operation message Operation { @@ -538,16 +550,9 @@ message CapabilityStatement { // Specific details about operation behavior Markdown documentation = 6; } - repeated Operation operation = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Operation operation = 20; } - repeated Resource resource = 7 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "searchParam.select(name).isDistinct()" - ]; + repeated Resource resource = 7; // What operations are supported? message SystemInteraction { @@ -581,9 +586,7 @@ message CapabilityStatement { // Anything special about operation behavior Markdown documentation = 5; } - repeated SystemInteraction interaction = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SystemInteraction interaction = 8; // Search parameters for searching all resources repeated Resource.SearchParam search_param = 9; @@ -594,12 +597,7 @@ message CapabilityStatement { // Compartments served/used by system repeated Canonical compartment = 11; } - repeated Rest rest = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "resource.select(type).isDistinct()" - ]; + repeated Rest rest = 33; // If messaging is supported message Messaging { @@ -631,9 +629,7 @@ message CapabilityStatement { Url address = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Endpoint endpoint = 4 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Endpoint endpoint = 4; // Reliable Message Cache Length (min) UnsignedInt reliable_cache = 5; @@ -674,13 +670,9 @@ message CapabilityStatement { Canonical definition = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated SupportedMessage supported_message = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SupportedMessage supported_message = 7; } - repeated Messaging messaging = 34 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Messaging messaging = 34; // Document definition message Document { @@ -718,7 +710,5 @@ message CapabilityStatement { Canonical profile = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Document document = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Document document = 35; } diff --git a/proto/r4/core/resources/care_plan.proto b/proto/r4/core/resources/care_plan.proto index ca5b128f7..0d368c379 100644 --- a/proto/r4/core/resources/care_plan.proto +++ b/proto/r4/core/resources/care_plan.proto @@ -184,6 +184,9 @@ message CarePlan { // Action to occur as part of plan message Activity { + option (.google.fhir.proto.fhir_path_message_constraint) = + "detail.empty() or reference.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -344,15 +347,9 @@ message CarePlan { // Extra info describing activity to perform String description = 20; } - Detail detail = 8 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Detail detail = 8; } - repeated Activity activity = 31 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "detail.empty() or reference.empty()" - ]; + repeated Activity activity = 31; // Comments about the plan repeated Annotation note = 32; diff --git a/proto/r4/core/resources/care_team.proto b/proto/r4/core/resources/care_team.proto index fb72a62e1..c119d5d4e 100644 --- a/proto/r4/core/resources/care_team.proto +++ b/proto/r4/core/resources/care_team.proto @@ -102,6 +102,9 @@ message CareTeam { // Members of the team message Participant { + option (.google.fhir.proto.fhir_path_message_constraint) = + "onBehalfOf.exists() implies (member.resolve() is Practitioner)"; + // Unique id for inter-element referencing String id = 1; @@ -131,12 +134,7 @@ message CareTeam { // Time period of participant Period period = 7; } - repeated Participant participant = 17 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "onBehalfOf.exists() implies (member.resolve() is Practitioner)" - ]; + repeated Participant participant = 17; // Why the care team exists repeated CodeableConcept reason_code = 18; diff --git a/proto/r4/core/resources/catalog_entry.proto b/proto/r4/core/resources/catalog_entry.proto index e3199671f..558e5ba80 100644 --- a/proto/r4/core/resources/catalog_entry.proto +++ b/proto/r4/core/resources/catalog_entry.proto @@ -160,7 +160,5 @@ message CatalogEntry { (.google.fhir.proto.valid_reference_type) = "CatalogEntry" ]; } - repeated RelatedEntry related_entry = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedEntry related_entry = 22; } diff --git a/proto/r4/core/resources/charge_item.proto b/proto/r4/core/resources/charge_item.proto index 888c02656..be640a481 100644 --- a/proto/r4/core/resources/charge_item.proto +++ b/proto/r4/core/resources/charge_item.proto @@ -148,9 +148,7 @@ message ChargeItem { (.google.fhir.proto.valid_reference_type) = "RelatedPerson" ]; } - repeated Performer performer = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Performer performer = 19; // Organization providing the charged service Reference performing_organization = 20 diff --git a/proto/r4/core/resources/charge_item_definition.proto b/proto/r4/core/resources/charge_item_definition.proto index a9ab3e4de..f6659c6e0 100644 --- a/proto/r4/core/resources/charge_item_definition.proto +++ b/proto/r4/core/resources/charge_item_definition.proto @@ -33,6 +33,8 @@ message ChargeItemDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -166,9 +168,7 @@ message ChargeItemDefinition { // Boolean-valued expression String expression = 6; } - repeated Applicability applicability = 31 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Applicability applicability = 31; // Group of properties which are applicable under the same conditions message PropertyGroup { @@ -222,11 +222,7 @@ message ChargeItemDefinition { // Monetary amount associated with this component Money amount = 7; } - repeated PriceComponent price_component = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PriceComponent price_component = 5; } - repeated PropertyGroup property_group = 32 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PropertyGroup property_group = 32; } diff --git a/proto/r4/core/resources/claim.proto b/proto/r4/core/resources/claim.proto index 4098cb228..c02bf60e6 100644 --- a/proto/r4/core/resources/claim.proto +++ b/proto/r4/core/resources/claim.proto @@ -163,9 +163,7 @@ message Claim { // File or case reference Identifier reference = 6; } - repeated RelatedClaim related = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedClaim related = 23; // Prescription authorizing services and products Reference prescription = 24 [ @@ -205,8 +203,7 @@ message Claim { (.google.fhir.proto.valid_reference_type) = "RelatedPerson" ]; } - Payee payee = 26 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Payee payee = 26; // Treatment referral Reference referral = 27 @@ -248,9 +245,7 @@ message Claim { // Practitioner credential or specialization CodeableConcept qualification = 8; } - repeated CareTeam care_team = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated CareTeam care_team = 29; // Supporting information message SupportingInformation { @@ -303,9 +298,7 @@ message Claim { // Explanation for the information CodeableConcept reason = 9; } - repeated SupportingInformation supporting_info = 30 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SupportingInformation supporting_info = 30; // Pertinent diagnosis information message Diagnosis { @@ -344,9 +337,7 @@ message Claim { // Package billing code CodeableConcept package_code = 8; } - repeated Diagnosis diagnosis = 31 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Diagnosis diagnosis = 31; // Clinical procedures performed message Procedure { @@ -386,9 +377,7 @@ message Claim { repeated Reference udi = 8 [(.google.fhir.proto.valid_reference_type) = "Device"]; } - repeated Procedure procedure = 32 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Procedure procedure = 32; // Patient insurance information message Insurance { @@ -428,11 +417,8 @@ message Claim { Reference claim_response = 10 [(.google.fhir.proto.valid_reference_type) = "ClaimResponse"]; } - repeated Insurance insurance = 33 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Insurance insurance = 33 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Details of the event message Accident { @@ -464,9 +450,7 @@ message Claim { } LocationX location = 6; } - Accident accident = 34 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Accident accident = 34; // Product or service provided message Item { @@ -655,17 +639,11 @@ message Claim { repeated Reference udi = 14 [(.google.fhir.proto.valid_reference_type) = "Device"]; } - repeated SubDetail sub_detail = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SubDetail sub_detail = 15; } - repeated Detail detail = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Detail detail = 24; } - repeated Item item = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Item item = 35; // Total claim cost Money total = 36; diff --git a/proto/r4/core/resources/claim_response.proto b/proto/r4/core/resources/claim_response.proto index 979dadc9c..949842fd4 100644 --- a/proto/r4/core/resources/claim_response.proto +++ b/proto/r4/core/resources/claim_response.proto @@ -202,11 +202,8 @@ message ClaimResponse { // Non-monetary value Decimal value = 7; } - repeated Adjudication adjudication = 6 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Adjudication adjudication = 6 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Adjudication for claim details message ItemDetail { @@ -251,17 +248,11 @@ message ClaimResponse { // Subdetail level adjudication details repeated Adjudication adjudication = 6; } - repeated SubDetail sub_detail = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SubDetail sub_detail = 7; } - repeated ItemDetail detail = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ItemDetail detail = 7; } - repeated Item item = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Item item = 25; // Insurer added line items message AddedItem { @@ -423,17 +414,11 @@ message ClaimResponse { repeated Item.Adjudication adjudication = 11 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated AddedItemSubDetail sub_detail = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AddedItemSubDetail sub_detail = 12; } - repeated AddedItemDetail detail = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AddedItemDetail detail = 21; } - repeated AddedItem add_item = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AddedItem add_item = 26; // Header-level adjudication repeated Item.Adjudication adjudication = 27; @@ -457,9 +442,7 @@ message ClaimResponse { Money amount = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Total total = 28 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Total total = 28; // Payment Details message Payment { @@ -492,8 +475,7 @@ message ClaimResponse { // Business identifier for the payment Identifier identifier = 9; } - Payment payment = 29 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Payment payment = 29; // Funds reserved status CodeableConcept funds_reserve = 30; @@ -542,9 +524,7 @@ message ClaimResponse { // Language of the text CodeableConcept language = 7; } - repeated Note process_note = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Note process_note = 33; // Request for additional information repeated Reference communication_request = 34 @@ -582,9 +562,7 @@ message ClaimResponse { Reference claim_response = 8 [(.google.fhir.proto.valid_reference_type) = "ClaimResponse"]; } - repeated Insurance insurance = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Insurance insurance = 35; // Processing errors message Error { @@ -610,7 +588,5 @@ message ClaimResponse { CodeableConcept code = 7 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Error error = 36 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Error error = 36; } diff --git a/proto/r4/core/resources/clinical_impression.proto b/proto/r4/core/resources/clinical_impression.proto index 8d330ad30..ecd0b9544 100644 --- a/proto/r4/core/resources/clinical_impression.proto +++ b/proto/r4/core/resources/clinical_impression.proto @@ -158,9 +158,7 @@ message ClinicalImpression { (.google.fhir.proto.valid_reference_type) = "Media" ]; } - repeated Investigation investigation = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Investigation investigation = 22; // Clinical Protocol followed repeated Uri protocol = 23; @@ -192,9 +190,7 @@ message ClinicalImpression { // Which investigations support finding String basis = 6; } - repeated Finding finding = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Finding finding = 25; // Estimate of likely outcome repeated CodeableConcept prognosis_codeable_concept = 26; diff --git a/proto/r4/core/resources/code_system.proto b/proto/r4/core/resources/code_system.proto index 83591526a..f2498e493 100644 --- a/proto/r4/core/resources/code_system.proto +++ b/proto/r4/core/resources/code_system.proto @@ -33,6 +33,10 @@ message CodeSystem { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/CodeSystem"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "concept.code.combine($this.descendants().concept.code).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -213,9 +217,7 @@ message CodeSystem { String value = 7 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Filter filter = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Filter filter = 33; // Additional information supplied about each concept message Property { @@ -257,9 +259,7 @@ message CodeSystem { TypeCode type = 7 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Property property = 34 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Property property = 34; // Concepts in the code system message ConceptDefinition { @@ -303,9 +303,7 @@ message CodeSystem { String value = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Designation designation = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Designation designation = 7; // Property value for the concept message ConceptProperty { @@ -339,14 +337,10 @@ message CodeSystem { ValueX value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated ConceptProperty property = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ConceptProperty property = 8; // Child Concepts (is-a/contains/categorizes) repeated ConceptDefinition concept = 9; } - repeated ConceptDefinition concept = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ConceptDefinition concept = 35; } diff --git a/proto/r4/core/resources/communication.proto b/proto/r4/core/resources/communication.proto index d4d832fff..d450bdb33 100644 --- a/proto/r4/core/resources/communication.proto +++ b/proto/r4/core/resources/communication.proto @@ -209,9 +209,7 @@ message Communication { ContentX content = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Payload payload = 31 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Payload payload = 31; // Comments made about the communication repeated Annotation note = 32; diff --git a/proto/r4/core/resources/communication_request.proto b/proto/r4/core/resources/communication_request.proto index aa39ea012..5d5390e6c 100644 --- a/proto/r4/core/resources/communication_request.proto +++ b/proto/r4/core/resources/communication_request.proto @@ -161,9 +161,7 @@ message CommunicationRequest { ContentX content = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Payload payload = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Payload payload = 23; // When scheduled message OccurrenceX { diff --git a/proto/r4/core/resources/compartment_definition.proto b/proto/r4/core/resources/compartment_definition.proto index a22b368fd..3069afd79 100644 --- a/proto/r4/core/resources/compartment_definition.proto +++ b/proto/r4/core/resources/compartment_definition.proto @@ -32,6 +32,8 @@ message CompartmentDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/CompartmentDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -166,7 +168,5 @@ message CompartmentDefinition { // Additional documentation about the resource and compartment String documentation = 6; } - repeated Resource resource = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Resource resource = 23; } diff --git a/proto/r4/core/resources/composition.proto b/proto/r4/core/resources/composition.proto index 03b6abfaa..f86a3f52d 100644 --- a/proto/r4/core/resources/composition.proto +++ b/proto/r4/core/resources/composition.proto @@ -174,9 +174,7 @@ message Composition { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated Attester attester = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Attester attester = 20; // Organization which maintains the composition Reference custodian = 21 @@ -224,9 +222,7 @@ message Composition { TargetX target = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated RelatesTo relates_to = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatesTo relates_to = 22; // The clinical service(s) being documented message Event { @@ -249,12 +245,15 @@ message Composition { repeated Reference detail = 6 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Event event = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Event event = 23; // Composition is broken into sections message Section { + option (.google.fhir.proto.fhir_path_message_constraint) = + "text.exists() or entry.exists() or section.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "emptyReason.empty() or entry.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -318,12 +317,5 @@ message Composition { // Nested Section repeated Section section = 13; } - repeated Section section = 24 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "text.exists() or entry.exists() or section.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "emptyReason.empty() or entry.empty()" - ]; + repeated Section section = 24; } diff --git a/proto/r4/core/resources/concept_map.proto b/proto/r4/core/resources/concept_map.proto index 0d341c529..3a23570fd 100644 --- a/proto/r4/core/resources/concept_map.proto +++ b/proto/r4/core/resources/concept_map.proto @@ -32,6 +32,8 @@ message ConceptMap { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ConceptMap"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -185,6 +187,9 @@ message ConceptMap { // Concept in target system for element message TargetElement { + option (.google.fhir.proto.fhir_path_message_constraint) = + "comment.exists() or equivalence.empty() or ((equivalence != 'narrower') and (equivalence != 'inexact'))"; + // Unique id for inter-element referencing String id = 1; @@ -247,28 +252,23 @@ message ConceptMap { // Display for the code (if value is a code) String display = 7; } - repeated OtherElement depends_on = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated OtherElement depends_on = 8; // Other concepts that this mapping also produces repeated OtherElement product = 9; } - repeated TargetElement target = 6 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "comment.exists() or equivalence.empty() or ((equivalence != 'narrower') and (equivalence != 'inexact'))" - ]; + repeated TargetElement target = 6; } - repeated SourceElement element = 8 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated SourceElement element = 8 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // What to do when there is no mapping for the source concept message Unmapped { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(mode = 'other-map') implies url.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(mode = 'fixed') implies code.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -306,16 +306,7 @@ message ConceptMap { // the source concept is unmapped Canonical url = 7; } - Unmapped unmapped = 9 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(mode = 'other-map') implies url.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "(mode = 'fixed') implies code.exists()" - ]; + Unmapped unmapped = 9; } - repeated Group group = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Group group = 27; } diff --git a/proto/r4/core/resources/condition.proto b/proto/r4/core/resources/condition.proto index ca2c7d3a6..a6ce571a1 100644 --- a/proto/r4/core/resources/condition.proto +++ b/proto/r4/core/resources/condition.proto @@ -31,6 +31,12 @@ message Condition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Condition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "verificationStatus.coding.where(system='http://terminology.hl7.org/CodeSystem/condition-ver-status' and code='entered-in-error').empty() or clinicalStatus.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "abatement.empty() or clinicalStatus.coding.where(system='http://terminology.hl7.org/CodeSystem/condition-clinical' and (code='resolved' or code='remission' or code='inactive')).exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "clinicalStatus.exists() or verificationStatus='entered-in-error' or category.select($this='problem-list-item').empty()"; // Logical id of this artifact Id id = 1; @@ -142,6 +148,9 @@ message Condition { // Stage/grade, usually assessed formally message Stage { + option (.google.fhir.proto.fhir_path_message_constraint) = + "summary.exists() or assessment.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -164,15 +173,13 @@ message Condition { // Kind of staging CodeableConcept type = 6; } - repeated Stage stage = 24 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "summary.exists() or assessment.exists()" - ]; + repeated Stage stage = 24; // Supporting evidence message Evidence { + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.exists() or detail.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -189,12 +196,7 @@ message Condition { repeated Reference detail = 5 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Evidence evidence = 25 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "code.exists() or detail.exists()" - ]; + repeated Evidence evidence = 25; // Additional information about the Condition repeated Annotation note = 26; diff --git a/proto/r4/core/resources/consent.proto b/proto/r4/core/resources/consent.proto index 050c61679..deb478a09 100644 --- a/proto/r4/core/resources/consent.proto +++ b/proto/r4/core/resources/consent.proto @@ -33,6 +33,16 @@ message Consent { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Consent"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "patient.exists() or scope.coding.where(system='something' and code='adr').exists().not()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "patient.exists() or scope.coding.where(system='something' and code='treatment').exists().not()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "patient.exists() or scope.coding.where(system='something' and code='patient-privacy').exists().not()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "patient.exists() or scope.coding.where(system='something' and code='research').exists().not()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "policy.exists() or policyRule.exists()"; // Logical id of this artifact Id id = 1; @@ -143,9 +153,7 @@ message Consent { // Specific policy covered by this consent Uri uri = 5; } - repeated Policy policy = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Policy policy = 19; // Regulation that this consents to CodeableConcept policy_rule = 20; @@ -174,9 +182,7 @@ message Consent { // When consent verified DateTime verification_date = 6; } - repeated Verification verification = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Verification verification = 21; // Constraints to the base Consent.policyRule message Provision { @@ -237,9 +243,7 @@ message Consent { (.google.fhir.proto.valid_reference_type) = "PractitionerRole" ]; } - repeated ProvisionActor actor = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ProvisionActor actor = 6; // Actions controlled by this rule repeated CodeableConcept action = 7; @@ -294,14 +298,10 @@ message Consent { (.google.fhir.proto.valid_reference_type) = "Resource" ]; } - repeated ProvisionData data = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ProvisionData data = 13; // Nested Exception Rules repeated Provision provision = 14; } - Provision provision = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Provision provision = 22; } diff --git a/proto/r4/core/resources/contract.proto b/proto/r4/core/resources/contract.proto index e58408ecb..4a29ec89f 100644 --- a/proto/r4/core/resources/contract.proto +++ b/proto/r4/core/resources/contract.proto @@ -216,9 +216,7 @@ message Contract { // Publication Ownership Markdown copyright = 9; } - ContentDefinition content_definition = 34 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + ContentDefinition content_definition = 34; // Contract Term List message Term { @@ -285,9 +283,7 @@ message Contract { // Handling Instructions repeated Coding control = 7; } - repeated SecurityLabel security_label = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SecurityLabel security_label = 11; // Context of the Contract term message ContractOffer { @@ -330,9 +326,7 @@ message Contract { CodeableConcept role = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated ContractParty party = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ContractParty party = 5; // Negotiable offer asset Reference topic = 6 @@ -381,9 +375,7 @@ message Contract { ValueX value = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Answer answer = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Answer answer = 10; // Human readable offer text String text = 11; @@ -394,11 +386,8 @@ message Contract { // Offer restriction numbers repeated UnsignedInt security_label_number = 13; } - ContractOffer offer = 12 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + ContractOffer offer = 12 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Contract Term Asset List message ContractAsset { @@ -448,9 +437,7 @@ message Contract { // Context description String text = 6; } - repeated AssetContext context = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AssetContext context = 9; // Quality desctiption of asset String condition = 10; @@ -550,13 +537,9 @@ message Contract { // Security Labels that define affected terms repeated UnsignedInt security_label_number = 17; } - repeated ValuedItem valued_item = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ValuedItem valued_item = 18; } - repeated ContractAsset asset = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ContractAsset asset = 13; // Entity being ascribed responsibility message Action { @@ -602,9 +585,7 @@ message Contract { // Role type of the agent CodeableConcept role = 5; } - repeated ActionSubject subject = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ActionSubject subject = 6; // Purpose for the Contract Term Action CodeableConcept intent = 7 @@ -699,16 +680,12 @@ message Contract { // Action restriction numbers repeated UnsignedInt security_label_number = 24; } - repeated Action action = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Action action = 14; // Nested Contract Term Group repeated Term group = 15; } - repeated Term term = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Term term = 35; // Extra Information repeated Reference supporting_info = 36 @@ -747,9 +724,7 @@ message Contract { repeated Signature signature = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Signatory signer = 38 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Signatory signer = 38; // Contract Friendly Language message FriendlyLanguage { @@ -778,9 +753,7 @@ message Contract { ContentX content = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated FriendlyLanguage friendly = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated FriendlyLanguage friendly = 39; // Contract Legal Language message LegalLanguage { @@ -809,9 +782,7 @@ message Contract { ContentX content = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated LegalLanguage legal = 40 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated LegalLanguage legal = 40; // Computable Contract Language message ComputableLanguage { @@ -837,9 +808,7 @@ message Contract { ContentX content = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated ComputableLanguage rule = 41 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ComputableLanguage rule = 41; // Binding Contract message LegallyBindingX { diff --git a/proto/r4/core/resources/coverage.proto b/proto/r4/core/resources/coverage.proto index 1aab7b025..8be3765b2 100644 --- a/proto/r4/core/resources/coverage.proto +++ b/proto/r4/core/resources/coverage.proto @@ -145,11 +145,7 @@ message Coverage { // Human readable description of the type and value String name = 6; } - repeated Class class_value = 21 [ - json_name = "class", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Class class_value = 21 [json_name = "class"]; // Relative order of the coverage PositiveInt order = 22; @@ -201,13 +197,9 @@ message Coverage { // The effective period of the exception Period period = 5; } - repeated Exemption exception = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Exemption exception = 6; } - repeated CostToBeneficiary cost_to_beneficiary = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated CostToBeneficiary cost_to_beneficiary = 24; // Reimbursement to insurer Boolean subrogation = 25; diff --git a/proto/r4/core/resources/coverage_eligibility_request.proto b/proto/r4/core/resources/coverage_eligibility_request.proto index ca836d885..25189179f 100644 --- a/proto/r4/core/resources/coverage_eligibility_request.proto +++ b/proto/r4/core/resources/coverage_eligibility_request.proto @@ -169,9 +169,7 @@ message CoverageEligibilityRequest { // Applies to all items Boolean applies_to_all = 6; } - repeated SupportingInformation supporting_info = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SupportingInformation supporting_info = 21; // Patient insurance information message Insurance { @@ -196,9 +194,7 @@ message CoverageEligibilityRequest { // Additional provider contract number String business_arrangement = 6; } - repeated Insurance insurance = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Insurance insurance = 22; // Item to be evaluated for eligibiity message Details { @@ -264,15 +260,11 @@ message CoverageEligibilityRequest { } DiagnosisX diagnosis = 4; } - repeated Diagnosis diagnosis = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Diagnosis diagnosis = 12; // Product or service details repeated Reference detail = 13 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Details item = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Details item = 23; } diff --git a/proto/r4/core/resources/coverage_eligibility_response.proto b/proto/r4/core/resources/coverage_eligibility_response.proto index 5ef4a7ac6..c50a6a94e 100644 --- a/proto/r4/core/resources/coverage_eligibility_response.proto +++ b/proto/r4/core/resources/coverage_eligibility_response.proto @@ -183,6 +183,9 @@ message CoverageEligibilityResponse { // Benefits and authorization details message Items { + option (.google.fhir.proto.fhir_path_message_constraint) = + "category.exists() xor productOrService.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -264,9 +267,7 @@ message CoverageEligibilityResponse { } UsedX used = 6; } - repeated Benefit benefit = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Benefit benefit = 14; // Authorization required flag Boolean authorization_required = 15; @@ -277,16 +278,9 @@ message CoverageEligibilityResponse { // Preauthorization requirements endpoint Uri authorization_url = 17; } - repeated Items item = 7 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "category.exists() xor productOrService.exists()" - ]; + repeated Items item = 7; } - repeated Insurance insurance = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Insurance insurance = 21; // Preauthorization reference String pre_auth_ref = 22; @@ -309,7 +303,5 @@ message CoverageEligibilityResponse { CodeableConcept code = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Errors error = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Errors error = 24; } diff --git a/proto/r4/core/resources/detected_issue.proto b/proto/r4/core/resources/detected_issue.proto index 80b50517b..cb3677127 100644 --- a/proto/r4/core/resources/detected_issue.proto +++ b/proto/r4/core/resources/detected_issue.proto @@ -144,9 +144,7 @@ message DetectedIssue { repeated Reference detail = 5 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Evidence evidence = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Evidence evidence = 18; // Description and context String detail = 19; @@ -178,7 +176,5 @@ message DetectedIssue { (.google.fhir.proto.valid_reference_type) = "PractitionerRole" ]; } - repeated Mitigation mitigation = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Mitigation mitigation = 21; } diff --git a/proto/r4/core/resources/device.proto b/proto/r4/core/resources/device.proto index 293a7ccb0..d2adee395 100644 --- a/proto/r4/core/resources/device.proto +++ b/proto/r4/core/resources/device.proto @@ -111,9 +111,7 @@ message Device { } EntryTypeCode entry_type = 9; } - repeated UdiCarrier udi_carrier = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated UdiCarrier udi_carrier = 12; // active | inactive | entered-in-error | unknown message StatusCode { @@ -187,9 +185,7 @@ message Device { TypeCode type = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated DeviceName device_name = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DeviceName device_name = 21; // The model number for the device String model_number = 22; @@ -219,9 +215,7 @@ message Device { // The version of the standard that is used to operate and communicate String version = 5; } - repeated Specialization specialization = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Specialization specialization = 25; // The actual design of the device or software version running on the device message Version { @@ -244,9 +238,7 @@ message Device { String value = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Version version = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Version version = 26; // The actual configuration settings of a device as it actually operates, // e.g., regulation status, time properties @@ -270,9 +262,7 @@ message Device { // Property value as a code, e.g., NTP4 (synced to NTP) repeated CodeableConcept value_code = 6; } - repeated Property property = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Property property = 27; // Patient to whom Device is affixed Reference patient = 28 diff --git a/proto/r4/core/resources/device_definition.proto b/proto/r4/core/resources/device_definition.proto index e6f05a4d3..6f8df7b8f 100644 --- a/proto/r4/core/resources/device_definition.proto +++ b/proto/r4/core/resources/device_definition.proto @@ -90,9 +90,7 @@ message DeviceDefinition { Uri jurisdiction = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated UdiDeviceIdentifier udi_device_identifier = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated UdiDeviceIdentifier udi_device_identifier = 11; // Name of device manufacturer message ManufacturerX { @@ -140,9 +138,7 @@ message DeviceDefinition { TypeCode type = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated DeviceName device_name = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DeviceName device_name = 13; // The model number for the device String model_number = 14; @@ -169,9 +165,7 @@ message DeviceDefinition { // The version of the standard that is used to operate and communicate String version = 5; } - repeated Specialization specialization = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Specialization specialization = 16; // Available versions repeated String version = 17; @@ -207,9 +201,7 @@ message DeviceDefinition { // Description of capability repeated CodeableConcept description = 5; } - repeated Capability capability = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Capability capability = 22; // The actual configuration settings of a device as it actually operates, // e.g., regulation status, time properties @@ -233,9 +225,7 @@ message DeviceDefinition { // Property value as a code, e.g., NTP4 (synced to NTP) repeated CodeableConcept value_code = 6; } - repeated Property property = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Property property = 23; // Organization responsible for device Reference owner = 24 @@ -283,7 +273,5 @@ message DeviceDefinition { // Whether the substance is a known or suspected allergen Boolean allergenic_indicator = 6; } - repeated Material material = 31 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Material material = 31; } diff --git a/proto/r4/core/resources/device_metric.proto b/proto/r4/core/resources/device_metric.proto index 51dc518b3..011caff69 100644 --- a/proto/r4/core/resources/device_metric.proto +++ b/proto/r4/core/resources/device_metric.proto @@ -178,7 +178,5 @@ message DeviceMetric { // Describes the time last calibration has been performed Instant time = 6; } - repeated Calibration calibration = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Calibration calibration = 19; } diff --git a/proto/r4/core/resources/device_request.proto b/proto/r4/core/resources/device_request.proto index f3104ea51..7280bd2c8 100644 --- a/proto/r4/core/resources/device_request.proto +++ b/proto/r4/core/resources/device_request.proto @@ -171,9 +171,7 @@ message DeviceRequest { } ValueX value = 5; } - repeated Parameter parameter = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Parameter parameter = 20; // Focus of request Reference subject = 21 [ diff --git a/proto/r4/core/resources/diagnostic_report.proto b/proto/r4/core/resources/diagnostic_report.proto index 4647bf4bb..3cae3a8ad 100644 --- a/proto/r4/core/resources/diagnostic_report.proto +++ b/proto/r4/core/resources/diagnostic_report.proto @@ -172,9 +172,7 @@ message DiagnosticReport { (.google.fhir.proto.valid_reference_type) = "Media" ]; } - repeated Media media = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Media media = 24; // Clinical conclusion (interpretation) of test results String conclusion = 25; diff --git a/proto/r4/core/resources/document_manifest.proto b/proto/r4/core/resources/document_manifest.proto index 840e099b3..8a257063a 100644 --- a/proto/r4/core/resources/document_manifest.proto +++ b/proto/r4/core/resources/document_manifest.proto @@ -146,7 +146,5 @@ message DocumentManifest { // Related Resource Reference ref = 5 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Related related = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Related related = 21; } diff --git a/proto/r4/core/resources/document_reference.proto b/proto/r4/core/resources/document_reference.proto index 500660f9e..9d6755bc5 100644 --- a/proto/r4/core/resources/document_reference.proto +++ b/proto/r4/core/resources/document_reference.proto @@ -173,9 +173,7 @@ message DocumentReference { (.google.fhir.proto.valid_reference_type) = "DocumentReference" ]; } - repeated RelatesTo relates_to = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatesTo relates_to = 21; // Human-readable description String description = 22; @@ -201,11 +199,8 @@ message DocumentReference { // Format/content rules for the document Coding format = 5; } - repeated Content content = 24 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Content content = 24 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Clinical context of document message Context { @@ -245,6 +240,5 @@ message DocumentReference { repeated Reference related = 10 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - Context context = 25 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Context context = 25; } diff --git a/proto/r4/core/resources/effect_evidence_synthesis.proto b/proto/r4/core/resources/effect_evidence_synthesis.proto index 7c22c566e..c43817082 100644 --- a/proto/r4/core/resources/effect_evidence_synthesis.proto +++ b/proto/r4/core/resources/effect_evidence_synthesis.proto @@ -33,6 +33,8 @@ message EffectEvidenceSynthesis { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/EffectEvidenceSynthesis"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -197,9 +199,7 @@ message EffectEvidenceSynthesis { // How many participants? Integer number_of_participants = 6; } - SampleSize sample_size = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + SampleSize sample_size = 39; // What was the result per exposure? message ResultsByExposure { @@ -241,9 +241,7 @@ message EffectEvidenceSynthesis { (.google.fhir.proto.valid_reference_type) = "RiskEvidenceSynthesis" ]; } - repeated ResultsByExposure results_by_exposure = 40 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ResultsByExposure results_by_exposure = 40; // What was the estimated effect message EffectEstimate { @@ -294,13 +292,9 @@ message EffectEvidenceSynthesis { // Upper bound Decimal to = 7; } - repeated PrecisionEstimate precision_estimate = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PrecisionEstimate precision_estimate = 9; } - repeated EffectEstimate effect_estimate = 41 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated EffectEstimate effect_estimate = 41; // How certain is the effect message Certainty { @@ -339,11 +333,7 @@ message EffectEvidenceSynthesis { // Used for footnotes or explanatory notes repeated Annotation note = 6; } - repeated CertaintySubcomponent certainty_subcomponent = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated CertaintySubcomponent certainty_subcomponent = 6; } - repeated Certainty certainty = 42 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Certainty certainty = 42; } diff --git a/proto/r4/core/resources/encounter.proto b/proto/r4/core/resources/encounter.proto index c8e45fc16..b3f87f5ac 100644 --- a/proto/r4/core/resources/encounter.proto +++ b/proto/r4/core/resources/encounter.proto @@ -117,9 +117,7 @@ message Encounter { Period period = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated StatusHistory status_history = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StatusHistory status_history = 12; // Classification of patient encounter Coding class_value = 13 [ @@ -148,9 +146,7 @@ message Encounter { Period period = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated ClassHistory class_history = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ClassHistory class_history = 14; // Specific type of encounter repeated CodeableConcept type = 15; @@ -199,9 +195,7 @@ message Encounter { (.google.fhir.proto.valid_reference_type) = "RelatedPerson" ]; } - repeated Participant participant = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 21; // The appointment that scheduled this encounter repeated Reference appointment = 22 @@ -249,9 +243,7 @@ message Encounter { // Ranking of the diagnosis (for each role type) PositiveInt rank = 6; } - repeated Diagnosis diagnosis = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Diagnosis diagnosis = 27; // The set of accounts that may be used for billing for this Encounter repeated Reference account = 28 @@ -302,9 +294,7 @@ message Encounter { // Category or kind of location after discharge CodeableConcept discharge_disposition = 12; } - Hospitalization hospitalization = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Hospitalization hospitalization = 29; // List of locations where the patient has been message Location { @@ -347,9 +337,7 @@ message Encounter { // Time period during which the patient was present at the location Period period = 7; } - repeated Location location = 30 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Location location = 30; // The organization (facility) responsible for this encounter Reference service_provider = 31 diff --git a/proto/r4/core/resources/episode_of_care.proto b/proto/r4/core/resources/episode_of_care.proto index 1142ba175..23f3d8df3 100644 --- a/proto/r4/core/resources/episode_of_care.proto +++ b/proto/r4/core/resources/episode_of_care.proto @@ -119,9 +119,7 @@ message EpisodeOfCare { Period period = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated StatusHistory status_history = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StatusHistory status_history = 12; // Type/class - e.g. specialist referral, disease management repeated CodeableConcept type = 13; @@ -150,9 +148,7 @@ message EpisodeOfCare { // Ranking of the diagnosis (for each role type) PositiveInt rank = 6; } - repeated Diagnosis diagnosis = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Diagnosis diagnosis = 14; // The patient who is the focus of this episode of care Reference patient = 15 [ diff --git a/proto/r4/core/resources/event_definition.proto b/proto/r4/core/resources/event_definition.proto index 4a4a43695..3f66e2654 100644 --- a/proto/r4/core/resources/event_definition.proto +++ b/proto/r4/core/resources/event_definition.proto @@ -32,6 +32,8 @@ message EventDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/EventDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/resources/evidence.proto b/proto/r4/core/resources/evidence.proto index eb695faeb..3ed525035 100644 --- a/proto/r4/core/resources/evidence.proto +++ b/proto/r4/core/resources/evidence.proto @@ -32,6 +32,8 @@ message Evidence { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Evidence"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/resources/evidence_variable.proto b/proto/r4/core/resources/evidence_variable.proto index 4fa470447..45cf54b71 100644 --- a/proto/r4/core/resources/evidence_variable.proto +++ b/proto/r4/core/resources/evidence_variable.proto @@ -32,6 +32,8 @@ message EvidenceVariable { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/EvidenceVariable"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -239,9 +241,6 @@ message EvidenceVariable { } GroupMeasureCode group_measure = 10; } - repeated Characteristic characteristic = 36 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Characteristic characteristic = 36 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/example_scenario.proto b/proto/r4/core/resources/example_scenario.proto index 62db74dd6..298b80588 100644 --- a/proto/r4/core/resources/example_scenario.proto +++ b/proto/r4/core/resources/example_scenario.proto @@ -32,6 +32,8 @@ message ExampleScenario { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ExampleScenario"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -154,9 +156,7 @@ message ExampleScenario { // The description of the actor Markdown description = 7; } - repeated Actor actor = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Actor actor = 23; // Each resource and each version that is present in the workflow message Instance { @@ -216,9 +216,7 @@ message ExampleScenario { Markdown description = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Version version = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Version version = 8; // Resources contained in the instance message ContainedInstance { @@ -238,13 +236,9 @@ message ExampleScenario { // A specific version of a resource contained in the instance String version_id = 5; } - repeated ContainedInstance contained_instance = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ContainedInstance contained_instance = 9; } - repeated Instance instance = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Instance instance = 24; // Each major process - a group of operations message Process { @@ -329,9 +323,7 @@ message ExampleScenario { // Each resource instance used by the responder Instance.ContainedInstance response = 13; } - Operation operation = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Operation operation = 6; // Alternate non-typical step action message Alternative { @@ -354,17 +346,11 @@ message ExampleScenario { // What happens in each alternative option repeated Step step = 6; } - repeated Alternative alternative = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Alternative alternative = 7; } - repeated Step step = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Step step = 8; } - repeated Process process = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Process process = 25; // Another nested workflow repeated Canonical workflow = 26; diff --git a/proto/r4/core/resources/explanation_of_benefit.proto b/proto/r4/core/resources/explanation_of_benefit.proto index a9d27e49d..551731140 100644 --- a/proto/r4/core/resources/explanation_of_benefit.proto +++ b/proto/r4/core/resources/explanation_of_benefit.proto @@ -167,9 +167,7 @@ message ExplanationOfBenefit { // File or case reference Identifier reference = 6; } - repeated RelatedClaim related = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedClaim related = 24; // Prescription authorizing services or products Reference prescription = 25 [ @@ -204,8 +202,7 @@ message ExplanationOfBenefit { (.google.fhir.proto.valid_reference_type) = "RelatedPerson" ]; } - Payee payee = 27 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Payee payee = 27; // Treatment Referral Reference referral = 28 @@ -280,9 +277,7 @@ message ExplanationOfBenefit { // Practitioner credential or specialization CodeableConcept qualification = 8; } - repeated CareTeam care_team = 36 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated CareTeam care_team = 36; // Supporting information message SupportingInformation { @@ -335,9 +330,7 @@ message ExplanationOfBenefit { // Explanation for the information Coding reason = 9; } - repeated SupportingInformation supporting_info = 37 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SupportingInformation supporting_info = 37; // Pertinent diagnosis information message Diagnosis { @@ -376,9 +369,7 @@ message ExplanationOfBenefit { // Package billing code CodeableConcept package_code = 8; } - repeated Diagnosis diagnosis = 38 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Diagnosis diagnosis = 38; // Clinical procedures performed message Procedure { @@ -418,9 +409,7 @@ message ExplanationOfBenefit { repeated Reference udi = 8 [(.google.fhir.proto.valid_reference_type) = "Device"]; } - repeated Procedure procedure = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Procedure procedure = 39; // Precedence (primary, secondary, etc.) PositiveInt precedence = 40; @@ -449,11 +438,8 @@ message ExplanationOfBenefit { // Prior authorization reference number repeated String pre_auth_ref = 6; } - repeated Insurance insurance = 41 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Insurance insurance = 41 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Details of the event message Accident { @@ -484,9 +470,7 @@ message ExplanationOfBenefit { } LocationX location = 6; } - Accident accident = 42 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Accident accident = 42; // Product or service provided message Item { @@ -608,9 +592,7 @@ message ExplanationOfBenefit { // Non-monitary value Decimal value = 7; } - repeated Adjudication adjudication = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Adjudication adjudication = 25; // Additional items message Detail { @@ -718,17 +700,11 @@ message ExplanationOfBenefit { // Subdetail level adjudication details repeated Adjudication adjudication = 16; } - repeated SubDetail sub_detail = 17 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SubDetail sub_detail = 17; } - repeated Detail detail = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Detail detail = 26; } - repeated Item item = 43 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Item item = 43; // Insurer added line items message AddedItem { @@ -887,17 +863,11 @@ message ExplanationOfBenefit { // Added items adjudication repeated Item.Adjudication adjudication = 11; } - repeated AddedItemDetailSubDetail sub_detail = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AddedItemDetailSubDetail sub_detail = 12; } - repeated AddedItemDetail detail = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AddedItemDetail detail = 21; } - repeated AddedItem add_item = 44 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AddedItem add_item = 44; // Header-level adjudication repeated Item.Adjudication adjudication = 45; @@ -921,9 +891,7 @@ message ExplanationOfBenefit { Money amount = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Total total = 46 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Total total = 46; // Payment Details message Payment { @@ -954,8 +922,7 @@ message ExplanationOfBenefit { // Business identifier for the payment Identifier identifier = 9; } - Payment payment = 47 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Payment payment = 47; // Printed form identifier CodeableConcept form_code = 48; @@ -1000,9 +967,7 @@ message ExplanationOfBenefit { // Language of the text CodeableConcept language = 7; } - repeated Note process_note = 50 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Note process_note = 50; // When the benefits are applicable Period benefit_period = 51; @@ -1078,11 +1043,7 @@ message ExplanationOfBenefit { } UsedX used = 6; } - repeated Benefit financial = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Benefit financial = 11; } - repeated BenefitBalance benefit_balance = 52 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated BenefitBalance benefit_balance = 52; } diff --git a/proto/r4/core/resources/family_member_history.proto b/proto/r4/core/resources/family_member_history.proto index 0c90e93ec..f73a02591 100644 --- a/proto/r4/core/resources/family_member_history.proto +++ b/proto/r4/core/resources/family_member_history.proto @@ -33,6 +33,10 @@ message FamilyMemberHistory { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "age.exists() or estimatedAge.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "age.empty() or born.empty()"; // Logical id of this artifact Id id = 1; @@ -204,7 +208,5 @@ message FamilyMemberHistory { // Extra information about condition repeated Annotation note = 8; } - repeated Condition condition = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Condition condition = 27; } diff --git a/proto/r4/core/resources/goal.proto b/proto/r4/core/resources/goal.proto index 7fa9d8a7d..488dbe1c2 100644 --- a/proto/r4/core/resources/goal.proto +++ b/proto/r4/core/resources/goal.proto @@ -118,6 +118,9 @@ message Goal { // Target outcome for the goal message Target { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(detail.exists() and measure.exists()) or detail.exists().not()"; + // Unique id for inter-element referencing String id = 1; @@ -157,12 +160,7 @@ message Goal { } DueX due = 6; } - repeated Target target = 18 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(detail.exists() and measure.exists()) or detail.exists().not()" - ]; + repeated Target target = 18; // When goal status took effect Date status_date = 19; diff --git a/proto/r4/core/resources/graph_definition.proto b/proto/r4/core/resources/graph_definition.proto index d64961cb4..00b3eddd1 100644 --- a/proto/r4/core/resources/graph_definition.proto +++ b/proto/r4/core/resources/graph_definition.proto @@ -32,6 +32,8 @@ message GraphDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/GraphDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -265,18 +267,12 @@ message GraphDefinition { // Documentation for FHIRPath expression String description = 8; } - repeated Compartment compartment = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Compartment compartment = 7; // Additional links from target resource repeated Link link = 8; } - repeated Target target = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Target target = 9; } - repeated Link link = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Link link = 24; } diff --git a/proto/r4/core/resources/group.proto b/proto/r4/core/resources/group.proto index 68f0ebb3c..da390e771 100644 --- a/proto/r4/core/resources/group.proto +++ b/proto/r4/core/resources/group.proto @@ -32,6 +32,8 @@ message Group { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Group"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "member.empty() or (actual = true)"; // Logical id of this artifact Id id = 1; @@ -142,9 +144,7 @@ message Group { // Period over which characteristic is tested Period period = 7; } - repeated Characteristic characteristic = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Characteristic characteristic = 18; // Who or what is in group message Member { @@ -175,7 +175,5 @@ message Group { // If member is no longer in group Boolean inactive = 6; } - repeated Member member = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Member member = 19; } diff --git a/proto/r4/core/resources/healthcare_service.proto b/proto/r4/core/resources/healthcare_service.proto index 2576619d4..33dd5ea92 100644 --- a/proto/r4/core/resources/healthcare_service.proto +++ b/proto/r4/core/resources/healthcare_service.proto @@ -123,9 +123,7 @@ message HealthcareService { // Describes the eligibility conditions for the service Markdown comment = 5; } - repeated Eligibility eligibility = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Eligibility eligibility = 24; // Programs that this service is applicable to repeated CodeableConcept program = 25; @@ -179,9 +177,7 @@ message HealthcareService { // Closing time of day (ignored if allDay = true) Time available_end_time = 7; } - repeated AvailableTime available_time = 30 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AvailableTime available_time = 30; // Not available during this time due to provided reason message NotAvailable { @@ -201,9 +197,7 @@ message HealthcareService { // Service not available from this date Period during = 5; } - repeated NotAvailable not_available = 31 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated NotAvailable not_available = 31; // Description of availability exceptions String availability_exceptions = 32; diff --git a/proto/r4/core/resources/imaging_study.proto b/proto/r4/core/resources/imaging_study.proto index 547638ae9..27f6b4497 100644 --- a/proto/r4/core/resources/imaging_study.proto +++ b/proto/r4/core/resources/imaging_study.proto @@ -230,9 +230,7 @@ message ImagingStudy { (.google.fhir.proto.valid_reference_type) = "RelatedPerson" ]; } - repeated Performer performer = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Performer performer = 14; // A single SOP instance from the series message Instance { @@ -259,11 +257,7 @@ message ImagingStudy { // Description of instance String title = 7; } - repeated Instance instance = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Instance instance = 15; } - repeated Series series = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Series series = 29; } diff --git a/proto/r4/core/resources/immunization.proto b/proto/r4/core/resources/immunization.proto index aceb9d701..47e39a960 100644 --- a/proto/r4/core/resources/immunization.proto +++ b/proto/r4/core/resources/immunization.proto @@ -164,9 +164,7 @@ message Immunization { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated Performer performer = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Performer performer = 27; // Additional immunization notes repeated Annotation note = 28; @@ -189,6 +187,9 @@ message Immunization { // Educational material presented to patient message Education { + option (.google.fhir.proto.fhir_path_message_constraint) = + "documentType.exists() or reference.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -210,12 +211,7 @@ message Immunization { // Educational material presentation date DateTime presentation_date = 7; } - repeated Education education = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "documentType.exists() or reference.exists()" - ]; + repeated Education education = 33; // Patient eligibility for a vaccination program repeated CodeableConcept program_eligibility = 34; @@ -244,9 +240,7 @@ message Immunization { // Indicates self-reported reaction Boolean reported = 6; } - repeated Reaction reaction = 36 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Reaction reaction = 36; // Protocol followed by the provider message ProtocolApplied { @@ -292,7 +286,5 @@ message Immunization { } SeriesDosesX series_doses = 8; } - repeated ProtocolApplied protocol_applied = 37 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ProtocolApplied protocol_applied = 37; } diff --git a/proto/r4/core/resources/immunization_recommendation.proto b/proto/r4/core/resources/immunization_recommendation.proto index f9fb96c4a..1d0d5ba56 100644 --- a/proto/r4/core/resources/immunization_recommendation.proto +++ b/proto/r4/core/resources/immunization_recommendation.proto @@ -80,6 +80,9 @@ message ImmunizationRecommendation { // Vaccine administration recommendations message Recommendation { + option (.google.fhir.proto.fhir_path_message_constraint) = + "vaccineCode.exists() or targetDisease.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -124,9 +127,7 @@ message ImmunizationRecommendation { DateTime value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated DateCriterion date_criterion = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DateCriterion date_criterion = 9; // Protocol details String description = 10; @@ -166,11 +167,6 @@ message ImmunizationRecommendation { repeated Reference supporting_patient_information = 15 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Recommendation recommendation = 14 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "vaccineCode.exists() or targetDisease.exists()" - ]; + repeated Recommendation recommendation = 14 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/implementation_guide.proto b/proto/r4/core/resources/implementation_guide.proto index e8c6d2728..831dfe472 100644 --- a/proto/r4/core/resources/implementation_guide.proto +++ b/proto/r4/core/resources/implementation_guide.proto @@ -32,6 +32,10 @@ message ImplementationGuide { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "definition.resource.fhirVersion.all(%context.fhirVersion contains $this)"; // Logical id of this artifact Id id = 1; @@ -174,9 +178,7 @@ message ImplementationGuide { // Version of the IG String version = 6; } - repeated DependsOn depends_on = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DependsOn depends_on = 26; // Profiles that apply globally message Global { @@ -211,12 +213,13 @@ message ImplementationGuide { Canonical profile = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Global global = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Global global = 27; // Information needed to build the IG message Definition { + option (.google.fhir.proto.fhir_path_message_constraint) = + "resource.groupingId.all(%context.grouping.id contains $this)"; + // Unique id for inter-element referencing String id = 1; @@ -244,9 +247,7 @@ message ImplementationGuide { // Human readable text describing the package String description = 5; } - repeated Grouping grouping = 4 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Grouping grouping = 4; // Resource in the implementation guide message Resource { @@ -302,11 +303,8 @@ message ImplementationGuide { // Grouping this is part of Id grouping_id = 9; } - repeated Resource resource = 5 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Resource resource = 5 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Page/Section in the Guide message Page { @@ -357,8 +355,7 @@ message ImplementationGuide { // Nested Pages / Sections repeated Page page = 7; } - Page page = 6 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Page page = 6; // Defines how IG is built by tools message Parameter { @@ -395,9 +392,7 @@ message ImplementationGuide { String value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Parameter parameter = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Parameter parameter = 7; // A template for building resources message Template { @@ -421,16 +416,9 @@ message ImplementationGuide { // The scope in which the template applies String scope = 6; } - repeated Template template = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Template template = 8; } - Definition definition = 28 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "resource.groupingId.all(%context.grouping.id contains $this)" - ]; + Definition definition = 28; // Information about an assembled IG message Manifest { @@ -477,11 +465,8 @@ message ImplementationGuide { // Relative path for page in IG Url relative_path = 6; } - repeated ManifestResource resource = 5 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated ManifestResource resource = 5 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // HTML page within the parent IG message ManifestPage { @@ -504,9 +489,7 @@ message ImplementationGuide { // Anchor available on the page repeated String anchor = 6; } - repeated ManifestPage page = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ManifestPage page = 6; // Image within the IG repeated String image = 7; @@ -514,7 +497,5 @@ message ImplementationGuide { // Additional linkable file in IG repeated String other = 8; } - Manifest manifest = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Manifest manifest = 29; } diff --git a/proto/r4/core/resources/insurance_plan.proto b/proto/r4/core/resources/insurance_plan.proto index b8cb499a4..2971c3656 100644 --- a/proto/r4/core/resources/insurance_plan.proto +++ b/proto/r4/core/resources/insurance_plan.proto @@ -33,6 +33,8 @@ message InsurancePlan { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/InsurancePlan"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(identifier.count() + name.count()) > 0"; // Logical id of this artifact Id id = 1; @@ -128,9 +130,7 @@ message InsurancePlan { // Visiting or postal addresses for the contact Address address = 7; } - repeated Contact contact = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Contact contact = 19; // Technical endpoint repeated Reference endpoint = 20 @@ -194,19 +194,12 @@ message InsurancePlan { // Benefit limit details CodeableConcept code = 5; } - repeated Limit limit = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Limit limit = 6; } - repeated CoverageBenefit benefit = 6 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated CoverageBenefit benefit = 6 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Coverage coverage = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Coverage coverage = 22; // Plan details message Plan { @@ -256,9 +249,7 @@ message InsurancePlan { // Additional cost information String comment = 7; } - repeated GeneralCost general_cost = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated GeneralCost general_cost = 8; // Specific costs message SpecificCost { @@ -314,19 +305,11 @@ message InsurancePlan { // The actual cost value Quantity value = 7; } - repeated Cost cost = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Cost cost = 5; } - repeated PlanBenefit benefit = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PlanBenefit benefit = 5; } - repeated SpecificCost specific_cost = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SpecificCost specific_cost = 9; } - repeated Plan plan = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Plan plan = 23; } diff --git a/proto/r4/core/resources/invoice.proto b/proto/r4/core/resources/invoice.proto index 2b1985308..4945938b8 100644 --- a/proto/r4/core/resources/invoice.proto +++ b/proto/r4/core/resources/invoice.proto @@ -128,9 +128,7 @@ message Invoice { (.google.fhir.proto.valid_reference_type) = "RelatedPerson" ]; } - repeated Participant participant = 17 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 17; // Issuing Organization of Invoice Reference issuer = 18 @@ -206,13 +204,9 @@ message Invoice { // Monetary amount associated with this component Money amount = 7; } - repeated PriceComponent price_component = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PriceComponent price_component = 6; } - repeated LineItem line_item = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated LineItem line_item = 20; // Components of Invoice total repeated LineItem.PriceComponent total_price_component = 21; diff --git a/proto/r4/core/resources/library.proto b/proto/r4/core/resources/library.proto index 2353bd94d..24774c39e 100644 --- a/proto/r4/core/resources/library.proto +++ b/proto/r4/core/resources/library.proto @@ -32,6 +32,8 @@ message Library { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Library"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/resources/linkage.proto b/proto/r4/core/resources/linkage.proto index 4aac695d9..2e278eb0d 100644 --- a/proto/r4/core/resources/linkage.proto +++ b/proto/r4/core/resources/linkage.proto @@ -32,6 +32,7 @@ message Linkage { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Linkage"; + option (.google.fhir.proto.fhir_path_message_constraint) = "item.count()>1"; // Logical id of this artifact Id id = 1; @@ -106,9 +107,6 @@ message Linkage { (.google.fhir.proto.valid_reference_type) = "Resource" ]; } - repeated Item item = 12 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Item item = 12 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/list.proto b/proto/r4/core/resources/list.proto index b1e781a40..5a0fa683f 100644 --- a/proto/r4/core/resources/list.proto +++ b/proto/r4/core/resources/list.proto @@ -32,6 +32,12 @@ message List { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/List"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "mode = 'working' or entry.date.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "mode = 'changes' or entry.deleted.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "emptyReason.empty() or entry.empty()"; // Logical id of this artifact Id id = 1; @@ -159,9 +165,7 @@ message List { (.google.fhir.proto.valid_reference_type) = "Resource" ]; } - repeated Entry entry = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Entry entry = 21; // Why list is empty CodeableConcept empty_reason = 22; diff --git a/proto/r4/core/resources/location.proto b/proto/r4/core/resources/location.proto index ed596a441..3665b50c5 100644 --- a/proto/r4/core/resources/location.proto +++ b/proto/r4/core/resources/location.proto @@ -144,9 +144,7 @@ message Location { // Altitude with WGS84 datum Decimal altitude = 6; } - Position position = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Position position = 21; // Organization responsible for provisioning and upkeep Reference managing_organization = 22 @@ -193,9 +191,7 @@ message Location { // Time that the Location closes Time closing_time = 7; } - repeated HoursOfOperation hours_of_operation = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated HoursOfOperation hours_of_operation = 24; // Description of availability exceptions String availability_exceptions = 25; diff --git a/proto/r4/core/resources/measure.proto b/proto/r4/core/resources/measure.proto index 09c0af8d6..9ab636dfb 100644 --- a/proto/r4/core/resources/measure.proto +++ b/proto/r4/core/resources/measure.proto @@ -32,6 +32,10 @@ message Measure { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Measure"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "group.stratifier.all((code | description | criteria).exists() xor component.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -242,9 +246,7 @@ message Measure { Expression criteria = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Population population = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Population population = 6; // Stratifier criteria for the measure message Stratifier { @@ -287,17 +289,11 @@ message Measure { Expression criteria = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Component component = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 7; } - repeated Stratifier stratifier = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Stratifier stratifier = 7; } - repeated Group group = 49 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Group group = 49; // What other data should be reported with the measure message SupplementalData { @@ -323,7 +319,5 @@ message Measure { Expression criteria = 7 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated SupplementalData supplemental_data = 50 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SupplementalData supplemental_data = 50; } diff --git a/proto/r4/core/resources/measure_report.proto b/proto/r4/core/resources/measure_report.proto index e63547955..2823a9972 100644 --- a/proto/r4/core/resources/measure_report.proto +++ b/proto/r4/core/resources/measure_report.proto @@ -32,6 +32,10 @@ message MeasureReport { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/MeasureReport"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "group.stratifier.stratum.all(value.exists() xor component.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type != 'data-collection') or group.exists().not()"; // Logical id of this artifact Id id = 1; @@ -168,9 +172,7 @@ message MeasureReport { Reference subject_results = 6 [(.google.fhir.proto.valid_reference_type) = "List"]; } - repeated Population population = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Population population = 5; // What score this group achieved Quantity measure_score = 6; @@ -223,9 +225,7 @@ message MeasureReport { CodeableConcept value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Component component = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 5; // Population results in this stratum message StratifierGroupPopulation { @@ -251,24 +251,16 @@ message MeasureReport { Reference subject_results = 6 [(.google.fhir.proto.valid_reference_type) = "List"]; } - repeated StratifierGroupPopulation population = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StratifierGroupPopulation population = 6; // What score this stratum achieved Quantity measure_score = 7; } - repeated StratifierGroup stratum = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StratifierGroup stratum = 5; } - repeated Stratifier stratifier = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Stratifier stratifier = 7; } - repeated Group group = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Group group = 19; // What data was used to calculate the measure score repeated Reference evaluated_resource = 20 diff --git a/proto/r4/core/resources/medication.proto b/proto/r4/core/resources/medication.proto index 8a7118646..ca38f6058 100644 --- a/proto/r4/core/resources/medication.proto +++ b/proto/r4/core/resources/medication.proto @@ -125,9 +125,7 @@ message Medication { // Quantity of ingredient present Ratio strength = 6; } - repeated Ingredient ingredient = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Ingredient ingredient = 16; // Details about packaged medications message Batch { @@ -146,6 +144,5 @@ message Medication { // When batch will expire DateTime expiration_date = 5; } - Batch batch = 17 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Batch batch = 17; } diff --git a/proto/r4/core/resources/medication_administration.proto b/proto/r4/core/resources/medication_administration.proto index e12466682..a5088cc4d 100644 --- a/proto/r4/core/resources/medication_administration.proto +++ b/proto/r4/core/resources/medication_administration.proto @@ -163,9 +163,7 @@ message MedicationAdministration { (.google.fhir.proto.valid_reference_type) = "Device" ]; } - repeated Performer performer = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Performer performer = 21; // Reason administration performed repeated CodeableConcept reason_code = 22; @@ -190,6 +188,9 @@ message MedicationAdministration { // Details of how medication was taken message Dosage { + option (.google.fhir.proto.fhir_path_message_constraint) = + "dose.exists() or rate.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -225,11 +226,7 @@ message MedicationAdministration { } RateX rate = 9; } - Dosage dosage = 27 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = "dose.exists() or rate.exists()" - ]; + Dosage dosage = 27; // A list of events of interest in the lifecycle repeated Reference event_history = 28 diff --git a/proto/r4/core/resources/medication_dispense.proto b/proto/r4/core/resources/medication_dispense.proto index 3386577f9..05bc00b08 100644 --- a/proto/r4/core/resources/medication_dispense.proto +++ b/proto/r4/core/resources/medication_dispense.proto @@ -32,6 +32,8 @@ message MedicationDispense { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/MedicationDispense"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "whenHandedOver.empty() or whenPrepared.empty() or whenHandedOver >= whenPrepared"; // Logical id of this artifact Id id = 1; @@ -155,9 +157,7 @@ message MedicationDispense { (.google.fhir.proto.valid_reference_type) = "RelatedPerson" ]; } - repeated Performer performer = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Performer performer = 19; // Where the dispense occurred Reference location = 20 @@ -227,9 +227,7 @@ message MedicationDispense { (.google.fhir.proto.valid_reference_type) = "PractitionerRole" ]; } - Substitution substitution = 31 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Substitution substitution = 31; // Clinical issue with action repeated Reference detected_issue = 32 diff --git a/proto/r4/core/resources/medication_knowledge.proto b/proto/r4/core/resources/medication_knowledge.proto index 5079b1e00..ec4e6e910 100644 --- a/proto/r4/core/resources/medication_knowledge.proto +++ b/proto/r4/core/resources/medication_knowledge.proto @@ -114,9 +114,7 @@ message MedicationKnowledge { (.google.fhir.proto.valid_reference_type) = "MedicationKnowledge" ]; } - repeated RelatedMedicationKnowledge related_medication_knowledge = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedMedicationKnowledge related_medication_knowledge = 16; // A medication resource that is associated with this medication repeated Reference associated_medication = 17 @@ -145,9 +143,7 @@ message MedicationKnowledge { (.google.fhir.proto.valid_reference_type) = "Media" ]; } - repeated Monograph monograph = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Monograph monograph = 19; // Active or inactive ingredient message Ingredient { @@ -179,9 +175,7 @@ message MedicationKnowledge { // Quantity of ingredient present Ratio strength = 6; } - repeated Ingredient ingredient = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Ingredient ingredient = 20; // The instructions for preparing the medication Markdown preparation_instruction = 21; @@ -211,9 +205,7 @@ message MedicationKnowledge { Money cost = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Cost cost = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Cost cost = 23; // Program under which a medication is reviewed message MonitoringProgram { @@ -232,9 +224,7 @@ message MedicationKnowledge { // Name of the reviewing program String name = 5; } - repeated MonitoringProgram monitoring_program = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated MonitoringProgram monitoring_program = 24; // Guidelines for administration of the medication message AdministrationGuidelines { @@ -266,9 +256,7 @@ message MedicationKnowledge { repeated .google.fhir.r4.core.Dosage dosage = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Dosage dosage = 4 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Dosage dosage = 4; // Indication for use that apply to the specific administration guidelines message IndicationX { @@ -310,13 +298,9 @@ message MedicationKnowledge { // The specific characteristic repeated String value = 5; } - repeated PatientCharacteristics patient_characteristics = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PatientCharacteristics patient_characteristics = 6; } - repeated AdministrationGuidelines administration_guidelines = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AdministrationGuidelines administration_guidelines = 25; // Categorization of the medication within a formulary or classification // system @@ -338,9 +322,7 @@ message MedicationKnowledge { // Specific category assigned to the medication repeated CodeableConcept classification = 5; } - repeated MedicineClassification medicine_classification = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated MedicineClassification medicine_classification = 26; // Details about packaged medications message Packaging { @@ -360,9 +342,7 @@ message MedicationKnowledge { // The number of product units the package would contain if fully loaded SimpleQuantity quantity = 5; } - Packaging packaging = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Packaging packaging = 27; // Specifies descriptive properties of the medicine message DrugCharacteristic { @@ -391,9 +371,7 @@ message MedicationKnowledge { } ValueX value = 5; } - repeated DrugCharacteristic drug_characteristic = 28 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DrugCharacteristic drug_characteristic = 28; // Potential clinical issue with or between medication(s) repeated Reference contraindication = 29 @@ -437,9 +415,7 @@ message MedicationKnowledge { Boolean allowed = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Substitution substitution = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Substitution substitution = 5; // Specifies the schedule of a medication in jurisdiction message Schedule { @@ -456,9 +432,7 @@ message MedicationKnowledge { CodeableConcept schedule = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Schedule schedule = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Schedule schedule = 6; // The maximum number of units of the medication that can be dispensed in a // period @@ -479,13 +453,9 @@ message MedicationKnowledge { // The period that applies to the maximum number of units Duration period = 5; } - MaxDispense max_dispense = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + MaxDispense max_dispense = 7; } - repeated Regulatory regulatory = 30 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Regulatory regulatory = 30; // The time course of drug absorption, distribution, metabolism and excretion // of a medication from the body @@ -508,7 +478,5 @@ message MedicationKnowledge { // Time required for concentration in the body to decrease by half Duration half_life_period = 6; } - repeated Kinetics kinetics = 31 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Kinetics kinetics = 31; } diff --git a/proto/r4/core/resources/medication_request.proto b/proto/r4/core/resources/medication_request.proto index b78b2f29b..c91bb07b6 100644 --- a/proto/r4/core/resources/medication_request.proto +++ b/proto/r4/core/resources/medication_request.proto @@ -272,9 +272,7 @@ message MedicationRequest { // First fill duration Duration duration = 5; } - InitialFill initial_fill = 4 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + InitialFill initial_fill = 4; // Minimum period of time between dispenses Duration dispense_interval = 5; @@ -295,9 +293,7 @@ message MedicationRequest { Reference performer = 10 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - DispenseRequest dispense_request = 37 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + DispenseRequest dispense_request = 37; // Any restrictions on medication substitution message Substitution { @@ -325,9 +321,7 @@ message MedicationRequest { // Why should (not) substitution be made CodeableConcept reason = 5; } - Substitution substitution = 38 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Substitution substitution = 38; // An order/prescription that is being replaced Reference prior_prescription = 39 diff --git a/proto/r4/core/resources/medicinal_product.proto b/proto/r4/core/resources/medicinal_product.proto index c42af99dc..738fb7deb 100644 --- a/proto/r4/core/resources/medicinal_product.proto +++ b/proto/r4/core/resources/medicinal_product.proto @@ -158,9 +158,7 @@ message MedicinalProduct { Coding type = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated NamePart name_part = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated NamePart name_part = 5; // Country where the name applies message CountryLanguage { @@ -184,15 +182,10 @@ message MedicinalProduct { CodeableConcept language = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated CountryLanguage country_language = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated CountryLanguage country_language = 6; } - repeated Name name = 26 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Name name = 26 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Reference to another product, e.g. for linking authorised to // investigational product @@ -230,9 +223,7 @@ message MedicinalProduct { Reference regulator = 9 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - repeated ManufacturingBusinessOperation manufacturing_business_operation = 28 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ManufacturingBusinessOperation manufacturing_business_operation = 28; // Indicates if the medicinal product has an orphan designation for the // treatment of a rare disease @@ -276,7 +267,5 @@ message MedicinalProduct { // Animal species for which this applies CodeableConcept species = 10; } - repeated SpecialDesignation special_designation = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SpecialDesignation special_designation = 29; } diff --git a/proto/r4/core/resources/medicinal_product_authorization.proto b/proto/r4/core/resources/medicinal_product_authorization.proto index 9184e7943..7404bafb9 100644 --- a/proto/r4/core/resources/medicinal_product_authorization.proto +++ b/proto/r4/core/resources/medicinal_product_authorization.proto @@ -133,9 +133,7 @@ message MedicinalProductAuthorization { // The start and expected end date of the authorization Period validity_period = 8; } - repeated JurisdictionalAuthorization jurisdictional_authorization = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated JurisdictionalAuthorization jurisdictional_authorization = 22; // Marketing Authorization Holder Reference holder = 23 @@ -177,7 +175,5 @@ message MedicinalProductAuthorization { // Applcations submitted to obtain a marketing authorization repeated Procedure application = 7; } - Procedure procedure = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Procedure procedure = 25; } diff --git a/proto/r4/core/resources/medicinal_product_contraindication.proto b/proto/r4/core/resources/medicinal_product_contraindication.proto index 01c8a35cb..8f8b80afd 100644 --- a/proto/r4/core/resources/medicinal_product_contraindication.proto +++ b/proto/r4/core/resources/medicinal_product_contraindication.proto @@ -116,9 +116,7 @@ message MedicinalProductContraindication { MedicationX medication = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated OtherTherapy other_therapy = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated OtherTherapy other_therapy = 15; // The population group to which this applies repeated Population population = 16; diff --git a/proto/r4/core/resources/medicinal_product_indication.proto b/proto/r4/core/resources/medicinal_product_indication.proto index 1aeb2b47a..c1cb490ec 100644 --- a/proto/r4/core/resources/medicinal_product_indication.proto +++ b/proto/r4/core/resources/medicinal_product_indication.proto @@ -117,9 +117,7 @@ message MedicinalProductIndication { MedicationX medication = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated OtherTherapy other_therapy = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated OtherTherapy other_therapy = 16; // Describe the undesirable effects of the medicinal product repeated Reference undesirable_effect = 17 diff --git a/proto/r4/core/resources/medicinal_product_ingredient.proto b/proto/r4/core/resources/medicinal_product_ingredient.proto index b12af225e..c18c91d17 100644 --- a/proto/r4/core/resources/medicinal_product_ingredient.proto +++ b/proto/r4/core/resources/medicinal_product_ingredient.proto @@ -160,17 +160,11 @@ message MedicinalProductIngredient { // The country or countries for which the strength range applies repeated CodeableConcept country = 8; } - repeated ReferenceStrength reference_strength = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ReferenceStrength reference_strength = 10; } - repeated Strength strength = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Strength strength = 7; } - repeated SpecifiedSubstance specified_substance = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated SpecifiedSubstance specified_substance = 14; // The ingredient substance message Substance { @@ -191,7 +185,5 @@ message MedicinalProductIngredient { // manufactured item or pharmaceutical product repeated SpecifiedSubstance.Strength strength = 5; } - Substance substance = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Substance substance = 15; } diff --git a/proto/r4/core/resources/medicinal_product_interaction.proto b/proto/r4/core/resources/medicinal_product_interaction.proto index aa7a4032f..d36d67af3 100644 --- a/proto/r4/core/resources/medicinal_product_interaction.proto +++ b/proto/r4/core/resources/medicinal_product_interaction.proto @@ -98,9 +98,7 @@ message MedicinalProductInteraction { ItemX item = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Interactant interactant = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Interactant interactant = 12; // The type of the interaction e.g. drug-drug interaction, drug-food // interaction, drug-lab test interaction diff --git a/proto/r4/core/resources/medicinal_product_packaged.proto b/proto/r4/core/resources/medicinal_product_packaged.proto index e9d391bc6..791efc81b 100644 --- a/proto/r4/core/resources/medicinal_product_packaged.proto +++ b/proto/r4/core/resources/medicinal_product_packaged.proto @@ -105,9 +105,7 @@ message MedicinalProductPackaged { // packaging) Identifier immediate_packaging = 5; } - repeated BatchIdentifier batch_identifier = 17 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated BatchIdentifier batch_identifier = 17; // A packaging item, as a contained for medicine, possibly with other // packaging items within @@ -164,9 +162,6 @@ message MedicinalProductPackaged { repeated Reference manufacturer = 15 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - repeated PackageItem package_item = 18 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated PackageItem package_item = 18 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/medicinal_product_pharmaceutical.proto b/proto/r4/core/resources/medicinal_product_pharmaceutical.proto index 0fc2b8653..2187a404f 100644 --- a/proto/r4/core/resources/medicinal_product_pharmaceutical.proto +++ b/proto/r4/core/resources/medicinal_product_pharmaceutical.proto @@ -98,9 +98,7 @@ message MedicinalProductPharmaceutical { // The status of characteristic e.g. assigned or pending CodeableConcept status = 5; } - repeated Characteristics characteristics = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Characteristics characteristics = 15; // The path by which the pharmaceutical product is taken into or makes contact // with the body @@ -181,17 +179,10 @@ message MedicinalProductPharmaceutical { // Extra information about the withdrawal period String supporting_information = 6; } - repeated WithdrawalPeriod withdrawal_period = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated WithdrawalPeriod withdrawal_period = 5; } - repeated TargetSpecies target_species = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated TargetSpecies target_species = 10; } - repeated RouteOfAdministration route_of_administration = 16 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated RouteOfAdministration route_of_administration = 16 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/message_definition.proto b/proto/r4/core/resources/message_definition.proto index a585bf238..3b30a5024 100644 --- a/proto/r4/core/resources/message_definition.proto +++ b/proto/r4/core/resources/message_definition.proto @@ -33,6 +33,8 @@ message MessageDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/MessageDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -161,6 +163,9 @@ message MessageDefinition { // Resource(s) that are the subject of the event message Focus { + option (.google.fhir.proto.fhir_path_message_constraint) = + "max='*' or (max.toInteger() > 0)"; + // Unique id for inter-element referencing String id = 1; @@ -198,12 +203,7 @@ message MessageDefinition { // Maximum number of focuses of this type String max = 7; } - repeated Focus focus = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "max='*' or (max.toInteger() > 0)" - ]; + repeated Focus focus = 30; // always | on-error | never | on-success message ResponseRequiredCode { @@ -239,9 +239,7 @@ message MessageDefinition { // When should this response be used Markdown situation = 5; } - repeated AllowedResponse allowed_response = 32 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AllowedResponse allowed_response = 32; // Canonical reference to a GraphDefinition repeated Canonical graph = 33; diff --git a/proto/r4/core/resources/message_header.proto b/proto/r4/core/resources/message_header.proto index 8954eca9f..a6f5b8cb0 100644 --- a/proto/r4/core/resources/message_header.proto +++ b/proto/r4/core/resources/message_header.proto @@ -102,9 +102,7 @@ message MessageHeader { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated MessageDestination destination = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated MessageDestination destination = 11; // Real world sender of the message Reference sender = 12 [ @@ -152,11 +150,8 @@ message MessageHeader { Url endpoint = 8 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - MessageSource source = 15 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + MessageSource source = 15 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Final responsibility for event Reference responsible = 16 [ @@ -205,9 +200,7 @@ message MessageHeader { Reference details = 6 [(.google.fhir.proto.valid_reference_type) = "OperationOutcome"]; } - Response response = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Response response = 18; // The actual content of the message repeated Reference focus = 19 diff --git a/proto/r4/core/resources/metadata_resource.proto b/proto/r4/core/resources/metadata_resource.proto index 087409302..0e0db4a74 100644 --- a/proto/r4/core/resources/metadata_resource.proto +++ b/proto/r4/core/resources/metadata_resource.proto @@ -32,6 +32,8 @@ message MetadataResource { option (.google.fhir.proto.structure_definition_kind) = KIND_LOGICAL; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/MetadataResource"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/resources/molecular_sequence.proto b/proto/r4/core/resources/molecular_sequence.proto index 310c13fbc..0bc9337c7 100644 --- a/proto/r4/core/resources/molecular_sequence.proto +++ b/proto/r4/core/resources/molecular_sequence.proto @@ -32,6 +32,8 @@ message MolecularSequence { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/MolecularSequence"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "coordinateSystem = 1 or coordinateSystem = 0"; // Logical id of this artifact Id id = 1; @@ -106,6 +108,11 @@ message MolecularSequence { // A sequence used as reference message ReferenceSeq { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(genomeBuild.count()+referenceSeqId.count()+ referenceSeqPointer.count()+ referenceSeqString.count()) = 1"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(chromosome.empty() and genomeBuild.empty()) or (chromosome.exists() and genomeBuild.exists())"; + // Unique id for inter-element referencing String id = 1; @@ -172,14 +179,7 @@ message MolecularSequence { // End position of the window on the reference sequence Integer window_end = 12; } - ReferenceSeq reference_seq = 18 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(genomeBuild.count()+referenceSeqId.count()+ referenceSeqPointer.count()+ referenceSeqString.count()) = 1", - (.google.fhir.proto.fhir_path_constraint) = - "(chromosome.empty() and genomeBuild.empty()) or (chromosome.exists() and genomeBuild.exists())" - ]; + ReferenceSeq reference_seq = 18; // Variant in sequence message Variant { @@ -211,9 +211,7 @@ message MolecularSequence { Reference variant_pointer = 9 [(.google.fhir.proto.valid_reference_type) = "Observation"]; } - repeated Variant variant = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Variant variant = 19; // Sequence that was observed String observed_seq = 20; @@ -319,12 +317,9 @@ message MolecularSequence { // FScore of the GQ score repeated Decimal f_measure = 10; } - Roc roc = 18 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Roc roc = 18; } - repeated Quality quality = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Quality quality = 21; // Average number of reads representing a given nucleotide in the // reconstructed sequence @@ -375,9 +370,7 @@ message MolecularSequence { // Id of the read String readset_id = 9; } - repeated Repository repository = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Repository repository = 23; // Pointer to next atomic sequence repeated Reference pointer = 24 @@ -420,8 +413,7 @@ message MolecularSequence { // Structural variant outer end Integer end = 5; } - Outer outer = 7 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Outer outer = 7; // Structural variant inner message Inner { @@ -440,10 +432,7 @@ message MolecularSequence { // Structural variant inner end Integer end = 5; } - Inner inner = 8 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Inner inner = 8; } - repeated StructureVariant structure_variant = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StructureVariant structure_variant = 25; } diff --git a/proto/r4/core/resources/naming_system.proto b/proto/r4/core/resources/naming_system.proto index 6802d4c47..618c46fbf 100644 --- a/proto/r4/core/resources/naming_system.proto +++ b/proto/r4/core/resources/naming_system.proto @@ -32,6 +32,12 @@ message NamingSystem { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/NamingSystem"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "kind != 'root' or uniqueId.all(type != 'uuid')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "uniqueId.where(preferred = true).select(type).isDistinct()"; // Logical id of this artifact Id id = 1; @@ -169,9 +175,6 @@ message NamingSystem { // When is identifier valid? Period period = 8; } - repeated UniqueId unique_id = 22 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated UniqueId unique_id = 22 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/nutrition_order.proto b/proto/r4/core/resources/nutrition_order.proto index 98c4b8747..b1280d77e 100644 --- a/proto/r4/core/resources/nutrition_order.proto +++ b/proto/r4/core/resources/nutrition_order.proto @@ -32,6 +32,8 @@ message NutritionOrder { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/NutritionOrder"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "oralDiet.exists() or supplement.exists() or enteralFormula.exists()"; // Logical id of this artifact Id id = 1; @@ -173,9 +175,7 @@ message NutritionOrder { // Quantity of the specified nutrient SimpleQuantity amount = 5; } - repeated Nutrient nutrient = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Nutrient nutrient = 6; // Required texture modifications message Texture { @@ -195,9 +195,7 @@ message NutritionOrder { // nutritional purposes CodeableConcept food_type = 5; } - repeated Texture texture = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Texture texture = 7; // The required consistency of fluids and liquids provided to the patient repeated CodeableConcept fluid_consistency_type = 8; @@ -205,9 +203,7 @@ message NutritionOrder { // Instructions or additional information about the oral diet String instruction = 9; } - OralDiet oral_diet = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + OralDiet oral_diet = 23; // Supplement components message Supplement { @@ -235,9 +231,7 @@ message NutritionOrder { // Instructions or additional information about the oral supplement String instruction = 8; } - repeated Supplement supplement = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Supplement supplement = 24; // Enteral formula components message EnteralFormula { @@ -296,9 +290,7 @@ message NutritionOrder { } RateX rate = 6; } - repeated Administration administration = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Administration administration = 10; // Upper limit on formula volume per unit of time SimpleQuantity max_volume_to_deliver = 11; @@ -306,9 +298,7 @@ message NutritionOrder { // Formula feeding instructions expressed as text String administration_instruction = 12; } - EnteralFormula enteral_formula = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + EnteralFormula enteral_formula = 25; // Comments repeated Annotation note = 26; diff --git a/proto/r4/core/resources/observation.proto b/proto/r4/core/resources/observation.proto index 9390b7e13..b80546fda 100644 --- a/proto/r4/core/resources/observation.proto +++ b/proto/r4/core/resources/observation.proto @@ -32,6 +32,10 @@ message Observation { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Observation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact Id id = 1; @@ -197,6 +201,9 @@ message Observation { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -224,12 +231,7 @@ message Observation { // Text based reference range in an observation String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Related resource that belongs to the Observation group repeated Reference has_member = 31 [ @@ -292,7 +294,5 @@ message Observation { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; } diff --git a/proto/r4/core/resources/observation_definition.proto b/proto/r4/core/resources/observation_definition.proto index 3828fe13c..601e3f162 100644 --- a/proto/r4/core/resources/observation_definition.proto +++ b/proto/r4/core/resources/observation_definition.proto @@ -120,9 +120,7 @@ message ObservationDefinition { // Decimal precision of observation quantitative results Integer decimal_precision = 7; } - QuantitativeDetails quantitative_details = 17 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + QuantitativeDetails quantitative_details = 17; // Qualified range for continuous and ordinal observation results message QualifiedInterval { @@ -187,9 +185,7 @@ message ObservationDefinition { // Condition associated with the reference range String condition = 11; } - repeated QualifiedInterval qualified_interval = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated QualifiedInterval qualified_interval = 18; // Value set of valid coded values for the observations conforming to this // ObservationDefinition diff --git a/proto/r4/core/resources/operation_definition.proto b/proto/r4/core/resources/operation_definition.proto index 9a03f8388..b5cbe290f 100644 --- a/proto/r4/core/resources/operation_definition.proto +++ b/proto/r4/core/resources/operation_definition.proto @@ -33,6 +33,8 @@ message OperationDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/OperationDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -183,6 +185,13 @@ message OperationDefinition { // Parameters for the operation/query message Parameter { + option (.google.fhir.proto.fhir_path_message_constraint) = + "type.exists() or part.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "searchType.exists() implies type = 'string'"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "targetProfile.exists() implies (type = 'Reference' or type = 'canonical')"; + // Unique id for inter-element referencing String id = 1; @@ -296,9 +305,7 @@ message OperationDefinition { Canonical value_set = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Binding binding = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Binding binding = 12; // References to this parameter message ReferencedFrom { @@ -318,23 +325,12 @@ message OperationDefinition { // Element id of reference String source_id = 5; } - repeated ReferencedFrom referenced_from = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ReferencedFrom referenced_from = 13; // Parts of a nested Parameter repeated Parameter part = 14; } - repeated Parameter parameter = 34 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "type.exists() or part.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "searchType.exists() implies type = 'string'", - (.google.fhir.proto.fhir_path_constraint) = - "targetProfile.exists() implies (type = 'Reference' or type = 'canonical')" - ]; + repeated Parameter parameter = 34; // Define overloaded variants for when generating code message Overload { @@ -353,7 +349,5 @@ message OperationDefinition { // Comments to go on overload String comment = 5; } - repeated Overload overload = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Overload overload = 35; } diff --git a/proto/r4/core/resources/operation_outcome.proto b/proto/r4/core/resources/operation_outcome.proto index d8a9d539d..b2647a13b 100644 --- a/proto/r4/core/resources/operation_outcome.proto +++ b/proto/r4/core/resources/operation_outcome.proto @@ -120,9 +120,6 @@ message OperationOutcome { // FHIRPath of element(s) related to issue repeated String expression = 9; } - repeated Issue issue = 10 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Issue issue = 10 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/organization.proto b/proto/r4/core/resources/organization.proto index 0ab261316..0d016080e 100644 --- a/proto/r4/core/resources/organization.proto +++ b/proto/r4/core/resources/organization.proto @@ -31,6 +31,8 @@ message Organization { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Organization"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(identifier.count() + name.count()) > 0"; // Logical id of this artifact Id id = 1; @@ -112,9 +114,7 @@ message Organization { // Visiting or postal addresses for the contact Address address = 7; } - repeated Contact contact = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Contact contact = 18; // Technical endpoints providing access to services operated for the // organization diff --git a/proto/r4/core/resources/parameters.proto b/proto/r4/core/resources/parameters.proto index 36f42c572..72eeb83e0 100644 --- a/proto/r4/core/resources/parameters.proto +++ b/proto/r4/core/resources/parameters.proto @@ -46,6 +46,9 @@ message Parameters { // Operation Parameter message Parameter { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(part.exists() and value.empty() and resource.empty()) or (part.empty() and (value.exists() xor resource.exists()))"; + // Unique id for inter-element referencing String id = 1; @@ -123,10 +126,5 @@ message Parameters { // Named part of a multi-part parameter repeated Parameter part = 7; } - repeated Parameter parameter = 5 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(part.exists() and value.empty() and resource.empty()) or (part.empty() and (value.exists() xor resource.exists()))" - ]; + repeated Parameter parameter = 5; } diff --git a/proto/r4/core/resources/patient.proto b/proto/r4/core/resources/patient.proto index 7589ea3b7..9d176311f 100644 --- a/proto/r4/core/resources/patient.proto +++ b/proto/r4/core/resources/patient.proto @@ -126,6 +126,9 @@ message Patient { // A contact party (e.g. guardian, partner, friend) for the patient message Contact { + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.exists() or telecom.exists() or address.exists() or organization.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -172,12 +175,7 @@ message Patient { // be contacted relating to this patient Period period = 10; } - repeated Contact contact = 21 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "name.exists() or telecom.exists() or address.exists() or organization.exists()" - ]; + repeated Contact contact = 21; // A language which may be used to communicate with the patient about his or // her health @@ -199,9 +197,7 @@ message Patient { // Language preference indicator Boolean preferred = 5; } - repeated Communication communication = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Communication communication = 22; // Patient's nominated primary care provider repeated Reference general_practitioner = 23 [ @@ -250,7 +246,5 @@ message Patient { TypeCode type = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Link link = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Link link = 25; } diff --git a/proto/r4/core/resources/payment_reconciliation.proto b/proto/r4/core/resources/payment_reconciliation.proto index 70f423779..bd87e26a5 100644 --- a/proto/r4/core/resources/payment_reconciliation.proto +++ b/proto/r4/core/resources/payment_reconciliation.proto @@ -185,9 +185,7 @@ message PaymentReconciliation { // Amount allocated to this payable Money amount = 13; } - repeated Details detail = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Details detail = 22; // Printed form identifier CodeableConcept form_code = 23; @@ -223,7 +221,5 @@ message PaymentReconciliation { // Note explanatory text String text = 5; } - repeated Notes process_note = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Notes process_note = 24; } diff --git a/proto/r4/core/resources/person.proto b/proto/r4/core/resources/person.proto index dcc022d3c..a7db58464 100644 --- a/proto/r4/core/resources/person.proto +++ b/proto/r4/core/resources/person.proto @@ -139,7 +139,5 @@ message Person { } AssuranceCode assurance = 5; } - repeated Link link = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Link link = 19; } diff --git a/proto/r4/core/resources/plan_definition.proto b/proto/r4/core/resources/plan_definition.proto index a011facfe..0f7b1546a 100644 --- a/proto/r4/core/resources/plan_definition.proto +++ b/proto/r4/core/resources/plan_definition.proto @@ -33,6 +33,8 @@ message PlanDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/PlanDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -232,13 +234,9 @@ message PlanDefinition { // Reach goal within Duration due = 6; } - repeated Target target = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Target target = 10; } - repeated Goal goal = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Goal goal = 39; // Action defined by the plan message Action { @@ -340,9 +338,7 @@ message PlanDefinition { // Boolean-valued expression Expression expression = 5; } - repeated Condition condition = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Condition condition = 15; // Input data requirements repeated DataRequirement input = 16; @@ -395,9 +391,7 @@ message PlanDefinition { } OffsetX offset = 6; } - repeated RelatedAction related_action = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedAction related_action = 18; // When the action should take place message TimingX { @@ -446,9 +440,7 @@ message PlanDefinition { // E.g. Nurse, Surgeon, Parent CodeableConcept role = 5; } - repeated Participant participant = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 20; // create | update | remove | fire-event CodeableConcept type = 21; @@ -569,14 +561,10 @@ message PlanDefinition { // An expression that provides the dynamic value for the customization Expression expression = 5; } - repeated DynamicValue dynamic_value = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DynamicValue dynamic_value = 29; // A sub-action repeated Action action = 30; } - repeated Action action = 40 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Action action = 40; } diff --git a/proto/r4/core/resources/practitioner.proto b/proto/r4/core/resources/practitioner.proto index 40e028b8f..14c02d7c4 100644 --- a/proto/r4/core/resources/practitioner.proto +++ b/proto/r4/core/resources/practitioner.proto @@ -125,9 +125,7 @@ message Practitioner { Reference issuer = 7 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - repeated Qualification qualification = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Qualification qualification = 18; // A language the practitioner can use in patient communication repeated CodeableConcept communication = 19; diff --git a/proto/r4/core/resources/practitioner_role.proto b/proto/r4/core/resources/practitioner_role.proto index 280561f1f..0bc9d6314 100644 --- a/proto/r4/core/resources/practitioner_role.proto +++ b/proto/r4/core/resources/practitioner_role.proto @@ -135,9 +135,7 @@ message PractitionerRole { // Closing time of day (ignored if allDay = true) Time available_end_time = 7; } - repeated AvailableTime available_time = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AvailableTime available_time = 20; // Not available during this time due to provided reason message NotAvailable { @@ -157,9 +155,7 @@ message PractitionerRole { // Service not available from this date Period during = 5; } - repeated NotAvailable not_available = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated NotAvailable not_available = 21; // Description of availability exceptions String availability_exceptions = 22; diff --git a/proto/r4/core/resources/procedure.proto b/proto/r4/core/resources/procedure.proto index 65e6c89c6..ae89f7371 100644 --- a/proto/r4/core/resources/procedure.proto +++ b/proto/r4/core/resources/procedure.proto @@ -180,9 +180,7 @@ message Procedure { Reference on_behalf_of = 6 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - repeated Performer performer = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Performer performer = 24; // Where the procedure happened Reference location = 25 @@ -246,9 +244,7 @@ message Procedure { (.google.fhir.proto.valid_reference_type) = "Device" ]; } - repeated FocalDevice focal_device = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated FocalDevice focal_device = 35; // Items used during procedure repeated Reference used_reference = 36 [ diff --git a/proto/r4/core/resources/provenance.proto b/proto/r4/core/resources/provenance.proto index 1785847e6..45c31656c 100644 --- a/proto/r4/core/resources/provenance.proto +++ b/proto/r4/core/resources/provenance.proto @@ -133,11 +133,8 @@ message Provenance { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated Agent agent = 17 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Agent agent = 17 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // An entity used in this activity message Entity { @@ -177,9 +174,7 @@ message Provenance { // Entity is attributed to this agent repeated Agent agent = 6; } - repeated Entity entity = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Entity entity = 18; // Signature on target repeated Signature signature = 19; diff --git a/proto/r4/core/resources/questionnaire.proto b/proto/r4/core/resources/questionnaire.proto index ef86d1cd7..56c8cbbc4 100644 --- a/proto/r4/core/resources/questionnaire.proto +++ b/proto/r4/core/resources/questionnaire.proto @@ -32,6 +32,10 @@ message Questionnaire { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Questionnaire"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "descendants().linkId.isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -154,6 +158,29 @@ message Questionnaire { // Questions and sections within the Questionnaire message Item { + option (.google.fhir.proto.fhir_path_message_constraint) = + "type!='display' or readOnly.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type!='group' and type!='display') or initial.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type!='display' or (required.empty() and repeats.empty())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type ='choice' or type = 'open-choice' or type = 'decimal' or type = 'integer' or type = 'date' or type = 'dateTime' or type = 'time' or type = 'string' or type = 'quantity') or (answerValueSet.empty() and answerOption.empty())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "answerOption.empty() or answerValueSet.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type!='display' or code.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type in ('boolean' | 'decimal' | 'integer' | 'string' | 'text' | 'url' | 'open-choice')) or maxLength.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type='group' implies item.empty().not()) and (type.trace('type')='display' implies item.trace('item').empty())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "repeats=true or initial.count() <= 1"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "answerOption.empty() or initial.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "enableWhen.count() > 2 implies enableBehavior.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -199,6 +226,9 @@ message Questionnaire { // Only allow data when message EnableWhen { + option (.google.fhir.proto.fhir_path_message_constraint) = + "operator = 'exists' implies (answer is Boolean)"; + // Unique id for inter-element referencing String id = 1; @@ -251,12 +281,7 @@ message Questionnaire { AnswerX answer = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated EnableWhen enable_when = 10 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "operator = 'exists' implies (answer is Boolean)" - ]; + repeated EnableWhen enable_when = 10; // all | any message EnableBehaviorCode { @@ -321,9 +346,7 @@ message Questionnaire { // Whether option is selected by default Boolean initial_selected = 5; } - repeated AnswerOption answer_option = 17 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AnswerOption answer_option = 17; // Initial value(s) when item is first rendered message Initial { @@ -359,37 +382,10 @@ message Questionnaire { ValueX value = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Initial initial = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Initial initial = 18; // Nested questionnaire items repeated Item item = 19; } - repeated Item item = 31 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "type!='display' or readOnly.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "(type!='group' and type!='display') or initial.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "type!='display' or (required.empty() and repeats.empty())", - (.google.fhir.proto.fhir_path_constraint) = - "(type ='choice' or type = 'open-choice' or type = 'decimal' or type = 'integer' or type = 'date' or type = 'dateTime' or type = 'time' or type = 'string' or type = 'quantity') or (answerValueSet.empty() and answerOption.empty())", - (.google.fhir.proto.fhir_path_constraint) = - "answerOption.empty() or answerValueSet.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "type!='display' or code.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "(type in ('boolean' | 'decimal' | 'integer' | 'string' | 'text' | 'url' | 'open-choice')) or maxLength.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "(type='group' implies item.empty().not()) and (type.trace('type')='display' implies item.trace('item').empty())", - (.google.fhir.proto.fhir_path_constraint) = - "repeats=true or initial.count() <= 1", - (.google.fhir.proto.fhir_path_constraint) = - "answerOption.empty() or initial.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "enableWhen.count() > 2 implies enableBehavior.exists()" - ]; + repeated Item item = 31; } diff --git a/proto/r4/core/resources/questionnaire_response.proto b/proto/r4/core/resources/questionnaire_response.proto index 4a66c7624..b148fc497 100644 --- a/proto/r4/core/resources/questionnaire_response.proto +++ b/proto/r4/core/resources/questionnaire_response.proto @@ -128,6 +128,9 @@ message QuestionnaireResponse { // Groups and questions message Item { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(answer.exists() and item.exists()).not()"; + // Unique id for inter-element referencing String id = 1; @@ -183,17 +186,10 @@ message QuestionnaireResponse { // Nested groups and questions repeated Item item = 5; } - repeated Answer answer = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Answer answer = 7; // Nested questionnaire response items repeated Item item = 8; } - repeated Item item = 20 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(answer.exists() and item.exists()).not()" - ]; + repeated Item item = 20; } diff --git a/proto/r4/core/resources/related_person.proto b/proto/r4/core/resources/related_person.proto index fd61d5698..7cb283d17 100644 --- a/proto/r4/core/resources/related_person.proto +++ b/proto/r4/core/resources/related_person.proto @@ -130,7 +130,5 @@ message RelatedPerson { // Language preference indicator Boolean preferred = 5; } - repeated Communication communication = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Communication communication = 21; } diff --git a/proto/r4/core/resources/request_group.proto b/proto/r4/core/resources/request_group.proto index 573f343db..834dd9ea2 100644 --- a/proto/r4/core/resources/request_group.proto +++ b/proto/r4/core/resources/request_group.proto @@ -171,6 +171,9 @@ message RequestGroup { // Proposed actions, if any message Action { + option (.google.fhir.proto.fhir_path_message_constraint) = + "resource.exists() != action.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -248,9 +251,7 @@ message RequestGroup { // Boolean-valued expression Expression expression = 5; } - repeated Condition condition = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Condition condition = 11; // Relationship to another action message RelatedAction { @@ -297,9 +298,7 @@ message RequestGroup { } OffsetX offset = 6; } - repeated RelatedAction related_action = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatedAction related_action = 12; // When the action should take place message TimingX { @@ -420,10 +419,5 @@ message RequestGroup { // Sub action repeated Action action = 22; } - repeated Action action = 27 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "resource.exists() != action.exists()" - ]; + repeated Action action = 27; } diff --git a/proto/r4/core/resources/research_definition.proto b/proto/r4/core/resources/research_definition.proto index a618befb9..5ab3731d6 100644 --- a/proto/r4/core/resources/research_definition.proto +++ b/proto/r4/core/resources/research_definition.proto @@ -32,6 +32,8 @@ message ResearchDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ResearchDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/resources/research_element_definition.proto b/proto/r4/core/resources/research_element_definition.proto index 730628d28..140a1b489 100644 --- a/proto/r4/core/resources/research_element_definition.proto +++ b/proto/r4/core/resources/research_element_definition.proto @@ -33,6 +33,8 @@ message ResearchElementDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -319,9 +321,6 @@ message ResearchElementDefinition { ParticipantEffectiveGroupMeasureCode participant_effective_group_measure = 15; } - repeated Characteristic characteristic = 42 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Characteristic characteristic = 42 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/research_study.proto b/proto/r4/core/resources/research_study.proto index f05f85d25..6474d62eb 100644 --- a/proto/r4/core/resources/research_study.proto +++ b/proto/r4/core/resources/research_study.proto @@ -177,8 +177,7 @@ message ResearchStudy { // Short explanation of study path String description = 6; } - repeated Arm arm = 32 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Arm arm = 32; // A goal for the study message Objective { @@ -197,7 +196,5 @@ message ResearchStudy { // primary | secondary | exploratory CodeableConcept type = 5; } - repeated Objective objective = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Objective objective = 33; } diff --git a/proto/r4/core/resources/risk_assessment.proto b/proto/r4/core/resources/risk_assessment.proto index 10c8e32f5..027358134 100644 --- a/proto/r4/core/resources/risk_assessment.proto +++ b/proto/r4/core/resources/risk_assessment.proto @@ -145,6 +145,9 @@ message RiskAssessment { // Outcome predicted message Prediction { + option (.google.fhir.proto.fhir_path_message_constraint) = + "probability is decimal implies (probability as decimal) <= 100"; + // Unique id for inter-element referencing String id = 1; @@ -159,6 +162,8 @@ message RiskAssessment { // Likelihood of specified outcome message ProbabilityX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(low.empty() or ((low.code = '%') and (low.system = %ucum))) and (high.empty() or ((high.code = '%') and (high.system = %ucum)))"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -166,10 +171,7 @@ message RiskAssessment { Range range = 2; } } - ProbabilityX probability = 5 [ - (.google.fhir.proto.fhir_path_constraint) = - "(low.empty() or ((low.code = '%') and (low.system = %ucum))) and (high.empty() or ((high.code = '%') and (high.system = %ucum)))" - ]; + ProbabilityX probability = 5; // Likelihood of specified outcome as a qualitative value CodeableConcept qualitative_risk = 6; @@ -191,12 +193,7 @@ message RiskAssessment { // Explanation of prediction String rationale = 9; } - repeated Prediction prediction = 24 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "probability is decimal implies (probability as decimal) <= 100" - ]; + repeated Prediction prediction = 24; // How to reduce risk String mitigation = 25; diff --git a/proto/r4/core/resources/risk_evidence_synthesis.proto b/proto/r4/core/resources/risk_evidence_synthesis.proto index 76f1f7871..905a03094 100644 --- a/proto/r4/core/resources/risk_evidence_synthesis.proto +++ b/proto/r4/core/resources/risk_evidence_synthesis.proto @@ -33,6 +33,8 @@ message RiskEvidenceSynthesis { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -189,9 +191,7 @@ message RiskEvidenceSynthesis { // How many participants? Integer number_of_participants = 6; } - SampleSize sample_size = 38 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + SampleSize sample_size = 38; // What was the estimated risk message RiskEstimate { @@ -245,13 +245,9 @@ message RiskEvidenceSynthesis { // Upper bound Decimal to = 7; } - repeated PrecisionEstimate precision_estimate = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PrecisionEstimate precision_estimate = 10; } - RiskEstimate risk_estimate = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + RiskEstimate risk_estimate = 39; // How certain is the risk message Certainty { @@ -290,11 +286,7 @@ message RiskEvidenceSynthesis { // Used for footnotes or explanatory notes repeated Annotation note = 6; } - repeated CertaintySubcomponent certainty_subcomponent = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated CertaintySubcomponent certainty_subcomponent = 6; } - repeated Certainty certainty = 40 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Certainty certainty = 40; } diff --git a/proto/r4/core/resources/search_parameter.proto b/proto/r4/core/resources/search_parameter.proto index d42b0be41..a2ade5b1a 100644 --- a/proto/r4/core/resources/search_parameter.proto +++ b/proto/r4/core/resources/search_parameter.proto @@ -32,6 +32,12 @@ message SearchParameter { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/SearchParameter"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "xpath.empty() or xpathUsage.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "chain.empty() or type = 'reference'"; // Logical id of this artifact Id id = 1; @@ -255,7 +261,5 @@ message SearchParameter { String expression = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Component component = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 35; } diff --git a/proto/r4/core/resources/service_request.proto b/proto/r4/core/resources/service_request.proto index 4a811e1f4..5d27fc8e4 100644 --- a/proto/r4/core/resources/service_request.proto +++ b/proto/r4/core/resources/service_request.proto @@ -32,6 +32,8 @@ message ServiceRequest { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ServiceRequest"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "orderDetail.empty() or code.exists()"; // Logical id of this artifact Id id = 1; diff --git a/proto/r4/core/resources/specimen.proto b/proto/r4/core/resources/specimen.proto index 9fa11e253..8b6e94d20 100644 --- a/proto/r4/core/resources/specimen.proto +++ b/proto/r4/core/resources/specimen.proto @@ -159,9 +159,7 @@ message Specimen { } FastingStatusX fasting_status = 10; } - Collection collection = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Collection collection = 18; // Processing and processing step details message Processing { @@ -195,9 +193,7 @@ message Specimen { } TimeX time = 7; } - repeated Processing processing = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Processing processing = 19; // Direct container of specimen (tube/slide, etc.) message Container { @@ -237,9 +233,7 @@ message Specimen { } AdditiveX additive = 9; } - repeated Container container = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Container container = 20; // State of the specimen repeated CodeableConcept condition = 21; diff --git a/proto/r4/core/resources/specimen_definition.proto b/proto/r4/core/resources/specimen_definition.proto index 8c293a8e4..8940292ae 100644 --- a/proto/r4/core/resources/specimen_definition.proto +++ b/proto/r4/core/resources/specimen_definition.proto @@ -172,16 +172,12 @@ message SpecimenDefinition { AdditiveX additive = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Additive additive = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Additive additive = 10; // Specimen container preparation String preparation = 11; } - Container container = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Container container = 7; // Specimen requirements String requirement = 8; @@ -215,11 +211,7 @@ message SpecimenDefinition { // Preservation instruction String instruction = 7; } - repeated Handling handling = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Handling handling = 11; } - repeated TypeTested type_tested = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated TypeTested type_tested = 15; } diff --git a/proto/r4/core/resources/structure_definition.proto b/proto/r4/core/resources/structure_definition.proto index b19494a20..4476430d7 100644 --- a/proto/r4/core/resources/structure_definition.proto +++ b/proto/r4/core/resources/structure_definition.proto @@ -32,6 +32,40 @@ message StructureDefinition { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/StructureDefinition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "children().element.where(path.contains('.').not()).label.empty() and children().element.where(path.contains('.').not()).code.empty() and children().element.where(path.contains('.').not()).requirements.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(kind!='logical' and differential.element.first().path.contains('.').not()) implies differential.element.first().type.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (differential.element.type.code.all(hasValue() implies matches('^[a-zA-Z0-9]+$')) and snapshot.element.type.code.all(hasValue() implies matches('^[a-zA-Z0-9]+$')))"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "snapshot.element.all(id) and snapshot.element.id.trace('ids').isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "kind!='logical' implies snapshot.element.first().type.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "contextInvariant.exists() implies type = 'Extension'"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "differential.element.all(id) and differential.element.id.trace('ids').isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(snapshot | differential).element.all(path.contains('.').not() implies sliceName.empty())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "kind != 'logical' implies snapshot.empty() or snapshot.element.first().path = type"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "url.startsWith('http://hl7.org/fhir/StructureDefinition') implies (snapshot.element.defaultValue.empty() and differential.element.defaultValue.empty())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "snapshot.element.all(id.exists()) and differential.element.all(id.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "derivation = 'constraint' or snapshot.element.select(path).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "differential.element.defaultValue.exists() implies (derivation = 'specialization')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "snapshot.exists() or differential.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type != 'Extension' or derivation = 'specialization' or (context.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "abstract = true or baseDefinition.exists()"; // Logical id of this artifact Id id = 1; @@ -143,6 +177,9 @@ message StructureDefinition { // External specification that the content is mapped to message Mapping { + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.exists() or uri.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -165,11 +202,7 @@ message StructureDefinition { // Versions, Issues, Scope limitations etc. String comment = 7; } - repeated Mapping mapping = 27 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = "name.exists() or uri.exists()" - ]; + repeated Mapping mapping = 27; // primitive-type | complex-type | resource | logical message KindCode { @@ -225,9 +258,7 @@ message StructureDefinition { String expression = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Context context = 30 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Context context = 30; // FHIRPath invariants - when the extension can be used repeated String context_invariant = 31; @@ -257,6 +288,13 @@ message StructureDefinition { // Snapshot view of the structure message Snapshot { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(%resource.kind = 'logical' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&'.'))"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "element.all(definition.exists() and min.exists() and max.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "element.all(base.exists())"; + // Unique id for inter-element referencing String id = 1; @@ -273,18 +311,15 @@ message StructureDefinition { "binding.empty() or binding.valueSet.exists() or binding.description.exists()" ]; } - Snapshot snapshot = 35 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(%resource.kind = 'logical' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&'.'))", - (.google.fhir.proto.fhir_path_constraint) = - "element.all(definition.exists() and min.exists() and max.exists())", - (.google.fhir.proto.fhir_path_constraint) = "element.all(base.exists())" - ]; + Snapshot snapshot = 35; // Differential view of the structure message Differential { + option (.google.fhir.proto.fhir_path_message_constraint) = + "element.where(path.contains('.').not()).slicing.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\\\..*','')&'.')))"; + // Unique id for inter-element referencing String id = 1; @@ -298,12 +333,5 @@ message StructureDefinition { repeated ElementDefinition element = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Differential differential = 36 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "element.where(path.contains('.').not()).slicing.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "(%resource.kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\\..*','')&'.')))" - ]; + Differential differential = 36; } diff --git a/proto/r4/core/resources/structure_map.proto b/proto/r4/core/resources/structure_map.proto index 78685acb5..00a60086d 100644 --- a/proto/r4/core/resources/structure_map.proto +++ b/proto/r4/core/resources/structure_map.proto @@ -33,6 +33,8 @@ message StructureMap { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/StructureMap"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -162,9 +164,7 @@ message StructureMap { // Documentation on use of structure String documentation = 7; } - repeated Structure structure = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Structure structure = 25; // Other maps used by this map (canonical URLs) repeated Canonical import = 26; @@ -247,11 +247,8 @@ message StructureMap { // Documentation for this instance of data String documentation = 7; } - repeated Input input = 8 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Input input = 8 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Transform Rule from source to target message Rule { @@ -383,14 +380,16 @@ message StructureMap { // Message to put in log if source exists (FHIRPath) String log_message = 14; } - repeated Source source = 5 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Source source = 5 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Content to create because of this mapping rule message Target { + option (.google.fhir.proto.fhir_path_message_constraint) = + "context.exists() implies contextType.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "element.exists() implies context.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -489,18 +488,9 @@ message StructureMap { ValueX value = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Parameter parameter = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Parameter parameter = 11; } - repeated Target target = 6 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "context.exists() implies contextType.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "element.exists() implies context.exists()" - ]; + repeated Target target = 6; // Rules contained in this rule repeated Rule rule = 7; @@ -524,22 +514,14 @@ message StructureMap { repeated String variable = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Dependent dependent = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Dependent dependent = 8; // Documentation for this instance of data String documentation = 9; } - repeated Rule rule = 9 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Rule rule = 9 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Group group = 27 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Group group = 27 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/subscription.proto b/proto/r4/core/resources/subscription.proto index 9602b6e34..98255baff 100644 --- a/proto/r4/core/resources/subscription.proto +++ b/proto/r4/core/resources/subscription.proto @@ -151,9 +151,6 @@ message Subscription { // Usage depends on the channel type repeated String header = 7; } - Channel channel = 16 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + Channel channel = 16 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/core/resources/substance.proto b/proto/r4/core/resources/substance.proto index e0101b9db..ec672d2a9 100644 --- a/proto/r4/core/resources/substance.proto +++ b/proto/r4/core/resources/substance.proto @@ -110,9 +110,7 @@ message Substance { // Amount of substance in the package SimpleQuantity quantity = 6; } - repeated Instance instance = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Instance instance = 15; // Composition information about the substance message Ingredient { @@ -141,7 +139,5 @@ message Substance { SubstanceX substance = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Ingredient ingredient = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Ingredient ingredient = 16; } diff --git a/proto/r4/core/resources/substance_nucleic_acid.proto b/proto/r4/core/resources/substance_nucleic_acid.proto index 865b80e74..cfd2f037c 100644 --- a/proto/r4/core/resources/substance_nucleic_acid.proto +++ b/proto/r4/core/resources/substance_nucleic_acid.proto @@ -154,9 +154,7 @@ message SubstanceNucleicAcid { // Residues shall be captured as described in 5.3.6.8.3 String residue_site = 7; } - repeated Linkage linkage = 10 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Linkage linkage = 10; // 5.3.6.8.1 Sugar ID (Mandatory) message Sugar { @@ -182,11 +180,7 @@ message SubstanceNucleicAcid { // the base sequences listed above String residue_site = 6; } - repeated Sugar sugar = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Sugar sugar = 11; } - repeated Subunit subunit = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Subunit subunit = 14; } diff --git a/proto/r4/core/resources/substance_polymer.proto b/proto/r4/core/resources/substance_polymer.proto index c272599b1..01df3224a 100644 --- a/proto/r4/core/resources/substance_polymer.proto +++ b/proto/r4/core/resources/substance_polymer.proto @@ -109,13 +109,9 @@ message SubstancePolymer { // Todo SubstanceAmount amount = 7; } - repeated StartingMaterial starting_material = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StartingMaterial starting_material = 5; } - repeated MonomerSet monomer_set = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated MonomerSet monomer_set = 14; // Todo message Repeat { @@ -174,9 +170,7 @@ message SubstancePolymer { // Todo SubstanceAmount amount = 5; } - repeated DegreeOfPolymerisation degree_of_polymerisation = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DegreeOfPolymerisation degree_of_polymerisation = 7; // Todo message StructuralRepresentation { @@ -198,15 +192,9 @@ message SubstancePolymer { // Todo Attachment attachment = 6; } - repeated StructuralRepresentation structural_representation = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StructuralRepresentation structural_representation = 8; } - repeated RepeatUnit repeat_unit = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RepeatUnit repeat_unit = 7; } - repeated Repeat repeat = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Repeat repeat = 15; } diff --git a/proto/r4/core/resources/substance_protein.proto b/proto/r4/core/resources/substance_protein.proto index 185433812..09941ed91 100644 --- a/proto/r4/core/resources/substance_protein.proto +++ b/proto/r4/core/resources/substance_protein.proto @@ -147,7 +147,5 @@ message SubstanceProtein { // The modification at the C-terminal shall be specified String c_terminal_modification = 11; } - repeated Subunit subunit = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Subunit subunit = 13; } diff --git a/proto/r4/core/resources/substance_reference_information.proto b/proto/r4/core/resources/substance_reference_information.proto index 61a98f68d..1abbd169e 100644 --- a/proto/r4/core/resources/substance_reference_information.proto +++ b/proto/r4/core/resources/substance_reference_information.proto @@ -84,9 +84,7 @@ message SubstanceReferenceInformation { repeated Reference source = 6 [(.google.fhir.proto.valid_reference_type) = "DocumentReference"]; } - repeated Gene gene = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Gene gene = 11; // Todo message GeneElement { @@ -109,9 +107,7 @@ message SubstanceReferenceInformation { repeated Reference source = 6 [(.google.fhir.proto.valid_reference_type) = "DocumentReference"]; } - repeated GeneElement gene_element = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated GeneElement gene_element = 12; // Todo message Classification { @@ -137,9 +133,7 @@ message SubstanceReferenceInformation { repeated Reference source = 7 [(.google.fhir.proto.valid_reference_type) = "DocumentReference"]; } - repeated Classification classification = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Classification classification = 13; // Todo message Target { @@ -186,7 +180,5 @@ message SubstanceReferenceInformation { repeated Reference source = 11 [(.google.fhir.proto.valid_reference_type) = "DocumentReference"]; } - repeated Target target = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Target target = 14; } diff --git a/proto/r4/core/resources/substance_source_material.proto b/proto/r4/core/resources/substance_source_material.proto index 94725003f..a63e8b0f2 100644 --- a/proto/r4/core/resources/substance_source_material.proto +++ b/proto/r4/core/resources/substance_source_material.proto @@ -144,9 +144,7 @@ message SubstanceSourceMaterial { // Specified Substance Group 1 CodeableConcept material_type = 5; } - repeated FractionDescription fraction_description = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated FractionDescription fraction_description = 20; // This subclause describes the organism which the substance is derived from. // For vaccines, the parent organism shall be specified based on these @@ -208,9 +206,7 @@ message SubstanceSourceMaterial { // plant/animal name (of any rank) String author_description = 5; } - repeated Author author = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Author author = 9; // 4.9.13.8.1 Hybrid species maternal organism ID (Optional) message Hybrid { @@ -245,8 +241,7 @@ message SubstanceSourceMaterial { // The hybrid type of an organism shall be specified CodeableConcept hybrid_type = 8; } - Hybrid hybrid = 10 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Hybrid hybrid = 10; // 4.9.13.7.1 Kingdom (Conditional) message OrganismGeneral { @@ -271,13 +266,9 @@ message SubstanceSourceMaterial { // The order of an organism shall be specified, CodeableConcept order = 7; } - OrganismGeneral organism_general = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + OrganismGeneral organism_general = 11; } - Organism organism = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Organism organism = 21; // To do message PartDescription { @@ -298,7 +289,5 @@ message SubstanceSourceMaterial { // locations may apply CodeableConcept part_location = 5; } - repeated PartDescription part_description = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PartDescription part_description = 22; } diff --git a/proto/r4/core/resources/substance_specification.proto b/proto/r4/core/resources/substance_specification.proto index 04630d9b8..fd7a7681e 100644 --- a/proto/r4/core/resources/substance_specification.proto +++ b/proto/r4/core/resources/substance_specification.proto @@ -123,9 +123,7 @@ message SubstanceSpecification { } AmountX amount = 10; } - repeated Moiety moiety = 17 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Moiety moiety = 17; // General specifications for this substance, including how it is related to // other substances @@ -175,9 +173,7 @@ message SubstanceSpecification { } AmountX amount = 8; } - repeated Property property = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Property property = 18; // General information detailing this substance Reference reference_information = 19 @@ -257,13 +253,9 @@ message SubstanceSpecification { // be captured in this field Quantity amount = 6; } - MolecularWeight molecular_weight = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + MolecularWeight molecular_weight = 8; } - repeated Isotope isotope = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Isotope isotope = 8; // The molecular weight or weight range (for proteins, polymers or nucleic // acids) @@ -294,13 +286,9 @@ message SubstanceSpecification { // An attached file with the structural representation Attachment attachment = 6; } - repeated Representation representation = 11 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Representation representation = 11; } - Structure structure = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Structure structure = 20; // Codes associated with the substance message CodeType { @@ -330,9 +318,7 @@ message SubstanceSpecification { repeated Reference source = 8 [(.google.fhir.proto.valid_reference_type) = "DocumentReference"]; } - repeated CodeType code = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated CodeType code = 21; // Names applicable to this substance message Name { @@ -394,17 +380,13 @@ message SubstanceSpecification { // Date of official name change DateTime date = 6; } - repeated Official official = 13 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Official official = 13; // Supporting literature repeated Reference source = 14 [(.google.fhir.proto.valid_reference_type) = "DocumentReference"]; } - repeated Name name = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Name name = 22; // The molecular weight or weight range (for proteins, polymers or nucleic // acids) @@ -468,9 +450,7 @@ message SubstanceSpecification { repeated Reference source = 10 [(.google.fhir.proto.valid_reference_type) = "DocumentReference"]; } - repeated Relationship relationship = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Relationship relationship = 24; // Data items specific to nucleic acids Reference nucleic_acid = 25 diff --git a/proto/r4/core/resources/supply_delivery.proto b/proto/r4/core/resources/supply_delivery.proto index b5a0733ce..fade9f5c9 100644 --- a/proto/r4/core/resources/supply_delivery.proto +++ b/proto/r4/core/resources/supply_delivery.proto @@ -126,9 +126,7 @@ message SupplyDelivery { } ItemX item = 5; } - SuppliedItem supplied_item = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + SuppliedItem supplied_item = 16; // When event occurred message OccurrenceX { diff --git a/proto/r4/core/resources/supply_request.proto b/proto/r4/core/resources/supply_request.proto index 0e9a2304f..9398e809c 100644 --- a/proto/r4/core/resources/supply_request.proto +++ b/proto/r4/core/resources/supply_request.proto @@ -146,9 +146,7 @@ message SupplyRequest { } ValueX value = 5; } - repeated Parameter parameter = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Parameter parameter = 16; // When the request should be fulfilled message OccurrenceX { diff --git a/proto/r4/core/resources/task.proto b/proto/r4/core/resources/task.proto index f9748882b..f02217294 100644 --- a/proto/r4/core/resources/task.proto +++ b/proto/r4/core/resources/task.proto @@ -33,6 +33,8 @@ message Task { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/Task"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "lastModified.exists().not() or authoredOn.exists().not() or lastModified >= authoredOn"; // Logical id of this artifact Id id = 1; @@ -243,9 +245,7 @@ message Task { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - Restriction restriction = 38 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Restriction restriction = 38; // Information used to perform task message Parameter { @@ -321,9 +321,7 @@ message Task { ValueX value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Parameter input = 39 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Parameter input = 39; // Information produced as part of task message Output { @@ -399,7 +397,5 @@ message Task { ValueX value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Output output = 40 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Output output = 40; } diff --git a/proto/r4/core/resources/terminology_capabilities.proto b/proto/r4/core/resources/terminology_capabilities.proto index eee0f3e1f..6df6f89b9 100644 --- a/proto/r4/core/resources/terminology_capabilities.proto +++ b/proto/r4/core/resources/terminology_capabilities.proto @@ -32,6 +32,16 @@ message TerminologyCapabilities { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(kind != 'instance') or implementation.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(description.count() + software.count() + implementation.count()) > 0"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(kind!='requirements') or (implementation.exists().not() and software.exists().not())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(kind != 'capability') or (implementation.exists().not() and software.exists())"; // Logical id of this artifact Id id = 1; @@ -154,9 +164,7 @@ message TerminologyCapabilities { // Version covered by this statement String version = 5; } - Software software = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Software software = 25; // If this describes a specific instance message Implementation { @@ -176,15 +184,16 @@ message TerminologyCapabilities { // Base URL for the implementation Url url = 5; } - Implementation implementation = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Implementation implementation = 26; // Whether lockedDate is supported Boolean locked_date = 27; // A code system supported by the server message CodeSystem { + option (.google.fhir.proto.fhir_path_message_constraint) = + "version.count() > 1 implies version.all(code.exists())"; + // Unique id for inter-element referencing String id = 1; @@ -239,26 +248,17 @@ message TerminologyCapabilities { repeated Code op = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Filter filter = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Filter filter = 8; // Properties supported for $lookup repeated Code property = 9; } - repeated Version version = 5 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Version version = 5; // Whether subsumption is supported Boolean subsumption = 6; } - repeated CodeSystem code_system = 28 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "version.count() > 1 implies version.all(code.exists())" - ]; + repeated CodeSystem code_system = 28; // Information about the [ValueSet/$expand](valueset-operation-expand.html) // operation @@ -299,16 +299,12 @@ message TerminologyCapabilities { // Description of support for parameter String documentation = 5; } - repeated Parameter parameter = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Parameter parameter = 7; // Documentation about text searching works Markdown text_filter = 8; } - Expansion expansion = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Expansion expansion = 29; // explicit | all message CodeSearchCode { @@ -342,9 +338,7 @@ message TerminologyCapabilities { Boolean translations = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - ValidateCode validate_code = 31 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + ValidateCode validate_code = 31; // Information about the // [ConceptMap/$translate](conceptmap-operation-translate.html) operation @@ -362,9 +356,7 @@ message TerminologyCapabilities { Boolean needs_map = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Translation translation = 32 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Translation translation = 32; // Information about the // [ConceptMap/$closure](conceptmap-operation-closure.html) operation @@ -381,6 +373,5 @@ message TerminologyCapabilities { // If cross-system closure is supported Boolean translation = 4; } - Closure closure = 33 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Closure closure = 33; } diff --git a/proto/r4/core/resources/test_report.proto b/proto/r4/core/resources/test_report.proto index 3563d6f77..92ae5cfbe 100644 --- a/proto/r4/core/resources/test_report.proto +++ b/proto/r4/core/resources/test_report.proto @@ -155,9 +155,7 @@ message TestReport { // The display name of the participant String display = 6; } - repeated Participant participant = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 18; // The results of the series of required setup operations before the tests // were executed @@ -173,6 +171,9 @@ message TestReport { // A setup operation or assert that was executed message SetupAction { + option (.google.fhir.proto.fhir_path_message_constraint) = + "operation.exists() xor assert.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -217,9 +218,7 @@ message TestReport { // A link to further details on the result Uri detail = 6; } - Operation operation = 4 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Operation operation = 4; // The assertion to perform message Assert { @@ -256,22 +255,12 @@ message TestReport { // A link to further details on the result String detail = 6; } - Assert assert_value = 5 [ - json_name = "assert", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + Assert assert_value = 5 [json_name = "assert"]; } - repeated SetupAction action = 4 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "operation.exists() xor assert.exists()" - ]; + repeated SetupAction action = 4 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Setup setup = 19 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Setup setup = 19; // A test executed from the test script message Test { @@ -292,6 +281,9 @@ message TestReport { // A test operation or assert that was performed message TestAction { + option (.google.fhir.proto.fhir_path_message_constraint) = + "operation.exists() xor assert.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -307,17 +299,10 @@ message TestReport { // The assertion performed Setup.SetupAction.Assert assert_value = 5 [json_name = "assert"]; } - repeated TestAction action = 6 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "operation.exists() xor assert.exists()" - ]; + repeated TestAction action = 6 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Test test = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Test test = 20; // The results of running the series of required clean up steps message Teardown { @@ -345,13 +330,8 @@ message TestReport { Setup.SetupAction.Operation operation = 4 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated TeardownAction action = 4 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated TeardownAction action = 4 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Teardown teardown = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Teardown teardown = 21; } diff --git a/proto/r4/core/resources/test_script.proto b/proto/r4/core/resources/test_script.proto index 7aadf4c86..b6b8aec39 100644 --- a/proto/r4/core/resources/test_script.proto +++ b/proto/r4/core/resources/test_script.proto @@ -33,6 +33,8 @@ message TestScript { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/TestScript"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -142,9 +144,7 @@ message TestScript { Coding profile = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Origin origin = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Origin origin = 25; // An abstract server representing a destination or receiver in a message // exchange @@ -167,13 +167,14 @@ message TestScript { Coding profile = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Destination destination = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Destination destination = 26; // Required capability that is assumed to function correctly on the FHIR // server being tested message Metadata { + option (.google.fhir.proto.fhir_path_message_constraint) = + "capability.required.exists() or capability.validated.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -201,9 +202,7 @@ message TestScript { // Short description String description = 5; } - repeated Link link = 4 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Link link = 4; // Capabilities that are assumed to function correctly on the FHIR server // being tested @@ -241,18 +240,10 @@ message TestScript { Canonical capabilities = 10 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Capability capability = 5 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated Capability capability = 5 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Metadata metadata = 27 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "capability.required.exists() or capability.validated.exists()" - ]; + Metadata metadata = 27; // Fixture in the test script - by reference (uri) message Fixture { @@ -277,9 +268,7 @@ message TestScript { Reference resource = 6 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Fixture fixture = 28 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Fixture fixture = 28; // Reference of the validation profile repeated Reference profile = 29 @@ -287,6 +276,9 @@ message TestScript { // Placeholder for evaluated elements message Variable { + option (.google.fhir.proto.fhir_path_message_constraint) = + "expression.empty() or headerField.empty() or path.empty()"; + // Unique id for inter-element referencing String id = 1; @@ -321,12 +313,7 @@ message TestScript { // Fixture Id of source expression or headerField within this variable Id source_id = 11; } - repeated Variable variable = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "expression.empty() or headerField.empty() or path.empty()" - ]; + repeated Variable variable = 30; // A series of required setup operations before tests are executed message Setup { @@ -341,6 +328,9 @@ message TestScript { // A setup operation or assert to perform message SetupAction { + option (.google.fhir.proto.fhir_path_message_constraint) = + "operation.exists() xor assert.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -352,6 +342,9 @@ message TestScript { // The setup operation to perform message Operation { + option (.google.fhir.proto.fhir_path_message_constraint) = + "sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' |'search' | 'transaction' | 'history'))"; + // Unique id for inter-element referencing String id = 1; @@ -478,9 +471,7 @@ message TestScript { String value = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated RequestHeader request_header = 15 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RequestHeader request_header = 15; // Fixture Id of mapped request Id request_id = 16; @@ -498,15 +489,17 @@ message TestScript { // Request URL String url = 20; } - Operation operation = 4 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' |'search' | 'transaction' | 'history'))" - ]; + Operation operation = 4; // The assertion to perform message Assert { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <=1)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())"; + // Unique id for inter-element referencing String id = 1; @@ -674,28 +667,12 @@ message TestScript { Boolean warning_only = 25 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Assert assert_value = 5 [ - json_name = "assert", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(response.empty() and responseCode.empty() and direction = 'request') or direction.empty() or direction = 'response'", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <=1)", - (.google.fhir.proto.fhir_path_constraint) = - "compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())" - ]; + Assert assert_value = 5 [json_name = "assert"]; } - repeated SetupAction action = 4 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "operation.exists() xor assert.exists()" - ]; + repeated SetupAction action = 4 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Setup setup = 31 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Setup setup = 31; // A test in this script message Test { @@ -716,6 +693,9 @@ message TestScript { // A test operation or assert to perform message TestAction { + option (.google.fhir.proto.fhir_path_message_constraint) = + "operation.exists() xor assert.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -742,17 +722,10 @@ message TestScript { "extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <=1)" ]; } - repeated TestAction action = 6 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "operation.exists() xor assert.exists()" - ]; + repeated TestAction action = 6 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Test test = 32 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Test test = 32; // A series of required clean up steps message Teardown { @@ -783,13 +756,8 @@ message TestScript { "sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in ('capabilities' | 'search' | 'transaction' | 'history'))" ]; } - repeated TeardownAction action = 4 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated TeardownAction action = 4 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - Teardown teardown = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Teardown teardown = 33; } diff --git a/proto/r4/core/resources/value_set.proto b/proto/r4/core/resources/value_set.proto index 16fb9bf01..11240c12d 100644 --- a/proto/r4/core/resources/value_set.proto +++ b/proto/r4/core/resources/value_set.proto @@ -32,6 +32,8 @@ message ValueSet { option (.google.fhir.proto.structure_definition_kind) = KIND_RESOURCE; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/StructureDefinition/ValueSet"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.matches('[A-Z]([A-Za-z0-9_]){0,254}')"; // Logical id of this artifact Id id = 1; @@ -144,6 +146,13 @@ message ValueSet { // Include one or more codes from a code system or other value set(s) message ConceptSet { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(concept.exists() or filter.exists()) implies system.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "concept.empty() or filter.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "valueSet.exists() or system.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -198,13 +207,9 @@ message ValueSet { String value = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Designation designation = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Designation designation = 6; } - repeated ConceptReference concept = 6 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ConceptReference concept = 6; // Select codes/concepts by their properties (including relationships) message Filter { @@ -244,30 +249,18 @@ message ValueSet { String value = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Filter filter = 7 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Filter filter = 7; // Select the contents included in this value set repeated Canonical value_set = 8; } - repeated ConceptSet include = 6 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(concept.exists() or filter.exists()) implies system.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "concept.empty() or filter.empty()", - (.google.fhir.proto.fhir_path_constraint) = - "valueSet.exists() or system.exists()" - ]; + repeated ConceptSet include = 6 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Explicitly exclude codes from a code system or other value sets repeated ConceptSet exclude = 7; } - Compose compose = 26 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Compose compose = 26; // Used when the value set is "expanded" message Expansion { @@ -324,12 +317,17 @@ message ValueSet { } ValueX value = 5; } - repeated Parameter parameter = 8 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Parameter parameter = 8; // Codes in the value set message Contains { + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.exists() or display.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.exists() or abstract = true"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.empty() or system.exists()"; + // Unique id for inter-element referencing String id = 1; @@ -363,18 +361,7 @@ message ValueSet { // Codes contained under this entry repeated Contains contains = 11; } - repeated Contains contains = 9 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "code.exists() or display.exists()", - (.google.fhir.proto.fhir_path_constraint) = - "code.exists() or abstract = true", - (.google.fhir.proto.fhir_path_constraint) = - "code.empty() or system.exists()" - ]; + repeated Contains contains = 9; } - Expansion expansion = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Expansion expansion = 27; } diff --git a/proto/r4/core/resources/verification_result.proto b/proto/r4/core/resources/verification_result.proto index 68b342110..5e6074e82 100644 --- a/proto/r4/core/resources/verification_result.proto +++ b/proto/r4/core/resources/verification_result.proto @@ -149,9 +149,7 @@ message VerificationResult { // specific | any | source repeated CodeableConcept push_type_available = 10; } - repeated PrimarySource primary_source = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated PrimarySource primary_source = 21; // Information about the entity attesting to information message Attestation { @@ -198,9 +196,7 @@ message VerificationResult { // Attester signature Signature source_signature = 11; } - Attestation attestation = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Attestation attestation = 22; // Information about the entity validating information message Validator { @@ -225,7 +221,5 @@ message VerificationResult { // Validator signature Signature attestation_signature = 6; } - repeated Validator validator = 23 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Validator validator = 23; } diff --git a/proto/r4/core/resources/vision_prescription.proto b/proto/r4/core/resources/vision_prescription.proto index bd9cfe521..036f368ee 100644 --- a/proto/r4/core/resources/vision_prescription.proto +++ b/proto/r4/core/resources/vision_prescription.proto @@ -181,9 +181,7 @@ message VisionPrescription { BaseCode base = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Prism prism = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Prism prism = 9; // Added power for multifocal levels Decimal add = 10; @@ -209,9 +207,6 @@ message VisionPrescription { // Notes for coatings repeated Annotation note = 17; } - repeated LensSpecification lens_specification = 17 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + repeated LensSpecification lens_specification = 17 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } diff --git a/proto/r4/google_extensions_core.proto b/proto/r4/google_extensions_core.proto index 6b39f6467..686c54beb 100755 --- a/proto/r4/google_extensions_core.proto +++ b/proto/r4/google_extensions_core.proto @@ -32,6 +32,8 @@ message PrimitiveHasNoValue { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "https://g.co/fhir/StructureDefinition/primitiveHasNoValue"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing core.String id = 1; @@ -49,6 +51,8 @@ message Base64BinarySeparatorStride { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "https://g.co/fhir/StructureDefinition/base64Binary-separatorStride"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing core.String id = 1; @@ -56,8 +60,6 @@ message Base64BinarySeparatorStride { // The separator, usually a sequence of spaces. core.String separator = 4 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -65,8 +67,6 @@ message Base64BinarySeparatorStride { // The stride. core.PositiveInt stride = 5 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -81,6 +81,8 @@ message EventLabel { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "https://g.co/fhir/StructureDefinition/eventLabel"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing core.String id = 1; @@ -91,8 +93,6 @@ message EventLabel { // The patient associated with this label core.Reference patient = 4 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -100,30 +100,23 @@ message EventLabel { // The type of label, part of the prediction task definition core.Coding type = 5 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; // Time associated with the label event, if available - core.DateTime event_time = 6 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() != value.exists()" - ]; + core.DateTime event_time = 6 [(.google.fhir.proto.fhir_path_constraint) = + "extension.exists() != value.exists()"]; // Resource that owns this label - core.Reference source = 7 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() != value.exists()" - ]; + core.Reference source = 7 [(.google.fhir.proto.fhir_path_constraint) = + "extension.exists() != value.exists()"]; // List of labels associated with this event message Label { + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -136,8 +129,6 @@ message EventLabel { // Class name in multi-class prediction tasks, e.g. code "780.60" for icd9 core.Coding class_name = 4 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -154,20 +145,10 @@ message EventLabel { core.DateTime date_time = 5; } } - ClassValue class_value = 5 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() != value.exists()" - ]; + ClassValue class_value = 5 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Label label = 8 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() != value.exists()" - ]; + repeated Label label = 8; } // Auto-generated from StructureDefinition for EventTrigger. @@ -179,6 +160,8 @@ message EventTrigger { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "https://g.co/fhir/StructureDefinition/eventTrigger"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing core.String id = 1; @@ -186,8 +169,6 @@ message EventTrigger { // The type of trigger, part of the prediction task definition. core.Coding type = 4 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -195,17 +176,11 @@ message EventTrigger { // Prediction event time, more recent data will be elided. core.DateTime event_time = 5 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; // Resource that owns this trigger. - core.Reference source = 6 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() != value.exists()" - ]; + core.Reference source = 6 [(.google.fhir.proto.fhir_path_constraint) = + "extension.exists() != value.exists()"]; } diff --git a/proto/r4/uscore.proto b/proto/r4/uscore.proto index fb7fa2cb2..b6a17597b 100755 --- a/proto/r4/uscore.proto +++ b/proto/r4/uscore.proto @@ -38,6 +38,12 @@ message USCorePediatricBMIforAgeObservationProfile { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact core.Id id = 1; @@ -153,6 +159,8 @@ message USCorePediatricBMIforAgeObservationProfile { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -160,11 +168,8 @@ message USCorePediatricBMIforAgeObservationProfile { core.Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available core.Instant issued = 20; @@ -219,6 +224,9 @@ message USCorePediatricBMIforAgeObservationProfile { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -246,12 +254,7 @@ message USCorePediatricBMIforAgeObservationProfile { // Text based reference range in an observation core.String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated core.Reference has_member = 31 [ @@ -272,6 +275,9 @@ message USCorePediatricBMIforAgeObservationProfile { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -314,12 +320,7 @@ message USCorePediatricBMIforAgeObservationProfile { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept @@ -338,6 +339,12 @@ message USCorePediatricWeightForHeightObservationProfile { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact core.Id id = 1; @@ -453,6 +460,8 @@ message USCorePediatricWeightForHeightObservationProfile { // Often just a dateTime for Vital Signs message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -460,11 +469,8 @@ message USCorePediatricWeightForHeightObservationProfile { core.Period period = 2; } } - EffectiveX effective = 19 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8" - ]; + EffectiveX effective = 19 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Date/Time this version was made available core.Instant issued = 20; @@ -519,6 +525,9 @@ message USCorePediatricWeightForHeightObservationProfile { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -546,12 +555,7 @@ message USCorePediatricWeightForHeightObservationProfile { // Text based reference range in an observation core.String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Used when reporting vital signs panel components repeated core.Reference has_member = 31 [ @@ -572,6 +576,9 @@ message USCorePediatricWeightForHeightObservationProfile { // Used when reporting systolic and diastolic blood pressure. message Component { + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.exists() or dataAbsentReason.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -614,12 +621,7 @@ message USCorePediatricWeightForHeightObservationProfile { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "value.exists() or dataAbsentReason.exists()" - ]; + repeated Component component = 33; // field 34 reserved for Observation.category:VSCat which uses an unsupported // slicing on CodeableConcept @@ -636,6 +638,10 @@ message USCoreAllergyIntolerance { "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "verificationStatus='entered-in-error' or clinicalStatus.exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "verificationStatus!='entered-in-error' or clinicalStatus.empty()"; // Logical id of this artifact core.Id id = 1; @@ -823,9 +829,7 @@ message USCoreAllergyIntolerance { // Text about event not captured in other fields repeated core.Annotation note = 10; } - repeated Reaction reaction = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Reaction reaction = 25; } // Auto-generated from StructureDefinition for USCoreBirthSexExtension. @@ -837,6 +841,10 @@ message PatientUSCoreBirthSexExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "children().count() > id.count()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // xml:id (or equivalent in JSON) core.String id = 1; @@ -1022,6 +1030,9 @@ message USCoreCarePlanProfile { // Action to occur as part of plan message Activity { + option (.google.fhir.proto.fhir_path_message_constraint) = + "detail.empty() or reference.empty()"; + // Unique id for inter-element referencing core.String id = 1; @@ -1182,15 +1193,9 @@ message USCoreCarePlanProfile { // Extra info describing activity to perform core.String description = 20; } - Detail detail = 8 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Detail detail = 8; } - repeated Activity activity = 31 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "detail.empty() or reference.empty()" - ]; + repeated Activity activity = 31; // Comments about the plan repeated core.Annotation note = 32; @@ -1279,6 +1284,9 @@ message USCoreCareTeam { // Members of the team message Participant { + option (.google.fhir.proto.fhir_path_message_constraint) = + "onBehalfOf.exists() implies (member.resolve() is Practitioner)"; + // Unique id for inter-element referencing core.String id = 1; @@ -1308,13 +1316,8 @@ message USCoreCareTeam { // Time period of participant core.Period period = 7; } - repeated Participant participant = 17 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "onBehalfOf.exists() implies (member.resolve() is Practitioner)" - ]; + repeated Participant participant = 17 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Why the care team exists repeated core.CodeableConcept reason_code = 18; @@ -1343,6 +1346,14 @@ message UsCoreCondition { "http://hl7.org/fhir/StructureDefinition/Condition"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "verificationStatus.coding.where(system='http://terminology.hl7.org/CodeSystem/condition-ver-status' and code='entered-in-error').empty() or clinicalStatus.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "abatement.empty() or clinicalStatus.coding.where(system='http://terminology.hl7.org/CodeSystem/condition-clinical' and (code='resolved' or code='remission' or code='inactive')).exists()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "clinicalStatus.exists() or verificationStatus='entered-in-error' or category.select($this='problem-list-item').empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "where(category in 'http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category').exists()"; // Logical id of this artifact core.Id id = 1; @@ -1455,6 +1466,9 @@ message UsCoreCondition { // Stage/grade, usually assessed formally message Stage { + option (.google.fhir.proto.fhir_path_message_constraint) = + "summary.exists() or assessment.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -1477,15 +1491,13 @@ message UsCoreCondition { // Kind of staging core.CodeableConcept type = 6; } - repeated Stage stage = 24 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "summary.exists() or assessment.exists()" - ]; + repeated Stage stage = 24; // Supporting evidence message Evidence { + option (.google.fhir.proto.fhir_path_message_constraint) = + "code.exists() or detail.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -1502,12 +1514,7 @@ message UsCoreCondition { repeated core.Reference detail = 5 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - repeated Evidence evidence = 25 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "code.exists() or detail.exists()" - ]; + repeated Evidence evidence = 25; // Additional information about the Condition repeated core.Annotation note = 26; @@ -1601,9 +1608,7 @@ message USCoreDeviceProfile { } EntryTypeCode entry_type = 9; } - UdiCarrier udi_carrier = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + UdiCarrier udi_carrier = 12; // active | inactive | entered-in-error | unknown message StatusCode { @@ -1677,9 +1682,7 @@ message USCoreDeviceProfile { TypeCode type = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated DeviceName device_name = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated DeviceName device_name = 21; // The model number for the device core.String model_number = 22; @@ -1710,9 +1713,7 @@ message USCoreDeviceProfile { // The version of the standard that is used to operate and communicate core.String version = 5; } - repeated Specialization specialization = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Specialization specialization = 25; // The actual design of the device or software version running on the device message Version { @@ -1735,9 +1736,7 @@ message USCoreDeviceProfile { core.String value = 6 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Version version = 26 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Version version = 26; // The actual configuration settings of a device as it actually operates, // e.g., regulation status, time properties @@ -1761,9 +1760,7 @@ message USCoreDeviceProfile { // Property value as a code, e.g., NTP4 (synced to NTP) repeated core.CodeableConcept value_code = 6; } - repeated Property property = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Property property = 27; // Patient to whom Device is affixed core.Reference patient = 28 [ @@ -1807,6 +1804,8 @@ message USCoreDiagnosticReportProfileLaboratoryReporting { "http://hl7.org/fhir/StructureDefinition/DiagnosticReport"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "result.exists() or presentedForm.exists()"; // Logical id of this artifact core.Id id = 1; @@ -1948,9 +1947,7 @@ message USCoreDiagnosticReportProfileLaboratoryReporting { (.google.fhir.proto.valid_reference_type) = "Media" ]; } - repeated Media media = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Media media = 24; // Clinical conclusion (interpretation) of test results core.String conclusion = 25; @@ -2115,9 +2112,7 @@ message USCoreDiagnosticReportProfileNoteExchange { (.google.fhir.proto.valid_reference_type) = "Media" ]; } - repeated Media media = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Media media = 24; // Clinical conclusion (interpretation) of test results core.String conclusion = 25; @@ -2138,6 +2133,10 @@ message UsCoreDirectEmail { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-direct"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "children().count() > id.count()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // xml:id (or equivalent in JSON) core.String id = 1; @@ -2299,9 +2298,7 @@ message USCoreDocumentReferenceProfile { (.google.fhir.proto.valid_reference_type) = "DocumentReference" ]; } - repeated RelatesTo relates_to = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated RelatesTo relates_to = 21; // Human-readable description core.String description = 22; @@ -2330,11 +2327,8 @@ message USCoreDocumentReferenceProfile { // Format/content rules for the document core.Coding format = 5; } - Content content = 24 [ - (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())" - ]; + Content content = 24 + [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; // Clinical context of document message Context { @@ -2372,8 +2366,7 @@ message USCoreDocumentReferenceProfile { repeated core.Reference related = 10 [(.google.fhir.proto.valid_reference_type) = "Resource"]; } - Context context = 25 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Context context = 25; } // Auto-generated from StructureDefinition for USCoreEncounterProfile. @@ -2469,9 +2462,7 @@ message USCoreEncounterProfile { core.Period period = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated StatusHistory status_history = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StatusHistory status_history = 12; // Classification of patient encounter core.Coding class_value = 13 [ @@ -2500,9 +2491,7 @@ message USCoreEncounterProfile { core.Period period = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated ClassHistory class_history = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ClassHistory class_history = 14; // Specific type of encounter repeated core.CodeableConcept type = 15 @@ -2549,9 +2538,7 @@ message USCoreEncounterProfile { core.Reference individual = 6 [(.google.fhir.proto.valid_reference_type) = "Practitioner"]; } - repeated Participant participant = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 21; // The appointment that scheduled this encounter repeated core.Reference appointment = 22 @@ -2599,9 +2586,7 @@ message USCoreEncounterProfile { // Ranking of the diagnosis (for each role type) core.PositiveInt rank = 6; } - repeated Diagnosis diagnosis = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Diagnosis diagnosis = 27; // The set of accounts that may be used for billing for this Encounter repeated core.Reference account = 28 @@ -2652,9 +2637,7 @@ message USCoreEncounterProfile { // Category or kind of location after discharge core.CodeableConcept discharge_disposition = 12; } - Hospitalization hospitalization = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Hospitalization hospitalization = 29; // List of locations where the patient has been message Location { @@ -2697,9 +2680,7 @@ message USCoreEncounterProfile { // Time period during which the patient was present at the location core.Period period = 7; } - repeated Location location = 30 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Location location = 30; // The organization (facility) responsible for this encounter core.Reference service_provider = 31 @@ -2719,6 +2700,10 @@ message PatientUSCoreEthnicityExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "children().count() > id.count()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // xml:id (or equivalent in JSON) core.String id = 1; @@ -2889,6 +2874,9 @@ message USCoreGoalProfile { // Target outcome for the goal message Target { + option (.google.fhir.proto.fhir_path_message_constraint) = + "(detail.exists() and measure.exists()) or detail.exists().not()"; + // Unique id for inter-element referencing core.String id = 1; @@ -2928,12 +2916,7 @@ message USCoreGoalProfile { } DueX due = 6; } - repeated Target target = 18 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "(detail.exists() and measure.exists()) or detail.exists().not()" - ]; + repeated Target target = 18; // When goal status took effect core.Date status_date = 19; @@ -3115,9 +3098,7 @@ message USCoreImmunizationProfile { (.google.fhir.proto.valid_reference_type) = "Organization" ]; } - repeated Performer performer = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Performer performer = 27; // Additional immunization notes repeated core.Annotation note = 28; @@ -3140,6 +3121,9 @@ message USCoreImmunizationProfile { // Educational material presented to patient message Education { + option (.google.fhir.proto.fhir_path_message_constraint) = + "documentType.exists() or reference.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -3161,12 +3145,7 @@ message USCoreImmunizationProfile { // Educational material presentation date core.DateTime presentation_date = 7; } - repeated Education education = 33 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "documentType.exists() or reference.exists()" - ]; + repeated Education education = 33; // Patient eligibility for a vaccination program repeated core.CodeableConcept program_eligibility = 34; @@ -3195,9 +3174,7 @@ message USCoreImmunizationProfile { // Indicates self-reported reaction core.Boolean reported = 6; } - repeated Reaction reaction = 36 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Reaction reaction = 36; // Protocol followed by the provider message ProtocolApplied { @@ -3243,9 +3220,7 @@ message USCoreImmunizationProfile { } SeriesDosesX series_doses = 8; } - repeated ProtocolApplied protocol_applied = 37 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ProtocolApplied protocol_applied = 37; } // Auto-generated from StructureDefinition for USCoreLocation. @@ -3370,9 +3345,7 @@ message USCoreLocation { // Altitude with WGS84 datum core.Decimal altitude = 6; } - Position position = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Position position = 21; // Organization responsible for provisioning and upkeep core.Reference managing_organization = 22 @@ -3419,9 +3392,7 @@ message USCoreLocation { // Time that the Location closes core.Time closing_time = 7; } - repeated HoursOfOperation hours_of_operation = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated HoursOfOperation hours_of_operation = 24; // Description of availability exceptions core.String availability_exceptions = 25; @@ -3534,9 +3505,7 @@ message USCoreMedicationProfile { // Quantity of ingredient present core.Ratio strength = 6; } - repeated Ingredient ingredient = 16 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Ingredient ingredient = 16; // Details about packaged medications message Batch { @@ -3555,8 +3524,7 @@ message USCoreMedicationProfile { // When batch will expire core.DateTime expiration_date = 5; } - Batch batch = 17 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Batch batch = 17; } // Auto-generated from StructureDefinition for USCoreMedicationRequestProfile. @@ -3804,9 +3772,7 @@ message USCoreMedicationRequestProfile { // First fill duration core.Duration duration = 5; } - InitialFill initial_fill = 4 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + InitialFill initial_fill = 4; // Minimum period of time between dispenses core.Duration dispense_interval = 5; @@ -3827,9 +3793,7 @@ message USCoreMedicationRequestProfile { core.Reference performer = 10 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - DispenseRequest dispense_request = 37 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + DispenseRequest dispense_request = 37; // Any restrictions on medication substitution message Substitution { @@ -3857,9 +3821,7 @@ message USCoreMedicationRequestProfile { // Why should (not) substitution be made core.CodeableConcept reason = 5; } - Substitution substitution = 38 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Substitution substitution = 38; // An order/prescription that is being replaced core.Reference prior_prescription = 39 @@ -4037,6 +3999,12 @@ message USCoreLaboratoryResultObservationProfile { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(component.empty() and related.empty()) implies (dataAbsentReason or value)"; // Logical id of this artifact core.Id id = 1; @@ -4130,6 +4098,8 @@ message USCoreLaboratoryResultObservationProfile { // Clinically relevant time/time-period for observation message EffectiveX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "($this as dateTime).toString().length() >= 8"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -4137,9 +4107,7 @@ message USCoreLaboratoryResultObservationProfile { core.Period period = 2; } } - EffectiveX effective = 19 - [(.google.fhir.proto.fhir_path_constraint) = - "($this as dateTime).toString().length() >= 8"]; + EffectiveX effective = 19; // Date/Time this version was made available core.Instant issued = 20; @@ -4156,6 +4124,10 @@ message USCoreLaboratoryResultObservationProfile { // Result Value message ValueX { + option (.google.fhir.proto.fhir_path_message_constraint) = + "valueCodeableConcept.coding.system.empty() or valueCodeableConcept.coding.system = 'http://snomed.info/sct'"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "valueQuantity.system.empty() or valueQuantity.system = 'http://unitsofmeasure.org'"; option (.google.fhir.proto.is_choice_type) = true; oneof choice { @@ -4172,12 +4144,7 @@ message USCoreLaboratoryResultObservationProfile { core.Period period = 11; } } - ValueX value = 22 [ - (.google.fhir.proto.fhir_path_constraint) = - "valueCodeableConcept.coding.system.empty() or valueCodeableConcept.coding.system = 'http://snomed.info/sct'", - (.google.fhir.proto.fhir_path_constraint) = - "valueQuantity.system.empty() or valueQuantity.system = 'http://unitsofmeasure.org'" - ]; + ValueX value = 22; // Why the result is missing core.CodeableConcept data_absent_reason = 23; @@ -4206,6 +4173,9 @@ message USCoreLaboratoryResultObservationProfile { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -4233,12 +4203,7 @@ message USCoreLaboratoryResultObservationProfile { // Text based reference range in an observation core.String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Related resource that belongs to the Observation group repeated core.Reference has_member = 31 [ @@ -4301,9 +4266,7 @@ message USCoreLaboratoryResultObservationProfile { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; // field 34 reserved for Observation.category:laboratory which uses an // unsupported slicing on CodeableConcept @@ -4319,6 +4282,8 @@ message USCoreOrganizationProfile { "http://hl7.org/fhir/StructureDefinition/Organization"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(identifier.count() + name.count()) > 0"; // Logical id of this artifact core.Id id = 1; @@ -4406,9 +4371,7 @@ message USCoreOrganizationProfile { // Visiting or postal addresses for the contact core.Address address = 7; } - repeated Contact contact = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Contact contact = 18; // Technical endpoints providing access to services operated for the // organization @@ -4524,6 +4487,9 @@ message USCorePatientProfile { // A contact party (e.g. guardian, partner, friend) for the patient message Contact { + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.exists() or telecom.exists() or address.exists() or organization.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -4570,12 +4536,7 @@ message USCorePatientProfile { // be contacted relating to this patient core.Period period = 10; } - repeated Contact contact = 21 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "name.exists() or telecom.exists() or address.exists() or organization.exists()" - ]; + repeated Contact contact = 21; // A language which may be used to communicate with the patient about his or // her health @@ -4597,9 +4558,7 @@ message USCorePatientProfile { // Language preference indicator core.Boolean preferred = 5; } - repeated Communication communication = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Communication communication = 22; // Patient's nominated primary care provider repeated core.Reference general_practitioner = 23 [ @@ -4648,9 +4607,7 @@ message USCorePatientProfile { TypeCode type = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Link link = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Link link = 25; // Extension PatientUSCoreRaceExtension race = 26 @@ -4772,9 +4729,7 @@ message USCorePractitionerProfile { core.Reference issuer = 7 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - repeated Qualification qualification = 18 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Qualification qualification = 18; // A language the practitioner can use in patient communication repeated core.CodeableConcept communication = 19; @@ -4793,6 +4748,8 @@ message USCorePractitionerRoleProfile { "http://hl7.org/fhir/StructureDefinition/PractitionerRole"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "telecom or endpoint"; // Logical id of this artifact core.Id id = 1; @@ -4900,9 +4857,7 @@ message USCorePractitionerRoleProfile { // Closing time of day (ignored if allDay = true) core.Time available_end_time = 7; } - repeated AvailableTime available_time = 20 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated AvailableTime available_time = 20; // Not available during this time due to provided reason message NotAvailable { @@ -4922,9 +4877,7 @@ message USCorePractitionerRoleProfile { // Service not available from this date core.Period during = 5; } - repeated NotAvailable not_available = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated NotAvailable not_available = 21; // Description of availability exceptions core.String availability_exceptions = 22; @@ -5090,9 +5043,7 @@ message USCoreProcedureProfile { core.Reference on_behalf_of = 6 [(.google.fhir.proto.valid_reference_type) = "Organization"]; } - repeated Performer performer = 24 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Performer performer = 24; // Where the procedure happened core.Reference location = 25 @@ -5156,9 +5107,7 @@ message USCoreProcedureProfile { (.google.fhir.proto.valid_reference_type) = "Device" ]; } - repeated FocalDevice focal_device = 35 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated FocalDevice focal_device = 35; // Items used during procedure repeated core.Reference used_reference = 36 [ @@ -5180,6 +5129,10 @@ message PatientUSCoreRaceExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "children().count() > id.count()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // xml:id (or equivalent in JSON) core.String id = 1; @@ -5268,6 +5221,10 @@ message USCoreSmokingStatusProfile { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact core.Id id = 1; @@ -5423,6 +5380,9 @@ message USCoreSmokingStatusProfile { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -5450,12 +5410,7 @@ message USCoreSmokingStatusProfile { // Text based reference range in an observation core.String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30; // Related resource that belongs to the Observation group repeated core.Reference has_member = 31 [ @@ -5518,7 +5473,5 @@ message USCoreSmokingStatusProfile { // Provides guide for interpretation of component result repeated ReferenceRange reference_range = 8; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; } diff --git a/testdata/r4/descriptors/11179-objectClass.descriptor.prototxt b/testdata/r4/descriptors/11179-objectClass.descriptor.prototxt index 66a9a7d99..b723c9175 100644 --- a/testdata/r4/descriptors/11179-objectClass.descriptor.prototxt +++ b/testdata/r4/descriptors/11179-objectClass.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for objectClass.\nObject Class.\nSee http://hl7.org/fhir/StructureDefinition/11179-objectClass" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/11179-objectClass" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/11179-objectClassProperty.descriptor.prototxt b/testdata/r4/descriptors/11179-objectClassProperty.descriptor.prototxt index dae050e6a..fc992c773 100644 --- a/testdata/r4/descriptors/11179-objectClassProperty.descriptor.prototxt +++ b/testdata/r4/descriptors/11179-objectClassProperty.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for objectClassProperty.\nObject Class Property.\nSee http://hl7.org/fhir/StructureDefinition/11179-objectClassProperty" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/11179-objectClassProperty" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/11179-permitted-value-conceptmap.descriptor.prototxt b/testdata/r4/descriptors/11179-permitted-value-conceptmap.descriptor.prototxt index 22f938b5b..0e7679fb7 100644 --- a/testdata/r4/descriptors/11179-permitted-value-conceptmap.descriptor.prototxt +++ b/testdata/r4/descriptors/11179-permitted-value-conceptmap.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for permitted-value-conceptmap.\nMapping from permitted to transmitted.\nSee http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/11179-permitted-value-valueset.descriptor.prototxt b/testdata/r4/descriptors/11179-permitted-value-valueset.descriptor.prototxt index 5a1decec5..169c72a3f 100644 --- a/testdata/r4/descriptors/11179-permitted-value-valueset.descriptor.prototxt +++ b/testdata/r4/descriptors/11179-permitted-value-valueset.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for permitted-value-valueset.\nPermitted values.\nSee http://hl7.org/fhir/StructureDefinition/11179-permitted-value-valueset" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/11179-permitted-value-valueset" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/Account.descriptor.prototxt b/testdata/r4/descriptors/Account.descriptor.prototxt index fc11099a7..f3ac01753 100644 --- a/testdata/r4/descriptors/Account.descriptor.prototxt +++ b/testdata/r4/descriptors/Account.descriptor.prototxt @@ -161,7 +161,6 @@ field { type_name: ".google.fhir.r4.core.Account.Coverage" options { [google.fhir.proto.field_description]: "The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -193,7 +192,6 @@ field { type_name: ".google.fhir.r4.core.Account.Guarantor" options { [google.fhir.proto.field_description]: "The parties ultimately responsible for balancing the Account" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/ActivityDefinition.descriptor.prototxt b/testdata/r4/descriptors/ActivityDefinition.descriptor.prototxt index a571cd3c6..be14d61b2 100644 --- a/testdata/r4/descriptors/ActivityDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/ActivityDefinition.descriptor.prototxt @@ -455,7 +455,6 @@ field { type_name: ".google.fhir.r4.core.ActivityDefinition.Participant" options { [google.fhir.proto.field_description]: "Who should participate in the action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -549,7 +548,6 @@ field { type_name: ".google.fhir.r4.core.ActivityDefinition.DynamicValue" options { [google.fhir.proto.field_description]: "Dynamic aspects of the definition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -914,4 +912,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ActivityDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nThe definition of a specific activity to be taken, independent of any particular patient or context.\nSee http://hl7.org/fhir/StructureDefinition/ActivityDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/AdverseEvent.descriptor.prototxt b/testdata/r4/descriptors/AdverseEvent.descriptor.prototxt index 611b3b567..d876dead5 100644 --- a/testdata/r4/descriptors/AdverseEvent.descriptor.prototxt +++ b/testdata/r4/descriptors/AdverseEvent.descriptor.prototxt @@ -269,7 +269,6 @@ field { type_name: ".google.fhir.r4.core.AdverseEvent.SuspectEntity" options { [google.fhir.proto.field_description]: "The suspected agent causing the adverse event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -397,7 +396,6 @@ nested_type { type_name: ".google.fhir.r4.core.AdverseEvent.SuspectEntity.Causality" options { [google.fhir.proto.field_description]: "Information on the possible cause of the event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Age.descriptor.prototxt b/testdata/r4/descriptors/Age.descriptor.prototxt index 3e2ff9400..242a2a6df 100644 --- a/testdata/r4/descriptors/Age.descriptor.prototxt +++ b/testdata/r4/descriptors/Age.descriptor.prototxt @@ -100,4 +100,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Age, last updated 2018-12-27T22:37:54.724+11:00.\nA duration of time during which an organism (or a process) has existed.\nSee http://hl7.org/fhir/StructureDefinition/Age" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Age" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "(code.exists() or value.empty()) and (system.empty() or system = %ucum) and (value.empty() or value.hasValue().not() or value > 0)" } diff --git a/testdata/r4/descriptors/AllergyIntolerance.descriptor.prototxt b/testdata/r4/descriptors/AllergyIntolerance.descriptor.prototxt index 94687b4a8..5c2815932 100644 --- a/testdata/r4/descriptors/AllergyIntolerance.descriptor.prototxt +++ b/testdata/r4/descriptors/AllergyIntolerance.descriptor.prototxt @@ -254,7 +254,6 @@ field { type_name: ".google.fhir.r4.core.AllergyIntolerance.Reaction" options { [google.fhir.proto.field_description]: "Adverse Reaction Events linked to exposure to substance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -523,4 +522,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for AllergyIntolerance, last updated 2018-12-27T22:37:54.724+11:00.\nAllergy or Intolerance (generally: Risk of adverse reaction to a substance).\nSee http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/AllergyIntolerance" + [google.fhir.proto.fhir_path_message_constraint]: "verificationStatus=\'entered-in-error\' or clinicalStatus.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "verificationStatus!=\'entered-in-error\' or clinicalStatus.empty()" } diff --git a/testdata/r4/descriptors/Appointment.descriptor.prototxt b/testdata/r4/descriptors/Appointment.descriptor.prototxt index 6b73db014..2934e8f8c 100644 --- a/testdata/r4/descriptors/Appointment.descriptor.prototxt +++ b/testdata/r4/descriptors/Appointment.descriptor.prototxt @@ -302,8 +302,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Participants involved in appointment" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "type.exists() or actor.exists()" } } field { @@ -487,9 +485,15 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "type.exists() or actor.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Appointment, last updated 2018-12-27T22:37:54.724+11:00.\nA booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).\nSee http://hl7.org/fhir/StructureDefinition/Appointment" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Appointment" + [google.fhir.proto.fhir_path_message_constraint]: "Appointment.cancelationReason.exists() implies (Appointment.status=\'no-show\' or Appointment.status=\'cancelled\')" + [google.fhir.proto.fhir_path_message_constraint]: "(start.exists() and end.exists()) or (status in (\'proposed\' | \'cancelled\' | \'waitlist\'))" + [google.fhir.proto.fhir_path_message_constraint]: "start.exists() = end.exists()" } diff --git a/testdata/r4/descriptors/AppointmentResponse.descriptor.prototxt b/testdata/r4/descriptors/AppointmentResponse.descriptor.prototxt index f82bc4425..717fe449f 100644 --- a/testdata/r4/descriptors/AppointmentResponse.descriptor.prototxt +++ b/testdata/r4/descriptors/AppointmentResponse.descriptor.prototxt @@ -206,4 +206,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for AppointmentResponse, last updated 2018-12-27T22:37:54.724+11:00.\nA reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection.\nSee http://hl7.org/fhir/StructureDefinition/AppointmentResponse" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/AppointmentResponse" + [google.fhir.proto.fhir_path_message_constraint]: "participantType.exists() or actor.exists()" } diff --git a/testdata/r4/descriptors/Attachment.descriptor.prototxt b/testdata/r4/descriptors/Attachment.descriptor.prototxt index b6d0cf18f..4e6a769ad 100644 --- a/testdata/r4/descriptors/Attachment.descriptor.prototxt +++ b/testdata/r4/descriptors/Attachment.descriptor.prototxt @@ -138,4 +138,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Attachment, last updated 2018-12-27T22:37:54.724+11:00.\nContent in a format defined elsewhere.\nSee http://hl7.org/fhir/StructureDefinition/Attachment" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Attachment" + [google.fhir.proto.fhir_path_message_constraint]: "data.empty() or contentType.exists()" } diff --git a/testdata/r4/descriptors/AuditEvent.descriptor.prototxt b/testdata/r4/descriptors/AuditEvent.descriptor.prototxt index a9773011b..b083936de 100644 --- a/testdata/r4/descriptors/AuditEvent.descriptor.prototxt +++ b/testdata/r4/descriptors/AuditEvent.descriptor.prototxt @@ -176,7 +176,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Actor involved in the event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -188,7 +187,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Audit Event Reporter" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -199,8 +197,6 @@ field { type_name: ".google.fhir.r4.core.AuditEvent.Entity" options { [google.fhir.proto.field_description]: "Data or objects used" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "name.empty() or query.empty()" } } nested_type { @@ -395,7 +391,6 @@ nested_type { type_name: ".google.fhir.r4.core.AuditEvent.Agent.Network" options { [google.fhir.proto.field_description]: "Logical network location for application activity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -680,7 +675,6 @@ nested_type { type_name: ".google.fhir.r4.core.AuditEvent.Entity.Detail" options { [google.fhir.proto.field_description]: "Additional Information about the entity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -764,6 +758,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "name.empty() or query.empty()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/BiologicallyDerivedProduct.descriptor.prototxt b/testdata/r4/descriptors/BiologicallyDerivedProduct.descriptor.prototxt index 0934b1aba..4aa31323d 100644 --- a/testdata/r4/descriptors/BiologicallyDerivedProduct.descriptor.prototxt +++ b/testdata/r4/descriptors/BiologicallyDerivedProduct.descriptor.prototxt @@ -165,7 +165,6 @@ field { type_name: ".google.fhir.r4.core.BiologicallyDerivedProduct.Collection" options { [google.fhir.proto.field_description]: "How this product was collected" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -176,7 +175,6 @@ field { type_name: ".google.fhir.r4.core.BiologicallyDerivedProduct.Processing" options { [google.fhir.proto.field_description]: "Any processing of the product during collection" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -187,7 +185,6 @@ field { type_name: ".google.fhir.r4.core.BiologicallyDerivedProduct.Manipulation" options { [google.fhir.proto.field_description]: "Any manipulation of product post-collection" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -198,7 +195,6 @@ field { type_name: ".google.fhir.r4.core.BiologicallyDerivedProduct.Storage" options { [google.fhir.proto.field_description]: "Product storage" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Bundle.descriptor.prototxt b/testdata/r4/descriptors/Bundle.descriptor.prototxt index f1b87ca0d..093751f0c 100644 --- a/testdata/r4/descriptors/Bundle.descriptor.prototxt +++ b/testdata/r4/descriptors/Bundle.descriptor.prototxt @@ -88,7 +88,6 @@ field { type_name: ".google.fhir.r4.core.Bundle.Link" options { [google.fhir.proto.field_description]: "Links related to this Bundle" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -99,9 +98,6 @@ field { type_name: ".google.fhir.r4.core.Bundle.Entry" options { [google.fhir.proto.field_description]: "Entry in the bundle - will have a resource or information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "fullUrl.contains(\'/_history/\').not()" - [google.fhir.proto.fhir_path_constraint]: "resource.exists() or request.exists() or response.exists()" } } field { @@ -266,7 +262,6 @@ nested_type { type_name: ".google.fhir.r4.core.Bundle.Entry.Search" options { [google.fhir.proto.field_description]: "Search related information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -277,7 +272,6 @@ nested_type { type_name: ".google.fhir.r4.core.Bundle.Entry.Request" options { [google.fhir.proto.field_description]: "Additional execution information (transaction/batch/history)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -288,7 +282,6 @@ nested_type { type_name: ".google.fhir.r4.core.Bundle.Entry.Response" options { [google.fhir.proto.field_description]: "Results of execution (transaction/batch/history)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -577,9 +570,22 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "fullUrl.contains(\'/_history/\').not()" + [google.fhir.proto.fhir_path_message_constraint]: "resource.exists() or request.exists() or response.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Bundle, last updated 2018-12-27T22:37:54.724+11:00.\nContains a collection of resources.\nSee http://hl7.org/fhir/StructureDefinition/Bundle" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Bundle" + [google.fhir.proto.fhir_path_message_constraint]: "(type = \'history\') or entry.where(fullUrl.exists()).select(fullUrl&resource.meta.versionId).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "type = \'document\' implies (identifier.system.exists() and identifier.value.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "entry.all(request.exists() = (%resource.type = \'batch\' or %resource.type = \'transaction\' or %resource.type = \'history\'))" + [google.fhir.proto.fhir_path_message_constraint]: "entry.all(response.exists() = (%resource.type = \'batch-response\' or %resource.type = \'transaction-response\' or %resource.type = \'history\'))" + [google.fhir.proto.fhir_path_message_constraint]: "type = \'message\' implies entry.first().resource.is(MessageHeader)" + [google.fhir.proto.fhir_path_message_constraint]: "total.empty() or (type = \'searchset\') or (type = \'history\')" + [google.fhir.proto.fhir_path_message_constraint]: "entry.search.empty() or (type = \'searchset\')" + [google.fhir.proto.fhir_path_message_constraint]: "type = \'document\' implies entry.first().resource.is(Composition)" + [google.fhir.proto.fhir_path_message_constraint]: "type = \'document\' implies (meta.lastUpdated.hasValue())" } diff --git a/testdata/r4/descriptors/CapabilityStatement.descriptor.prototxt b/testdata/r4/descriptors/CapabilityStatement.descriptor.prototxt index 7883b6518..c23ff5ad0 100644 --- a/testdata/r4/descriptors/CapabilityStatement.descriptor.prototxt +++ b/testdata/r4/descriptors/CapabilityStatement.descriptor.prototxt @@ -266,7 +266,6 @@ field { type_name: ".google.fhir.r4.core.CapabilityStatement.Software" options { [google.fhir.proto.field_description]: "Software that is covered by this capability statement" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -277,7 +276,6 @@ field { type_name: ".google.fhir.r4.core.CapabilityStatement.Implementation" options { [google.fhir.proto.field_description]: "If this describes a specific instance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -330,8 +328,6 @@ field { type_name: ".google.fhir.r4.core.CapabilityStatement.Rest" options { [google.fhir.proto.field_description]: "If the endpoint is a RESTful one" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "resource.select(type).isDistinct()" } } field { @@ -342,7 +338,6 @@ field { type_name: ".google.fhir.r4.core.CapabilityStatement.Messaging" options { [google.fhir.proto.field_description]: "If messaging is supported" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -353,7 +348,6 @@ field { type_name: ".google.fhir.r4.core.CapabilityStatement.Document" options { [google.fhir.proto.field_description]: "Document definition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -697,7 +691,6 @@ nested_type { type_name: ".google.fhir.r4.core.CapabilityStatement.Rest.Security" options { [google.fhir.proto.field_description]: "Information about security of implementation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -708,8 +701,6 @@ nested_type { type_name: ".google.fhir.r4.core.CapabilityStatement.Rest.Resource" options { [google.fhir.proto.field_description]: "Resource served on the REST interface" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "searchParam.select(name).isDistinct()" } } field { @@ -720,7 +711,6 @@ nested_type { type_name: ".google.fhir.r4.core.CapabilityStatement.Rest.SystemInteraction" options { [google.fhir.proto.field_description]: "What operations are supported?" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -924,7 +914,6 @@ nested_type { type_name: ".google.fhir.r4.core.CapabilityStatement.Rest.Resource.ResourceInteraction" options { [google.fhir.proto.field_description]: "What operations are supported?" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1035,7 +1024,6 @@ nested_type { type_name: ".google.fhir.r4.core.CapabilityStatement.Rest.Resource.SearchParam" options { [google.fhir.proto.field_description]: "Search parameters supported by implementation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1046,7 +1034,6 @@ nested_type { type_name: ".google.fhir.r4.core.CapabilityStatement.Rest.Resource.Operation" options { [google.fhir.proto.field_description]: "Definition of a resource operation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1432,6 +1419,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "searchParam.select(name).isDistinct()" + } } nested_type { name: "SystemInteraction" @@ -1514,6 +1504,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "resource.select(type).isDistinct()" + } } nested_type { name: "Messaging" @@ -1555,7 +1548,6 @@ nested_type { type_name: ".google.fhir.r4.core.CapabilityStatement.Messaging.Endpoint" options { [google.fhir.proto.field_description]: "Where messages should be sent" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1586,7 +1578,6 @@ nested_type { type_name: ".google.fhir.r4.core.CapabilityStatement.Messaging.SupportedMessage" options { [google.fhir.proto.field_description]: "Messages supported by this system" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1823,4 +1814,12 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for CapabilityStatement, last updated 2018-12-27T22:37:54.724+11:00.\nA statement of system capabilities.\nSee http://hl7.org/fhir/StructureDefinition/CapabilityStatement" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/CapabilityStatement" + [google.fhir.proto.fhir_path_message_constraint]: "document.select(profile&mode).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "(kind!=\'requirements\') or (implementation.exists().not() and software.exists().not())" + [google.fhir.proto.fhir_path_message_constraint]: "(kind != \'capability\') or (implementation.exists().not() and software.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "messaging.endpoint.empty() or kind = \'instance\'" + [google.fhir.proto.fhir_path_message_constraint]: "(kind != \'instance\') or implementation.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "(description.count() + software.count() + implementation.count()) > 0" + [google.fhir.proto.fhir_path_message_constraint]: "rest.exists() or messaging.exists() or document.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/CarePlan.descriptor.prototxt b/testdata/r4/descriptors/CarePlan.descriptor.prototxt index f09d11198..6fb6c8d1b 100644 --- a/testdata/r4/descriptors/CarePlan.descriptor.prototxt +++ b/testdata/r4/descriptors/CarePlan.descriptor.prototxt @@ -330,8 +330,6 @@ field { type_name: ".google.fhir.r4.core.CarePlan.Activity" options { [google.fhir.proto.field_description]: "Action to occur as part of plan" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "detail.empty() or reference.empty()" } } field { @@ -488,7 +486,6 @@ nested_type { type_name: ".google.fhir.r4.core.CarePlan.Activity.Detail" options { [google.fhir.proto.field_description]: "In-line definition of activity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -826,6 +823,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "detail.empty() or reference.empty()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/CareTeam.descriptor.prototxt b/testdata/r4/descriptors/CareTeam.descriptor.prototxt index 9506a64ee..edcbb7ee4 100644 --- a/testdata/r4/descriptors/CareTeam.descriptor.prototxt +++ b/testdata/r4/descriptors/CareTeam.descriptor.prototxt @@ -166,8 +166,6 @@ field { type_name: ".google.fhir.r4.core.CareTeam.Participant" options { [google.fhir.proto.field_description]: "Members of the team" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "onBehalfOf.exists() implies (member.resolve() is Practitioner)" } } field { @@ -328,6 +326,9 @@ nested_type { [google.fhir.proto.field_description]: "Time period of participant" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "onBehalfOf.exists() implies (member.resolve() is Practitioner)" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/CatalogEntry.descriptor.prototxt b/testdata/r4/descriptors/CatalogEntry.descriptor.prototxt index 95bf9f49f..bb579a394 100644 --- a/testdata/r4/descriptors/CatalogEntry.descriptor.prototxt +++ b/testdata/r4/descriptors/CatalogEntry.descriptor.prototxt @@ -226,7 +226,6 @@ field { type_name: ".google.fhir.r4.core.CatalogEntry.RelatedEntry" options { [google.fhir.proto.field_description]: "An item that this catalog entry is related to" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/ChargeItem.descriptor.prototxt b/testdata/r4/descriptors/ChargeItem.descriptor.prototxt index 403e6f510..83cec6b70 100644 --- a/testdata/r4/descriptors/ChargeItem.descriptor.prototxt +++ b/testdata/r4/descriptors/ChargeItem.descriptor.prototxt @@ -191,7 +191,6 @@ field { type_name: ".google.fhir.r4.core.ChargeItem.Performer" options { [google.fhir.proto.field_description]: "Who performed charged service" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/ChargeItemDefinition.descriptor.prototxt b/testdata/r4/descriptors/ChargeItemDefinition.descriptor.prototxt index c422ad055..7fd8e4cca 100644 --- a/testdata/r4/descriptors/ChargeItemDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/ChargeItemDefinition.descriptor.prototxt @@ -308,7 +308,6 @@ field { type_name: ".google.fhir.r4.core.ChargeItemDefinition.Applicability" options { [google.fhir.proto.field_description]: "Whether or not the billing code is applicable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -319,7 +318,6 @@ field { type_name: ".google.fhir.r4.core.ChargeItemDefinition.PropertyGroup" options { [google.fhir.proto.field_description]: "Group of properties which are applicable under the same conditions" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -462,7 +460,6 @@ nested_type { type_name: ".google.fhir.r4.core.ChargeItemDefinition.PropertyGroup.PriceComponent" options { [google.fhir.proto.field_description]: "Components of total line item price" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -571,4 +568,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ChargeItemDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nDefinition of properties and rules about how the price and the applicability of a ChargeItem can be determined.\nSee http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Claim.descriptor.prototxt b/testdata/r4/descriptors/Claim.descriptor.prototxt index 91c8ae230..b0c7d5aad 100644 --- a/testdata/r4/descriptors/Claim.descriptor.prototxt +++ b/testdata/r4/descriptors/Claim.descriptor.prototxt @@ -237,7 +237,6 @@ field { type_name: ".google.fhir.r4.core.Claim.RelatedClaim" options { [google.fhir.proto.field_description]: "Prior or corollary claims" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -274,7 +273,6 @@ field { type_name: ".google.fhir.r4.core.Claim.Payee" options { [google.fhir.proto.field_description]: "Recipient of benefits payable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -307,7 +305,6 @@ field { type_name: ".google.fhir.r4.core.Claim.CareTeam" options { [google.fhir.proto.field_description]: "Members of the care team" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -318,7 +315,6 @@ field { type_name: ".google.fhir.r4.core.Claim.SupportingInformation" options { [google.fhir.proto.field_description]: "Supporting information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -329,7 +325,6 @@ field { type_name: ".google.fhir.r4.core.Claim.Diagnosis" options { [google.fhir.proto.field_description]: "Pertinent diagnosis information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -340,7 +335,6 @@ field { type_name: ".google.fhir.r4.core.Claim.Procedure" options { [google.fhir.proto.field_description]: "Clinical procedures performed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -352,7 +346,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Patient insurance information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -363,7 +356,6 @@ field { type_name: ".google.fhir.r4.core.Claim.Accident" options { [google.fhir.proto.field_description]: "Details of the event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -374,7 +366,6 @@ field { type_name: ".google.fhir.r4.core.Claim.Item" options { [google.fhir.proto.field_description]: "Product or service provided" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1496,7 +1487,6 @@ nested_type { type_name: ".google.fhir.r4.core.Claim.Item.Detail" options { [google.fhir.proto.field_description]: "Product or service provided" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1713,7 +1703,6 @@ nested_type { type_name: ".google.fhir.r4.core.Claim.Item.Detail.SubDetail" options { [google.fhir.proto.field_description]: "Product or service provided" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/ClaimResponse.descriptor.prototxt b/testdata/r4/descriptors/ClaimResponse.descriptor.prototxt index e0c61c475..15e7d53a7 100644 --- a/testdata/r4/descriptors/ClaimResponse.descriptor.prototxt +++ b/testdata/r4/descriptors/ClaimResponse.descriptor.prototxt @@ -256,7 +256,6 @@ field { type_name: ".google.fhir.r4.core.ClaimResponse.Item" options { [google.fhir.proto.field_description]: "Adjudication for claim line items" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -267,7 +266,6 @@ field { type_name: ".google.fhir.r4.core.ClaimResponse.AddedItem" options { [google.fhir.proto.field_description]: "Insurer added line items" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -288,7 +286,6 @@ field { type_name: ".google.fhir.r4.core.ClaimResponse.Total" options { [google.fhir.proto.field_description]: "Adjudication totals" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -299,7 +296,6 @@ field { type_name: ".google.fhir.r4.core.ClaimResponse.Payment" options { [google.fhir.proto.field_description]: "Payment Details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -340,7 +336,6 @@ field { type_name: ".google.fhir.r4.core.ClaimResponse.Note" options { [google.fhir.proto.field_description]: "Note concerning adjudication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -362,7 +357,6 @@ field { type_name: ".google.fhir.r4.core.ClaimResponse.Insurance" options { [google.fhir.proto.field_description]: "Patient insurance information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -373,7 +367,6 @@ field { type_name: ".google.fhir.r4.core.ClaimResponse.Error" options { [google.fhir.proto.field_description]: "Processing errors" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -519,7 +512,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Adjudication details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -530,7 +522,6 @@ nested_type { type_name: ".google.fhir.r4.core.ClaimResponse.Item.ItemDetail" options { [google.fhir.proto.field_description]: "Adjudication for claim details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -679,7 +670,6 @@ nested_type { type_name: ".google.fhir.r4.core.ClaimResponse.Item.ItemDetail.SubDetail" options { [google.fhir.proto.field_description]: "Adjudication for claim sub-details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -963,7 +953,6 @@ nested_type { type_name: ".google.fhir.r4.core.ClaimResponse.AddedItem.AddedItemDetail" options { [google.fhir.proto.field_description]: "Insurer added line details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1149,7 +1138,6 @@ nested_type { type_name: ".google.fhir.r4.core.ClaimResponse.AddedItem.AddedItemDetail.AddedItemSubDetail" options { [google.fhir.proto.field_description]: "Insurer added line items" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/ClinicalImpression.descriptor.prototxt b/testdata/r4/descriptors/ClinicalImpression.descriptor.prototxt index 563cedaa7..b5a251037 100644 --- a/testdata/r4/descriptors/ClinicalImpression.descriptor.prototxt +++ b/testdata/r4/descriptors/ClinicalImpression.descriptor.prototxt @@ -223,7 +223,6 @@ field { type_name: ".google.fhir.r4.core.ClinicalImpression.Investigation" options { [google.fhir.proto.field_description]: "One or more sets of investigations (signs, symptoms, etc.)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -254,7 +253,6 @@ field { type_name: ".google.fhir.r4.core.ClinicalImpression.Finding" options { [google.fhir.proto.field_description]: "Possible or likely findings and diagnoses" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/CodeSystem.descriptor.prototxt b/testdata/r4/descriptors/CodeSystem.descriptor.prototxt index 1ac914f0c..2f520c66d 100644 --- a/testdata/r4/descriptors/CodeSystem.descriptor.prototxt +++ b/testdata/r4/descriptors/CodeSystem.descriptor.prototxt @@ -325,7 +325,6 @@ field { type_name: ".google.fhir.r4.core.CodeSystem.Filter" options { [google.fhir.proto.field_description]: "Filter that can be used in a value set" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -336,7 +335,6 @@ field { type_name: ".google.fhir.r4.core.CodeSystem.Property" options { [google.fhir.proto.field_description]: "Additional information supplied about each concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -347,7 +345,6 @@ field { type_name: ".google.fhir.r4.core.CodeSystem.ConceptDefinition" options { [google.fhir.proto.field_description]: "Concepts in the code system" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -707,7 +704,6 @@ nested_type { type_name: ".google.fhir.r4.core.CodeSystem.ConceptDefinition.Designation" options { [google.fhir.proto.field_description]: "Additional representations for the concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -718,7 +714,6 @@ nested_type { type_name: ".google.fhir.r4.core.CodeSystem.ConceptDefinition.ConceptProperty" options { [google.fhir.proto.field_description]: "Property value for the concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -921,4 +916,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for CodeSystem, last updated 2018-12-27T22:37:54.724+11:00.\nDeclares the existence of and describes a code system or code system supplement.\nSee http://hl7.org/fhir/StructureDefinition/CodeSystem" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/CodeSystem" + [google.fhir.proto.fhir_path_message_constraint]: "concept.code.combine($this.descendants().concept.code).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Communication.descriptor.prototxt b/testdata/r4/descriptors/Communication.descriptor.prototxt index 56b7a0360..c95446b25 100644 --- a/testdata/r4/descriptors/Communication.descriptor.prototxt +++ b/testdata/r4/descriptors/Communication.descriptor.prototxt @@ -331,7 +331,6 @@ field { type_name: ".google.fhir.r4.core.Communication.Payload" options { [google.fhir.proto.field_description]: "Message payload" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/CommunicationRequest.descriptor.prototxt b/testdata/r4/descriptors/CommunicationRequest.descriptor.prototxt index 21b09c8e1..268ae1025 100644 --- a/testdata/r4/descriptors/CommunicationRequest.descriptor.prototxt +++ b/testdata/r4/descriptors/CommunicationRequest.descriptor.prototxt @@ -230,7 +230,6 @@ field { type_name: ".google.fhir.r4.core.CommunicationRequest.Payload" options { [google.fhir.proto.field_description]: "Message payload" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/CompartmentDefinition.descriptor.prototxt b/testdata/r4/descriptors/CompartmentDefinition.descriptor.prototxt index 614ff50fd..8dbc8e9cc 100644 --- a/testdata/r4/descriptors/CompartmentDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/CompartmentDefinition.descriptor.prototxt @@ -228,7 +228,6 @@ field { type_name: ".google.fhir.r4.core.CompartmentDefinition.Resource" options { [google.fhir.proto.field_description]: "How a resource is related to the compartment" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -380,4 +379,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for CompartmentDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nCompartment Definition for a resource.\nSee http://hl7.org/fhir/StructureDefinition/CompartmentDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/CompartmentDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Composition.descriptor.prototxt b/testdata/r4/descriptors/Composition.descriptor.prototxt index 1ccf14955..8295a0abd 100644 --- a/testdata/r4/descriptors/Composition.descriptor.prototxt +++ b/testdata/r4/descriptors/Composition.descriptor.prototxt @@ -206,7 +206,6 @@ field { type_name: ".google.fhir.r4.core.Composition.Attester" options { [google.fhir.proto.field_description]: "Attests to accuracy of composition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -228,7 +227,6 @@ field { type_name: ".google.fhir.r4.core.Composition.RelatesTo" options { [google.fhir.proto.field_description]: "Relationships to other compositions/documents" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -239,7 +237,6 @@ field { type_name: ".google.fhir.r4.core.Composition.Event" options { [google.fhir.proto.field_description]: "The clinical service(s) being documented" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -250,9 +247,6 @@ field { type_name: ".google.fhir.r4.core.Composition.Section" options { [google.fhir.proto.field_description]: "Composition is broken into sections" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "text.exists() or entry.exists() or section.exists()" - [google.fhir.proto.fhir_path_constraint]: "emptyReason.empty() or entry.empty()" } } nested_type { @@ -746,6 +740,10 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "text.exists() or entry.exists() or section.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "emptyReason.empty() or entry.empty()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/ConceptMap.descriptor.prototxt b/testdata/r4/descriptors/ConceptMap.descriptor.prototxt index 7bd8e2bc3..989e0bd20 100644 --- a/testdata/r4/descriptors/ConceptMap.descriptor.prototxt +++ b/testdata/r4/descriptors/ConceptMap.descriptor.prototxt @@ -264,7 +264,6 @@ field { type_name: ".google.fhir.r4.core.ConceptMap.Group" options { [google.fhir.proto.field_description]: "Same source and target systems" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -425,7 +424,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Mappings for a concept from the source set" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -436,9 +434,6 @@ nested_type { type_name: ".google.fhir.r4.core.ConceptMap.Group.Unmapped" options { [google.fhir.proto.field_description]: "What to do when there is no mapping for the source concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(mode = \'other-map\') implies url.exists()" - [google.fhir.proto.fhir_path_constraint]: "(mode = \'fixed\') implies code.exists()" } } nested_type { @@ -501,8 +496,6 @@ nested_type { type_name: ".google.fhir.r4.core.ConceptMap.Group.SourceElement.TargetElement" options { [google.fhir.proto.field_description]: "Concept in target system for element" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "comment.exists() or equivalence.empty() or ((equivalence != \'narrower\') and (equivalence != \'inexact\'))" } } nested_type { @@ -586,7 +579,6 @@ nested_type { type_name: ".google.fhir.r4.core.ConceptMap.Group.SourceElement.TargetElement.OtherElement" options { [google.fhir.proto.field_description]: "Other elements required for this mapping (from context)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -701,6 +693,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "comment.exists() or equivalence.empty() or ((equivalence != \'narrower\') and (equivalence != \'inexact\'))" + } } } nested_type { @@ -803,10 +798,15 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(mode = \'other-map\') implies url.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "(mode = \'fixed\') implies code.exists()" + } } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ConceptMap, last updated 2018-12-27T22:37:54.724+11:00.\nA map from one set of concepts to one or more other concepts.\nSee http://hl7.org/fhir/StructureDefinition/ConceptMap" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ConceptMap" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Condition.descriptor.prototxt b/testdata/r4/descriptors/Condition.descriptor.prototxt index 191d0c374..b26f9c09b 100644 --- a/testdata/r4/descriptors/Condition.descriptor.prototxt +++ b/testdata/r4/descriptors/Condition.descriptor.prototxt @@ -245,8 +245,6 @@ field { type_name: ".google.fhir.r4.core.Condition.Stage" options { [google.fhir.proto.field_description]: "Stage/grade, usually assessed formally" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "summary.exists() or assessment.exists()" } } field { @@ -257,8 +255,6 @@ field { type_name: ".google.fhir.r4.core.Condition.Evidence" options { [google.fhir.proto.field_description]: "Supporting evidence" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "code.exists() or detail.exists()" } } field { @@ -436,6 +432,9 @@ nested_type { [google.fhir.proto.field_description]: "Kind of staging" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "summary.exists() or assessment.exists()" + } } nested_type { name: "Evidence" @@ -490,9 +489,15 @@ nested_type { [google.fhir.proto.valid_reference_type]: "Resource" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "code.exists() or detail.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Condition, last updated 2018-12-27T22:37:54.724+11:00.\nDetailed information about conditions, problems or diagnoses.\nSee http://hl7.org/fhir/StructureDefinition/Condition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Condition" + [google.fhir.proto.fhir_path_message_constraint]: "verificationStatus.coding.where(system=\'http://terminology.hl7.org/CodeSystem/condition-ver-status\' and code=\'entered-in-error\').empty() or clinicalStatus.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "abatement.empty() or clinicalStatus.coding.where(system=\'http://terminology.hl7.org/CodeSystem/condition-clinical\' and (code=\'resolved\' or code=\'remission\' or code=\'inactive\')).exists()" + [google.fhir.proto.fhir_path_message_constraint]: "clinicalStatus.exists() or verificationStatus=\'entered-in-error\' or category.select($this=\'problem-list-item\').empty()" } diff --git a/testdata/r4/descriptors/Consent.descriptor.prototxt b/testdata/r4/descriptors/Consent.descriptor.prototxt index 0a40ea271..1be3a06d3 100644 --- a/testdata/r4/descriptors/Consent.descriptor.prototxt +++ b/testdata/r4/descriptors/Consent.descriptor.prototxt @@ -193,7 +193,6 @@ field { type_name: ".google.fhir.r4.core.Consent.Policy" options { [google.fhir.proto.field_description]: "Policies covered by this consent" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -214,7 +213,6 @@ field { type_name: ".google.fhir.r4.core.Consent.Verification" options { [google.fhir.proto.field_description]: "Consent Verified by patient or family" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -225,7 +223,6 @@ field { type_name: ".google.fhir.r4.core.Consent.Provision" options { [google.fhir.proto.field_description]: "Constraints to the base Consent.policyRule" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -465,7 +462,6 @@ nested_type { type_name: ".google.fhir.r4.core.Consent.Provision.ProvisionActor" options { [google.fhir.proto.field_description]: "Who|what controlled by this rule (or group, by role)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -537,7 +533,6 @@ nested_type { type_name: ".google.fhir.r4.core.Consent.Provision.ProvisionData" options { [google.fhir.proto.field_description]: "Data controlled by this rule" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -728,4 +723,9 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Consent, last updated 2018-12-27T22:37:54.724+11:00.\nA healthcare consumer\'s choices to permit or deny recipients or roles to perform actions for specific purposes and periods of time.\nSee http://hl7.org/fhir/StructureDefinition/Consent" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Consent" + [google.fhir.proto.fhir_path_message_constraint]: "patient.exists() or scope.coding.where(system=\'something\' and code=\'adr\').exists().not()" + [google.fhir.proto.fhir_path_message_constraint]: "patient.exists() or scope.coding.where(system=\'something\' and code=\'treatment\').exists().not()" + [google.fhir.proto.fhir_path_message_constraint]: "patient.exists() or scope.coding.where(system=\'something\' and code=\'patient-privacy\').exists().not()" + [google.fhir.proto.fhir_path_message_constraint]: "patient.exists() or scope.coding.where(system=\'something\' and code=\'research\').exists().not()" + [google.fhir.proto.fhir_path_message_constraint]: "policy.exists() or policyRule.exists()" } diff --git a/testdata/r4/descriptors/ContactPoint.descriptor.prototxt b/testdata/r4/descriptors/ContactPoint.descriptor.prototxt index 210ff5fc8..853297370 100644 --- a/testdata/r4/descriptors/ContactPoint.descriptor.prototxt +++ b/testdata/r4/descriptors/ContactPoint.descriptor.prototxt @@ -127,4 +127,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ContactPoint, last updated 2018-12-27T22:37:54.724+11:00.\nDetails of a Technology mediated contact point (phone, fax, email, etc.).\nSee http://hl7.org/fhir/StructureDefinition/ContactPoint" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ContactPoint" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or system.exists()" } diff --git a/testdata/r4/descriptors/Contract.descriptor.prototxt b/testdata/r4/descriptors/Contract.descriptor.prototxt index 46f53b377..af10bc9a3 100644 --- a/testdata/r4/descriptors/Contract.descriptor.prototxt +++ b/testdata/r4/descriptors/Contract.descriptor.prototxt @@ -342,7 +342,6 @@ field { type_name: ".google.fhir.r4.core.Contract.ContentDefinition" options { [google.fhir.proto.field_description]: "Contract precursor content" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -353,7 +352,6 @@ field { type_name: ".google.fhir.r4.core.Contract.Term" options { [google.fhir.proto.field_description]: "Contract Term List" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -386,7 +384,6 @@ field { type_name: ".google.fhir.r4.core.Contract.Signatory" options { [google.fhir.proto.field_description]: "Contract Signatory" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -397,7 +394,6 @@ field { type_name: ".google.fhir.r4.core.Contract.FriendlyLanguage" options { [google.fhir.proto.field_description]: "Contract Friendly Language" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -408,7 +404,6 @@ field { type_name: ".google.fhir.r4.core.Contract.LegalLanguage" options { [google.fhir.proto.field_description]: "Contract Legal Language" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -419,7 +414,6 @@ field { type_name: ".google.fhir.r4.core.Contract.ComputableLanguage" options { [google.fhir.proto.field_description]: "Computable Contract Language" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -722,7 +716,6 @@ nested_type { type_name: ".google.fhir.r4.core.Contract.Term.SecurityLabel" options { [google.fhir.proto.field_description]: "Protection for the Term" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -734,7 +727,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Context of the Contract term" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -745,7 +737,6 @@ nested_type { type_name: ".google.fhir.r4.core.Contract.Term.ContractAsset" options { [google.fhir.proto.field_description]: "Contract Term Asset List" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -756,7 +747,6 @@ nested_type { type_name: ".google.fhir.r4.core.Contract.Term.Action" options { [google.fhir.proto.field_description]: "Entity being ascribed responsibility" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -921,7 +911,6 @@ nested_type { type_name: ".google.fhir.r4.core.Contract.Term.ContractOffer.ContractParty" options { [google.fhir.proto.field_description]: "Offer Recipient" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -973,7 +962,6 @@ nested_type { type_name: ".google.fhir.r4.core.Contract.Term.ContractOffer.Answer" options { [google.fhir.proto.field_description]: "Response to offer text" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1313,7 +1301,6 @@ nested_type { type_name: ".google.fhir.r4.core.Contract.Term.ContractAsset.AssetContext" options { [google.fhir.proto.field_description]: "Circumstance of the asset" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1404,7 +1391,6 @@ nested_type { type_name: ".google.fhir.r4.core.Contract.Term.ContractAsset.ValuedItem" options { [google.fhir.proto.field_description]: "Contract Valued Item List" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1744,7 +1730,6 @@ nested_type { type_name: ".google.fhir.r4.core.Contract.Term.Action.ActionSubject" options { [google.fhir.proto.field_description]: "Entity of the action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/Count.descriptor.prototxt b/testdata/r4/descriptors/Count.descriptor.prototxt index ab74cf168..6f42ef731 100644 --- a/testdata/r4/descriptors/Count.descriptor.prototxt +++ b/testdata/r4/descriptors/Count.descriptor.prototxt @@ -100,4 +100,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Count, last updated 2018-12-27T22:37:54.724+11:00.\nA measured or measurable amount.\nSee http://hl7.org/fhir/StructureDefinition/Count" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Count" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "(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())" } diff --git a/testdata/r4/descriptors/Coverage.descriptor.prototxt b/testdata/r4/descriptors/Coverage.descriptor.prototxt index 43a0085ef..c64d705ec 100644 --- a/testdata/r4/descriptors/Coverage.descriptor.prototxt +++ b/testdata/r4/descriptors/Coverage.descriptor.prototxt @@ -215,7 +215,6 @@ field { type_name: ".google.fhir.r4.core.Coverage.Class" options { [google.fhir.proto.field_description]: "Additional coverage classifications" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } json_name: "class" } @@ -247,7 +246,6 @@ field { type_name: ".google.fhir.r4.core.Coverage.CostToBeneficiary" options { [google.fhir.proto.field_description]: "Patient payments for services/products" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -424,7 +422,6 @@ nested_type { type_name: ".google.fhir.r4.core.Coverage.CostToBeneficiary.Exemption" options { [google.fhir.proto.field_description]: "Exceptions for patient payments" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/CoverageEligibilityRequest.descriptor.prototxt b/testdata/r4/descriptors/CoverageEligibilityRequest.descriptor.prototxt index 5ded03c7c..0ba38b403 100644 --- a/testdata/r4/descriptors/CoverageEligibilityRequest.descriptor.prototxt +++ b/testdata/r4/descriptors/CoverageEligibilityRequest.descriptor.prototxt @@ -216,7 +216,6 @@ field { type_name: ".google.fhir.r4.core.CoverageEligibilityRequest.SupportingInformation" options { [google.fhir.proto.field_description]: "Supporting information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -227,7 +226,6 @@ field { type_name: ".google.fhir.r4.core.CoverageEligibilityRequest.Insurance" options { [google.fhir.proto.field_description]: "Patient insurance information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -238,7 +236,6 @@ field { type_name: ".google.fhir.r4.core.CoverageEligibilityRequest.Details" options { [google.fhir.proto.field_description]: "Item to be evaluated for eligibiity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -575,7 +572,6 @@ nested_type { type_name: ".google.fhir.r4.core.CoverageEligibilityRequest.Details.Diagnosis" options { [google.fhir.proto.field_description]: "Applicable diagnosis" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/CoverageEligibilityResponse.descriptor.prototxt b/testdata/r4/descriptors/CoverageEligibilityResponse.descriptor.prototxt index 0422c0c3f..d2707f512 100644 --- a/testdata/r4/descriptors/CoverageEligibilityResponse.descriptor.prototxt +++ b/testdata/r4/descriptors/CoverageEligibilityResponse.descriptor.prototxt @@ -216,7 +216,6 @@ field { type_name: ".google.fhir.r4.core.CoverageEligibilityResponse.Insurance" options { [google.fhir.proto.field_description]: "Patient insurance information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -247,7 +246,6 @@ field { type_name: ".google.fhir.r4.core.CoverageEligibilityResponse.Errors" options { [google.fhir.proto.field_description]: "Processing errors" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -428,8 +426,6 @@ nested_type { type_name: ".google.fhir.r4.core.CoverageEligibilityResponse.Insurance.Items" options { [google.fhir.proto.field_description]: "Benefits and authorization details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "category.exists() xor productOrService.exists()" } } nested_type { @@ -574,7 +570,6 @@ nested_type { type_name: ".google.fhir.r4.core.CoverageEligibilityResponse.Insurance.Items.Benefit" options { [google.fhir.proto.field_description]: "Benefit Summary" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -739,6 +734,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "category.exists() xor productOrService.exists()" + } } } nested_type { diff --git a/testdata/r4/descriptors/DataRequirement.descriptor.prototxt b/testdata/r4/descriptors/DataRequirement.descriptor.prototxt index 957622a88..866e5c50d 100644 --- a/testdata/r4/descriptors/DataRequirement.descriptor.prototxt +++ b/testdata/r4/descriptors/DataRequirement.descriptor.prototxt @@ -68,8 +68,6 @@ field { type_name: ".google.fhir.r4.core.DataRequirement.CodeFilter" options { [google.fhir.proto.field_description]: "What codes are expected" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "path.exists() xor searchParam.exists()" } } field { @@ -80,8 +78,6 @@ field { type_name: ".google.fhir.r4.core.DataRequirement.DateFilter" options { [google.fhir.proto.field_description]: "What dates/date ranges are expected" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "path.exists() xor searchParam.exists()" } } field { @@ -102,7 +98,6 @@ field { type_name: ".google.fhir.r4.core.DataRequirement.Sort" options { [google.fhir.proto.field_description]: "Order of the results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -222,6 +217,9 @@ nested_type { [google.fhir.proto.field_description]: "What code is expected" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "path.exists() xor searchParam.exists()" + } } nested_type { name: "DateFilter" @@ -308,6 +306,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "path.exists() xor searchParam.exists()" + } } nested_type { name: "Sort" diff --git a/testdata/r4/descriptors/DetectedIssue.descriptor.prototxt b/testdata/r4/descriptors/DetectedIssue.descriptor.prototxt index 0778dc1b0..5c31e8337 100644 --- a/testdata/r4/descriptors/DetectedIssue.descriptor.prototxt +++ b/testdata/r4/descriptors/DetectedIssue.descriptor.prototxt @@ -179,7 +179,6 @@ field { type_name: ".google.fhir.r4.core.DetectedIssue.Evidence" options { [google.fhir.proto.field_description]: "Supporting evidence" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -210,7 +209,6 @@ field { type_name: ".google.fhir.r4.core.DetectedIssue.Mitigation" options { [google.fhir.proto.field_description]: "Step taken to address" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Device.descriptor.prototxt b/testdata/r4/descriptors/Device.descriptor.prototxt index 9fd558152..893f1e9da 100644 --- a/testdata/r4/descriptors/Device.descriptor.prototxt +++ b/testdata/r4/descriptors/Device.descriptor.prototxt @@ -114,7 +114,6 @@ field { type_name: ".google.fhir.r4.core.Device.UdiCarrier" options { [google.fhir.proto.field_description]: "Unique Device Identifier (UDI) Barcode string" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -205,7 +204,6 @@ field { type_name: ".google.fhir.r4.core.Device.DeviceName" options { [google.fhir.proto.field_description]: "The name of the device as given by the manufacturer" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -246,7 +244,6 @@ field { type_name: ".google.fhir.r4.core.Device.Specialization" options { [google.fhir.proto.field_description]: "The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -257,7 +254,6 @@ field { type_name: ".google.fhir.r4.core.Device.Version" options { [google.fhir.proto.field_description]: "The actual design of the device or software version running on the device" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -268,7 +264,6 @@ field { type_name: ".google.fhir.r4.core.Device.Property" options { [google.fhir.proto.field_description]: "The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/DeviceDefinition.descriptor.prototxt b/testdata/r4/descriptors/DeviceDefinition.descriptor.prototxt index b3de9705a..7c3090fdb 100644 --- a/testdata/r4/descriptors/DeviceDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/DeviceDefinition.descriptor.prototxt @@ -103,7 +103,6 @@ field { type_name: ".google.fhir.r4.core.DeviceDefinition.UdiDeviceIdentifier" options { [google.fhir.proto.field_description]: "Unique Device Identifier (UDI) Barcode string" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -124,7 +123,6 @@ field { type_name: ".google.fhir.r4.core.DeviceDefinition.DeviceName" options { [google.fhir.proto.field_description]: "A name given to the device to identify it" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -155,7 +153,6 @@ field { type_name: ".google.fhir.r4.core.DeviceDefinition.Specialization" options { [google.fhir.proto.field_description]: "The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -216,7 +213,6 @@ field { type_name: ".google.fhir.r4.core.DeviceDefinition.Capability" options { [google.fhir.proto.field_description]: "Device capabilities" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -227,7 +223,6 @@ field { type_name: ".google.fhir.r4.core.DeviceDefinition.Property" options { [google.fhir.proto.field_description]: "The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -310,7 +305,6 @@ field { type_name: ".google.fhir.r4.core.DeviceDefinition.Material" options { [google.fhir.proto.field_description]: "A substance used to create the material(s) of which the device is made" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/DeviceMetric.descriptor.prototxt b/testdata/r4/descriptors/DeviceMetric.descriptor.prototxt index 5f6fded52..5f0369c98 100644 --- a/testdata/r4/descriptors/DeviceMetric.descriptor.prototxt +++ b/testdata/r4/descriptors/DeviceMetric.descriptor.prototxt @@ -187,7 +187,6 @@ field { type_name: ".google.fhir.r4.core.DeviceMetric.Calibration" options { [google.fhir.proto.field_description]: "Describes the calibrations that have been performed or that are required to be performed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/DeviceRequest.descriptor.prototxt b/testdata/r4/descriptors/DeviceRequest.descriptor.prototxt index 9c5a68690..868be4be7 100644 --- a/testdata/r4/descriptors/DeviceRequest.descriptor.prototxt +++ b/testdata/r4/descriptors/DeviceRequest.descriptor.prototxt @@ -197,7 +197,6 @@ field { type_name: ".google.fhir.r4.core.DeviceRequest.Parameter" options { [google.fhir.proto.field_description]: "Device details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/DiagnosticReport-geneticsAnalysis.descriptor.prototxt b/testdata/r4/descriptors/DiagnosticReport-geneticsAnalysis.descriptor.prototxt index 66b018228..0c8633b34 100644 --- a/testdata/r4/descriptors/DiagnosticReport-geneticsAnalysis.descriptor.prototxt +++ b/testdata/r4/descriptors/DiagnosticReport-geneticsAnalysis.descriptor.prototxt @@ -45,4 +45,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Analysis.\nAnalysis.\nSee http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAnalysis" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAnalysis" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/DiagnosticReport-geneticsAssessedCondition.descriptor.prototxt b/testdata/r4/descriptors/DiagnosticReport-geneticsAssessedCondition.descriptor.prototxt index 4325183dd..4c0947153 100644 --- a/testdata/r4/descriptors/DiagnosticReport-geneticsAssessedCondition.descriptor.prototxt +++ b/testdata/r4/descriptors/DiagnosticReport-geneticsAssessedCondition.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for AssessedCondition.\nAssessedCondition.\nSee http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAssessedCondition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAssessedCondition" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/DiagnosticReport-geneticsFamilyMemberHistory.descriptor.prototxt b/testdata/r4/descriptors/DiagnosticReport-geneticsFamilyMemberHistory.descriptor.prototxt index f861af166..4bf0ecef1 100644 --- a/testdata/r4/descriptors/DiagnosticReport-geneticsFamilyMemberHistory.descriptor.prototxt +++ b/testdata/r4/descriptors/DiagnosticReport-geneticsFamilyMemberHistory.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for FamilyMemberHistory.\nFamilyHistory.\nSee http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsFamilyMemberHistory" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsFamilyMemberHistory" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/DiagnosticReport-geneticsReferences.descriptor.prototxt b/testdata/r4/descriptors/DiagnosticReport-geneticsReferences.descriptor.prototxt index e35014190..f8cc185a9 100644 --- a/testdata/r4/descriptors/DiagnosticReport-geneticsReferences.descriptor.prototxt +++ b/testdata/r4/descriptors/DiagnosticReport-geneticsReferences.descriptor.prototxt @@ -54,4 +54,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for References.\nAdditional bibliographic reference information.\nSee http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsReferences" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsReferences" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/DiagnosticReport.descriptor.prototxt b/testdata/r4/descriptors/DiagnosticReport.descriptor.prototxt index 44f16244a..13a042e9a 100644 --- a/testdata/r4/descriptors/DiagnosticReport.descriptor.prototxt +++ b/testdata/r4/descriptors/DiagnosticReport.descriptor.prototxt @@ -256,7 +256,6 @@ field { type_name: ".google.fhir.r4.core.DiagnosticReport.Media" options { [google.fhir.proto.field_description]: "Key images associated with this report" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/Distance.descriptor.prototxt b/testdata/r4/descriptors/Distance.descriptor.prototxt index 3868fdb33..b14d3c5e0 100644 --- a/testdata/r4/descriptors/Distance.descriptor.prototxt +++ b/testdata/r4/descriptors/Distance.descriptor.prototxt @@ -100,4 +100,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Distance, last updated 2018-12-27T22:37:54.724+11:00.\nA length - a value with a unit that is a physical distance.\nSee http://hl7.org/fhir/StructureDefinition/Distance" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Distance" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "(code.exists() or value.empty()) and (system.empty() or system = %ucum)" } diff --git a/testdata/r4/descriptors/DocumentManifest.descriptor.prototxt b/testdata/r4/descriptors/DocumentManifest.descriptor.prototxt index cf81713bf..d30215511 100644 --- a/testdata/r4/descriptors/DocumentManifest.descriptor.prototxt +++ b/testdata/r4/descriptors/DocumentManifest.descriptor.prototxt @@ -221,7 +221,6 @@ field { type_name: ".google.fhir.r4.core.DocumentManifest.Related" options { [google.fhir.proto.field_description]: "Related things" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/DocumentReference.descriptor.prototxt b/testdata/r4/descriptors/DocumentReference.descriptor.prototxt index 53d018ef6..caea77eae 100644 --- a/testdata/r4/descriptors/DocumentReference.descriptor.prototxt +++ b/testdata/r4/descriptors/DocumentReference.descriptor.prototxt @@ -218,7 +218,6 @@ field { type_name: ".google.fhir.r4.core.DocumentReference.RelatesTo" options { [google.fhir.proto.field_description]: "Relationships to other documents" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -250,7 +249,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Document referenced" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -261,7 +259,6 @@ field { type_name: ".google.fhir.r4.core.DocumentReference.Context" options { [google.fhir.proto.field_description]: "Clinical context of document" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Dosage.descriptor.prototxt b/testdata/r4/descriptors/Dosage.descriptor.prototxt index a403af533..a2e4d4366 100644 --- a/testdata/r4/descriptors/Dosage.descriptor.prototxt +++ b/testdata/r4/descriptors/Dosage.descriptor.prototxt @@ -127,7 +127,6 @@ field { type_name: ".google.fhir.r4.core.Dosage.DoseAndRate" options { [google.fhir.proto.field_description]: "Amount of medication administered" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/Duration.descriptor.prototxt b/testdata/r4/descriptors/Duration.descriptor.prototxt index 4a25662f1..6034da2d8 100644 --- a/testdata/r4/descriptors/Duration.descriptor.prototxt +++ b/testdata/r4/descriptors/Duration.descriptor.prototxt @@ -100,4 +100,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Duration, last updated 2018-12-27T22:37:54.724+11:00.\nA length of time.\nSee http://hl7.org/fhir/StructureDefinition/Duration" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Duration" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "code.exists() implies ((system = %ucum) and value.exists())" } diff --git a/testdata/r4/descriptors/EffectEvidenceSynthesis.descriptor.prototxt b/testdata/r4/descriptors/EffectEvidenceSynthesis.descriptor.prototxt index 648db48b4..fa504e58c 100644 --- a/testdata/r4/descriptors/EffectEvidenceSynthesis.descriptor.prototxt +++ b/testdata/r4/descriptors/EffectEvidenceSynthesis.descriptor.prototxt @@ -392,7 +392,6 @@ field { type_name: ".google.fhir.r4.core.EffectEvidenceSynthesis.SampleSize" options { [google.fhir.proto.field_description]: "What sample size was involved?" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -403,7 +402,6 @@ field { type_name: ".google.fhir.r4.core.EffectEvidenceSynthesis.ResultsByExposure" options { [google.fhir.proto.field_description]: "What was the result per exposure?" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -414,7 +412,6 @@ field { type_name: ".google.fhir.r4.core.EffectEvidenceSynthesis.EffectEstimate" options { [google.fhir.proto.field_description]: "What was the estimated effect" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -425,7 +422,6 @@ field { type_name: ".google.fhir.r4.core.EffectEvidenceSynthesis.Certainty" options { [google.fhir.proto.field_description]: "How certain is the effect" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -710,7 +706,6 @@ nested_type { type_name: ".google.fhir.r4.core.EffectEvidenceSynthesis.EffectEstimate.PrecisionEstimate" options { [google.fhir.proto.field_description]: "How precise the estimate is" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -847,7 +842,6 @@ nested_type { type_name: ".google.fhir.r4.core.EffectEvidenceSynthesis.Certainty.CertaintySubcomponent" options { [google.fhir.proto.field_description]: "A component that contributes to the overall certainty" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -918,4 +912,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for EffectEvidenceSynthesis, last updated 2018-12-27T22:37:54.724+11:00.\nA quantified estimate of effect based on a body of evidence.\nSee http://hl7.org/fhir/StructureDefinition/EffectEvidenceSynthesis" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/EffectEvidenceSynthesis" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/ElementDefinition.descriptor.prototxt b/testdata/r4/descriptors/ElementDefinition.descriptor.prototxt index 26849af2d..8f068a147 100644 --- a/testdata/r4/descriptors/ElementDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/ElementDefinition.descriptor.prototxt @@ -98,8 +98,6 @@ field { type_name: ".google.fhir.r4.core.ElementDefinition.Slicing" options { [google.fhir.proto.field_description]: "This element is sliced - slices follow" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "discriminator.exists() or description.exists()" } } field { @@ -181,7 +179,6 @@ field { type_name: ".google.fhir.r4.core.ElementDefinition.Base" options { [google.fhir.proto.field_description]: "Base definition information for tools" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -202,9 +199,6 @@ field { type_name: ".google.fhir.r4.core.ElementDefinition.TypeRef" options { [google.fhir.proto.field_description]: "Data type and Profile for this element" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "aggregation.empty() or (code = \'Reference\')" - [google.fhir.proto.fhir_path_constraint]: "(code=\'Reference\' or code = \'canonical\') or targetProfile.empty()" } } field { @@ -265,7 +259,6 @@ field { type_name: ".google.fhir.r4.core.ElementDefinition.Example" options { [google.fhir.proto.field_description]: "Example value (as defined for type)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -316,8 +309,6 @@ field { type_name: ".google.fhir.r4.core.ElementDefinition.Constraint" options { [google.fhir.proto.field_description]: "Condition that must evaluate to true" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "expression.exists()" } } field { @@ -368,8 +359,6 @@ field { type_name: ".google.fhir.r4.core.ElementDefinition.ElementDefinitionBinding" options { [google.fhir.proto.field_description]: "ValueSet details if this is coded" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "valueSet.exists() implies (valueSet.startsWith(\'http:\') or valueSet.startsWith(\'https\') or valueSet.startsWith(\'urn:\'))" } } field { @@ -380,7 +369,6 @@ field { type_name: ".google.fhir.r4.core.ElementDefinition.Mapping" options { [google.fhir.proto.field_description]: "Map element to another set of definitions" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -440,7 +428,6 @@ nested_type { type_name: ".google.fhir.r4.core.ElementDefinition.Slicing.Discriminator" options { [google.fhir.proto.field_description]: "Element values that are used to distinguish the slices" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -573,6 +560,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "discriminator.exists() or description.exists()" + } } nested_type { name: "Base" @@ -757,6 +747,10 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "aggregation.empty() or (code = \'Reference\')" + [google.fhir.proto.fhir_path_message_constraint]: "(code=\'Reference\' or code = \'canonical\') or targetProfile.empty()" + } } nested_type { name: "DefaultValueX" @@ -2695,6 +2689,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "expression.exists()" + } } nested_type { name: "ElementDefinitionBinding" @@ -2776,6 +2773,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "valueSet.exists() implies (valueSet.startsWith(\'http:\') or valueSet.startsWith(\'https\') or valueSet.startsWith(\'urn:\'))" + } } nested_type { name: "Mapping" @@ -2881,4 +2881,17 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ElementDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nDefinition of an element in a resource or extension.\nSee http://hl7.org/fhir/StructureDefinition/ElementDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ElementDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "min.empty() or max.empty() or (max = \'*\') or iif(max != \'*\', min <= max.toInteger())" + [google.fhir.proto.fhir_path_message_constraint]: "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())" + [google.fhir.proto.fhir_path_message_constraint]: "pattern.empty() or (type.count() <= 1)" + [google.fhir.proto.fhir_path_message_constraint]: "fixed.empty() or (type.count() <= 1)" + [google.fhir.proto.fhir_path_message_constraint]: "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()" + [google.fhir.proto.fhir_path_message_constraint]: "sliceIsConstraining.exists() implies sliceName.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "pattern.empty() or fixed.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "constraint.select(key).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "type.select(code).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "sliceName.empty() or sliceName.matches(\'^[a-zA-Z0-9\\\\/\\\\-_\\\\[\\\\]\\\\@]+$\')" + [google.fhir.proto.fhir_path_message_constraint]: "defaultValue.empty() or meaningWhenMissing.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "isModifier implies isModifierReason.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "path.matches(\'[A-Za-z][A-Za-z0-9]*(\\\\.[a-z][A-Za-z0-9]*(\\\\[x])?)*\')" } diff --git a/testdata/r4/descriptors/Encounter.descriptor.prototxt b/testdata/r4/descriptors/Encounter.descriptor.prototxt index 97b8c0472..733570de6 100644 --- a/testdata/r4/descriptors/Encounter.descriptor.prototxt +++ b/testdata/r4/descriptors/Encounter.descriptor.prototxt @@ -114,7 +114,6 @@ field { type_name: ".google.fhir.r4.core.Encounter.StatusHistory" options { [google.fhir.proto.field_description]: "List of past encounter statuses" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -137,7 +136,6 @@ field { type_name: ".google.fhir.r4.core.Encounter.ClassHistory" options { [google.fhir.proto.field_description]: "List of past encounter classes" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -212,7 +210,6 @@ field { type_name: ".google.fhir.r4.core.Encounter.Participant" options { [google.fhir.proto.field_description]: "List of participants involved in the encounter" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -278,7 +275,6 @@ field { type_name: ".google.fhir.r4.core.Encounter.Diagnosis" options { [google.fhir.proto.field_description]: "The list of diagnosis relevant to this encounter" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -300,7 +296,6 @@ field { type_name: ".google.fhir.r4.core.Encounter.Hospitalization" options { [google.fhir.proto.field_description]: "Details about the admission to a healthcare service" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -311,7 +306,6 @@ field { type_name: ".google.fhir.r4.core.Encounter.Location" options { [google.fhir.proto.field_description]: "List of locations where the patient has been" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/EpisodeOfCare.descriptor.prototxt b/testdata/r4/descriptors/EpisodeOfCare.descriptor.prototxt index 75e91da8d..d778ec0d7 100644 --- a/testdata/r4/descriptors/EpisodeOfCare.descriptor.prototxt +++ b/testdata/r4/descriptors/EpisodeOfCare.descriptor.prototxt @@ -114,7 +114,6 @@ field { type_name: ".google.fhir.r4.core.EpisodeOfCare.StatusHistory" options { [google.fhir.proto.field_description]: "Past list of status codes (the current status may be included to cover the start date of the status)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -135,7 +134,6 @@ field { type_name: ".google.fhir.r4.core.EpisodeOfCare.Diagnosis" options { [google.fhir.proto.field_description]: "The list of diagnosis relevant to this episode of care" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/EventDefinition.descriptor.prototxt b/testdata/r4/descriptors/EventDefinition.descriptor.prototxt index 67f62a02c..84085a1c5 100644 --- a/testdata/r4/descriptors/EventDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/EventDefinition.descriptor.prototxt @@ -426,4 +426,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for EventDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nA description of when an event can occur.\nSee http://hl7.org/fhir/StructureDefinition/EventDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/EventDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Evidence.descriptor.prototxt b/testdata/r4/descriptors/Evidence.descriptor.prototxt index 964851fc0..1b733071b 100644 --- a/testdata/r4/descriptors/Evidence.descriptor.prototxt +++ b/testdata/r4/descriptors/Evidence.descriptor.prototxt @@ -401,4 +401,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Evidence, last updated 2018-12-27T22:37:54.724+11:00.\nA research context or question.\nSee http://hl7.org/fhir/StructureDefinition/Evidence" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Evidence" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/EvidenceVariable.descriptor.prototxt b/testdata/r4/descriptors/EvidenceVariable.descriptor.prototxt index 93a70a748..b9e6efe67 100644 --- a/testdata/r4/descriptors/EvidenceVariable.descriptor.prototxt +++ b/testdata/r4/descriptors/EvidenceVariable.descriptor.prototxt @@ -355,7 +355,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "What defines the members of the evidence element" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -648,4 +647,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for EvidenceVariable, last updated 2018-12-27T22:37:54.724+11:00.\nA population, intervention, or exposure definition.\nSee http://hl7.org/fhir/StructureDefinition/EvidenceVariable" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/EvidenceVariable" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/ExampleScenario.descriptor.prototxt b/testdata/r4/descriptors/ExampleScenario.descriptor.prototxt index 99250b0d3..219c7e83d 100644 --- a/testdata/r4/descriptors/ExampleScenario.descriptor.prototxt +++ b/testdata/r4/descriptors/ExampleScenario.descriptor.prototxt @@ -224,7 +224,6 @@ field { type_name: ".google.fhir.r4.core.ExampleScenario.Actor" options { [google.fhir.proto.field_description]: "Actor participating in the resource" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -235,7 +234,6 @@ field { type_name: ".google.fhir.r4.core.ExampleScenario.Instance" options { [google.fhir.proto.field_description]: "Each resource and each version that is present in the workflow" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -246,7 +244,6 @@ field { type_name: ".google.fhir.r4.core.ExampleScenario.Process" options { [google.fhir.proto.field_description]: "Each major process - a group of operations" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -470,7 +467,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExampleScenario.Instance.Version" options { [google.fhir.proto.field_description]: "A specific version of the resource" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -481,7 +477,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExampleScenario.Instance.ContainedInstance" options { [google.fhir.proto.field_description]: "Resources contained in the instance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -702,7 +697,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExampleScenario.Process.Step" options { [google.fhir.proto.field_description]: "Each step of the process" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -765,7 +759,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExampleScenario.Process.Step.Operation" options { [google.fhir.proto.field_description]: "Each interaction or action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -776,7 +769,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExampleScenario.Process.Step.Alternative" options { [google.fhir.proto.field_description]: "Alternate non-typical step action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -983,4 +975,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ExampleScenario, last updated 2018-12-27T22:37:54.724+11:00.\nExample of workflow instance.\nSee http://hl7.org/fhir/StructureDefinition/ExampleScenario" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ExampleScenario" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/ExplanationOfBenefit.descriptor.prototxt b/testdata/r4/descriptors/ExplanationOfBenefit.descriptor.prototxt index b9ac08a7d..d76485cdc 100644 --- a/testdata/r4/descriptors/ExplanationOfBenefit.descriptor.prototxt +++ b/testdata/r4/descriptors/ExplanationOfBenefit.descriptor.prototxt @@ -247,7 +247,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.RelatedClaim" options { [google.fhir.proto.field_description]: "Prior or corollary claims" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -281,7 +280,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Payee" options { [google.fhir.proto.field_description]: "Recipient of benefits payable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -377,7 +375,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.CareTeam" options { [google.fhir.proto.field_description]: "Care Team members" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -388,7 +385,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.SupportingInformation" options { [google.fhir.proto.field_description]: "Supporting information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -399,7 +395,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Diagnosis" options { [google.fhir.proto.field_description]: "Pertinent diagnosis information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -410,7 +405,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Procedure" options { [google.fhir.proto.field_description]: "Clinical procedures performed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -432,7 +426,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Patient insurance information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -443,7 +436,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Accident" options { [google.fhir.proto.field_description]: "Details of the event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -454,7 +446,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Item" options { [google.fhir.proto.field_description]: "Product or service provided" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -465,7 +456,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.AddedItem" options { [google.fhir.proto.field_description]: "Insurer added line items" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -486,7 +476,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Total" options { [google.fhir.proto.field_description]: "Adjudication totals" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -497,7 +486,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Payment" options { [google.fhir.proto.field_description]: "Payment Details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -528,7 +516,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Note" options { [google.fhir.proto.field_description]: "Note concerning adjudication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -549,7 +536,6 @@ field { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.BenefitBalance" options { [google.fhir.proto.field_description]: "Balance by Benefit Category" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1654,7 +1640,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Item.Adjudication" options { [google.fhir.proto.field_description]: "Adjudication details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1665,7 +1650,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Item.Detail" options { [google.fhir.proto.field_description]: "Additional items" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1976,7 +1960,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.Item.Detail.SubDetail" options { [google.fhir.proto.field_description]: "Additional items" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -2361,7 +2344,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.AddedItem.AddedItemDetail" options { [google.fhir.proto.field_description]: "Insurer added line items" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -2546,7 +2528,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.AddedItem.AddedItemDetail.AddedItemDetailSubDetail" options { [google.fhir.proto.field_description]: "Insurer added line items" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -3024,7 +3005,6 @@ nested_type { type_name: ".google.fhir.r4.core.ExplanationOfBenefit.BenefitBalance.Benefit" options { [google.fhir.proto.field_description]: "Benefit Summary" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Expression.descriptor.prototxt b/testdata/r4/descriptors/Expression.descriptor.prototxt index b7982e5ea..4bad79d06 100644 --- a/testdata/r4/descriptors/Expression.descriptor.prototxt +++ b/testdata/r4/descriptors/Expression.descriptor.prototxt @@ -74,4 +74,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Expression, last updated 2018-12-27T22:37:54.724+11:00.\nAn expression that can be used to generate a value.\nSee http://hl7.org/fhir/StructureDefinition/Expression" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Expression" + [google.fhir.proto.fhir_path_message_constraint]: "expression.exists() or reference.exists()" } diff --git a/testdata/r4/descriptors/FamilyMemberHistory.descriptor.prototxt b/testdata/r4/descriptors/FamilyMemberHistory.descriptor.prototxt index ed94e491f..e5594664c 100644 --- a/testdata/r4/descriptors/FamilyMemberHistory.descriptor.prototxt +++ b/testdata/r4/descriptors/FamilyMemberHistory.descriptor.prototxt @@ -273,7 +273,6 @@ field { type_name: ".google.fhir.r4.core.FamilyMemberHistory.Condition" options { [google.fhir.proto.field_description]: "Condition that the related person had" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -551,4 +550,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for FamilyMemberHistory, last updated 2018-12-27T22:37:54.724+11:00.\nInformation about patient\'s relatives, relevant for patient.\nSee http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory" + [google.fhir.proto.fhir_path_message_constraint]: "age.exists() or estimatedAge.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "age.empty() or born.empty()" } diff --git a/testdata/r4/descriptors/Goal.descriptor.prototxt b/testdata/r4/descriptors/Goal.descriptor.prototxt index beeb9ac26..9fa9e20df 100644 --- a/testdata/r4/descriptors/Goal.descriptor.prototxt +++ b/testdata/r4/descriptors/Goal.descriptor.prototxt @@ -179,8 +179,6 @@ field { type_name: ".google.fhir.r4.core.Goal.Target" options { [google.fhir.proto.field_description]: "Target outcome for the goal" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(detail.exists() and measure.exists()) or detail.exists().not()" } } field { @@ -469,6 +467,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(detail.exists() and measure.exists()) or detail.exists().not()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/GraphDefinition.descriptor.prototxt b/testdata/r4/descriptors/GraphDefinition.descriptor.prototxt index bf293348a..560b9f9c5 100644 --- a/testdata/r4/descriptors/GraphDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/GraphDefinition.descriptor.prototxt @@ -236,7 +236,6 @@ field { type_name: ".google.fhir.r4.core.GraphDefinition.Link" options { [google.fhir.proto.field_description]: "Links this graph makes rules about" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -383,7 +382,6 @@ nested_type { type_name: ".google.fhir.r4.core.GraphDefinition.Link.Target" options { [google.fhir.proto.field_description]: "Potential target for the link" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -457,7 +455,6 @@ nested_type { type_name: ".google.fhir.r4.core.GraphDefinition.Link.Target.Compartment" options { [google.fhir.proto.field_description]: "Compartment Consistency Rules" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -670,4 +667,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for GraphDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nDefinition of a graph of resources.\nSee http://hl7.org/fhir/StructureDefinition/GraphDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/GraphDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Group.descriptor.prototxt b/testdata/r4/descriptors/Group.descriptor.prototxt index 7aae44e35..21c8cd336 100644 --- a/testdata/r4/descriptors/Group.descriptor.prototxt +++ b/testdata/r4/descriptors/Group.descriptor.prototxt @@ -179,7 +179,6 @@ field { type_name: ".google.fhir.r4.core.Group.Characteristic" options { [google.fhir.proto.field_description]: "Include / Exclude group members by Trait" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -190,7 +189,6 @@ field { type_name: ".google.fhir.r4.core.Group.Member" options { [google.fhir.proto.field_description]: "Who or what is in group" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -420,4 +418,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Group, last updated 2018-12-27T22:37:54.724+11:00.\nGroup of multiple entities.\nSee http://hl7.org/fhir/StructureDefinition/Group" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Group" + [google.fhir.proto.fhir_path_message_constraint]: "member.empty() or (actual = true)" } diff --git a/testdata/r4/descriptors/HealthcareService.descriptor.prototxt b/testdata/r4/descriptors/HealthcareService.descriptor.prototxt index 9da1a281b..df4f41a3a 100644 --- a/testdata/r4/descriptors/HealthcareService.descriptor.prototxt +++ b/testdata/r4/descriptors/HealthcareService.descriptor.prototxt @@ -236,7 +236,6 @@ field { type_name: ".google.fhir.r4.core.HealthcareService.Eligibility" options { [google.fhir.proto.field_description]: "Specific eligibility requirements required to use the service" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -297,7 +296,6 @@ field { type_name: ".google.fhir.r4.core.HealthcareService.AvailableTime" options { [google.fhir.proto.field_description]: "Times the Service Site is available" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -308,7 +306,6 @@ field { type_name: ".google.fhir.r4.core.HealthcareService.NotAvailable" options { [google.fhir.proto.field_description]: "Not available during this time due to provided reason" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/ImagingStudy.descriptor.prototxt b/testdata/r4/descriptors/ImagingStudy.descriptor.prototxt index 5203252fb..77dc157c3 100644 --- a/testdata/r4/descriptors/ImagingStudy.descriptor.prototxt +++ b/testdata/r4/descriptors/ImagingStudy.descriptor.prototxt @@ -306,7 +306,6 @@ field { type_name: ".google.fhir.r4.core.ImagingStudy.Series" options { [google.fhir.proto.field_description]: "Each study has one or more series of instances" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -480,7 +479,6 @@ nested_type { type_name: ".google.fhir.r4.core.ImagingStudy.Series.Performer" options { [google.fhir.proto.field_description]: "Who performed the series" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -491,7 +489,6 @@ nested_type { type_name: ".google.fhir.r4.core.ImagingStudy.Series.Instance" options { [google.fhir.proto.field_description]: "A single SOP instance from the series" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Immunization.descriptor.prototxt b/testdata/r4/descriptors/Immunization.descriptor.prototxt index addf21fb7..e03eb9614 100644 --- a/testdata/r4/descriptors/Immunization.descriptor.prototxt +++ b/testdata/r4/descriptors/Immunization.descriptor.prototxt @@ -271,7 +271,6 @@ field { type_name: ".google.fhir.r4.core.Immunization.Performer" options { [google.fhir.proto.field_description]: "Who performed event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -335,8 +334,6 @@ field { type_name: ".google.fhir.r4.core.Immunization.Education" options { [google.fhir.proto.field_description]: "Educational material presented to patient" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "documentType.exists() or reference.exists()" } } field { @@ -367,7 +364,6 @@ field { type_name: ".google.fhir.r4.core.Immunization.Reaction" options { [google.fhir.proto.field_description]: "Details of a reaction that follows immunization" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -378,7 +374,6 @@ field { type_name: ".google.fhir.r4.core.Immunization.ProtocolApplied" options { [google.fhir.proto.field_description]: "Protocol followed by the provider" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -563,6 +558,9 @@ nested_type { [google.fhir.proto.field_description]: "Educational material presentation date" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "documentType.exists() or reference.exists()" + } } nested_type { name: "Reaction" diff --git a/testdata/r4/descriptors/ImmunizationRecommendation.descriptor.prototxt b/testdata/r4/descriptors/ImmunizationRecommendation.descriptor.prototxt index 045914934..56f7e564f 100644 --- a/testdata/r4/descriptors/ImmunizationRecommendation.descriptor.prototxt +++ b/testdata/r4/descriptors/ImmunizationRecommendation.descriptor.prototxt @@ -138,8 +138,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Vaccine administration recommendations" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "vaccineCode.exists() or targetDisease.exists()" } } nested_type { @@ -233,7 +231,6 @@ nested_type { type_name: ".google.fhir.r4.core.ImmunizationRecommendation.Recommendation.DateCriterion" options { [google.fhir.proto.field_description]: "Dates governing proposed immunization" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -406,6 +403,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "vaccineCode.exists() or targetDisease.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/ImplementationGuide.descriptor.prototxt b/testdata/r4/descriptors/ImplementationGuide.descriptor.prototxt index eb3a68d88..258fd6a3f 100644 --- a/testdata/r4/descriptors/ImplementationGuide.descriptor.prototxt +++ b/testdata/r4/descriptors/ImplementationGuide.descriptor.prototxt @@ -258,7 +258,6 @@ field { type_name: ".google.fhir.r4.core.ImplementationGuide.DependsOn" options { [google.fhir.proto.field_description]: "Another Implementation guide this depends on" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -269,7 +268,6 @@ field { type_name: ".google.fhir.r4.core.ImplementationGuide.Global" options { [google.fhir.proto.field_description]: "Profiles that apply globally" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -280,8 +278,6 @@ field { type_name: ".google.fhir.r4.core.ImplementationGuide.Definition" options { [google.fhir.proto.field_description]: "Information needed to build the IG" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "resource.groupingId.all(%context.grouping.id contains $this)" } } field { @@ -292,7 +288,6 @@ field { type_name: ".google.fhir.r4.core.ImplementationGuide.Manifest" options { [google.fhir.proto.field_description]: "Information about an assembled IG" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -562,7 +557,6 @@ nested_type { type_name: ".google.fhir.r4.core.ImplementationGuide.Definition.Grouping" options { [google.fhir.proto.field_description]: "Grouping used to present related resources in the IG" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -574,7 +568,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Resource in the implementation guide" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -585,7 +578,6 @@ nested_type { type_name: ".google.fhir.r4.core.ImplementationGuide.Definition.Page" options { [google.fhir.proto.field_description]: "Page/Section in the Guide" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -596,7 +588,6 @@ nested_type { type_name: ".google.fhir.r4.core.ImplementationGuide.Definition.Parameter" options { [google.fhir.proto.field_description]: "Defines how IG is built by tools" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -607,7 +598,6 @@ nested_type { type_name: ".google.fhir.r4.core.ImplementationGuide.Definition.Template" options { [google.fhir.proto.field_description]: "A template for building resources" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1089,6 +1079,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "resource.groupingId.all(%context.grouping.id contains $this)" + } } nested_type { name: "Manifest" @@ -1141,7 +1134,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Resource in the implementation guide" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1152,7 +1144,6 @@ nested_type { type_name: ".google.fhir.r4.core.ImplementationGuide.Manifest.ManifestPage" options { [google.fhir.proto.field_description]: "HTML page within the parent IG" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1334,4 +1325,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ImplementationGuide, last updated 2018-12-27T22:37:54.724+11:00.\nA set of rules about how FHIR is used.\nSee http://hl7.org/fhir/StructureDefinition/ImplementationGuide" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ImplementationGuide" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" + [google.fhir.proto.fhir_path_message_constraint]: "definition.resource.fhirVersion.all(%context.fhirVersion contains $this)" } diff --git a/testdata/r4/descriptors/InsurancePlan.descriptor.prototxt b/testdata/r4/descriptors/InsurancePlan.descriptor.prototxt index e2de92b54..cff0e6f1b 100644 --- a/testdata/r4/descriptors/InsurancePlan.descriptor.prototxt +++ b/testdata/r4/descriptors/InsurancePlan.descriptor.prototxt @@ -186,7 +186,6 @@ field { type_name: ".google.fhir.r4.core.InsurancePlan.Contact" options { [google.fhir.proto.field_description]: "Contact for the product" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -219,7 +218,6 @@ field { type_name: ".google.fhir.r4.core.InsurancePlan.Coverage" options { [google.fhir.proto.field_description]: "Coverage details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -230,7 +228,6 @@ field { type_name: ".google.fhir.r4.core.InsurancePlan.Plan" options { [google.fhir.proto.field_description]: "Plan details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -396,7 +393,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "List of benefits" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -460,7 +456,6 @@ nested_type { type_name: ".google.fhir.r4.core.InsurancePlan.Coverage.CoverageBenefit.Limit" options { [google.fhir.proto.field_description]: "Benefit limits" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -600,7 +595,6 @@ nested_type { type_name: ".google.fhir.r4.core.InsurancePlan.Plan.GeneralCost" options { [google.fhir.proto.field_description]: "Overall costs" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -611,7 +605,6 @@ nested_type { type_name: ".google.fhir.r4.core.InsurancePlan.Plan.SpecificCost" options { [google.fhir.proto.field_description]: "Specific costs" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -738,7 +731,6 @@ nested_type { type_name: ".google.fhir.r4.core.InsurancePlan.Plan.SpecificCost.PlanBenefit" options { [google.fhir.proto.field_description]: "Benefits list" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -792,7 +784,6 @@ nested_type { type_name: ".google.fhir.r4.core.InsurancePlan.Plan.SpecificCost.PlanBenefit.Cost" options { [google.fhir.proto.field_description]: "List of the costs" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -876,4 +867,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for InsurancePlan, last updated 2018-12-27T22:37:54.724+11:00.\nDetails of a Health Insurance product/plan provided by an organization.\nSee http://hl7.org/fhir/StructureDefinition/InsurancePlan" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/InsurancePlan" + [google.fhir.proto.fhir_path_message_constraint]: "(identifier.count() + name.count()) > 0" } diff --git a/testdata/r4/descriptors/Invoice.descriptor.prototxt b/testdata/r4/descriptors/Invoice.descriptor.prototxt index b1d0571dd..1ed04575c 100644 --- a/testdata/r4/descriptors/Invoice.descriptor.prototxt +++ b/testdata/r4/descriptors/Invoice.descriptor.prototxt @@ -169,7 +169,6 @@ field { type_name: ".google.fhir.r4.core.Invoice.Participant" options { [google.fhir.proto.field_description]: "Participant in creation of this Invoice" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -202,7 +201,6 @@ field { type_name: ".google.fhir.r4.core.Invoice.LineItem" options { [google.fhir.proto.field_description]: "Line items of this Invoice" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -403,7 +401,6 @@ nested_type { type_name: ".google.fhir.r4.core.Invoice.LineItem.PriceComponent" options { [google.fhir.proto.field_description]: "Components of total line item price" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Library.descriptor.prototxt b/testdata/r4/descriptors/Library.descriptor.prototxt index 0e9a43b45..c4e96eb93 100644 --- a/testdata/r4/descriptors/Library.descriptor.prototxt +++ b/testdata/r4/descriptors/Library.descriptor.prototxt @@ -456,4 +456,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Library, last updated 2018-12-27T22:37:54.724+11:00.\nRepresents a library of quality improvement components.\nSee http://hl7.org/fhir/StructureDefinition/Library" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Library" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Linkage.descriptor.prototxt b/testdata/r4/descriptors/Linkage.descriptor.prototxt index 608998ca1..0fdd79dd2 100644 --- a/testdata/r4/descriptors/Linkage.descriptor.prototxt +++ b/testdata/r4/descriptors/Linkage.descriptor.prototxt @@ -117,7 +117,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Item to be linked" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -207,4 +206,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Linkage, last updated 2018-12-27T22:37:54.724+11:00.\nLinks records for \'same\' item.\nSee http://hl7.org/fhir/StructureDefinition/Linkage" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Linkage" + [google.fhir.proto.fhir_path_message_constraint]: "item.count()>1" } diff --git a/testdata/r4/descriptors/List.descriptor.prototxt b/testdata/r4/descriptors/List.descriptor.prototxt index 78e6d827c..31d067f58 100644 --- a/testdata/r4/descriptors/List.descriptor.prototxt +++ b/testdata/r4/descriptors/List.descriptor.prototxt @@ -214,7 +214,6 @@ field { type_name: ".google.fhir.r4.core.List.Entry" options { [google.fhir.proto.field_description]: "Entries in the list" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -360,4 +359,7 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for List, last updated 2018-12-27T22:37:54.724+11:00.\nA list is a curated collection of resources.\nSee http://hl7.org/fhir/StructureDefinition/List" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/List" + [google.fhir.proto.fhir_path_message_constraint]: "mode = \'working\' or entry.date.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "mode = \'changes\' or entry.deleted.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "emptyReason.empty() or entry.empty()" } diff --git a/testdata/r4/descriptors/Location.descriptor.prototxt b/testdata/r4/descriptors/Location.descriptor.prototxt index 32b3bf2af..4fd2e4a32 100644 --- a/testdata/r4/descriptors/Location.descriptor.prototxt +++ b/testdata/r4/descriptors/Location.descriptor.prototxt @@ -203,7 +203,6 @@ field { type_name: ".google.fhir.r4.core.Location.Position" options { [google.fhir.proto.field_description]: "The absolute geographic location" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -236,7 +235,6 @@ field { type_name: ".google.fhir.r4.core.Location.HoursOfOperation" options { [google.fhir.proto.field_description]: "What days/times during a week is this location usually open" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/Measure.descriptor.prototxt b/testdata/r4/descriptors/Measure.descriptor.prototxt index 9d61f4446..c4eac5b32 100644 --- a/testdata/r4/descriptors/Measure.descriptor.prototxt +++ b/testdata/r4/descriptors/Measure.descriptor.prototxt @@ -484,7 +484,6 @@ field { type_name: ".google.fhir.r4.core.Measure.Group" options { [google.fhir.proto.field_description]: "Population criteria group" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -495,7 +494,6 @@ field { type_name: ".google.fhir.r4.core.Measure.SupplementalData" options { [google.fhir.proto.field_description]: "What other data should be reported with the measure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -613,7 +611,6 @@ nested_type { type_name: ".google.fhir.r4.core.Measure.Group.Population" options { [google.fhir.proto.field_description]: "Population criteria" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -624,7 +621,6 @@ nested_type { type_name: ".google.fhir.r4.core.Measure.Group.Stratifier" options { [google.fhir.proto.field_description]: "Stratifier criteria for the measure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -761,7 +757,6 @@ nested_type { type_name: ".google.fhir.r4.core.Measure.Group.Stratifier.Component" options { [google.fhir.proto.field_description]: "Stratifier criteria component for the measure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -908,4 +903,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Measure, last updated 2018-12-27T22:37:54.724+11:00.\nA quality measure definition.\nSee http://hl7.org/fhir/StructureDefinition/Measure" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Measure" + [google.fhir.proto.fhir_path_message_constraint]: "group.stratifier.all((code | description | criteria).exists() xor component.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/MeasureReport.descriptor.prototxt b/testdata/r4/descriptors/MeasureReport.descriptor.prototxt index 1d00d2f4f..aaf6cd7bc 100644 --- a/testdata/r4/descriptors/MeasureReport.descriptor.prototxt +++ b/testdata/r4/descriptors/MeasureReport.descriptor.prototxt @@ -198,7 +198,6 @@ field { type_name: ".google.fhir.r4.core.MeasureReport.Group" options { [google.fhir.proto.field_description]: "Measure results for each group" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -316,7 +315,6 @@ nested_type { type_name: ".google.fhir.r4.core.MeasureReport.Group.Population" options { [google.fhir.proto.field_description]: "The populations in the group" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -337,7 +335,6 @@ nested_type { type_name: ".google.fhir.r4.core.MeasureReport.Group.Stratifier" options { [google.fhir.proto.field_description]: "Stratification results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -454,7 +451,6 @@ nested_type { type_name: ".google.fhir.r4.core.MeasureReport.Group.Stratifier.StratifierGroup" options { [google.fhir.proto.field_description]: "Stratum results, one for each unique value, or set of values, in the stratifier, or stratifier components" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -507,7 +503,6 @@ nested_type { type_name: ".google.fhir.r4.core.MeasureReport.Group.Stratifier.StratifierGroup.Component" options { [google.fhir.proto.field_description]: "Stratifier component values" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -518,7 +513,6 @@ nested_type { type_name: ".google.fhir.r4.core.MeasureReport.Group.Stratifier.StratifierGroup.StratifierGroupPopulation" options { [google.fhir.proto.field_description]: "Population results in this stratum" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -657,4 +651,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for MeasureReport, last updated 2018-12-27T22:37:54.724+11:00.\nResults of a measure evaluation.\nSee http://hl7.org/fhir/StructureDefinition/MeasureReport" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/MeasureReport" + [google.fhir.proto.fhir_path_message_constraint]: "group.stratifier.stratum.all(value.exists() xor component.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "(type != \'data-collection\') or group.exists().not()" } diff --git a/testdata/r4/descriptors/Medication.descriptor.prototxt b/testdata/r4/descriptors/Medication.descriptor.prototxt index d6d50892d..c375f4d51 100644 --- a/testdata/r4/descriptors/Medication.descriptor.prototxt +++ b/testdata/r4/descriptors/Medication.descriptor.prototxt @@ -154,7 +154,6 @@ field { type_name: ".google.fhir.r4.core.Medication.Ingredient" options { [google.fhir.proto.field_description]: "Active or inactive ingredient" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -165,7 +164,6 @@ field { type_name: ".google.fhir.r4.core.Medication.Batch" options { [google.fhir.proto.field_description]: "Details about packaged medications" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/MedicationAdministration.descriptor.prototxt b/testdata/r4/descriptors/MedicationAdministration.descriptor.prototxt index 4840b1a6a..f8ea5c10f 100644 --- a/testdata/r4/descriptors/MedicationAdministration.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicationAdministration.descriptor.prototxt @@ -214,7 +214,6 @@ field { type_name: ".google.fhir.r4.core.MedicationAdministration.Performer" options { [google.fhir.proto.field_description]: "Who performed the medication administration and what they did" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -280,8 +279,6 @@ field { type_name: ".google.fhir.r4.core.MedicationAdministration.Dosage" options { [google.fhir.proto.field_description]: "Details of how medication was taken" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "dose.exists() or rate.exists()" } } field { @@ -551,6 +548,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "dose.exists() or rate.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/MedicationDispense.descriptor.prototxt b/testdata/r4/descriptors/MedicationDispense.descriptor.prototxt index 398ee9fc4..e1886af18 100644 --- a/testdata/r4/descriptors/MedicationDispense.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicationDispense.descriptor.prototxt @@ -191,7 +191,6 @@ field { type_name: ".google.fhir.r4.core.MedicationDispense.Performer" options { [google.fhir.proto.field_description]: "Who performed event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -317,7 +316,6 @@ field { type_name: ".google.fhir.r4.core.MedicationDispense.Substitution" options { [google.fhir.proto.field_description]: "Whether a substitution was performed on the dispense" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -565,4 +563,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for MedicationDispense, last updated 2018-12-27T22:37:54.724+11:00.\nDispensing a medication to a named patient.\nSee http://hl7.org/fhir/StructureDefinition/MedicationDispense" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/MedicationDispense" + [google.fhir.proto.fhir_path_message_constraint]: "whenHandedOver.empty() or whenPrepared.empty() or whenHandedOver >= whenPrepared" } diff --git a/testdata/r4/descriptors/MedicationKnowledge.descriptor.prototxt b/testdata/r4/descriptors/MedicationKnowledge.descriptor.prototxt index fb27b062e..9bdd0f5b3 100644 --- a/testdata/r4/descriptors/MedicationKnowledge.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicationKnowledge.descriptor.prototxt @@ -154,7 +154,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.RelatedMedicationKnowledge" options { [google.fhir.proto.field_description]: "Associated or related medication information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -186,7 +185,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.Monograph" options { [google.fhir.proto.field_description]: "Associated documentation about the medication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -197,7 +195,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.Ingredient" options { [google.fhir.proto.field_description]: "Active or inactive ingredient" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -228,7 +225,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.Cost" options { [google.fhir.proto.field_description]: "The pricing of the medication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -239,7 +235,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.MonitoringProgram" options { [google.fhir.proto.field_description]: "Program under which a medication is reviewed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -250,7 +245,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.AdministrationGuidelines" options { [google.fhir.proto.field_description]: "Guidelines for administration of the medication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -261,7 +255,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.MedicineClassification" options { [google.fhir.proto.field_description]: "Categorization of the medication within a formulary or classification system" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -272,7 +265,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.Packaging" options { [google.fhir.proto.field_description]: "Details about packaged medications" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -283,7 +275,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.DrugCharacteristic" options { [google.fhir.proto.field_description]: "Specifies descriptive properties of the medicine" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -305,7 +296,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.Regulatory" options { [google.fhir.proto.field_description]: "Regulatory information about a medication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -316,7 +306,6 @@ field { type_name: ".google.fhir.r4.core.MedicationKnowledge.Kinetics" options { [google.fhir.proto.field_description]: "The time course of drug absorption, distribution, metabolism and excretion of a medication from the body" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -707,7 +696,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicationKnowledge.AdministrationGuidelines.Dosage" options { [google.fhir.proto.field_description]: "Dosage for the medication for the specific guidelines" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -728,7 +716,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicationKnowledge.AdministrationGuidelines.PatientCharacteristics" options { [google.fhir.proto.field_description]: "Characteristics of the patient that are relevant to the administration guidelines" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1148,7 +1135,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicationKnowledge.Regulatory.Substitution" options { [google.fhir.proto.field_description]: "Specifies if changes are allowed when dispensing a medication from a regulatory perspective" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1159,7 +1145,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicationKnowledge.Regulatory.Schedule" options { [google.fhir.proto.field_description]: "Specifies the schedule of a medication in jurisdiction" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1170,7 +1155,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicationKnowledge.Regulatory.MaxDispense" options { [google.fhir.proto.field_description]: "The maximum number of units of the medication that can be dispensed in a period" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/MedicationRequest.descriptor.prototxt b/testdata/r4/descriptors/MedicationRequest.descriptor.prototxt index 94aacc5de..4fa07c466 100644 --- a/testdata/r4/descriptors/MedicationRequest.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicationRequest.descriptor.prototxt @@ -394,7 +394,6 @@ field { type_name: ".google.fhir.r4.core.MedicationRequest.DispenseRequest" options { [google.fhir.proto.field_description]: "Medication supply authorization" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -405,7 +404,6 @@ field { type_name: ".google.fhir.r4.core.MedicationRequest.Substitution" options { [google.fhir.proto.field_description]: "Any restrictions on medication substitution" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -622,7 +620,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicationRequest.DispenseRequest.InitialFill" options { [google.fhir.proto.field_description]: "First fill details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/MedicinalProduct.descriptor.prototxt b/testdata/r4/descriptors/MedicinalProduct.descriptor.prototxt index 171144a5d..359cdf38b 100644 --- a/testdata/r4/descriptors/MedicinalProduct.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicinalProduct.descriptor.prototxt @@ -261,7 +261,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "The product\'s name, including full name and possibly coded parts" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -282,7 +281,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProduct.ManufacturingBusinessOperation" options { [google.fhir.proto.field_description]: "An operation applied to the product, for manufacturing or adminsitrative purpose" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -293,7 +291,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProduct.SpecialDesignation" options { [google.fhir.proto.field_description]: "Indicates if the medicinal product has an orphan designation for the treatment of a rare disease" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -347,7 +344,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicinalProduct.Name.NamePart" options { [google.fhir.proto.field_description]: "Coding words or phrases of the name" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -358,7 +354,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicinalProduct.Name.CountryLanguage" options { [google.fhir.proto.field_description]: "Country where the name applies" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/MedicinalProductAuthorization.descriptor.prototxt b/testdata/r4/descriptors/MedicinalProductAuthorization.descriptor.prototxt index 55af2aae5..4cb36914d 100644 --- a/testdata/r4/descriptors/MedicinalProductAuthorization.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicinalProductAuthorization.descriptor.prototxt @@ -215,7 +215,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductAuthorization.JurisdictionalAuthorization" options { [google.fhir.proto.field_description]: "Authorization in areas within a country" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -248,7 +247,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductAuthorization.Procedure" options { [google.fhir.proto.field_description]: "The regulatory procedure for granting or amending a marketing authorization" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/MedicinalProductContraindication.descriptor.prototxt b/testdata/r4/descriptors/MedicinalProductContraindication.descriptor.prototxt index 121547bf0..9e6c592be 100644 --- a/testdata/r4/descriptors/MedicinalProductContraindication.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicinalProductContraindication.descriptor.prototxt @@ -146,7 +146,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductContraindication.OtherTherapy" options { [google.fhir.proto.field_description]: "Information about the use of the medicinal product in relation to other therapies described as part of the indication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/MedicinalProductIndication.descriptor.prototxt b/testdata/r4/descriptors/MedicinalProductIndication.descriptor.prototxt index 2e73bbcf9..dc125993f 100644 --- a/testdata/r4/descriptors/MedicinalProductIndication.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicinalProductIndication.descriptor.prototxt @@ -155,7 +155,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductIndication.OtherTherapy" options { [google.fhir.proto.field_description]: "Information about the use of the medicinal product in relation to other therapies described as part of the indication" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/MedicinalProductIngredient.descriptor.prototxt b/testdata/r4/descriptors/MedicinalProductIngredient.descriptor.prototxt index 2aa6479ac..6861385c0 100644 --- a/testdata/r4/descriptors/MedicinalProductIngredient.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicinalProductIngredient.descriptor.prototxt @@ -135,7 +135,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductIngredient.SpecifiedSubstance" options { [google.fhir.proto.field_description]: "A specified substance that comprises this ingredient" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -146,7 +145,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductIngredient.Substance" options { [google.fhir.proto.field_description]: "The ingredient substance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -221,7 +219,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicinalProductIngredient.SpecifiedSubstance.Strength" options { [google.fhir.proto.field_description]: "Quantity of the substance or specified substance present in the manufactured item or pharmaceutical product" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -325,7 +322,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicinalProductIngredient.SpecifiedSubstance.Strength.ReferenceStrength" options { [google.fhir.proto.field_description]: "Strength expressed in terms of a reference substance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/MedicinalProductInteraction.descriptor.prototxt b/testdata/r4/descriptors/MedicinalProductInteraction.descriptor.prototxt index 3619a6342..940dbdbe9 100644 --- a/testdata/r4/descriptors/MedicinalProductInteraction.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicinalProductInteraction.descriptor.prototxt @@ -116,7 +116,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductInteraction.Interactant" options { [google.fhir.proto.field_description]: "The specific medication, food or laboratory test that interacts" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/MedicinalProductPackaged.descriptor.prototxt b/testdata/r4/descriptors/MedicinalProductPackaged.descriptor.prototxt index 9f79655d2..28f96af6e 100644 --- a/testdata/r4/descriptors/MedicinalProductPackaged.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicinalProductPackaged.descriptor.prototxt @@ -166,7 +166,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductPackaged.BatchIdentifier" options { [google.fhir.proto.field_description]: "Batch numbering" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -178,7 +177,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A packaging item, as a contained for medicine, possibly with other packaging items within" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/MedicinalProductPharmaceutical.descriptor.prototxt b/testdata/r4/descriptors/MedicinalProductPharmaceutical.descriptor.prototxt index a0c5552a7..4b050b3c6 100644 --- a/testdata/r4/descriptors/MedicinalProductPharmaceutical.descriptor.prototxt +++ b/testdata/r4/descriptors/MedicinalProductPharmaceutical.descriptor.prototxt @@ -146,7 +146,6 @@ field { type_name: ".google.fhir.r4.core.MedicinalProductPharmaceutical.Characteristics" options { [google.fhir.proto.field_description]: "Characteristics e.g. a products onset of action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -158,7 +157,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "The path by which the pharmaceutical product is taken into or makes contact with the body" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -316,7 +314,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicinalProductPharmaceutical.RouteOfAdministration.TargetSpecies" options { [google.fhir.proto.field_description]: "A species for which this route applies" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -370,7 +367,6 @@ nested_type { type_name: ".google.fhir.r4.core.MedicinalProductPharmaceutical.RouteOfAdministration.TargetSpecies.WithdrawalPeriod" options { [google.fhir.proto.field_description]: "A species specific time during which consumption of animal product is not appropriate" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/MessageDefinition.descriptor.prototxt b/testdata/r4/descriptors/MessageDefinition.descriptor.prototxt index d44339707..7d228e59d 100644 --- a/testdata/r4/descriptors/MessageDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/MessageDefinition.descriptor.prototxt @@ -296,8 +296,6 @@ field { type_name: ".google.fhir.r4.core.MessageDefinition.Focus" options { [google.fhir.proto.field_description]: "Resource(s) that are the subject of the event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "max=\'*\' or (max.toInteger() > 0)" } } field { @@ -318,7 +316,6 @@ field { type_name: ".google.fhir.r4.core.MessageDefinition.AllowedResponse" options { [google.fhir.proto.field_description]: "Responses to this message" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -511,6 +508,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "max=\'*\' or (max.toInteger() > 0)" + } } nested_type { name: "ResponseRequiredCode" @@ -597,4 +597,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for MessageDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nA resource that defines a type of message that can be exchanged between systems.\nSee http://hl7.org/fhir/StructureDefinition/MessageDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/MessageDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/MessageHeader.descriptor.prototxt b/testdata/r4/descriptors/MessageHeader.descriptor.prototxt index 8e474e16e..861369676 100644 --- a/testdata/r4/descriptors/MessageHeader.descriptor.prototxt +++ b/testdata/r4/descriptors/MessageHeader.descriptor.prototxt @@ -104,7 +104,6 @@ field { type_name: ".google.fhir.r4.core.MessageHeader.MessageDestination" options { [google.fhir.proto.field_description]: "Message destination application(s)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -153,7 +152,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Message source application" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -187,7 +185,6 @@ field { type_name: ".google.fhir.r4.core.MessageHeader.Response" options { [google.fhir.proto.field_description]: "If this is a reply to prior message" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/MetadataResource.descriptor.prototxt b/testdata/r4/descriptors/MetadataResource.descriptor.prototxt index 6d76076cc..d1690ee14 100644 --- a/testdata/r4/descriptors/MetadataResource.descriptor.prototxt +++ b/testdata/r4/descriptors/MetadataResource.descriptor.prototxt @@ -237,4 +237,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_LOGICAL [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for MetadataResource, last updated 2018-12-27T22:37:54.724+11:00.\nCommon Ancestor declaration for definitional resources.\nSee http://hl7.org/fhir/StructureDefinition/MetadataResource" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/MetadataResource" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/MolecularSequence.descriptor.prototxt b/testdata/r4/descriptors/MolecularSequence.descriptor.prototxt index 8b8f7cc83..4e8b078ff 100644 --- a/testdata/r4/descriptors/MolecularSequence.descriptor.prototxt +++ b/testdata/r4/descriptors/MolecularSequence.descriptor.prototxt @@ -178,9 +178,6 @@ field { type_name: ".google.fhir.r4.core.MolecularSequence.ReferenceSeq" options { [google.fhir.proto.field_description]: "A sequence used as reference" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(genomeBuild.count()+referenceSeqId.count()+ referenceSeqPointer.count()+ referenceSeqString.count()) = 1" - [google.fhir.proto.fhir_path_constraint]: "(chromosome.empty() and genomeBuild.empty()) or (chromosome.exists() and genomeBuild.exists())" } } field { @@ -191,7 +188,6 @@ field { type_name: ".google.fhir.r4.core.MolecularSequence.Variant" options { [google.fhir.proto.field_description]: "Variant in sequence" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -212,7 +208,6 @@ field { type_name: ".google.fhir.r4.core.MolecularSequence.Quality" options { [google.fhir.proto.field_description]: "An set of value as quality of sequence" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -233,7 +228,6 @@ field { type_name: ".google.fhir.r4.core.MolecularSequence.Repository" options { [google.fhir.proto.field_description]: "External repository which contains detailed report related with observedSeq in this resource" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -255,7 +249,6 @@ field { type_name: ".google.fhir.r4.core.MolecularSequence.StructureVariant" options { [google.fhir.proto.field_description]: "Structural variant" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -462,6 +455,10 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(genomeBuild.count()+referenceSeqId.count()+ referenceSeqPointer.count()+ referenceSeqString.count()) = 1" + [google.fhir.proto.fhir_path_message_constraint]: "(chromosome.empty() and genomeBuild.empty()) or (chromosome.exists() and genomeBuild.exists())" + } } nested_type { name: "Variant" @@ -743,7 +740,6 @@ nested_type { type_name: ".google.fhir.r4.core.MolecularSequence.Quality.Roc" options { [google.fhir.proto.field_description]: "Receiver Operator Characteristic (ROC) Curve" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1071,7 +1067,6 @@ nested_type { type_name: ".google.fhir.r4.core.MolecularSequence.StructureVariant.Outer" options { [google.fhir.proto.field_description]: "Structural variant outer" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1082,7 +1077,6 @@ nested_type { type_name: ".google.fhir.r4.core.MolecularSequence.StructureVariant.Inner" options { [google.fhir.proto.field_description]: "Structural variant inner" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1196,4 +1190,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for MolecularSequence, last updated 2018-12-27T22:37:54.724+11:00.\nInformation about a biological sequence.\nSee http://hl7.org/fhir/StructureDefinition/MolecularSequence" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/MolecularSequence" + [google.fhir.proto.fhir_path_message_constraint]: "coordinateSystem = 1 or coordinateSystem = 0" } diff --git a/testdata/r4/descriptors/MoneyQuantity.descriptor.prototxt b/testdata/r4/descriptors/MoneyQuantity.descriptor.prototxt index cc4df6898..7d4c3b008 100644 --- a/testdata/r4/descriptors/MoneyQuantity.descriptor.prototxt +++ b/testdata/r4/descriptors/MoneyQuantity.descriptor.prototxt @@ -101,4 +101,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for MoneyQuantity, last updated 2018-12-27T22:37:54.724+11:00.\nAn amount of money. With regard to precision, see [Decimal Precision](datatypes.html#precision).\nSee http://hl7.org/fhir/StructureDefinition/MoneyQuantity" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Quantity" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/MoneyQuantity" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "(code.exists() or value.empty()) and (system.empty() or system = \'urn:iso:std:iso:4217\')" } diff --git a/testdata/r4/descriptors/NamingSystem.descriptor.prototxt b/testdata/r4/descriptors/NamingSystem.descriptor.prototxt index ab41ee7a4..ce9cf98e8 100644 --- a/testdata/r4/descriptors/NamingSystem.descriptor.prototxt +++ b/testdata/r4/descriptors/NamingSystem.descriptor.prototxt @@ -218,7 +218,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Unique identifiers used for system" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -391,4 +390,7 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for NamingSystem, last updated 2018-12-27T22:37:54.724+11:00.\nSystem of unique identification.\nSee http://hl7.org/fhir/StructureDefinition/NamingSystem" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/NamingSystem" + [google.fhir.proto.fhir_path_message_constraint]: "kind != \'root\' or uniqueId.all(type != \'uuid\')" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" + [google.fhir.proto.fhir_path_message_constraint]: "uniqueId.where(preferred = true).select(type).isDistinct()" } diff --git a/testdata/r4/descriptors/NutritionOrder.descriptor.prototxt b/testdata/r4/descriptors/NutritionOrder.descriptor.prototxt index 7d31c5054..28cb0bb4d 100644 --- a/testdata/r4/descriptors/NutritionOrder.descriptor.prototxt +++ b/testdata/r4/descriptors/NutritionOrder.descriptor.prototxt @@ -232,7 +232,6 @@ field { type_name: ".google.fhir.r4.core.NutritionOrder.OralDiet" options { [google.fhir.proto.field_description]: "Oral diet components" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -243,7 +242,6 @@ field { type_name: ".google.fhir.r4.core.NutritionOrder.Supplement" options { [google.fhir.proto.field_description]: "Supplement components" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -254,7 +252,6 @@ field { type_name: ".google.fhir.r4.core.NutritionOrder.EnteralFormula" options { [google.fhir.proto.field_description]: "Enteral formula components" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -381,7 +378,6 @@ nested_type { type_name: ".google.fhir.r4.core.NutritionOrder.OralDiet.Nutrient" options { [google.fhir.proto.field_description]: "Required nutrient modifications" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -392,7 +388,6 @@ nested_type { type_name: ".google.fhir.r4.core.NutritionOrder.OralDiet.Texture" options { [google.fhir.proto.field_description]: "Required texture modifications" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -705,7 +700,6 @@ nested_type { type_name: ".google.fhir.r4.core.NutritionOrder.EnteralFormula.Administration" options { [google.fhir.proto.field_description]: "Formula feeding instruction as structured data" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -821,4 +815,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for NutritionOrder, last updated 2018-12-27T22:37:54.724+11:00.\nDiet, formula or nutritional supplement request.\nSee http://hl7.org/fhir/StructureDefinition/NutritionOrder" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/NutritionOrder" + [google.fhir.proto.fhir_path_message_constraint]: "oralDiet.exists() or supplement.exists() or enteralFormula.exists()" } diff --git a/testdata/r4/descriptors/Observation.descriptor.prototxt b/testdata/r4/descriptors/Observation.descriptor.prototxt index dcbff61a6..233d07e46 100644 --- a/testdata/r4/descriptors/Observation.descriptor.prototxt +++ b/testdata/r4/descriptors/Observation.descriptor.prototxt @@ -322,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.Observation.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -363,7 +361,6 @@ field { type_name: ".google.fhir.r4.core.Observation.Component" options { [google.fhir.proto.field_description]: "Component results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -624,6 +621,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -811,4 +811,6 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Observation, last updated 2018-12-27T22:37:54.724+11:00.\nMeasurements and simple assertions.\nSee http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Observation" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" } diff --git a/testdata/r4/descriptors/ObservationDefinition.descriptor.prototxt b/testdata/r4/descriptors/ObservationDefinition.descriptor.prototxt index 252ad2dfc..5ae7120c6 100644 --- a/testdata/r4/descriptors/ObservationDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/ObservationDefinition.descriptor.prototxt @@ -164,7 +164,6 @@ field { type_name: ".google.fhir.r4.core.ObservationDefinition.QuantitativeDetails" options { [google.fhir.proto.field_description]: "Characteristics of quantitative results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -175,7 +174,6 @@ field { type_name: ".google.fhir.r4.core.ObservationDefinition.QualifiedInterval" options { [google.fhir.proto.field_description]: "Qualified range for continuous and ordinal observation results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/OperationDefinition.descriptor.prototxt b/testdata/r4/descriptors/OperationDefinition.descriptor.prototxt index 000696c4a..2bb49b53a 100644 --- a/testdata/r4/descriptors/OperationDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/OperationDefinition.descriptor.prototxt @@ -340,10 +340,6 @@ field { type_name: ".google.fhir.r4.core.OperationDefinition.Parameter" options { [google.fhir.proto.field_description]: "Parameters for the operation/query" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "type.exists() or part.exists()" - [google.fhir.proto.fhir_path_constraint]: "searchType.exists() implies type = \'string\'" - [google.fhir.proto.fhir_path_constraint]: "targetProfile.exists() implies (type = \'Reference\' or type = \'canonical\')" } } field { @@ -354,7 +350,6 @@ field { type_name: ".google.fhir.r4.core.OperationDefinition.Overload" options { [google.fhir.proto.field_description]: "Define overloaded variants for when generating code" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -562,7 +557,6 @@ nested_type { type_name: ".google.fhir.r4.core.OperationDefinition.Parameter.Binding" options { [google.fhir.proto.field_description]: "ValueSet details if this is coded" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -573,7 +567,6 @@ nested_type { type_name: ".google.fhir.r4.core.OperationDefinition.Parameter.ReferencedFrom" options { [google.fhir.proto.field_description]: "References to this parameter" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -803,6 +796,11 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "type.exists() or part.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "searchType.exists() implies type = \'string\'" + [google.fhir.proto.fhir_path_message_constraint]: "targetProfile.exists() implies (type = \'Reference\' or type = \'canonical\')" + } } nested_type { name: "Overload" @@ -861,4 +859,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for OperationDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nDefinition of an operation or a named query.\nSee http://hl7.org/fhir/StructureDefinition/OperationDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/OperationDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/OperationOutcome.descriptor.prototxt b/testdata/r4/descriptors/OperationOutcome.descriptor.prototxt index de03e6a1f..e26686c8e 100644 --- a/testdata/r4/descriptors/OperationOutcome.descriptor.prototxt +++ b/testdata/r4/descriptors/OperationOutcome.descriptor.prototxt @@ -94,7 +94,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A single issue associated with the action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Organization.descriptor.prototxt b/testdata/r4/descriptors/Organization.descriptor.prototxt index 8d3911b3f..935cab442 100644 --- a/testdata/r4/descriptors/Organization.descriptor.prototxt +++ b/testdata/r4/descriptors/Organization.descriptor.prototxt @@ -176,7 +176,6 @@ field { type_name: ".google.fhir.r4.core.Organization.Contact" options { [google.fhir.proto.field_description]: "Contact for the organization for a certain purpose" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -267,4 +266,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Organization, last updated 2018-12-27T22:37:54.724+11:00.\nA grouping of people or organizations with a common purpose.\nSee http://hl7.org/fhir/StructureDefinition/Organization" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Organization" + [google.fhir.proto.fhir_path_message_constraint]: "(identifier.count() + name.count()) > 0" } diff --git a/testdata/r4/descriptors/Parameters.descriptor.prototxt b/testdata/r4/descriptors/Parameters.descriptor.prototxt index 201dc232a..018bbc98b 100644 --- a/testdata/r4/descriptors/Parameters.descriptor.prototxt +++ b/testdata/r4/descriptors/Parameters.descriptor.prototxt @@ -47,8 +47,6 @@ field { type_name: ".google.fhir.r4.core.Parameters.Parameter" options { [google.fhir.proto.field_description]: "Operation Parameter" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(part.exists() and value.empty() and resource.empty()) or (part.empty() and (value.exists() xor resource.exists()))" } } nested_type { @@ -526,6 +524,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(part.exists() and value.empty() and resource.empty()) or (part.empty() and (value.exists() xor resource.exists()))" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/Patient.descriptor.prototxt b/testdata/r4/descriptors/Patient.descriptor.prototxt index 3ce811381..74eaf1d41 100644 --- a/testdata/r4/descriptors/Patient.descriptor.prototxt +++ b/testdata/r4/descriptors/Patient.descriptor.prototxt @@ -203,8 +203,6 @@ field { type_name: ".google.fhir.r4.core.Patient.Contact" options { [google.fhir.proto.field_description]: "A contact party (e.g. guardian, partner, friend) for the patient" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "name.exists() or telecom.exists() or address.exists() or organization.exists()" } } field { @@ -215,7 +213,6 @@ field { type_name: ".google.fhir.r4.core.Patient.Communication" options { [google.fhir.proto.field_description]: "A language which may be used to communicate with the patient about his or her health" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -250,7 +247,6 @@ field { type_name: ".google.fhir.r4.core.Patient.Link" options { [google.fhir.proto.field_description]: "Link to another patient resource that concerns the same actual person" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -460,6 +456,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "name.exists() or telecom.exists() or address.exists() or organization.exists()" + } } nested_type { name: "Communication" diff --git a/testdata/r4/descriptors/PaymentReconciliation.descriptor.prototxt b/testdata/r4/descriptors/PaymentReconciliation.descriptor.prototxt index 5fa5cacb3..aa0af059d 100644 --- a/testdata/r4/descriptors/PaymentReconciliation.descriptor.prototxt +++ b/testdata/r4/descriptors/PaymentReconciliation.descriptor.prototxt @@ -222,7 +222,6 @@ field { type_name: ".google.fhir.r4.core.PaymentReconciliation.Details" options { [google.fhir.proto.field_description]: "Settlement particulars" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -243,7 +242,6 @@ field { type_name: ".google.fhir.r4.core.PaymentReconciliation.Notes" options { [google.fhir.proto.field_description]: "Note concerning processing" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Period.descriptor.prototxt b/testdata/r4/descriptors/Period.descriptor.prototxt index e5b9332d0..e0c441426 100644 --- a/testdata/r4/descriptors/Period.descriptor.prototxt +++ b/testdata/r4/descriptors/Period.descriptor.prototxt @@ -43,4 +43,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Period, last updated 2018-12-27T22:37:54.724+11:00.\nTime range defined by start and end date/time.\nSee http://hl7.org/fhir/StructureDefinition/Period" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Period" + [google.fhir.proto.fhir_path_message_constraint]: "start.hasValue().not() or end.hasValue().not() or (start <= end)" } diff --git a/testdata/r4/descriptors/Person.descriptor.prototxt b/testdata/r4/descriptors/Person.descriptor.prototxt index b9f028217..a16aeaa4c 100644 --- a/testdata/r4/descriptors/Person.descriptor.prototxt +++ b/testdata/r4/descriptors/Person.descriptor.prototxt @@ -184,7 +184,6 @@ field { type_name: ".google.fhir.r4.core.Person.Link" options { [google.fhir.proto.field_description]: "Link to a resource that concerns the same actual person" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/PlanDefinition.descriptor.prototxt b/testdata/r4/descriptors/PlanDefinition.descriptor.prototxt index 26f0e95e8..920dd0c95 100644 --- a/testdata/r4/descriptors/PlanDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/PlanDefinition.descriptor.prototxt @@ -384,7 +384,6 @@ field { type_name: ".google.fhir.r4.core.PlanDefinition.Goal" options { [google.fhir.proto.field_description]: "What the plan is trying to accomplish" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -395,7 +394,6 @@ field { type_name: ".google.fhir.r4.core.PlanDefinition.Action" options { [google.fhir.proto.field_description]: "Action defined by the plan" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -554,7 +552,6 @@ nested_type { type_name: ".google.fhir.r4.core.PlanDefinition.Goal.Target" options { [google.fhir.proto.field_description]: "Target outcome for the goal" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -804,7 +801,6 @@ nested_type { type_name: ".google.fhir.r4.core.PlanDefinition.Action.Condition" options { [google.fhir.proto.field_description]: "Whether or not the action is applicable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -835,7 +831,6 @@ nested_type { type_name: ".google.fhir.r4.core.PlanDefinition.Action.RelatedAction" options { [google.fhir.proto.field_description]: "Relationship to another action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -856,7 +851,6 @@ nested_type { type_name: ".google.fhir.r4.core.PlanDefinition.Action.Participant" options { [google.fhir.proto.field_description]: "Who should participate in the action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -947,7 +941,6 @@ nested_type { type_name: ".google.fhir.r4.core.PlanDefinition.Action.DynamicValue" options { [google.fhir.proto.field_description]: "Dynamic aspects of the definition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1569,4 +1562,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for PlanDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nThe definition of a plan for a series of actions, independent of any specific patient or context.\nSee http://hl7.org/fhir/StructureDefinition/PlanDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/PlanDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Practitioner.descriptor.prototxt b/testdata/r4/descriptors/Practitioner.descriptor.prototxt index ec71069a7..9d191f7ac 100644 --- a/testdata/r4/descriptors/Practitioner.descriptor.prototxt +++ b/testdata/r4/descriptors/Practitioner.descriptor.prototxt @@ -173,7 +173,6 @@ field { type_name: ".google.fhir.r4.core.Practitioner.Qualification" options { [google.fhir.proto.field_description]: "Certification, licenses, or training pertaining to the provision of care" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/PractitionerRole.descriptor.prototxt b/testdata/r4/descriptors/PractitionerRole.descriptor.prototxt index 1c6d0f4ba..11d230939 100644 --- a/testdata/r4/descriptors/PractitionerRole.descriptor.prototxt +++ b/testdata/r4/descriptors/PractitionerRole.descriptor.prototxt @@ -197,7 +197,6 @@ field { type_name: ".google.fhir.r4.core.PractitionerRole.AvailableTime" options { [google.fhir.proto.field_description]: "Times the Service Site is available" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -208,7 +207,6 @@ field { type_name: ".google.fhir.r4.core.PractitionerRole.NotAvailable" options { [google.fhir.proto.field_description]: "Not available during this time due to provided reason" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/Procedure.descriptor.prototxt b/testdata/r4/descriptors/Procedure.descriptor.prototxt index 8cf48936e..d1b90b1b8 100644 --- a/testdata/r4/descriptors/Procedure.descriptor.prototxt +++ b/testdata/r4/descriptors/Procedure.descriptor.prototxt @@ -251,7 +251,6 @@ field { type_name: ".google.fhir.r4.core.Procedure.Performer" options { [google.fhir.proto.field_description]: "The people who performed the procedure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -372,7 +371,6 @@ field { type_name: ".google.fhir.r4.core.Procedure.FocalDevice" options { [google.fhir.proto.field_description]: "Manipulated, implanted, or removed device" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/Provenance.descriptor.prototxt b/testdata/r4/descriptors/Provenance.descriptor.prototxt index da211f67e..59fadf5e1 100644 --- a/testdata/r4/descriptors/Provenance.descriptor.prototxt +++ b/testdata/r4/descriptors/Provenance.descriptor.prototxt @@ -168,7 +168,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Actor involved" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -179,7 +178,6 @@ field { type_name: ".google.fhir.r4.core.Provenance.Entity" options { [google.fhir.proto.field_description]: "An entity used in this activity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/Quantity.descriptor.prototxt b/testdata/r4/descriptors/Quantity.descriptor.prototxt index 8d59debde..a7ca6832e 100644 --- a/testdata/r4/descriptors/Quantity.descriptor.prototxt +++ b/testdata/r4/descriptors/Quantity.descriptor.prototxt @@ -100,4 +100,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Quantity, last updated 2018-12-27T22:37:54.724+11:00.\nA measured or measurable amount.\nSee http://hl7.org/fhir/StructureDefinition/Quantity" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Quantity" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" } diff --git a/testdata/r4/descriptors/Questionnaire.descriptor.prototxt b/testdata/r4/descriptors/Questionnaire.descriptor.prototxt index 56e482947..5ff1d1fa7 100644 --- a/testdata/r4/descriptors/Questionnaire.descriptor.prototxt +++ b/testdata/r4/descriptors/Questionnaire.descriptor.prototxt @@ -304,18 +304,6 @@ field { type_name: ".google.fhir.r4.core.Questionnaire.Item" options { [google.fhir.proto.field_description]: "Questions and sections within the Questionnaire" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "type!=\'display\' or readOnly.empty()" - [google.fhir.proto.fhir_path_constraint]: "(type!=\'group\' and type!=\'display\') or initial.empty()" - [google.fhir.proto.fhir_path_constraint]: "type!=\'display\' or (required.empty() and repeats.empty())" - [google.fhir.proto.fhir_path_constraint]: "(type =\'choice\' or type = \'open-choice\' or type = \'decimal\' or type = \'integer\' or type = \'date\' or type = \'dateTime\' or type = \'time\' or type = \'string\' or type = \'quantity\') or (answerValueSet.empty() and answerOption.empty())" - [google.fhir.proto.fhir_path_constraint]: "answerOption.empty() or answerValueSet.empty()" - [google.fhir.proto.fhir_path_constraint]: "type!=\'display\' or code.empty()" - [google.fhir.proto.fhir_path_constraint]: "(type in (\'boolean\' | \'decimal\' | \'integer\' | \'string\' | \'text\' | \'url\' | \'open-choice\')) or maxLength.empty()" - [google.fhir.proto.fhir_path_constraint]: "(type=\'group\' implies item.empty().not()) and (type.trace(\'type\')=\'display\' implies item.trace(\'item\').empty())" - [google.fhir.proto.fhir_path_constraint]: "repeats=true or initial.count() <= 1" - [google.fhir.proto.fhir_path_constraint]: "answerOption.empty() or initial.empty()" - [google.fhir.proto.fhir_path_constraint]: "enableWhen.count() > 2 implies enableBehavior.exists()" } } nested_type { @@ -474,8 +462,6 @@ nested_type { type_name: ".google.fhir.r4.core.Questionnaire.Item.EnableWhen" options { [google.fhir.proto.field_description]: "Only allow data when" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "operator = \'exists\' implies (answer is Boolean)" } } field { @@ -546,7 +532,6 @@ nested_type { type_name: ".google.fhir.r4.core.Questionnaire.Item.AnswerOption" options { [google.fhir.proto.field_description]: "Permitted answer" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -557,7 +542,6 @@ nested_type { type_name: ".google.fhir.r4.core.Questionnaire.Item.Initial" options { [google.fhir.proto.field_description]: "Initial value(s) when item is first rendered" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -782,6 +766,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "operator = \'exists\' implies (answer is Boolean)" + } } nested_type { name: "EnableBehaviorCode" @@ -1078,9 +1065,24 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "type!=\'display\' or readOnly.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(type!=\'group\' and type!=\'display\') or initial.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "type!=\'display\' or (required.empty() and repeats.empty())" + [google.fhir.proto.fhir_path_message_constraint]: "(type =\'choice\' or type = \'open-choice\' or type = \'decimal\' or type = \'integer\' or type = \'date\' or type = \'dateTime\' or type = \'time\' or type = \'string\' or type = \'quantity\') or (answerValueSet.empty() and answerOption.empty())" + [google.fhir.proto.fhir_path_message_constraint]: "answerOption.empty() or answerValueSet.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "type!=\'display\' or code.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(type in (\'boolean\' | \'decimal\' | \'integer\' | \'string\' | \'text\' | \'url\' | \'open-choice\')) or maxLength.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(type=\'group\' implies item.empty().not()) and (type.trace(\'type\')=\'display\' implies item.trace(\'item\').empty())" + [google.fhir.proto.fhir_path_message_constraint]: "repeats=true or initial.count() <= 1" + [google.fhir.proto.fhir_path_message_constraint]: "answerOption.empty() or initial.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "enableWhen.count() > 2 implies enableBehavior.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Questionnaire, last updated 2018-12-27T22:37:54.724+11:00.\nA structured set of questions.\nSee http://hl7.org/fhir/StructureDefinition/Questionnaire" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Questionnaire" + [google.fhir.proto.fhir_path_message_constraint]: "descendants().linkId.isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/QuestionnaireResponse.descriptor.prototxt b/testdata/r4/descriptors/QuestionnaireResponse.descriptor.prototxt index 5c525627f..d5adf466c 100644 --- a/testdata/r4/descriptors/QuestionnaireResponse.descriptor.prototxt +++ b/testdata/r4/descriptors/QuestionnaireResponse.descriptor.prototxt @@ -210,8 +210,6 @@ field { type_name: ".google.fhir.r4.core.QuestionnaireResponse.Item" options { [google.fhir.proto.field_description]: "Groups and questions" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(answer.exists() and item.exists()).not()" } } nested_type { @@ -312,7 +310,6 @@ nested_type { type_name: ".google.fhir.r4.core.QuestionnaireResponse.Item.Answer" options { [google.fhir.proto.field_description]: "The response(s) to the question" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -487,6 +484,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(answer.exists() and item.exists()).not()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/Range.descriptor.prototxt b/testdata/r4/descriptors/Range.descriptor.prototxt index 72d889086..5826cb1dd 100644 --- a/testdata/r4/descriptors/Range.descriptor.prototxt +++ b/testdata/r4/descriptors/Range.descriptor.prototxt @@ -43,4 +43,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Range, last updated 2018-12-27T22:37:54.724+11:00.\nSet of values bounded by low and high.\nSee http://hl7.org/fhir/StructureDefinition/Range" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Range" + [google.fhir.proto.fhir_path_message_constraint]: "low.empty() or high.empty() or (low <= high)" } diff --git a/testdata/r4/descriptors/Ratio.descriptor.prototxt b/testdata/r4/descriptors/Ratio.descriptor.prototxt index 47d04841d..59e88b4ec 100644 --- a/testdata/r4/descriptors/Ratio.descriptor.prototxt +++ b/testdata/r4/descriptors/Ratio.descriptor.prototxt @@ -43,4 +43,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Ratio, last updated 2018-12-27T22:37:54.724+11:00.\nA ratio of two Quantity values - a numerator and a denominator.\nSee http://hl7.org/fhir/StructureDefinition/Ratio" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Ratio" + [google.fhir.proto.fhir_path_message_constraint]: "(numerator.empty() xor denominator.exists()) and (numerator.exists() or extension.exists())" } diff --git a/testdata/r4/descriptors/RelatedPerson.descriptor.prototxt b/testdata/r4/descriptors/RelatedPerson.descriptor.prototxt index a1e7ee66b..66e96a49f 100644 --- a/testdata/r4/descriptors/RelatedPerson.descriptor.prototxt +++ b/testdata/r4/descriptors/RelatedPerson.descriptor.prototxt @@ -205,7 +205,6 @@ field { type_name: ".google.fhir.r4.core.RelatedPerson.Communication" options { [google.fhir.proto.field_description]: "A language which may be used to communicate with about the patient\'s health" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/RequestGroup.descriptor.prototxt b/testdata/r4/descriptors/RequestGroup.descriptor.prototxt index cf3c77cc0..5d77e38d1 100644 --- a/testdata/r4/descriptors/RequestGroup.descriptor.prototxt +++ b/testdata/r4/descriptors/RequestGroup.descriptor.prototxt @@ -277,8 +277,6 @@ field { type_name: ".google.fhir.r4.core.RequestGroup.Action" options { [google.fhir.proto.field_description]: "Proposed actions, if any" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "resource.exists() != action.exists()" } } nested_type { @@ -472,7 +470,6 @@ nested_type { type_name: ".google.fhir.r4.core.RequestGroup.Action.Condition" options { [google.fhir.proto.field_description]: "Whether or not the action is applicable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -483,7 +480,6 @@ nested_type { type_name: ".google.fhir.r4.core.RequestGroup.Action.RelatedAction" options { [google.fhir.proto.field_description]: "Relationship to another action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1009,6 +1005,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "resource.exists() != action.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/ResearchDefinition.descriptor.prototxt b/testdata/r4/descriptors/ResearchDefinition.descriptor.prototxt index 275a6f872..46e8d0101 100644 --- a/testdata/r4/descriptors/ResearchDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/ResearchDefinition.descriptor.prototxt @@ -490,4 +490,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ResearchDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nA research context or question.\nSee http://hl7.org/fhir/StructureDefinition/ResearchDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ResearchDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/ResearchElementDefinition.descriptor.prototxt b/testdata/r4/descriptors/ResearchElementDefinition.descriptor.prototxt index 15d7304e2..a0c941b06 100644 --- a/testdata/r4/descriptors/ResearchElementDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/ResearchElementDefinition.descriptor.prototxt @@ -416,7 +416,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "What defines the members of the research element" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -863,4 +862,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ResearchElementDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nA population, intervention, or exposure definition.\nSee http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/ResearchStudy.descriptor.prototxt b/testdata/r4/descriptors/ResearchStudy.descriptor.prototxt index 7d1ac2fd5..834b07d6f 100644 --- a/testdata/r4/descriptors/ResearchStudy.descriptor.prototxt +++ b/testdata/r4/descriptors/ResearchStudy.descriptor.prototxt @@ -321,7 +321,6 @@ field { type_name: ".google.fhir.r4.core.ResearchStudy.Arm" options { [google.fhir.proto.field_description]: "Defined path through the study for a subject" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -332,7 +331,6 @@ field { type_name: ".google.fhir.r4.core.ResearchStudy.Objective" options { [google.fhir.proto.field_description]: "A goal for the study" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/RiskAssessment.descriptor.prototxt b/testdata/r4/descriptors/RiskAssessment.descriptor.prototxt index 4d4ce6bad..7d9c0a729 100644 --- a/testdata/r4/descriptors/RiskAssessment.descriptor.prototxt +++ b/testdata/r4/descriptors/RiskAssessment.descriptor.prototxt @@ -249,8 +249,6 @@ field { type_name: ".google.fhir.r4.core.RiskAssessment.Prediction" options { [google.fhir.proto.field_description]: "Outcome predicted" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "probability is decimal implies (probability as decimal) <= 100" } } field { @@ -375,7 +373,6 @@ nested_type { type_name: ".google.fhir.r4.core.RiskAssessment.Prediction.ProbabilityX" options { [google.fhir.proto.field_description]: "Likelihood of specified outcome" - [google.fhir.proto.fhir_path_constraint]: "(low.empty() or ((low.code = \'%\') and (low.system = %ucum))) and (high.empty() or ((high.code = \'%\') and (high.system = %ucum)))" } } field { @@ -438,6 +435,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "(low.empty() or ((low.code = \'%\') and (low.system = %ucum))) and (high.empty() or ((high.code = \'%\') and (high.system = %ucum)))" } oneof_decl { name: "choice" @@ -468,6 +466,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "probability is decimal implies (probability as decimal) <= 100" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/RiskEvidenceSynthesis.descriptor.prototxt b/testdata/r4/descriptors/RiskEvidenceSynthesis.descriptor.prototxt index fc1051d1a..5e4de74a9 100644 --- a/testdata/r4/descriptors/RiskEvidenceSynthesis.descriptor.prototxt +++ b/testdata/r4/descriptors/RiskEvidenceSynthesis.descriptor.prototxt @@ -379,7 +379,6 @@ field { type_name: ".google.fhir.r4.core.RiskEvidenceSynthesis.SampleSize" options { [google.fhir.proto.field_description]: "What sample size was involved?" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -390,7 +389,6 @@ field { type_name: ".google.fhir.r4.core.RiskEvidenceSynthesis.RiskEstimate" options { [google.fhir.proto.field_description]: "What was the estimated risk" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -401,7 +399,6 @@ field { type_name: ".google.fhir.r4.core.RiskEvidenceSynthesis.Certainty" options { [google.fhir.proto.field_description]: "How certain is the risk" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -594,7 +591,6 @@ nested_type { type_name: ".google.fhir.r4.core.RiskEvidenceSynthesis.RiskEstimate.PrecisionEstimate" options { [google.fhir.proto.field_description]: "How precise the estimate is" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -731,7 +727,6 @@ nested_type { type_name: ".google.fhir.r4.core.RiskEvidenceSynthesis.Certainty.CertaintySubcomponent" options { [google.fhir.proto.field_description]: "A component that contributes to the overall certainty" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -802,4 +797,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for RiskEvidenceSynthesis, last updated 2018-12-27T22:37:54.724+11:00.\nA quantified estimate of risk based on a body of evidence.\nSee http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/SearchParameter.descriptor.prototxt b/testdata/r4/descriptors/SearchParameter.descriptor.prototxt index 8573485b5..8eb60d8fc 100644 --- a/testdata/r4/descriptors/SearchParameter.descriptor.prototxt +++ b/testdata/r4/descriptors/SearchParameter.descriptor.prototxt @@ -350,7 +350,6 @@ field { type_name: ".google.fhir.r4.core.SearchParameter.Component" options { [google.fhir.proto.field_description]: "For Composite resources to define the parts" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -601,4 +600,7 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for SearchParameter, last updated 2018-12-27T22:37:54.724+11:00.\nSearch parameter for a resource.\nSee http://hl7.org/fhir/StructureDefinition/SearchParameter" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/SearchParameter" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" + [google.fhir.proto.fhir_path_message_constraint]: "xpath.empty() or xpathUsage.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "chain.empty() or type = \'reference\'" } diff --git a/testdata/r4/descriptors/ServiceRequest.descriptor.prototxt b/testdata/r4/descriptors/ServiceRequest.descriptor.prototxt index 79a560ab4..3941a580e 100644 --- a/testdata/r4/descriptors/ServiceRequest.descriptor.prototxt +++ b/testdata/r4/descriptors/ServiceRequest.descriptor.prototxt @@ -627,4 +627,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ServiceRequest, last updated 2018-12-27T22:37:54.724+11:00.\nA request for a service to be performed.\nSee http://hl7.org/fhir/StructureDefinition/ServiceRequest" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ServiceRequest" + [google.fhir.proto.fhir_path_message_constraint]: "orderDetail.empty() or code.exists()" } diff --git a/testdata/r4/descriptors/SimpleQuantity.descriptor.prototxt b/testdata/r4/descriptors/SimpleQuantity.descriptor.prototxt index 44e422a72..105558152 100644 --- a/testdata/r4/descriptors/SimpleQuantity.descriptor.prototxt +++ b/testdata/r4/descriptors/SimpleQuantity.descriptor.prototxt @@ -70,4 +70,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for SimpleQuantity, last updated 2018-12-27T22:37:54.724+11:00.\nA fixed quantity (no comparator).\nSee http://hl7.org/fhir/StructureDefinition/SimpleQuantity" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Quantity" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/SimpleQuantity" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "comparator.empty()" } diff --git a/testdata/r4/descriptors/Specimen.descriptor.prototxt b/testdata/r4/descriptors/Specimen.descriptor.prototxt index 02cfb7078..a7c73ed10 100644 --- a/testdata/r4/descriptors/Specimen.descriptor.prototxt +++ b/testdata/r4/descriptors/Specimen.descriptor.prototxt @@ -180,7 +180,6 @@ field { type_name: ".google.fhir.r4.core.Specimen.Collection" options { [google.fhir.proto.field_description]: "Collection details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -191,7 +190,6 @@ field { type_name: ".google.fhir.r4.core.Specimen.Processing" options { [google.fhir.proto.field_description]: "Processing and processing step details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -202,7 +200,6 @@ field { type_name: ".google.fhir.r4.core.Specimen.Container" options { [google.fhir.proto.field_description]: "Direct container of specimen (tube/slide, etc.)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/SpecimenDefinition.descriptor.prototxt b/testdata/r4/descriptors/SpecimenDefinition.descriptor.prototxt index 1eb631afb..c1c4d6e20 100644 --- a/testdata/r4/descriptors/SpecimenDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/SpecimenDefinition.descriptor.prototxt @@ -143,7 +143,6 @@ field { type_name: ".google.fhir.r4.core.SpecimenDefinition.TypeTested" options { [google.fhir.proto.field_description]: "Specimen in container intended for testing by lab" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -217,7 +216,6 @@ nested_type { type_name: ".google.fhir.r4.core.SpecimenDefinition.TypeTested.Container" options { [google.fhir.proto.field_description]: "The specimen\'s container" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -258,7 +256,6 @@ nested_type { type_name: ".google.fhir.r4.core.SpecimenDefinition.TypeTested.Handling" options { [google.fhir.proto.field_description]: "Specimen handling before testing" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -388,7 +385,6 @@ nested_type { type_name: ".google.fhir.r4.core.SpecimenDefinition.TypeTested.Container.Additive" options { [google.fhir.proto.field_description]: "Additive associated with container" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/StructureDefinition.descriptor.prototxt b/testdata/r4/descriptors/StructureDefinition.descriptor.prototxt index 17f5dcebc..d367ed793 100644 --- a/testdata/r4/descriptors/StructureDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/StructureDefinition.descriptor.prototxt @@ -266,8 +266,6 @@ field { type_name: ".google.fhir.r4.core.StructureDefinition.Mapping" options { [google.fhir.proto.field_description]: "External specification that the content is mapped to" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "name.exists() or uri.exists()" } } field { @@ -300,7 +298,6 @@ field { type_name: ".google.fhir.r4.core.StructureDefinition.Context" options { [google.fhir.proto.field_description]: "If an extension, where it can be used in instances" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -352,10 +349,6 @@ field { type_name: ".google.fhir.r4.core.StructureDefinition.Snapshot" options { [google.fhir.proto.field_description]: "Snapshot view of the structure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(%resource.kind = \'logical\' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&\'.\'))" - [google.fhir.proto.fhir_path_constraint]: "element.all(definition.exists() and min.exists() and max.exists())" - [google.fhir.proto.fhir_path_constraint]: "element.all(base.exists())" } } field { @@ -366,9 +359,6 @@ field { type_name: ".google.fhir.r4.core.StructureDefinition.Differential" options { [google.fhir.proto.field_description]: "Differential view of the structure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "element.where(path.contains(\'.\').not()).slicing.empty()" - [google.fhir.proto.fhir_path_constraint]: "(%resource.kind = \'logical\' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches(\'\\\\..*\',\'\')&\'.\')))" } } nested_type { @@ -498,6 +488,9 @@ nested_type { [google.fhir.proto.field_description]: "Versions, Issues, Scope limitations etc." } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "name.exists() or uri.exists()" + } } nested_type { name: "KindCode" @@ -679,6 +672,11 @@ nested_type { [google.fhir.proto.fhir_path_constraint]: "binding.empty() or binding.valueSet.exists() or binding.description.exists()" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(%resource.kind = \'logical\' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&\'.\'))" + [google.fhir.proto.fhir_path_message_constraint]: "element.all(definition.exists() and min.exists() and max.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "element.all(base.exists())" + } } nested_type { name: "Differential" @@ -723,9 +721,30 @@ nested_type { [google.fhir.proto.field_description]: "Definition of elements in the resource (if no StructureDefinition)" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "element.where(path.contains(\'.\').not()).slicing.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(%resource.kind = \'logical\' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches(\'\\\\..*\',\'\')&\'.\')))" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for StructureDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nStructural Definition.\nSee http://hl7.org/fhir/StructureDefinition/StructureDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/StructureDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "children().element.where(path.contains(\'.\').not()).label.empty() and children().element.where(path.contains(\'.\').not()).code.empty() and children().element.where(path.contains(\'.\').not()).requirements.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(kind!=\'logical\' and differential.element.first().path.contains(\'.\').not()) implies differential.element.first().type.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "url.startsWith(\'http://hl7.org/fhir/StructureDefinition\') implies (differential.element.type.code.all(hasValue() implies matches(\'^[a-zA-Z0-9]+$\')) and snapshot.element.type.code.all(hasValue() implies matches(\'^[a-zA-Z0-9]+$\')))" + [google.fhir.proto.fhir_path_message_constraint]: "snapshot.element.all(id) and snapshot.element.id.trace(\'ids\').isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "kind!=\'logical\' implies snapshot.element.first().type.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "contextInvariant.exists() implies type = \'Extension\'" + [google.fhir.proto.fhir_path_message_constraint]: "differential.element.all(id) and differential.element.id.trace(\'ids\').isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "(snapshot | differential).element.all(path.contains(\'.\').not() implies sliceName.empty())" + [google.fhir.proto.fhir_path_message_constraint]: "kind != \'logical\' implies snapshot.empty() or snapshot.element.first().path = type" + [google.fhir.proto.fhir_path_message_constraint]: "url.startsWith(\'http://hl7.org/fhir/StructureDefinition\') implies (snapshot.element.defaultValue.empty() and differential.element.defaultValue.empty())" + [google.fhir.proto.fhir_path_message_constraint]: "snapshot.element.all(id.exists()) and differential.element.all(id.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "derivation = \'constraint\' or snapshot.element.select(path).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "differential.element.defaultValue.exists() implies (derivation = \'specialization\')" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" + [google.fhir.proto.fhir_path_message_constraint]: "snapshot.exists() or differential.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "type != \'Extension\' or derivation = \'specialization\' or (context.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "abstract = true or baseDefinition.exists()" } diff --git a/testdata/r4/descriptors/StructureMap.descriptor.prototxt b/testdata/r4/descriptors/StructureMap.descriptor.prototxt index f6982ce5d..bd52ae797 100644 --- a/testdata/r4/descriptors/StructureMap.descriptor.prototxt +++ b/testdata/r4/descriptors/StructureMap.descriptor.prototxt @@ -246,7 +246,6 @@ field { type_name: ".google.fhir.r4.core.StructureMap.Structure" options { [google.fhir.proto.field_description]: "Structure Definition used by this map" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -268,7 +267,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Named sections for reader convenience" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -483,7 +481,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Named instance provided when invoking the map" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -495,7 +492,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Transform Rule from source to target" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -679,7 +675,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Source inputs to the mapping" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -690,9 +685,6 @@ nested_type { type_name: ".google.fhir.r4.core.StructureMap.Group.Rule.Target" options { [google.fhir.proto.field_description]: "Content to create because of this mapping rule" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "context.exists() implies contextType.exists()" - [google.fhir.proto.fhir_path_constraint]: "element.exists() implies context.exists()" } } field { @@ -713,7 +705,6 @@ nested_type { type_name: ".google.fhir.r4.core.StructureMap.Group.Rule.Dependent" options { [google.fhir.proto.field_description]: "Which other rules to apply in the context of this rule" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1409,7 +1400,6 @@ nested_type { type_name: ".google.fhir.r4.core.StructureMap.Group.Rule.Target.Parameter" options { [google.fhir.proto.field_description]: "Parameters to the transform" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1587,6 +1577,10 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "context.exists() implies contextType.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "element.exists() implies context.exists()" + } } nested_type { name: "Dependent" @@ -1649,4 +1643,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for StructureMap, last updated 2018-12-27T22:37:54.724+11:00.\nA Map of relationships between 2 structures that can be used to transform data.\nSee http://hl7.org/fhir/StructureDefinition/StructureMap" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/StructureMap" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Subscription.descriptor.prototxt b/testdata/r4/descriptors/Subscription.descriptor.prototxt index 3faf479f8..518f4d81c 100644 --- a/testdata/r4/descriptors/Subscription.descriptor.prototxt +++ b/testdata/r4/descriptors/Subscription.descriptor.prototxt @@ -157,7 +157,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "The channel on which to report matches to the criteria" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/Substance.descriptor.prototxt b/testdata/r4/descriptors/Substance.descriptor.prototxt index 79ac3104e..d506a2db1 100644 --- a/testdata/r4/descriptors/Substance.descriptor.prototxt +++ b/testdata/r4/descriptors/Substance.descriptor.prototxt @@ -144,7 +144,6 @@ field { type_name: ".google.fhir.r4.core.Substance.Instance" options { [google.fhir.proto.field_description]: "If this describes a specific package/container of the substance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -155,7 +154,6 @@ field { type_name: ".google.fhir.r4.core.Substance.Ingredient" options { [google.fhir.proto.field_description]: "Composition information about the substance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/SubstanceAmount.descriptor.prototxt b/testdata/r4/descriptors/SubstanceAmount.descriptor.prototxt index f4d2afe9d..aae5e4dfc 100644 --- a/testdata/r4/descriptors/SubstanceAmount.descriptor.prototxt +++ b/testdata/r4/descriptors/SubstanceAmount.descriptor.prototxt @@ -67,7 +67,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceAmount.ReferenceRange" options { [google.fhir.proto.field_description]: "Reference range of possible or expected values" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/SubstanceNucleicAcid.descriptor.prototxt b/testdata/r4/descriptors/SubstanceNucleicAcid.descriptor.prototxt index e1d1a21be..177f7cc49 100644 --- a/testdata/r4/descriptors/SubstanceNucleicAcid.descriptor.prototxt +++ b/testdata/r4/descriptors/SubstanceNucleicAcid.descriptor.prototxt @@ -133,7 +133,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceNucleicAcid.Subunit" options { [google.fhir.proto.field_description]: "Subunits are listed in order of decreasing length; sequences of the same length will be ordered by molecular weight; subunits that have identical sequences will be repeated multiple times" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -236,7 +235,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceNucleicAcid.Subunit.Linkage" options { [google.fhir.proto.field_description]: "The linkages between sugar residues will also be captured" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -247,7 +245,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceNucleicAcid.Subunit.Sugar" options { [google.fhir.proto.field_description]: "5.3.6.8.1 Sugar ID (Mandatory)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/SubstancePolymer.descriptor.prototxt b/testdata/r4/descriptors/SubstancePolymer.descriptor.prototxt index 8680062ba..95fa3e0c5 100644 --- a/testdata/r4/descriptors/SubstancePolymer.descriptor.prototxt +++ b/testdata/r4/descriptors/SubstancePolymer.descriptor.prototxt @@ -134,7 +134,6 @@ field { type_name: ".google.fhir.r4.core.SubstancePolymer.MonomerSet" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -145,7 +144,6 @@ field { type_name: ".google.fhir.r4.core.SubstancePolymer.Repeat" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -198,7 +196,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstancePolymer.MonomerSet.StartingMaterial" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -345,7 +342,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstancePolymer.Repeat.RepeatUnit" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -418,7 +414,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstancePolymer.Repeat.RepeatUnit.DegreeOfPolymerisation" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -429,7 +424,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstancePolymer.Repeat.RepeatUnit.StructuralRepresentation" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/SubstanceProtein.descriptor.prototxt b/testdata/r4/descriptors/SubstanceProtein.descriptor.prototxt index 57aabc1f1..36a81e618 100644 --- a/testdata/r4/descriptors/SubstanceProtein.descriptor.prototxt +++ b/testdata/r4/descriptors/SubstanceProtein.descriptor.prototxt @@ -123,7 +123,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceProtein.Subunit" options { [google.fhir.proto.field_description]: "This subclause refers to the description of each subunit constituting the SubstanceProtein. A subunit is a linear sequence of amino acids linked through peptide bonds. The Subunit information shall be provided when the finished SubstanceProtein is a complex of multiple sequences; subunits are not used to delineate domains within a single sequence. Subunits are listed in order of decreasing length; sequences of the same length will be ordered by decreasing molecular weight; subunits that have identical sequences will be repeated multiple times" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/SubstanceReferenceInformation.descriptor.prototxt b/testdata/r4/descriptors/SubstanceReferenceInformation.descriptor.prototxt index 507b9f566..f2928ad9b 100644 --- a/testdata/r4/descriptors/SubstanceReferenceInformation.descriptor.prototxt +++ b/testdata/r4/descriptors/SubstanceReferenceInformation.descriptor.prototxt @@ -103,7 +103,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceReferenceInformation.Gene" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -114,7 +113,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceReferenceInformation.GeneElement" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -125,7 +123,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceReferenceInformation.Classification" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -136,7 +133,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceReferenceInformation.Target" options { [google.fhir.proto.field_description]: "Todo" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/SubstanceSourceMaterial.descriptor.prototxt b/testdata/r4/descriptors/SubstanceSourceMaterial.descriptor.prototxt index 109b81d1e..e17c37296 100644 --- a/testdata/r4/descriptors/SubstanceSourceMaterial.descriptor.prototxt +++ b/testdata/r4/descriptors/SubstanceSourceMaterial.descriptor.prototxt @@ -193,7 +193,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSourceMaterial.FractionDescription" options { [google.fhir.proto.field_description]: "Many complex materials are fractions of parts of plants, animals, or minerals. Fraction elements are often necessary to define both Substances and Specified Group 1 Substances. For substances derived from Plants, fraction information will be captured at the Substance information level ( . Oils, Juices and Exudates). Additional information for Extracts, such as extraction solvent composition, will be captured at the Specified Substance Group 1 information level. For plasma-derived products fraction information will be captured at the Substance and the Specified Substance Group 1 levels" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -204,7 +203,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSourceMaterial.Organism" options { [google.fhir.proto.field_description]: "This subclause describes the organism which the substance is derived from. For vaccines, the parent organism shall be specified based on these subclause elements. As an example, full taxonomy will be described for the Substance Name: ., Leaf" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -215,7 +213,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSourceMaterial.PartDescription" options { [google.fhir.proto.field_description]: "To do" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -361,7 +358,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceSourceMaterial.Organism.Author" options { [google.fhir.proto.field_description]: "4.9.13.6.1 Author type (Conditional)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -372,7 +368,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceSourceMaterial.Organism.Hybrid" options { [google.fhir.proto.field_description]: "4.9.13.8.1 Hybrid species maternal organism ID (Optional)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -383,7 +378,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceSourceMaterial.Organism.OrganismGeneral" options { [google.fhir.proto.field_description]: "4.9.13.7.1 Kingdom (Conditional)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/SubstanceSpecification.descriptor.prototxt b/testdata/r4/descriptors/SubstanceSpecification.descriptor.prototxt index 4d62de123..7d57a0978 100644 --- a/testdata/r4/descriptors/SubstanceSpecification.descriptor.prototxt +++ b/testdata/r4/descriptors/SubstanceSpecification.descriptor.prototxt @@ -164,7 +164,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSpecification.Moiety" options { [google.fhir.proto.field_description]: "Moiety, for structural modifications" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -175,7 +174,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSpecification.Property" options { [google.fhir.proto.field_description]: "General specifications for this substance, including how it is related to other substances" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -197,7 +195,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSpecification.Structure" options { [google.fhir.proto.field_description]: "Structural information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -208,7 +205,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSpecification.CodeType" options { [google.fhir.proto.field_description]: "Codes associated with the substance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -219,7 +215,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSpecification.Name" options { [google.fhir.proto.field_description]: "Names applicable to this substance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -240,7 +235,6 @@ field { type_name: ".google.fhir.r4.core.SubstanceSpecification.Relationship" options { [google.fhir.proto.field_description]: "A link between this substance and another, with details of the relationship" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -634,7 +628,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceSpecification.Structure.Isotope" options { [google.fhir.proto.field_description]: "Applicable for single substances that contain a radionuclide or a non-natural isotopic ratio" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -666,7 +659,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceSpecification.Structure.Representation" options { [google.fhir.proto.field_description]: "Molecular structural representation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -749,7 +741,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceSpecification.Structure.Isotope.MolecularWeight" options { [google.fhir.proto.field_description]: "The molecular weight or weight range (for proteins, polymers or nucleic acids)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1095,7 +1086,6 @@ nested_type { type_name: ".google.fhir.r4.core.SubstanceSpecification.Name.Official" options { [google.fhir.proto.field_description]: "Details of the official nature of this name" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/SupplyDelivery.descriptor.prototxt b/testdata/r4/descriptors/SupplyDelivery.descriptor.prototxt index 0474ec612..19b2ad331 100644 --- a/testdata/r4/descriptors/SupplyDelivery.descriptor.prototxt +++ b/testdata/r4/descriptors/SupplyDelivery.descriptor.prototxt @@ -157,7 +157,6 @@ field { type_name: ".google.fhir.r4.core.SupplyDelivery.SuppliedItem" options { [google.fhir.proto.field_description]: "The item that is delivered or supplied" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/SupplyRequest.descriptor.prototxt b/testdata/r4/descriptors/SupplyRequest.descriptor.prototxt index 5d27b6208..d3b4a5bdc 100644 --- a/testdata/r4/descriptors/SupplyRequest.descriptor.prototxt +++ b/testdata/r4/descriptors/SupplyRequest.descriptor.prototxt @@ -155,7 +155,6 @@ field { type_name: ".google.fhir.r4.core.SupplyRequest.Parameter" options { [google.fhir.proto.field_description]: "Ordered item details" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/Task.descriptor.prototxt b/testdata/r4/descriptors/Task.descriptor.prototxt index 3c5bb048e..3a279365b 100644 --- a/testdata/r4/descriptors/Task.descriptor.prototxt +++ b/testdata/r4/descriptors/Task.descriptor.prototxt @@ -400,7 +400,6 @@ field { type_name: ".google.fhir.r4.core.Task.Restriction" options { [google.fhir.proto.field_description]: "Constraints on fulfillment tasks" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -411,7 +410,6 @@ field { type_name: ".google.fhir.r4.core.Task.Parameter" options { [google.fhir.proto.field_description]: "Information used to perform task" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -422,7 +420,6 @@ field { type_name: ".google.fhir.r4.core.Task.Output" options { [google.fhir.proto.field_description]: "Information produced as part of task" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -1493,4 +1490,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Task, last updated 2018-12-27T22:37:54.724+11:00.\nA task to be performed.\nSee http://hl7.org/fhir/StructureDefinition/Task" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/Task" + [google.fhir.proto.fhir_path_message_constraint]: "lastModified.exists().not() or authoredOn.exists().not() or lastModified >= authoredOn" } diff --git a/testdata/r4/descriptors/TerminologyCapabilities.descriptor.prototxt b/testdata/r4/descriptors/TerminologyCapabilities.descriptor.prototxt index b869b683b..20425a58a 100644 --- a/testdata/r4/descriptors/TerminologyCapabilities.descriptor.prototxt +++ b/testdata/r4/descriptors/TerminologyCapabilities.descriptor.prototxt @@ -246,7 +246,6 @@ field { type_name: ".google.fhir.r4.core.TerminologyCapabilities.Software" options { [google.fhir.proto.field_description]: "Software that is covered by this terminology capability statement" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -257,7 +256,6 @@ field { type_name: ".google.fhir.r4.core.TerminologyCapabilities.Implementation" options { [google.fhir.proto.field_description]: "If this describes a specific instance" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -278,8 +276,6 @@ field { type_name: ".google.fhir.r4.core.TerminologyCapabilities.CodeSystem" options { [google.fhir.proto.field_description]: "A code system supported by the server" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "version.count() > 1 implies version.all(code.exists())" } } field { @@ -290,7 +286,6 @@ field { type_name: ".google.fhir.r4.core.TerminologyCapabilities.Expansion" options { [google.fhir.proto.field_description]: "Information about the [ValueSet/$expand](valueset-operation-expand.html) operation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -311,7 +306,6 @@ field { type_name: ".google.fhir.r4.core.TerminologyCapabilities.ValidateCode" options { [google.fhir.proto.field_description]: "Information about the [ValueSet/$validate-code](valueset-operation-validate-code.html) operation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -322,7 +316,6 @@ field { type_name: ".google.fhir.r4.core.TerminologyCapabilities.Translation" options { [google.fhir.proto.field_description]: "Information about the [ConceptMap/$translate](conceptmap-operation-translate.html) operation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -333,7 +326,6 @@ field { type_name: ".google.fhir.r4.core.TerminologyCapabilities.Closure" options { [google.fhir.proto.field_description]: "Information about the [ConceptMap/$closure](conceptmap-operation-closure.html) operation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -548,7 +540,6 @@ nested_type { type_name: ".google.fhir.r4.core.TerminologyCapabilities.CodeSystem.Version" options { [google.fhir.proto.field_description]: "Version of Code System supported" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -641,7 +632,6 @@ nested_type { type_name: ".google.fhir.r4.core.TerminologyCapabilities.CodeSystem.Version.Filter" options { [google.fhir.proto.field_description]: "Filter Properties supported" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -710,6 +700,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "version.count() > 1 implies version.all(code.exists())" + } } nested_type { name: "Expansion" @@ -781,7 +774,6 @@ nested_type { type_name: ".google.fhir.r4.core.TerminologyCapabilities.Expansion.Parameter" options { [google.fhir.proto.field_description]: "Supported expansion parameter" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1011,4 +1003,9 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for TerminologyCapabilities, last updated 2018-12-27T22:37:54.724+11:00.\nA statement of system capabilities.\nSee http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" + [google.fhir.proto.fhir_path_message_constraint]: "(kind != \'instance\') or implementation.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "(description.count() + software.count() + implementation.count()) > 0" + [google.fhir.proto.fhir_path_message_constraint]: "(kind!=\'requirements\') or (implementation.exists().not() and software.exists().not())" + [google.fhir.proto.fhir_path_message_constraint]: "(kind != \'capability\') or (implementation.exists().not() and software.exists())" } diff --git a/testdata/r4/descriptors/TestReport.descriptor.prototxt b/testdata/r4/descriptors/TestReport.descriptor.prototxt index 51aa65230..929be78ce 100644 --- a/testdata/r4/descriptors/TestReport.descriptor.prototxt +++ b/testdata/r4/descriptors/TestReport.descriptor.prototxt @@ -177,7 +177,6 @@ field { type_name: ".google.fhir.r4.core.TestReport.Participant" options { [google.fhir.proto.field_description]: "A participant in the test execution, either the execution engine, a client, or a server" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -188,7 +187,6 @@ field { type_name: ".google.fhir.r4.core.TestReport.Setup" options { [google.fhir.proto.field_description]: "The results of the series of required setup operations before the tests were executed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -199,7 +197,6 @@ field { type_name: ".google.fhir.r4.core.TestReport.Test" options { [google.fhir.proto.field_description]: "A test executed from the test script" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -210,7 +207,6 @@ field { type_name: ".google.fhir.r4.core.TestReport.Teardown" options { [google.fhir.proto.field_description]: "The results of running the series of required clean up steps" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -400,8 +396,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A setup operation or assert that was executed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "operation.exists() xor assert.exists()" } } nested_type { @@ -444,7 +438,6 @@ nested_type { type_name: ".google.fhir.r4.core.TestReport.Setup.SetupAction.Operation" options { [google.fhir.proto.field_description]: "The operation to perform" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -455,7 +448,6 @@ nested_type { type_name: ".google.fhir.r4.core.TestReport.Setup.SetupAction.Assert" options { [google.fhir.proto.field_description]: "The assertion to perform" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } json_name: "assert" } @@ -641,6 +633,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "operation.exists() xor assert.exists()" + } } } nested_type { @@ -704,8 +699,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A test operation or assert that was performed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "operation.exists() xor assert.exists()" } } nested_type { @@ -761,6 +754,9 @@ nested_type { } json_name: "assert" } + options { + [google.fhir.proto.fhir_path_message_constraint]: "operation.exists() xor assert.exists()" + } } } nested_type { @@ -804,7 +800,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "One or more teardown operations performed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/TestScript.descriptor.prototxt b/testdata/r4/descriptors/TestScript.descriptor.prototxt index 116f7df54..43374e8cf 100644 --- a/testdata/r4/descriptors/TestScript.descriptor.prototxt +++ b/testdata/r4/descriptors/TestScript.descriptor.prototxt @@ -246,7 +246,6 @@ field { type_name: ".google.fhir.r4.core.TestScript.Origin" options { [google.fhir.proto.field_description]: "An abstract server representing a client or sender in a message exchange" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -257,7 +256,6 @@ field { type_name: ".google.fhir.r4.core.TestScript.Destination" options { [google.fhir.proto.field_description]: "An abstract server representing a destination or receiver in a message exchange" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -268,8 +266,6 @@ field { type_name: ".google.fhir.r4.core.TestScript.Metadata" options { [google.fhir.proto.field_description]: "Required capability that is assumed to function correctly on the FHIR server being tested" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "capability.required.exists() or capability.validated.exists()" } } field { @@ -280,7 +276,6 @@ field { type_name: ".google.fhir.r4.core.TestScript.Fixture" options { [google.fhir.proto.field_description]: "Fixture in the test script - by reference (uri)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -302,8 +297,6 @@ field { type_name: ".google.fhir.r4.core.TestScript.Variable" options { [google.fhir.proto.field_description]: "Placeholder for evaluated elements" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "expression.empty() or headerField.empty() or path.empty()" } } field { @@ -314,7 +307,6 @@ field { type_name: ".google.fhir.r4.core.TestScript.Setup" options { [google.fhir.proto.field_description]: "A series of required setup operations before tests are executed" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -325,7 +317,6 @@ field { type_name: ".google.fhir.r4.core.TestScript.Test" options { [google.fhir.proto.field_description]: "A test in this script" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -336,7 +327,6 @@ field { type_name: ".google.fhir.r4.core.TestScript.Teardown" options { [google.fhir.proto.field_description]: "A series of required clean up steps" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -516,7 +506,6 @@ nested_type { type_name: ".google.fhir.r4.core.TestScript.Metadata.Link" options { [google.fhir.proto.field_description]: "Links to the FHIR specification" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -528,7 +517,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Capabilities that are assumed to function correctly on the FHIR server being tested" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -691,6 +679,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "capability.required.exists() or capability.validated.exists()" + } } nested_type { name: "Fixture" @@ -871,6 +862,9 @@ nested_type { [google.fhir.proto.field_description]: "Fixture Id of source expression or headerField within this variable" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "expression.empty() or headerField.empty() or path.empty()" + } } nested_type { name: "Setup" @@ -913,8 +907,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A setup operation or assert to perform" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "operation.exists() xor assert.exists()" } } nested_type { @@ -957,8 +949,6 @@ nested_type { type_name: ".google.fhir.r4.core.TestScript.Setup.SetupAction.Operation" options { [google.fhir.proto.field_description]: "The setup operation to perform" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in (\'capabilities\' |\'search\' | \'transaction\' | \'history\'))" } } field { @@ -969,10 +959,6 @@ nested_type { type_name: ".google.fhir.r4.core.TestScript.Setup.SetupAction.Assert" options { [google.fhir.proto.field_description]: "The assertion to perform" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(response.empty() and responseCode.empty() and direction = \'request\') or direction.empty() or direction = \'response\'" - [google.fhir.proto.fhir_path_constraint]: "extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <=1)" - [google.fhir.proto.fhir_path_constraint]: "compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())" } json_name: "assert" } @@ -1127,7 +1113,6 @@ nested_type { type_name: ".google.fhir.r4.core.TestScript.Setup.SetupAction.Operation.RequestHeader" options { [google.fhir.proto.field_description]: "Each operation can have one or more header elements" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1359,6 +1344,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "sourceId.exists() or (targetId.count() + url.count() + params.count() = 1) or (type.code in (\'capabilities\' |\'search\' | \'transaction\' | \'history\'))" + } } nested_type { name: "Assert" @@ -1784,6 +1772,14 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(response.empty() and responseCode.empty() and direction = \'request\') or direction.empty() or direction = \'response\'" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() or (contentType.count() + expression.count() + headerField.count() + minimumId.count() + navigationLinks.count() + path.count() + requestMethod.count() + resource.count() + responseCode.count() + response.count() + validateProfileId.count() <=1)" + [google.fhir.proto.fhir_path_message_constraint]: "compareToSourceId.empty() xor (compareToSourceExpression.exists() or compareToSourcePath.exists())" + } + } + options { + [google.fhir.proto.fhir_path_message_constraint]: "operation.exists() xor assert.exists()" } } } @@ -1848,8 +1844,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A test operation or assert to perform" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "operation.exists() xor assert.exists()" } } nested_type { @@ -1909,6 +1903,9 @@ nested_type { } json_name: "assert" } + options { + [google.fhir.proto.fhir_path_message_constraint]: "operation.exists() xor assert.exists()" + } } } nested_type { @@ -1952,7 +1949,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "One or more teardown operations to perform" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -2005,4 +2001,5 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for TestScript, last updated 2018-12-27T22:37:54.724+11:00.\nDescribes a set of tests.\nSee http://hl7.org/fhir/StructureDefinition/TestScript" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/TestScript" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/Timing.descriptor.prototxt b/testdata/r4/descriptors/Timing.descriptor.prototxt index 2c4980548..8f3c87e76 100644 --- a/testdata/r4/descriptors/Timing.descriptor.prototxt +++ b/testdata/r4/descriptors/Timing.descriptor.prototxt @@ -47,16 +47,6 @@ field { type_name: ".google.fhir.r4.core.Timing.Repeat" options { [google.fhir.proto.field_description]: "When the event is to occur" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "offset.empty() or (when.exists() and ((when in (\'C\' | \'CM\' | \'CD\' | \'CV\')).not()))" - [google.fhir.proto.fhir_path_constraint]: "period.exists() implies period >= 0" - [google.fhir.proto.fhir_path_constraint]: "periodMax.empty() or period.exists()" - [google.fhir.proto.fhir_path_constraint]: "durationMax.empty() or duration.exists()" - [google.fhir.proto.fhir_path_constraint]: "countMax.empty() or count.exists()" - [google.fhir.proto.fhir_path_constraint]: "duration.empty() or durationUnit.exists()" - [google.fhir.proto.fhir_path_constraint]: "timeOfDay.empty() or when.empty()" - [google.fhir.proto.fhir_path_constraint]: "period.empty() or periodUnit.exists()" - [google.fhir.proto.fhir_path_constraint]: "duration.exists() implies duration >= 0" } } field { @@ -382,6 +372,17 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "offset.empty() or (when.exists() and ((when in (\'C\' | \'CM\' | \'CD\' | \'CV\')).not()))" + [google.fhir.proto.fhir_path_message_constraint]: "period.exists() implies period >= 0" + [google.fhir.proto.fhir_path_message_constraint]: "periodMax.empty() or period.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "durationMax.empty() or duration.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "countMax.empty() or count.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "duration.empty() or durationUnit.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "timeOfDay.empty() or when.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "period.empty() or periodUnit.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "duration.exists() implies duration >= 0" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE diff --git a/testdata/r4/descriptors/TriggerDefinition.descriptor.prototxt b/testdata/r4/descriptors/TriggerDefinition.descriptor.prototxt index d057be0cd..54d6932e6 100644 --- a/testdata/r4/descriptors/TriggerDefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/TriggerDefinition.descriptor.prototxt @@ -145,4 +145,7 @@ options { [google.fhir.proto.structure_definition_kind]: KIND_COMPLEX_TYPE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for TriggerDefinition, last updated 2018-12-27T22:37:54.724+11:00.\nDefines an expected trigger for a module.\nSee http://hl7.org/fhir/StructureDefinition/TriggerDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/TriggerDefinition" + [google.fhir.proto.fhir_path_message_constraint]: "(type = \'named-event\' implies name.exists()) and (type = \'periodic\' implies timing.exists()) and (type.startsWith(\'data-\') implies data.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "condition.exists() implies data.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "data.empty() or timing.empty()" } diff --git a/testdata/r4/descriptors/ValueSet.descriptor.prototxt b/testdata/r4/descriptors/ValueSet.descriptor.prototxt index 7ac48b38f..85b6b18c3 100644 --- a/testdata/r4/descriptors/ValueSet.descriptor.prototxt +++ b/testdata/r4/descriptors/ValueSet.descriptor.prototxt @@ -254,7 +254,6 @@ field { type_name: ".google.fhir.r4.core.ValueSet.Compose" options { [google.fhir.proto.field_description]: "Content logical definition of the value set (CLD)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -265,7 +264,6 @@ field { type_name: ".google.fhir.r4.core.ValueSet.Expansion" options { [google.fhir.proto.field_description]: "Used when the value set is \"expanded\"" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -356,10 +354,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Include one or more codes from a code system or other value set(s)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(concept.exists() or filter.exists()) implies system.exists()" - [google.fhir.proto.fhir_path_constraint]: "concept.empty() or filter.empty()" - [google.fhir.proto.fhir_path_constraint]: "valueSet.exists() or system.exists()" } } field { @@ -432,7 +426,6 @@ nested_type { type_name: ".google.fhir.r4.core.ValueSet.Compose.ConceptSet.ConceptReference" options { [google.fhir.proto.field_description]: "A concept defined in the system" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -443,7 +436,6 @@ nested_type { type_name: ".google.fhir.r4.core.ValueSet.Compose.ConceptSet.Filter" options { [google.fhir.proto.field_description]: "Select codes/concepts by their properties (including relationships)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -517,7 +509,6 @@ nested_type { type_name: ".google.fhir.r4.core.ValueSet.Compose.ConceptSet.ConceptReference.Designation" options { [google.fhir.proto.field_description]: "Additional representations for this concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -678,6 +669,11 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(concept.exists() or filter.exists()) implies system.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "concept.empty() or filter.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "valueSet.exists() or system.exists()" + } } } nested_type { @@ -761,7 +757,6 @@ nested_type { type_name: ".google.fhir.r4.core.ValueSet.Expansion.Parameter" options { [google.fhir.proto.field_description]: "Parameter that controlled the expansion process" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -772,10 +767,6 @@ nested_type { type_name: ".google.fhir.r4.core.ValueSet.Expansion.Contains" options { [google.fhir.proto.field_description]: "Codes in the value set" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "code.exists() or display.exists()" - [google.fhir.proto.fhir_path_constraint]: "code.exists() or abstract = true" - [google.fhir.proto.fhir_path_constraint]: "code.empty() or system.exists()" } } nested_type { @@ -1010,10 +1001,16 @@ nested_type { [google.fhir.proto.field_description]: "Codes contained under this entry" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "code.exists() or display.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "code.exists() or abstract = true" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" + } } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ValueSet, last updated 2018-12-27T22:37:54.724+11:00.\nA set of codes drawn from one or more code systems.\nSee http://hl7.org/fhir/StructureDefinition/ValueSet" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ValueSet" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/VerificationResult.descriptor.prototxt b/testdata/r4/descriptors/VerificationResult.descriptor.prototxt index 95feaed0d..d383a0852 100644 --- a/testdata/r4/descriptors/VerificationResult.descriptor.prototxt +++ b/testdata/r4/descriptors/VerificationResult.descriptor.prototxt @@ -205,7 +205,6 @@ field { type_name: ".google.fhir.r4.core.VerificationResult.PrimarySource" options { [google.fhir.proto.field_description]: "Information about the primary source(s) involved in validation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -216,7 +215,6 @@ field { type_name: ".google.fhir.r4.core.VerificationResult.Attestation" options { [google.fhir.proto.field_description]: "Information about the entity attesting to information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -227,7 +225,6 @@ field { type_name: ".google.fhir.r4.core.VerificationResult.Validator" options { [google.fhir.proto.field_description]: "Information about the entity validating information" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { diff --git a/testdata/r4/descriptors/VisionPrescription.descriptor.prototxt b/testdata/r4/descriptors/VisionPrescription.descriptor.prototxt index 8f4020427..0512c5be7 100644 --- a/testdata/r4/descriptors/VisionPrescription.descriptor.prototxt +++ b/testdata/r4/descriptors/VisionPrescription.descriptor.prototxt @@ -173,7 +173,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Vision lens authorization" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -295,7 +294,6 @@ nested_type { type_name: ".google.fhir.r4.core.VisionPrescription.LensSpecification.Prism" options { [google.fhir.proto.field_description]: "Eye alignment compensation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/actualgroup.descriptor.prototxt b/testdata/r4/descriptors/actualgroup.descriptor.prototxt index a4970175d..49b775aa7 100644 --- a/testdata/r4/descriptors/actualgroup.descriptor.prototxt +++ b/testdata/r4/descriptors/actualgroup.descriptor.prototxt @@ -185,7 +185,6 @@ field { type_name: ".google.fhir.r4.core.ActualGroup.Member" options { [google.fhir.proto.field_description]: "Who or what is in group" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -291,4 +290,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Actual Group.\nGroup of multiple entities.\nSee http://hl7.org/fhir/StructureDefinition/actualgroup" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Group" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/actualgroup" + [google.fhir.proto.fhir_path_message_constraint]: "member.empty() or (actual = true)" } diff --git a/testdata/r4/descriptors/allergyintolerance-assertedDate.descriptor.prototxt b/testdata/r4/descriptors/allergyintolerance-assertedDate.descriptor.prototxt index 440bba6ba..121774820 100644 --- a/testdata/r4/descriptors/allergyintolerance-assertedDate.descriptor.prototxt +++ b/testdata/r4/descriptors/allergyintolerance-assertedDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for assertedDate.\nDate the allergy or intolerance was first asserted.\nSee http://hl7.org/fhir/StructureDefinition/allergyintolerance-assertedDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/allergyintolerance-assertedDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/allergyintolerance-certainty.descriptor.prototxt b/testdata/r4/descriptors/allergyintolerance-certainty.descriptor.prototxt index 0edf81b65..6d32a5e83 100644 --- a/testdata/r4/descriptors/allergyintolerance-certainty.descriptor.prototxt +++ b/testdata/r4/descriptors/allergyintolerance-certainty.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for certainty.\nCertainty that the substance was the cause of the manifestation.\nSee http://hl7.org/fhir/StructureDefinition/allergyintolerance-certainty" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/allergyintolerance-certainty" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/allergyintolerance-duration.descriptor.prototxt b/testdata/r4/descriptors/allergyintolerance-duration.descriptor.prototxt index c90b6ff13..78d8a4f7d 100644 --- a/testdata/r4/descriptors/allergyintolerance-duration.descriptor.prototxt +++ b/testdata/r4/descriptors/allergyintolerance-duration.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for duration.\nHow long Manifestations persisted.\nSee http://hl7.org/fhir/StructureDefinition/allergyintolerance-duration" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/allergyintolerance-duration" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/allergyintolerance-reasonRefuted.descriptor.prototxt b/testdata/r4/descriptors/allergyintolerance-reasonRefuted.descriptor.prototxt index 888baea70..ed66fa42a 100644 --- a/testdata/r4/descriptors/allergyintolerance-reasonRefuted.descriptor.prototxt +++ b/testdata/r4/descriptors/allergyintolerance-reasonRefuted.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reasonRefuted.\nExplanation associated with refuted status.\nSee http://hl7.org/fhir/StructureDefinition/allergyintolerance-reasonRefuted" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/allergyintolerance-reasonRefuted" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/allergyintolerance-resolutionAge.descriptor.prototxt b/testdata/r4/descriptors/allergyintolerance-resolutionAge.descriptor.prototxt index 1641af287..c6c4b0863 100644 --- a/testdata/r4/descriptors/allergyintolerance-resolutionAge.descriptor.prototxt +++ b/testdata/r4/descriptors/allergyintolerance-resolutionAge.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for resolutionAge.\nAge that the allergy or intolerance resolved.\nSee http://hl7.org/fhir/StructureDefinition/allergyintolerance-resolutionAge" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/allergyintolerance-resolutionAge" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/allergyintolerance-substanceExposureRisk.descriptor.prototxt b/testdata/r4/descriptors/allergyintolerance-substanceExposureRisk.descriptor.prototxt index f621c9b9f..c860d3628 100644 --- a/testdata/r4/descriptors/allergyintolerance-substanceExposureRisk.descriptor.prototxt +++ b/testdata/r4/descriptors/allergyintolerance-substanceExposureRisk.descriptor.prototxt @@ -46,4 +46,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for substanceExposureRisk.\nExposure risk of adverse reaction (allergy or intolerance) to the specified substance/product.\nSee http://hl7.org/fhir/StructureDefinition/allergyintolerance-substanceExposureRisk" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/allergyintolerance-substanceExposureRisk" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "substanceExposureRisk.exists() and code.empty()" } diff --git a/testdata/r4/descriptors/auditevent-Accession.descriptor.prototxt b/testdata/r4/descriptors/auditevent-Accession.descriptor.prototxt index 5db9b5b14..d4e452bb3 100644 --- a/testdata/r4/descriptors/auditevent-Accession.descriptor.prototxt +++ b/testdata/r4/descriptors/auditevent-Accession.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Accession.\nAccession Number.\nSee http://hl7.org/fhir/StructureDefinition/auditevent-Accession" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/auditevent-Accession" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/auditevent-Anonymized.descriptor.prototxt b/testdata/r4/descriptors/auditevent-Anonymized.descriptor.prototxt index 5e2a1af82..37212b28c 100644 --- a/testdata/r4/descriptors/auditevent-Anonymized.descriptor.prototxt +++ b/testdata/r4/descriptors/auditevent-Anonymized.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Anonymized.\nAnonymized state.\nSee http://hl7.org/fhir/StructureDefinition/auditevent-Anonymized" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/auditevent-Anonymized" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/auditevent-Encrypted.descriptor.prototxt b/testdata/r4/descriptors/auditevent-Encrypted.descriptor.prototxt index 54e2ec497..a7d58d4bb 100644 --- a/testdata/r4/descriptors/auditevent-Encrypted.descriptor.prototxt +++ b/testdata/r4/descriptors/auditevent-Encrypted.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Encrypted.\nEncrypted state.\nSee http://hl7.org/fhir/StructureDefinition/auditevent-Encrypted" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/auditevent-Encrypted" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/auditevent-Instance.descriptor.prototxt b/testdata/r4/descriptors/auditevent-Instance.descriptor.prototxt index dc22993c5..3b5b82925 100644 --- a/testdata/r4/descriptors/auditevent-Instance.descriptor.prototxt +++ b/testdata/r4/descriptors/auditevent-Instance.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Instance.\nSOP Instance UID value.\nSee http://hl7.org/fhir/StructureDefinition/auditevent-Instance" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/auditevent-Instance" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/auditevent-MPPS.descriptor.prototxt b/testdata/r4/descriptors/auditevent-MPPS.descriptor.prototxt index b65d55403..798318bff 100644 --- a/testdata/r4/descriptors/auditevent-MPPS.descriptor.prototxt +++ b/testdata/r4/descriptors/auditevent-MPPS.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for MPPS.\nMPPS instance UID.\nSee http://hl7.org/fhir/StructureDefinition/auditevent-MPPS" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/auditevent-MPPS" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/auditevent-NumberOfInstances.descriptor.prototxt b/testdata/r4/descriptors/auditevent-NumberOfInstances.descriptor.prototxt index 62ba9738c..c451da84d 100644 --- a/testdata/r4/descriptors/auditevent-NumberOfInstances.descriptor.prototxt +++ b/testdata/r4/descriptors/auditevent-NumberOfInstances.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for NumberOfInstances.\nNumber of SOP Instances referred to by this entity.\nSee http://hl7.org/fhir/StructureDefinition/auditevent-NumberOfInstances" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/auditevent-NumberOfInstances" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/auditevent-ParticipantObjectContainsStudy.descriptor.prototxt b/testdata/r4/descriptors/auditevent-ParticipantObjectContainsStudy.descriptor.prototxt index 7c3016023..f0bedd184 100644 --- a/testdata/r4/descriptors/auditevent-ParticipantObjectContainsStudy.descriptor.prototxt +++ b/testdata/r4/descriptors/auditevent-ParticipantObjectContainsStudy.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ParticipantObjectContainsStudy.\nContains Study.\nSee http://hl7.org/fhir/StructureDefinition/auditevent-ParticipantObjectContainsStudy" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/auditevent-ParticipantObjectContainsStudy" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/auditevent-SOPClass.descriptor.prototxt b/testdata/r4/descriptors/auditevent-SOPClass.descriptor.prototxt index 77f619754..ac256fec5 100644 --- a/testdata/r4/descriptors/auditevent-SOPClass.descriptor.prototxt +++ b/testdata/r4/descriptors/auditevent-SOPClass.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for SOPClass.\nUIDs of SOP classes referred to.\nSee http://hl7.org/fhir/StructureDefinition/auditevent-SOPClass" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/auditevent-SOPClass" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/bmi.descriptor.prototxt b/testdata/r4/descriptors/bmi.descriptor.prototxt index ddb756095..0eea85e73 100644 --- a/testdata/r4/descriptors/bmi.descriptor.prototxt +++ b/testdata/r4/descriptors/bmi.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -324,8 +323,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBmi.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -365,8 +362,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBmi.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -480,6 +475,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -594,6 +590,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -776,6 +775,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -783,4 +785,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/bmi" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/bodySite.descriptor.prototxt b/testdata/r4/descriptors/bodySite.descriptor.prototxt index 7836a7467..f55f4e939 100644 --- a/testdata/r4/descriptors/bodySite.descriptor.prototxt +++ b/testdata/r4/descriptors/bodySite.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for BodyStructure Reference.\nTarget anatomic location or structure.\nSee http://hl7.org/fhir/StructureDefinition/bodySite" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/bodySite" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/bodyheight.descriptor.prototxt b/testdata/r4/descriptors/bodyheight.descriptor.prototxt index 37b95820f..08b13e287 100644 --- a/testdata/r4/descriptors/bodyheight.descriptor.prototxt +++ b/testdata/r4/descriptors/bodyheight.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -323,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBodyheight.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -364,8 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBodyheight.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -479,6 +474,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -593,6 +589,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -775,6 +774,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -782,4 +784,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/bodyheight" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/bodytemp.descriptor.prototxt b/testdata/r4/descriptors/bodytemp.descriptor.prototxt index e9779a680..48e716576 100644 --- a/testdata/r4/descriptors/bodytemp.descriptor.prototxt +++ b/testdata/r4/descriptors/bodytemp.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -323,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBodytemp.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -364,8 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBodytemp.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -479,6 +474,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -593,6 +589,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -775,6 +774,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -782,4 +784,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/bodytemp" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/bodyweight.descriptor.prototxt b/testdata/r4/descriptors/bodyweight.descriptor.prototxt index 5423e5ead..b3a80b4cd 100644 --- a/testdata/r4/descriptors/bodyweight.descriptor.prototxt +++ b/testdata/r4/descriptors/bodyweight.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -323,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBodyweight.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -364,8 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBodyweight.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -479,6 +474,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -593,6 +589,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -775,6 +774,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -782,4 +784,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/bodyweight" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/bp.descriptor.prototxt b/testdata/r4/descriptors/bp.descriptor.prototxt index 900d9136f..909b68d9f 100644 --- a/testdata/r4/descriptors/bp.descriptor.prototxt +++ b/testdata/r4/descriptors/bp.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -319,8 +318,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBp.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -360,8 +357,6 @@ field { type_name: ".google.fhir.r4.core.ObservationBp.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -487,6 +482,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -584,6 +580,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -766,6 +765,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -773,4 +775,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/bp" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/capabilities.descriptor.prototxt b/testdata/r4/descriptors/capabilities.descriptor.prototxt index 05622076c..53742d205 100644 --- a/testdata/r4/descriptors/capabilities.descriptor.prototxt +++ b/testdata/r4/descriptors/capabilities.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for capabilities.\nServer Capabilities.\nSee http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/capabilitystatement-expectation.descriptor.prototxt b/testdata/r4/descriptors/capabilitystatement-expectation.descriptor.prototxt index 3b6c001d1..b1816ebad 100644 --- a/testdata/r4/descriptors/capabilitystatement-expectation.descriptor.prototxt +++ b/testdata/r4/descriptors/capabilitystatement-expectation.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for expectation.\nSHALL | SHOULD | MAY |SHOULD-NOT.\nSee http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/capabilitystatement-prohibited.descriptor.prototxt b/testdata/r4/descriptors/capabilitystatement-prohibited.descriptor.prototxt index 7ebd7e4c6..5090b6645 100644 --- a/testdata/r4/descriptors/capabilitystatement-prohibited.descriptor.prototxt +++ b/testdata/r4/descriptors/capabilitystatement-prohibited.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for prohibited.\nFunctionality not allowed.\nSee http://hl7.org/fhir/StructureDefinition/capabilitystatement-prohibited" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/capabilitystatement-prohibited" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/capabilitystatement-search-parameter-combination.descriptor.prototxt b/testdata/r4/descriptors/capabilitystatement-search-parameter-combination.descriptor.prototxt index 398324ebb..7d29ee436 100644 --- a/testdata/r4/descriptors/capabilitystatement-search-parameter-combination.descriptor.prototxt +++ b/testdata/r4/descriptors/capabilitystatement-search-parameter-combination.descriptor.prototxt @@ -45,4 +45,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for search-parameter-combination.\nAn allowable parameter combination.\nSee http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/capabilitystatement-supported-system.descriptor.prototxt b/testdata/r4/descriptors/capabilitystatement-supported-system.descriptor.prototxt index 0e446861b..b208c16b5 100644 --- a/testdata/r4/descriptors/capabilitystatement-supported-system.descriptor.prototxt +++ b/testdata/r4/descriptors/capabilitystatement-supported-system.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for supported-system.\nCode system not defined in a value set.\nSee http://hl7.org/fhir/StructureDefinition/capabilitystatement-supported-system" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/capabilitystatement-supported-system" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/capabilitystatement-websocket.descriptor.prototxt b/testdata/r4/descriptors/capabilitystatement-websocket.descriptor.prototxt index 503392ec3..ac87eb8fe 100644 --- a/testdata/r4/descriptors/capabilitystatement-websocket.descriptor.prototxt +++ b/testdata/r4/descriptors/capabilitystatement-websocket.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for websocket.\nWhere server websocket end point is found.\nSee http://hl7.org/fhir/StructureDefinition/capabilitystatement-websocket" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/capabilitystatement-websocket" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/careplan-activity-title.descriptor.prototxt b/testdata/r4/descriptors/careplan-activity-title.descriptor.prototxt index 484ae00f6..d4894bd18 100644 --- a/testdata/r4/descriptors/careplan-activity-title.descriptor.prototxt +++ b/testdata/r4/descriptors/careplan-activity-title.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for activity-title.\nLabel for activity.\nSee http://hl7.org/fhir/StructureDefinition/careplan-activity-title" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/careplan-activity-title" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/catalog.descriptor.prototxt b/testdata/r4/descriptors/catalog.descriptor.prototxt index 5cfc071c6..b5a526619 100644 --- a/testdata/r4/descriptors/catalog.descriptor.prototxt +++ b/testdata/r4/descriptors/catalog.descriptor.prototxt @@ -191,7 +191,6 @@ field { type_name: ".google.fhir.r4.core.ProfileForCatalog.Attester" options { [google.fhir.proto.field_description]: "Attests to accuracy of composition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -213,7 +212,6 @@ field { type_name: ".google.fhir.r4.core.ProfileForCatalog.RelatesTo" options { [google.fhir.proto.field_description]: "Relationships to other compositions/documents" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -224,7 +222,6 @@ field { type_name: ".google.fhir.r4.core.ProfileForCatalog.Event" options { [google.fhir.proto.field_description]: "The clinical service(s) being documented" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -235,9 +232,6 @@ field { type_name: ".google.fhir.r4.core.ProfileForCatalog.Section" options { [google.fhir.proto.field_description]: "Composition is broken into sections" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "text.exists() or entry.exists() or section.exists()" - [google.fhir.proto.fhir_path_constraint]: "emptyReason.empty() or entry.empty()" } } field { @@ -250,7 +244,6 @@ field { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "The validity of the catalog" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/cqm-ValidityPeriod" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "ValidityPeriod" @@ -753,6 +746,10 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "text.exists() or entry.exists() or section.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "emptyReason.empty() or entry.empty()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/cdshooksguidanceresponse.descriptor.prototxt b/testdata/r4/descriptors/cdshooksguidanceresponse.descriptor.prototxt index 736c8782c..c869f121f 100644 --- a/testdata/r4/descriptors/cdshooksguidanceresponse.descriptor.prototxt +++ b/testdata/r4/descriptors/cdshooksguidanceresponse.descriptor.prototxt @@ -261,7 +261,6 @@ field { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Service endpoint" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/cqf-cdsHooksEndpoint" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } } diff --git a/testdata/r4/descriptors/cdshooksrequestgroup.descriptor.prototxt b/testdata/r4/descriptors/cdshooksrequestgroup.descriptor.prototxt index 31df91f9a..59c09901c 100644 --- a/testdata/r4/descriptors/cdshooksrequestgroup.descriptor.prototxt +++ b/testdata/r4/descriptors/cdshooksrequestgroup.descriptor.prototxt @@ -279,8 +279,6 @@ field { type_name: ".google.fhir.r4.core.CDSHooksRequestGroup.Action" options { [google.fhir.proto.field_description]: "Proposed actions, if any" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "resource.exists() != action.exists()" } } nested_type { @@ -474,7 +472,6 @@ nested_type { type_name: ".google.fhir.r4.core.CDSHooksRequestGroup.Action.Condition" options { [google.fhir.proto.field_description]: "Whether or not the action is applicable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -485,7 +482,6 @@ nested_type { type_name: ".google.fhir.r4.core.CDSHooksRequestGroup.Action.RelatedAction" options { [google.fhir.proto.field_description]: "Relationship to another action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1011,6 +1007,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "resource.exists() != action.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/cdshooksserviceplandefinition.descriptor.prototxt b/testdata/r4/descriptors/cdshooksserviceplandefinition.descriptor.prototxt index 0592c1836..d3cc385a7 100644 --- a/testdata/r4/descriptors/cdshooksserviceplandefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/cdshooksserviceplandefinition.descriptor.prototxt @@ -384,7 +384,6 @@ field { type_name: ".google.fhir.r4.core.CDSHooksServicePlanDefinition.Goal" options { [google.fhir.proto.field_description]: "What the plan is trying to accomplish" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -395,7 +394,6 @@ field { type_name: ".google.fhir.r4.core.CDSHooksServicePlanDefinition.Action" options { [google.fhir.proto.field_description]: "Action defined by the plan" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -408,7 +406,6 @@ field { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Service endpoint" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/cqf-cdsHooksEndpoint" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } } @@ -568,7 +565,6 @@ nested_type { type_name: ".google.fhir.r4.core.CDSHooksServicePlanDefinition.Goal.Target" options { [google.fhir.proto.field_description]: "Target outcome for the goal" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -818,7 +814,6 @@ nested_type { type_name: ".google.fhir.r4.core.CDSHooksServicePlanDefinition.Action.Condition" options { [google.fhir.proto.field_description]: "Whether or not the action is applicable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -849,7 +844,6 @@ nested_type { type_name: ".google.fhir.r4.core.CDSHooksServicePlanDefinition.Action.RelatedAction" options { [google.fhir.proto.field_description]: "Relationship to another action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -870,7 +864,6 @@ nested_type { type_name: ".google.fhir.r4.core.CDSHooksServicePlanDefinition.Action.Participant" options { [google.fhir.proto.field_description]: "Who should participate in the action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -961,7 +954,6 @@ nested_type { type_name: ".google.fhir.r4.core.CDSHooksServicePlanDefinition.Action.DynamicValue" options { [google.fhir.proto.field_description]: "Dynamic aspects of the definition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1584,4 +1576,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for CDS Hooks Service PlanDefinition.\nThe definition of a plan for a series of actions, independent of any specific patient or context.\nSee http://hl7.org/fhir/StructureDefinition/cdshooksserviceplandefinition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/PlanDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cdshooksserviceplandefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/cholesterol.descriptor.prototxt b/testdata/r4/descriptors/cholesterol.descriptor.prototxt index b838bfe12..cf1b8373c 100644 --- a/testdata/r4/descriptors/cholesterol.descriptor.prototxt +++ b/testdata/r4/descriptors/cholesterol.descriptor.prototxt @@ -323,8 +323,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -347,7 +345,6 @@ field { type_name: ".google.fhir.r4.core.Cholesterol.Component" options { [google.fhir.proto.field_description]: "Component results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -482,7 +479,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A fixed quantity (no comparator)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "code.empty() or system.exists()" [google.fhir.proto.fhir_path_constraint]: "comparator.empty()" } @@ -515,6 +511,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -703,4 +702,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Example Lipid Profile.\nMeasurements and simple assertions.\nSee http://hl7.org/fhir/StructureDefinition/cholesterol" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cholesterol" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" } diff --git a/testdata/r4/descriptors/clinicaldocument.descriptor.prototxt b/testdata/r4/descriptors/clinicaldocument.descriptor.prototxt index 9f1432ebe..1ef8d1123 100644 --- a/testdata/r4/descriptors/clinicaldocument.descriptor.prototxt +++ b/testdata/r4/descriptors/clinicaldocument.descriptor.prototxt @@ -210,7 +210,6 @@ field { type_name: ".google.fhir.r4.core.ClinicalDocument.Attester" options { [google.fhir.proto.field_description]: "Attests to accuracy of composition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -232,7 +231,6 @@ field { type_name: ".google.fhir.r4.core.ClinicalDocument.RelatesTo" options { [google.fhir.proto.field_description]: "Relationships to other compositions/documents" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -243,7 +241,6 @@ field { type_name: ".google.fhir.r4.core.ClinicalDocument.Event" options { [google.fhir.proto.field_description]: "The clinical service(s) being documented" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -254,9 +251,6 @@ field { type_name: ".google.fhir.r4.core.ClinicalDocument.Section" options { [google.fhir.proto.field_description]: "Composition is broken into sections" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "text.exists() or entry.exists() or section.exists()" - [google.fhir.proto.fhir_path_constraint]: "emptyReason.empty() or entry.empty()" } } field { @@ -268,7 +262,6 @@ field { options { [google.fhir.proto.field_description]: "Version-specific identifier for composition" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-versionNumber" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } } @@ -763,6 +756,10 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "text.exists() or entry.exists() or section.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "emptyReason.empty() or entry.empty()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/codesystem-alternate.descriptor.prototxt b/testdata/r4/descriptors/codesystem-alternate.descriptor.prototxt index 55e155c59..d077caca5 100644 --- a/testdata/r4/descriptors/codesystem-alternate.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-alternate.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for alternate.\nAdditional code for the concept.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-alternate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-alternate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-author.descriptor.prototxt b/testdata/r4/descriptors/codesystem-author.descriptor.prototxt index 24875b2fe..1db764f38 100644 --- a/testdata/r4/descriptors/codesystem-author.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-author.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for author.\nUser or Org actually involved in creating the value set content.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-author" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-author" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-concept-comments.descriptor.prototxt b/testdata/r4/descriptors/codesystem-concept-comments.descriptor.prototxt index c4fd0e47f..1e4344202 100644 --- a/testdata/r4/descriptors/codesystem-concept-comments.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-concept-comments.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for concept-comments.\nComment about the use of this code in this context.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-concept-comments" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-concept-comments" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-conceptOrder.descriptor.prototxt b/testdata/r4/descriptors/codesystem-conceptOrder.descriptor.prototxt index 830517b6c..ec0ca7b9d 100644 --- a/testdata/r4/descriptors/codesystem-conceptOrder.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-conceptOrder.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for conceptOrder.\nAppearance order for user selection.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-conceptOrder" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-conceptOrder" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-effectiveDate.descriptor.prototxt b/testdata/r4/descriptors/codesystem-effectiveDate.descriptor.prototxt index 9942bb27a..5362714db 100644 --- a/testdata/r4/descriptors/codesystem-effectiveDate.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-effectiveDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for effectiveDate.\nWhen the value set version becomes Active and is available for use.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-effectiveDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-effectiveDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-expirationDate.descriptor.prototxt b/testdata/r4/descriptors/codesystem-expirationDate.descriptor.prototxt index b7408365d..67fb0fbff 100644 --- a/testdata/r4/descriptors/codesystem-expirationDate.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-expirationDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for expirationDate.\nWhen the value set version should no longer be used.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-expirationDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-expirationDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-history.descriptor.prototxt b/testdata/r4/descriptors/codesystem-history.descriptor.prototxt index a3d5d48bc..ce3422d1b 100644 --- a/testdata/r4/descriptors/codesystem-history.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-history.descriptor.prototxt @@ -113,4 +113,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for history.\nWhat has happened over time.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-history" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-history" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-keyWord.descriptor.prototxt b/testdata/r4/descriptors/codesystem-keyWord.descriptor.prototxt index 9a4bff272..f6dac2f43 100644 --- a/testdata/r4/descriptors/codesystem-keyWord.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-keyWord.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for keyWord.\nDescriptors and key terms for search.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-keyWord" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-keyWord" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-label.descriptor.prototxt b/testdata/r4/descriptors/codesystem-label.descriptor.prototxt index cd44c35c8..e14713d09 100644 --- a/testdata/r4/descriptors/codesystem-label.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-label.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for label.\nE.g. \"(a)\", \"1.\", etc.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-label" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-label" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-map.descriptor.prototxt b/testdata/r4/descriptors/codesystem-map.descriptor.prototxt index 97d4ff81e..93c01fb3d 100644 --- a/testdata/r4/descriptors/codesystem-map.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-map.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for map.\nA concept map relevant to interpret this value set.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-map" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-map" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-otherName.descriptor.prototxt b/testdata/r4/descriptors/codesystem-otherName.descriptor.prototxt index 1d3c25537..f4416dec5 100644 --- a/testdata/r4/descriptors/codesystem-otherName.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-otherName.descriptor.prototxt @@ -45,4 +45,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for otherName.\nAlternative names.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-otherName" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-otherName" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-replacedby.descriptor.prototxt b/testdata/r4/descriptors/codesystem-replacedby.descriptor.prototxt index f63f0ba01..bbccc38c0 100644 --- a/testdata/r4/descriptors/codesystem-replacedby.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-replacedby.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for replacedby.\nA code that replaces this.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-replacedby" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-replacedby" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-sourceReference.descriptor.prototxt b/testdata/r4/descriptors/codesystem-sourceReference.descriptor.prototxt index 7e66725c3..b458d1d40 100644 --- a/testdata/r4/descriptors/codesystem-sourceReference.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-sourceReference.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for sourceReference.\nWhere did this content come from.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-sourceReference" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-sourceReference" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-trusted-expansion.descriptor.prototxt b/testdata/r4/descriptors/codesystem-trusted-expansion.descriptor.prototxt index 9358daef2..25b0d2dae 100644 --- a/testdata/r4/descriptors/codesystem-trusted-expansion.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-trusted-expansion.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for trusted-expansion.\nReference to a trusted expansion.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-trusted-expansion" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-trusted-expansion" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-usage.descriptor.prototxt b/testdata/r4/descriptors/codesystem-usage.descriptor.prototxt index a3446c23b..ec28a6138 100644 --- a/testdata/r4/descriptors/codesystem-usage.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-usage.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for usage.\nWho has used and how?.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-usage" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-usage" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-warning.descriptor.prototxt b/testdata/r4/descriptors/codesystem-warning.descriptor.prototxt index ce569a447..138a53363 100644 --- a/testdata/r4/descriptors/codesystem-warning.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-warning.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for warning.\nExtra warning about the correct use of the value set.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-warning" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-warning" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/codesystem-workflowStatus.descriptor.prototxt b/testdata/r4/descriptors/codesystem-workflowStatus.descriptor.prototxt index 8b240cc28..150790b59 100644 --- a/testdata/r4/descriptors/codesystem-workflowStatus.descriptor.prototxt +++ b/testdata/r4/descriptors/codesystem-workflowStatus.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for workflowStatus.\nIndicates the state of development of the value set.\nSee http://hl7.org/fhir/StructureDefinition/codesystem-workflowStatus" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/codesystem-workflowStatus" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/coding-sctdescid.descriptor.prototxt b/testdata/r4/descriptors/coding-sctdescid.descriptor.prototxt index 179784ade..e1e4bd04e 100644 --- a/testdata/r4/descriptors/coding-sctdescid.descriptor.prototxt +++ b/testdata/r4/descriptors/coding-sctdescid.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for sctdescid.\nSNOMED CT Description ID.\nSee http://hl7.org/fhir/StructureDefinition/coding-sctdescid" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/coding-sctdescid" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/communication-media.descriptor.prototxt b/testdata/r4/descriptors/communication-media.descriptor.prototxt index f46b67820..940a0b885 100644 --- a/testdata/r4/descriptors/communication-media.descriptor.prototxt +++ b/testdata/r4/descriptors/communication-media.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for media.\nAttached media.\nSee http://hl7.org/fhir/StructureDefinition/communication-media" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/communication-media" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/communicationrequest-initiatingLocation.descriptor.prototxt b/testdata/r4/descriptors/communicationrequest-initiatingLocation.descriptor.prototxt index 9da63af43..a799866f1 100644 --- a/testdata/r4/descriptors/communicationrequest-initiatingLocation.descriptor.prototxt +++ b/testdata/r4/descriptors/communicationrequest-initiatingLocation.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for initiatingLocation.\nLocation where the CommunicationRequest was initiated.\nSee http://hl7.org/fhir/StructureDefinition/communicationrequest-initiatingLocation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/communicationrequest-initiatingLocation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/composition-clinicaldocument-otherConfidentiality.descriptor.prototxt b/testdata/r4/descriptors/composition-clinicaldocument-otherConfidentiality.descriptor.prototxt index 99302f35b..bde14edfa 100644 --- a/testdata/r4/descriptors/composition-clinicaldocument-otherConfidentiality.descriptor.prototxt +++ b/testdata/r4/descriptors/composition-clinicaldocument-otherConfidentiality.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for otherConfidentiality.\nAdditional confidentiality codes.\nSee http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-otherConfidentiality" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-otherConfidentiality" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/composition-clinicaldocument-versionNumber.descriptor.prototxt b/testdata/r4/descriptors/composition-clinicaldocument-versionNumber.descriptor.prototxt index cc933e5c1..f8b8e36c0 100644 --- a/testdata/r4/descriptors/composition-clinicaldocument-versionNumber.descriptor.prototxt +++ b/testdata/r4/descriptors/composition-clinicaldocument-versionNumber.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for versionNumber.\nVersion-specific identifier for composition.\nSee http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-versionNumber" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/composition-clinicaldocument-versionNumber" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/composition-section-subject.descriptor.prototxt b/testdata/r4/descriptors/composition-section-subject.descriptor.prototxt index dced5c191..b628ed78c 100644 --- a/testdata/r4/descriptors/composition-section-subject.descriptor.prototxt +++ b/testdata/r4/descriptors/composition-section-subject.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for section-subject.\nSection has a different subject that it\'s container.\nSee http://hl7.org/fhir/StructureDefinition/composition-section-subject" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/composition-section-subject" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/computableplandefinition.descriptor.prototxt b/testdata/r4/descriptors/computableplandefinition.descriptor.prototxt index 3a6b0bf1d..d66b77a26 100644 --- a/testdata/r4/descriptors/computableplandefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/computableplandefinition.descriptor.prototxt @@ -385,7 +385,6 @@ field { type_name: ".google.fhir.r4.core.ComputablePlanDefinition.Goal" options { [google.fhir.proto.field_description]: "What the plan is trying to accomplish" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -396,7 +395,6 @@ field { type_name: ".google.fhir.r4.core.ComputablePlanDefinition.Action" options { [google.fhir.proto.field_description]: "Action defined by the plan" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -555,7 +553,6 @@ nested_type { type_name: ".google.fhir.r4.core.ComputablePlanDefinition.Goal.Target" options { [google.fhir.proto.field_description]: "Target outcome for the goal" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -805,7 +802,6 @@ nested_type { type_name: ".google.fhir.r4.core.ComputablePlanDefinition.Action.Condition" options { [google.fhir.proto.field_description]: "Whether or not the action is applicable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -836,7 +832,6 @@ nested_type { type_name: ".google.fhir.r4.core.ComputablePlanDefinition.Action.RelatedAction" options { [google.fhir.proto.field_description]: "Relationship to another action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -857,7 +852,6 @@ nested_type { type_name: ".google.fhir.r4.core.ComputablePlanDefinition.Action.Participant" options { [google.fhir.proto.field_description]: "Who should participate in the action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -948,7 +942,6 @@ nested_type { type_name: ".google.fhir.r4.core.ComputablePlanDefinition.Action.DynamicValue" options { [google.fhir.proto.field_description]: "Dynamic aspects of the definition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1571,4 +1564,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Computable PlanDefinition.\nThe definition of a plan for a series of actions, independent of any specific patient or context.\nSee http://hl7.org/fhir/StructureDefinition/computableplandefinition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/PlanDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/computableplandefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/concept-bidirectional.descriptor.prototxt b/testdata/r4/descriptors/concept-bidirectional.descriptor.prototxt index 7c96974a5..e9de55590 100644 --- a/testdata/r4/descriptors/concept-bidirectional.descriptor.prototxt +++ b/testdata/r4/descriptors/concept-bidirectional.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for bidirectional.\nWhether the map can be interpreted in reverse.\nSee http://hl7.org/fhir/StructureDefinition/concept-bidirectional" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/concept-bidirectional" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/condition-assertedDate.descriptor.prototxt b/testdata/r4/descriptors/condition-assertedDate.descriptor.prototxt index 27ef0d9ec..8be3fd005 100644 --- a/testdata/r4/descriptors/condition-assertedDate.descriptor.prototxt +++ b/testdata/r4/descriptors/condition-assertedDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for assertedDate.\nDate the condition was first asserted.\nSee http://hl7.org/fhir/StructureDefinition/condition-assertedDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/condition-assertedDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/condition-dueTo.descriptor.prototxt b/testdata/r4/descriptors/condition-dueTo.descriptor.prototxt index 9e86f2446..d4e66e602 100644 --- a/testdata/r4/descriptors/condition-dueTo.descriptor.prototxt +++ b/testdata/r4/descriptors/condition-dueTo.descriptor.prototxt @@ -57,4 +57,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for dueTo.\nCauses for this Condition.\nSee http://hl7.org/fhir/StructureDefinition/condition-dueTo" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/condition-dueTo" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/condition-occurredFollowing.descriptor.prototxt b/testdata/r4/descriptors/condition-occurredFollowing.descriptor.prototxt index 831c09034..caed2cfee 100644 --- a/testdata/r4/descriptors/condition-occurredFollowing.descriptor.prototxt +++ b/testdata/r4/descriptors/condition-occurredFollowing.descriptor.prototxt @@ -57,4 +57,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for occurredFollowing.\nPrecedent for this Condition.\nSee http://hl7.org/fhir/StructureDefinition/condition-occurredFollowing" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/condition-occurredFollowing" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/condition-outcome.descriptor.prototxt b/testdata/r4/descriptors/condition-outcome.descriptor.prototxt index 1b5a15fbf..0939b9668 100644 --- a/testdata/r4/descriptors/condition-outcome.descriptor.prototxt +++ b/testdata/r4/descriptors/condition-outcome.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for outcome.\nA consequence of the Condition.\nSee http://hl7.org/fhir/StructureDefinition/condition-outcome" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/condition-outcome" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/condition-related.descriptor.prototxt b/testdata/r4/descriptors/condition-related.descriptor.prototxt index a6a8e93cb..4f42d1583 100644 --- a/testdata/r4/descriptors/condition-related.descriptor.prototxt +++ b/testdata/r4/descriptors/condition-related.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for related.\nConditions associated with this condition.\nSee http://hl7.org/fhir/StructureDefinition/condition-related" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/condition-related" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/condition-ruledOut.descriptor.prototxt b/testdata/r4/descriptors/condition-ruledOut.descriptor.prototxt index 41803ce18..4878227e4 100644 --- a/testdata/r4/descriptors/condition-ruledOut.descriptor.prototxt +++ b/testdata/r4/descriptors/condition-ruledOut.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ruledOut.\nConditions ruled out for this condition.\nSee http://hl7.org/fhir/StructureDefinition/condition-ruledOut" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/condition-ruledOut" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/consent-NotificationEndpoint.descriptor.prototxt b/testdata/r4/descriptors/consent-NotificationEndpoint.descriptor.prototxt index 58156aede..076b55bc0 100644 --- a/testdata/r4/descriptors/consent-NotificationEndpoint.descriptor.prototxt +++ b/testdata/r4/descriptors/consent-NotificationEndpoint.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for NotificationEndpoint.\nNotification Endpoint.\nSee http://hl7.org/fhir/StructureDefinition/consent-NotificationEndpoint" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/consent-NotificationEndpoint" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/consent-Transcriber.descriptor.prototxt b/testdata/r4/descriptors/consent-Transcriber.descriptor.prototxt index e9f11e7df..6e05aff58 100644 --- a/testdata/r4/descriptors/consent-Transcriber.descriptor.prototxt +++ b/testdata/r4/descriptors/consent-Transcriber.descriptor.prototxt @@ -29,4 +29,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Transcriber.\nTranscribed consent.\nSee http://hl7.org/fhir/StructureDefinition/consent-Transcriber" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/consent-Transcriber" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/consent-Witness.descriptor.prototxt b/testdata/r4/descriptors/consent-Witness.descriptor.prototxt index 67c1c1961..ea804c54a 100644 --- a/testdata/r4/descriptors/consent-Witness.descriptor.prototxt +++ b/testdata/r4/descriptors/consent-Witness.descriptor.prototxt @@ -29,4 +29,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Witness.\nWitness to Consent.\nSee http://hl7.org/fhir/StructureDefinition/consent-Witness" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/consent-Witness" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/consent-location.descriptor.prototxt b/testdata/r4/descriptors/consent-location.descriptor.prototxt index 5ffba2b20..37d1e56c1 100644 --- a/testdata/r4/descriptors/consent-location.descriptor.prototxt +++ b/testdata/r4/descriptors/consent-location.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for location.\nA location specific constraint.\nSee http://hl7.org/fhir/StructureDefinition/consent-location" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/consent-location" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/contactpoint-area.descriptor.prototxt b/testdata/r4/descriptors/contactpoint-area.descriptor.prototxt index 8e3de1881..d38aecce2 100644 --- a/testdata/r4/descriptors/contactpoint-area.descriptor.prototxt +++ b/testdata/r4/descriptors/contactpoint-area.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for area.\nArea/zone/city code.\nSee http://hl7.org/fhir/StructureDefinition/contactpoint-area" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/contactpoint-area" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/contactpoint-country.descriptor.prototxt b/testdata/r4/descriptors/contactpoint-country.descriptor.prototxt index 0d152ca61..2cbe91d84 100644 --- a/testdata/r4/descriptors/contactpoint-country.descriptor.prototxt +++ b/testdata/r4/descriptors/contactpoint-country.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for country.\nCountry code as defined by the ITU.\nSee http://hl7.org/fhir/StructureDefinition/contactpoint-country" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/contactpoint-country" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/contactpoint-extension.descriptor.prototxt b/testdata/r4/descriptors/contactpoint-extension.descriptor.prototxt index c1989980d..ee84a47b5 100644 --- a/testdata/r4/descriptors/contactpoint-extension.descriptor.prototxt +++ b/testdata/r4/descriptors/contactpoint-extension.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for extension.\nNumber within private network.\nSee http://hl7.org/fhir/StructureDefinition/contactpoint-extension" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/contactpoint-extension" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/contactpoint-local.descriptor.prototxt b/testdata/r4/descriptors/contactpoint-local.descriptor.prototxt index 47e1f8993..f15823a9c 100644 --- a/testdata/r4/descriptors/contactpoint-local.descriptor.prototxt +++ b/testdata/r4/descriptors/contactpoint-local.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for local.\nLocal number that must always be dialled.\nSee http://hl7.org/fhir/StructureDefinition/contactpoint-local" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/contactpoint-local" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-calculatedValue.descriptor.prototxt b/testdata/r4/descriptors/cqf-calculatedValue.descriptor.prototxt index e2be93b7d..b042607a6 100644 --- a/testdata/r4/descriptors/cqf-calculatedValue.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-calculatedValue.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for calculatedValue.\nA calculated value.\nSee http://hl7.org/fhir/StructureDefinition/cqf-calculatedValue" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-calculatedValue" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-cdsHooksEndpoint.descriptor.prototxt b/testdata/r4/descriptors/cqf-cdsHooksEndpoint.descriptor.prototxt index b7db67fe1..af03d4e7c 100644 --- a/testdata/r4/descriptors/cqf-cdsHooksEndpoint.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-cdsHooksEndpoint.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for cdsHooksEndpoint.\nSurface this ECA Rule here.\nSee http://hl7.org/fhir/StructureDefinition/cqf-cdsHooksEndpoint" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-cdsHooksEndpoint" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-citation.descriptor.prototxt b/testdata/r4/descriptors/cqf-citation.descriptor.prototxt index 4ab78b427..7869fa9a1 100644 --- a/testdata/r4/descriptors/cqf-citation.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-citation.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for citation.\nBibliographic citation for the resource.\nSee http://hl7.org/fhir/StructureDefinition/cqf-citation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-citation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-encounterClass.descriptor.prototxt b/testdata/r4/descriptors/cqf-encounterClass.descriptor.prototxt index 5ce46719d..a31e2cc52 100644 --- a/testdata/r4/descriptors/cqf-encounterClass.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-encounterClass.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for encounterClass.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-encounterClass" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-encounterClass" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-encounterType.descriptor.prototxt b/testdata/r4/descriptors/cqf-encounterType.descriptor.prototxt index 36d3f63d7..016a70291 100644 --- a/testdata/r4/descriptors/cqf-encounterType.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-encounterType.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for encounterType.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-encounterType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-encounterType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-expression.descriptor.prototxt b/testdata/r4/descriptors/cqf-expression.descriptor.prototxt index 198857b28..395089cc0 100644 --- a/testdata/r4/descriptors/cqf-expression.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-expression.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for expression.\nAn dynamic expression.\nSee http://hl7.org/fhir/StructureDefinition/cqf-expression" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-expression" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-initialValue.descriptor.prototxt b/testdata/r4/descriptors/cqf-initialValue.descriptor.prototxt index a44bd82d1..f741c0d2b 100644 --- a/testdata/r4/descriptors/cqf-initialValue.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-initialValue.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for initialValue.\nAn initial value expression.\nSee http://hl7.org/fhir/StructureDefinition/cqf-initialValue" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-initialValue" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-initiatingOrganization.descriptor.prototxt b/testdata/r4/descriptors/cqf-initiatingOrganization.descriptor.prototxt index b7b4eca4b..e4dd1bebd 100644 --- a/testdata/r4/descriptors/cqf-initiatingOrganization.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-initiatingOrganization.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for initiatingOrganization.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-initiatingOrganization" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-initiatingOrganization" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-initiatingPerson.descriptor.prototxt b/testdata/r4/descriptors/cqf-initiatingPerson.descriptor.prototxt index 07af68afb..b54132135 100644 --- a/testdata/r4/descriptors/cqf-initiatingPerson.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-initiatingPerson.descriptor.prototxt @@ -29,4 +29,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for initiatingPerson.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-initiatingPerson" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-initiatingPerson" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-library.descriptor.prototxt b/testdata/r4/descriptors/cqf-library.descriptor.prototxt index d5015af53..5916ddbca 100644 --- a/testdata/r4/descriptors/cqf-library.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-library.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for library.\nA library containing logic used by the artifact.\nSee http://hl7.org/fhir/StructureDefinition/cqf-library" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-library" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-measureInfo.descriptor.prototxt b/testdata/r4/descriptors/cqf-measureInfo.descriptor.prototxt index 6a0fcc0d7..ef862b855 100644 --- a/testdata/r4/descriptors/cqf-measureInfo.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-measureInfo.descriptor.prototxt @@ -54,4 +54,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for measureInfo.\nMeasure criteria for the resource.\nSee http://hl7.org/fhir/StructureDefinition/cqf-measureInfo" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-measureInfo" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-qualityOfEvidence.descriptor.prototxt b/testdata/r4/descriptors/cqf-qualityOfEvidence.descriptor.prototxt index 321de1ade..342d8d203 100644 --- a/testdata/r4/descriptors/cqf-qualityOfEvidence.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-qualityOfEvidence.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for qualityOfEvidence.\nThe quality of the evidence.\nSee http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-questionnaire.descriptor.prototxt b/testdata/r4/descriptors/cqf-questionnaire.descriptor.prototxt index 272b23026..85a4147d2 100644 --- a/testdata/r4/descriptors/cqf-questionnaire.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-questionnaire.descriptor.prototxt @@ -304,18 +304,6 @@ field { type_name: ".google.fhir.r4.core.CQFQuestionnaire.Item" options { [google.fhir.proto.field_description]: "Questions and sections within the Questionnaire" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "type!=\'display\' or readOnly.empty()" - [google.fhir.proto.fhir_path_constraint]: "(type!=\'group\' and type!=\'display\') or initial.empty()" - [google.fhir.proto.fhir_path_constraint]: "type!=\'display\' or (required.empty() and repeats.empty())" - [google.fhir.proto.fhir_path_constraint]: "(type =\'choice\' or type = \'open-choice\' or type = \'decimal\' or type = \'integer\' or type = \'date\' or type = \'dateTime\' or type = \'time\' or type = \'string\' or type = \'quantity\') or (answerValueSet.empty() and answerOption.empty())" - [google.fhir.proto.fhir_path_constraint]: "answerOption.empty() or answerValueSet.empty()" - [google.fhir.proto.fhir_path_constraint]: "type!=\'display\' or code.empty()" - [google.fhir.proto.fhir_path_constraint]: "(type in (\'boolean\' | \'decimal\' | \'integer\' | \'string\' | \'text\' | \'url\' | \'open-choice\')) or maxLength.empty()" - [google.fhir.proto.fhir_path_constraint]: "(type=\'group\' implies item.empty().not()) and (type.trace(\'type\')=\'display\' implies item.trace(\'item\').empty())" - [google.fhir.proto.fhir_path_constraint]: "repeats=true or initial.count() <= 1" - [google.fhir.proto.fhir_path_constraint]: "answerOption.empty() or initial.empty()" - [google.fhir.proto.fhir_path_constraint]: "enableWhen.count() > 2 implies enableBehavior.exists()" } } field { @@ -327,7 +315,6 @@ field { options { [google.fhir.proto.field_description]: "A library containing logic referenced by the questionnaire" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/cqf-library" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } } @@ -487,8 +474,6 @@ nested_type { type_name: ".google.fhir.r4.core.CQFQuestionnaire.Item.EnableWhen" options { [google.fhir.proto.field_description]: "Only allow data when" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "operator = \'exists\' implies (answer is Boolean)" } } field { @@ -559,7 +544,6 @@ nested_type { type_name: ".google.fhir.r4.core.CQFQuestionnaire.Item.AnswerOption" options { [google.fhir.proto.field_description]: "Permitted answer" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -570,7 +554,6 @@ nested_type { type_name: ".google.fhir.r4.core.CQFQuestionnaire.Item.Initial" options { [google.fhir.proto.field_description]: "Initial value(s) when item is first rendered" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -795,6 +778,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "operator = \'exists\' implies (answer is Boolean)" + } } nested_type { name: "EnableBehaviorCode" @@ -1091,10 +1077,25 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "type!=\'display\' or readOnly.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(type!=\'group\' and type!=\'display\') or initial.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "type!=\'display\' or (required.empty() and repeats.empty())" + [google.fhir.proto.fhir_path_message_constraint]: "(type =\'choice\' or type = \'open-choice\' or type = \'decimal\' or type = \'integer\' or type = \'date\' or type = \'dateTime\' or type = \'time\' or type = \'string\' or type = \'quantity\') or (answerValueSet.empty() and answerOption.empty())" + [google.fhir.proto.fhir_path_message_constraint]: "answerOption.empty() or answerValueSet.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "type!=\'display\' or code.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(type in (\'boolean\' | \'decimal\' | \'integer\' | \'string\' | \'text\' | \'url\' | \'open-choice\')) or maxLength.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(type=\'group\' implies item.empty().not()) and (type.trace(\'type\')=\'display\' implies item.trace(\'item\').empty())" + [google.fhir.proto.fhir_path_message_constraint]: "repeats=true or initial.count() <= 1" + [google.fhir.proto.fhir_path_message_constraint]: "answerOption.empty() or initial.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "enableWhen.count() > 2 implies enableBehavior.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for CQF-Questionnaire.\nA questionnaire with the ability to specify behavior associated with questions or groups of questions.\nSee http://hl7.org/fhir/StructureDefinition/cqf-questionnaire" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Questionnaire" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-questionnaire" + [google.fhir.proto.fhir_path_message_constraint]: "descendants().linkId.isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/cqf-receivingOrganization.descriptor.prototxt b/testdata/r4/descriptors/cqf-receivingOrganization.descriptor.prototxt index 25f50b8c1..750b28f86 100644 --- a/testdata/r4/descriptors/cqf-receivingOrganization.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-receivingOrganization.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for receivingOrganization.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-receivingOrganization" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-receivingOrganization" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-receivingPerson.descriptor.prototxt b/testdata/r4/descriptors/cqf-receivingPerson.descriptor.prototxt index 1e3befd00..0715edebf 100644 --- a/testdata/r4/descriptors/cqf-receivingPerson.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-receivingPerson.descriptor.prototxt @@ -29,4 +29,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for receivingPerson.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-receivingPerson" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-receivingPerson" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-recipientLanguage.descriptor.prototxt b/testdata/r4/descriptors/cqf-recipientLanguage.descriptor.prototxt index b6aa2c7f9..482f94a28 100644 --- a/testdata/r4/descriptors/cqf-recipientLanguage.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-recipientLanguage.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for recipientLanguage.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-recipientLanguage" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-recipientLanguage" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-recipientType.descriptor.prototxt b/testdata/r4/descriptors/cqf-recipientType.descriptor.prototxt index 86069ce91..dd37789c5 100644 --- a/testdata/r4/descriptors/cqf-recipientType.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-recipientType.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for recipientType.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-recipientType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-recipientType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-relativeDateTime.descriptor.prototxt b/testdata/r4/descriptors/cqf-relativeDateTime.descriptor.prototxt index 1789635f9..79067bba1 100644 --- a/testdata/r4/descriptors/cqf-relativeDateTime.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-relativeDateTime.descriptor.prototxt @@ -120,4 +120,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for relativeDateTime.\nA date/time that is specified relative to another event.\nSee http://hl7.org/fhir/StructureDefinition/cqf-relativeDateTime" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-relativeDateTime" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-strengthOfRecommendation.descriptor.prototxt b/testdata/r4/descriptors/cqf-strengthOfRecommendation.descriptor.prototxt index 2cdc71f40..fda7671d1 100644 --- a/testdata/r4/descriptors/cqf-strengthOfRecommendation.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-strengthOfRecommendation.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for strengthOfRecommendation.\nThe strength of the recommendation.\nSee http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-strengthOfRecommendation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-systemUserLanguage.descriptor.prototxt b/testdata/r4/descriptors/cqf-systemUserLanguage.descriptor.prototxt index 770bd00dd..eb293a8c0 100644 --- a/testdata/r4/descriptors/cqf-systemUserLanguage.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-systemUserLanguage.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for systemUserLanguage.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/cqf-systemUserLanguage" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-systemUserLanguage" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-systemUserTaskContext.descriptor.prototxt b/testdata/r4/descriptors/cqf-systemUserTaskContext.descriptor.prototxt index 39323603c..f068fc31b 100644 --- a/testdata/r4/descriptors/cqf-systemUserTaskContext.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-systemUserTaskContext.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for systemUserTaskContext.\nThe task the system user is performing.\nSee http://hl7.org/fhir/StructureDefinition/cqf-systemUserTaskContext" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-systemUserTaskContext" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqf-systemUserType.descriptor.prototxt b/testdata/r4/descriptors/cqf-systemUserType.descriptor.prototxt index d88c07a5a..d261b9490 100644 --- a/testdata/r4/descriptors/cqf-systemUserType.descriptor.prototxt +++ b/testdata/r4/descriptors/cqf-systemUserType.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for systemUserType.\nThe type of user initiating the request.\nSee http://hl7.org/fhir/StructureDefinition/cqf-systemUserType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqf-systemUserType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/cqllibrary.descriptor.prototxt b/testdata/r4/descriptors/cqllibrary.descriptor.prototxt index 7a5d1da4d..be0f464fa 100644 --- a/testdata/r4/descriptors/cqllibrary.descriptor.prototxt +++ b/testdata/r4/descriptors/cqllibrary.descriptor.prototxt @@ -457,4 +457,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for CQL Library.\nRepresents a library of quality improvement components.\nSee http://hl7.org/fhir/StructureDefinition/cqllibrary" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Library" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqllibrary" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/cqm-ValidityPeriod.descriptor.prototxt b/testdata/r4/descriptors/cqm-ValidityPeriod.descriptor.prototxt index 57855c4eb..ecb5a4c11 100644 --- a/testdata/r4/descriptors/cqm-ValidityPeriod.descriptor.prototxt +++ b/testdata/r4/descriptors/cqm-ValidityPeriod.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ValidityPeriod.\nValidity Period.\nSee http://hl7.org/fhir/StructureDefinition/cqm-ValidityPeriod" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/cqm-ValidityPeriod" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/data-absent-reason.descriptor.prototxt b/testdata/r4/descriptors/data-absent-reason.descriptor.prototxt index 3f9c53cbd..26b682ad0 100644 --- a/testdata/r4/descriptors/data-absent-reason.descriptor.prototxt +++ b/testdata/r4/descriptors/data-absent-reason.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Data Absent Reason.\nunknown | asked | temp | notasked | masked | unsupported | astext | error.\nSee http://hl7.org/fhir/StructureDefinition/data-absent-reason" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/data-absent-reason" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/designNote.descriptor.prototxt b/testdata/r4/descriptors/designNote.descriptor.prototxt index e6fb8b57a..90ce96da5 100644 --- a/testdata/r4/descriptors/designNote.descriptor.prototxt +++ b/testdata/r4/descriptors/designNote.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Design Note.\nDesign comments.\nSee http://hl7.org/fhir/StructureDefinition/designNote" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/designNote" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/device-implantStatus.descriptor.prototxt b/testdata/r4/descriptors/device-implantStatus.descriptor.prototxt index b442ec049..a07582cc2 100644 --- a/testdata/r4/descriptors/device-implantStatus.descriptor.prototxt +++ b/testdata/r4/descriptors/device-implantStatus.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for implantStatus.\nImplant Status.\nSee http://hl7.org/fhir/StructureDefinition/device-implantStatus" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/device-implantStatus" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/devicemetricobservation.descriptor.prototxt b/testdata/r4/descriptors/devicemetricobservation.descriptor.prototxt index 24e7529a2..343c0664a 100644 --- a/testdata/r4/descriptors/devicemetricobservation.descriptor.prototxt +++ b/testdata/r4/descriptors/devicemetricobservation.descriptor.prototxt @@ -304,8 +304,6 @@ field { type_name: ".google.fhir.r4.core.DeviceMetricObservationProfile.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -338,7 +336,6 @@ field { type_name: ".google.fhir.r4.core.DeviceMetricObservationProfile.Component" options { [google.fhir.proto.field_description]: "Component results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -559,6 +556,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -747,4 +747,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Device Metric Observation Profile.\nMeasurements and simple assertions.\nSee http://hl7.org/fhir/StructureDefinition/devicemetricobservation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/devicemetricobservation" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" } diff --git a/testdata/r4/descriptors/devicerequest-patientInstruction.descriptor.prototxt b/testdata/r4/descriptors/devicerequest-patientInstruction.descriptor.prototxt index f4ab7dafd..cd0516232 100644 --- a/testdata/r4/descriptors/devicerequest-patientInstruction.descriptor.prototxt +++ b/testdata/r4/descriptors/devicerequest-patientInstruction.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for patientInstruction.\nPatient Friendly Insructions.\nSee http://hl7.org/fhir/StructureDefinition/devicerequest-patientInstruction" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/devicerequest-patientInstruction" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/diagnosticReport-addendumOf.descriptor.prototxt b/testdata/r4/descriptors/diagnosticReport-addendumOf.descriptor.prototxt index f5dc81353..fdee0d77a 100644 --- a/testdata/r4/descriptors/diagnosticReport-addendumOf.descriptor.prototxt +++ b/testdata/r4/descriptors/diagnosticReport-addendumOf.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for addendumOf.\nAdditional or Supplement Content.\nSee http://hl7.org/fhir/StructureDefinition/diagnosticReport-addendumOf" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/diagnosticReport-addendumOf" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/diagnosticReport-extends.descriptor.prototxt b/testdata/r4/descriptors/diagnosticReport-extends.descriptor.prototxt index ee466c8d0..0ee61ed6d 100644 --- a/testdata/r4/descriptors/diagnosticReport-extends.descriptor.prototxt +++ b/testdata/r4/descriptors/diagnosticReport-extends.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for extends.\nRelated reports.\nSee http://hl7.org/fhir/StructureDefinition/diagnosticReport-extends" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/diagnosticReport-extends" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/diagnosticReport-locationPerformed.descriptor.prototxt b/testdata/r4/descriptors/diagnosticReport-locationPerformed.descriptor.prototxt index fa8768870..5a8c67531 100644 --- a/testdata/r4/descriptors/diagnosticReport-locationPerformed.descriptor.prototxt +++ b/testdata/r4/descriptors/diagnosticReport-locationPerformed.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for locationPerformed.\nLocation Performed.\nSee http://hl7.org/fhir/StructureDefinition/diagnosticReport-locationPerformed" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/diagnosticReport-locationPerformed" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/diagnosticReport-replaces.descriptor.prototxt b/testdata/r4/descriptors/diagnosticReport-replaces.descriptor.prototxt index fd2740a6e..50e2a65e7 100644 --- a/testdata/r4/descriptors/diagnosticReport-replaces.descriptor.prototxt +++ b/testdata/r4/descriptors/diagnosticReport-replaces.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for replaces.\nReplacement for another report.\nSee http://hl7.org/fhir/StructureDefinition/diagnosticReport-replaces" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/diagnosticReport-replaces" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/diagnosticReport-risk.descriptor.prototxt b/testdata/r4/descriptors/diagnosticReport-risk.descriptor.prototxt index 6742e502a..defbccd90 100644 --- a/testdata/r4/descriptors/diagnosticReport-risk.descriptor.prototxt +++ b/testdata/r4/descriptors/diagnosticReport-risk.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for risk.\nRisk.\nSee http://hl7.org/fhir/StructureDefinition/diagnosticReport-risk" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/diagnosticReport-risk" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/diagnosticReport-summaryOf.descriptor.prototxt b/testdata/r4/descriptors/diagnosticReport-summaryOf.descriptor.prototxt index d5a27a84c..3d2707477 100644 --- a/testdata/r4/descriptors/diagnosticReport-summaryOf.descriptor.prototxt +++ b/testdata/r4/descriptors/diagnosticReport-summaryOf.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for summaryOf.\nSummary Of Other Reports.\nSee http://hl7.org/fhir/StructureDefinition/diagnosticReport-summaryOf" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/diagnosticReport-summaryOf" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/diagnosticreport-genetics.descriptor.prototxt b/testdata/r4/descriptors/diagnosticreport-genetics.descriptor.prototxt index 0dfdebb26..fdf78ce37 100644 --- a/testdata/r4/descriptors/diagnosticreport-genetics.descriptor.prototxt +++ b/testdata/r4/descriptors/diagnosticreport-genetics.descriptor.prototxt @@ -256,7 +256,6 @@ field { type_name: ".google.fhir.r4.core.DiagnosticReportGenetics.Media" options { [google.fhir.proto.field_description]: "Key images associated with this report" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -294,7 +293,6 @@ field { options { [google.fhir.proto.field_description]: "AssessedCondition" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAssessedCondition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "AssessedCondition" @@ -308,7 +306,6 @@ field { options { [google.fhir.proto.field_description]: "FamilyHistory" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsFamilyMemberHistory" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "FamilyMemberHistory" @@ -322,7 +319,6 @@ field { options { [google.fhir.proto.field_description]: "Analysis" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsAnalysis" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "Analysis" @@ -336,7 +332,6 @@ field { options { [google.fhir.proto.field_description]: "References" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/DiagnosticReport-geneticsReferences" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "References" diff --git a/testdata/r4/descriptors/display.descriptor.prototxt b/testdata/r4/descriptors/display.descriptor.prototxt index a1baa669c..c5365c22f 100644 --- a/testdata/r4/descriptors/display.descriptor.prototxt +++ b/testdata/r4/descriptors/display.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Display Name.\nDisplay name for canonical reference.\nSee http://hl7.org/fhir/StructureDefinition/display" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/display" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/ehrsrle-auditevent.descriptor.prototxt b/testdata/r4/descriptors/ehrsrle-auditevent.descriptor.prototxt index 7e62161fc..98e358878 100644 --- a/testdata/r4/descriptors/ehrsrle-auditevent.descriptor.prototxt +++ b/testdata/r4/descriptors/ehrsrle-auditevent.descriptor.prototxt @@ -176,7 +176,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Actor involved in the event" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -188,7 +187,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Audit Event Reporter" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -199,8 +197,6 @@ field { type_name: ".google.fhir.r4.core.EHRSFMRecordLifecycleEventAuditEvent.Entity" options { [google.fhir.proto.field_description]: "Data or objects used" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "name.empty() or query.empty()" } } nested_type { @@ -395,7 +391,6 @@ nested_type { type_name: ".google.fhir.r4.core.EHRSFMRecordLifecycleEventAuditEvent.Agent.Network" options { [google.fhir.proto.field_description]: "Logical network location for application activity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -680,7 +675,6 @@ nested_type { type_name: ".google.fhir.r4.core.EHRSFMRecordLifecycleEventAuditEvent.Entity.Detail" options { [google.fhir.proto.field_description]: "Additional Information about the entity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -764,6 +758,9 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "name.empty() or query.empty()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE diff --git a/testdata/r4/descriptors/ehrsrle-provenance.descriptor.prototxt b/testdata/r4/descriptors/ehrsrle-provenance.descriptor.prototxt index 2c7692050..8467b0a3e 100644 --- a/testdata/r4/descriptors/ehrsrle-provenance.descriptor.prototxt +++ b/testdata/r4/descriptors/ehrsrle-provenance.descriptor.prototxt @@ -168,7 +168,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Actor involved" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -179,7 +178,6 @@ field { type_name: ".google.fhir.r4.core.EHRSFMRecordLifecycleEventProvenance.Entity" options { [google.fhir.proto.field_description]: "An entity used in this activity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/elementdefinition-allowedUnits.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-allowedUnits.descriptor.prototxt index d31d9863b..9ff6d859e 100644 --- a/testdata/r4/descriptors/elementdefinition-allowedUnits.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-allowedUnits.descriptor.prototxt @@ -50,4 +50,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for allowedUnits.\nUnits to use for measured value.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-bestpractice-explanation.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-bestpractice-explanation.descriptor.prototxt index 2dbeed1c1..1aa89c5d7 100644 --- a/testdata/r4/descriptors/elementdefinition-bestpractice-explanation.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-bestpractice-explanation.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for bestpractice-explanation.\nExplains why an invariant is labelled as best practice.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-bestpractice.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-bestpractice.descriptor.prototxt index 010a7f0fc..4a7ea9d07 100644 --- a/testdata/r4/descriptors/elementdefinition-bestpractice.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-bestpractice.descriptor.prototxt @@ -50,4 +50,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for bestpractice.\nMark a warning invariant as \'best practice\'.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-bindingName.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-bindingName.descriptor.prototxt index 6382d0c2b..3b183f524 100644 --- a/testdata/r4/descriptors/elementdefinition-bindingName.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-bindingName.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for bindingName.\nSuggested Name for code generation.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-de.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-de.descriptor.prototxt index 4f27ce414..439a72477 100644 --- a/testdata/r4/descriptors/elementdefinition-de.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-de.descriptor.prototxt @@ -167,7 +167,6 @@ field { type_name: ".google.fhir.r4.core.DataElementConstraintOnElementDefinitionDataType.Base" options { [google.fhir.proto.field_description]: "Base definition information for tools" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -184,9 +183,6 @@ field { type_name: ".google.fhir.r4.core.DataElementConstraintOnElementDefinitionDataType.TypeRef" options { [google.fhir.proto.field_description]: "Data type and Profile for this element" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "aggregation.empty() or (code = \'Reference\')" - [google.fhir.proto.fhir_path_constraint]: "(code=\'Reference\' or code = \'canonical\') or targetProfile.empty()" } } field { @@ -239,7 +235,6 @@ field { type_name: ".google.fhir.r4.core.DataElementConstraintOnElementDefinitionDataType.Example" options { [google.fhir.proto.field_description]: "Example value (as defined for type)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -290,8 +285,6 @@ field { type_name: ".google.fhir.r4.core.DataElementConstraintOnElementDefinitionDataType.Constraint" options { [google.fhir.proto.field_description]: "Condition that must evaluate to true" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "expression.exists()" } } field { @@ -334,8 +327,6 @@ field { type_name: ".google.fhir.r4.core.DataElementConstraintOnElementDefinitionDataType.ElementDefinitionBinding" options { [google.fhir.proto.field_description]: "ValueSet details if this is coded" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "valueSet.exists() implies (valueSet.startsWith(\'http:\') or valueSet.startsWith(\'https\') or valueSet.startsWith(\'urn:\'))" } } field { @@ -346,7 +337,6 @@ field { type_name: ".google.fhir.r4.core.DataElementConstraintOnElementDefinitionDataType.Mapping" options { [google.fhir.proto.field_description]: "Map element to another set of definitions" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -521,6 +511,10 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "aggregation.empty() or (code = \'Reference\')" + [google.fhir.proto.fhir_path_message_constraint]: "(code=\'Reference\' or code = \'canonical\') or targetProfile.empty()" + } } nested_type { name: "DefaultValueX" @@ -1655,6 +1649,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "expression.exists()" + } } nested_type { name: "ElementDefinitionBinding" @@ -1736,6 +1733,9 @@ nested_type { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/code" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "valueSet.exists() implies (valueSet.startsWith(\'http:\') or valueSet.startsWith(\'https\') or valueSet.startsWith(\'urn:\'))" + } } nested_type { name: "Mapping" @@ -1842,4 +1842,17 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for DataElement constraint on ElementDefinition data type.\nDefinition of an element in a resource or extension.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-de" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/ElementDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-de" + [google.fhir.proto.fhir_path_message_constraint]: "min.empty() or max.empty() or (max = \'*\') or iif(max != \'*\', min <= max.toInteger())" + [google.fhir.proto.fhir_path_message_constraint]: "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())" + [google.fhir.proto.fhir_path_message_constraint]: "pattern.empty() or (type.count() <= 1)" + [google.fhir.proto.fhir_path_message_constraint]: "fixed.empty() or (type.count() <= 1)" + [google.fhir.proto.fhir_path_message_constraint]: "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()" + [google.fhir.proto.fhir_path_message_constraint]: "sliceIsConstraining.exists() implies sliceName.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "pattern.empty() or fixed.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "constraint.select(key).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "type.select(code).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "sliceName.empty() or sliceName.matches(\'^[a-zA-Z0-9\\\\/\\\\-_\\\\[\\\\]\\\\@]+$\')" + [google.fhir.proto.fhir_path_message_constraint]: "defaultValue.empty() or meaningWhenMissing.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "isModifier implies isModifierReason.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "path.matches(\'[A-Za-z][A-Za-z0-9]*(\\\\.[a-z][A-Za-z0-9]*(\\\\[x])?)*\')" } diff --git a/testdata/r4/descriptors/elementdefinition-equivalence.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-equivalence.descriptor.prototxt index 90527fbf6..e337a64b8 100644 --- a/testdata/r4/descriptors/elementdefinition-equivalence.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-equivalence.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for equivalence.\nequivalent | equal | wider | subsumes | narrower | specializes | inexact | unmatched | disjoint.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-equivalence" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-equivalence" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-identifier.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-identifier.descriptor.prototxt index a119fa22b..0c6189ece 100644 --- a/testdata/r4/descriptors/elementdefinition-identifier.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-identifier.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for identifier.\nExternal Identifier associated with this element.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-identifier" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-identifier" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-inheritedExtensibleValueSet.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-inheritedExtensibleValueSet.descriptor.prototxt index d571e3518..b1944c9ee 100644 --- a/testdata/r4/descriptors/elementdefinition-inheritedExtensibleValueSet.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-inheritedExtensibleValueSet.descriptor.prototxt @@ -50,4 +50,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for inheritedExtensibleValueSet.\nAn extensible Value Set specified in a parent profile.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-inheritedExtensibleValueSet" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-inheritedExtensibleValueSet" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-isCommonBinding.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-isCommonBinding.descriptor.prototxt index 69a906ee4..8b6bbc9f1 100644 --- a/testdata/r4/descriptors/elementdefinition-isCommonBinding.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-isCommonBinding.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for isCommonBinding.\nWhether used on multiple resources.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-maxValueSet.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-maxValueSet.descriptor.prototxt index 26fd2e1fc..6579d05c9 100644 --- a/testdata/r4/descriptors/elementdefinition-maxValueSet.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-maxValueSet.descriptor.prototxt @@ -50,4 +50,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for maxValueSet.\nMaximum Value Set (when strength = extensible).\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-minValueSet.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-minValueSet.descriptor.prototxt index d33bae5b8..28395d9e8 100644 --- a/testdata/r4/descriptors/elementdefinition-minValueSet.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-minValueSet.descriptor.prototxt @@ -50,4 +50,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for minValueSet.\nMinimum Value Set (what system must support).\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-minValueSet" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-minValueSet" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-namespace.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-namespace.descriptor.prototxt index 80ee372bf..d4b02d946 100644 --- a/testdata/r4/descriptors/elementdefinition-namespace.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-namespace.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for namespace.\nspecify namespace other than http://hl7.org/fhir.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-profile-element.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-profile-element.descriptor.prototxt index 26d9eb7e0..ae5406178 100644 --- a/testdata/r4/descriptors/elementdefinition-profile-element.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-profile-element.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for profile-element.\nSpecific element for profile (for backbone elements).\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-profile-element" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-question.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-question.descriptor.prototxt index ab302010a..be6bf9eb0 100644 --- a/testdata/r4/descriptors/elementdefinition-question.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-question.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for question.\nPrompt for element phrased as question.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-question" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-question" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-selector.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-selector.descriptor.prototxt index c656a90ab..1f465d72b 100644 --- a/testdata/r4/descriptors/elementdefinition-selector.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-selector.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for selector.\nFHIRPath that defines the selection criteria for a slice.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-selector" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-selector" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/elementdefinition-translatable.descriptor.prototxt b/testdata/r4/descriptors/elementdefinition-translatable.descriptor.prototxt index b3b91c872..7224d9665 100644 --- a/testdata/r4/descriptors/elementdefinition-translatable.descriptor.prototxt +++ b/testdata/r4/descriptors/elementdefinition-translatable.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for translatable.\nWhether translations apply to this element.\nSee http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/encounter-associatedEncounter.descriptor.prototxt b/testdata/r4/descriptors/encounter-associatedEncounter.descriptor.prototxt index 92eb7e744..2101de6a3 100644 --- a/testdata/r4/descriptors/encounter-associatedEncounter.descriptor.prototxt +++ b/testdata/r4/descriptors/encounter-associatedEncounter.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for associatedEncounter.\nAssociated Encounter.\nSee http://hl7.org/fhir/StructureDefinition/encounter-associatedEncounter" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/encounter-associatedEncounter" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/encounter-modeOfArrival.descriptor.prototxt b/testdata/r4/descriptors/encounter-modeOfArrival.descriptor.prototxt index a4451218e..c91284d8b 100644 --- a/testdata/r4/descriptors/encounter-modeOfArrival.descriptor.prototxt +++ b/testdata/r4/descriptors/encounter-modeOfArrival.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for modeOfArrival.\nThe method of arrival of the patient into the facility.\nSee http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/encounter-modeOfArrival" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/encounter-reasonCancelled.descriptor.prototxt b/testdata/r4/descriptors/encounter-reasonCancelled.descriptor.prototxt index 366e310f6..2c004c29d 100644 --- a/testdata/r4/descriptors/encounter-reasonCancelled.descriptor.prototxt +++ b/testdata/r4/descriptors/encounter-reasonCancelled.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reasonCancelled.\nExplanation for cancellation.\nSee http://hl7.org/fhir/StructureDefinition/encounter-reasonCancelled" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/encounter-reasonCancelled" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/entryFormat.descriptor.prototxt b/testdata/r4/descriptors/entryFormat.descriptor.prototxt index 4c1cb5781..62c3deb72 100644 --- a/testdata/r4/descriptors/entryFormat.descriptor.prototxt +++ b/testdata/r4/descriptors/entryFormat.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for entryFormat.\nUser prompt for format.\nSee http://hl7.org/fhir/StructureDefinition/entryFormat" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/entryFormat" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/event-basedOn.descriptor.prototxt b/testdata/r4/descriptors/event-basedOn.descriptor.prototxt index c5bd3ed23..e6b6d8b03 100644 --- a/testdata/r4/descriptors/event-basedOn.descriptor.prototxt +++ b/testdata/r4/descriptors/event-basedOn.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for basedOn.\nFulfills plan, proposal or order.\nSee http://hl7.org/fhir/StructureDefinition/event-basedOn" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/event-basedOn" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/event-eventHistory.descriptor.prototxt b/testdata/r4/descriptors/event-eventHistory.descriptor.prototxt index 6a43bf07c..366e8e47f 100644 --- a/testdata/r4/descriptors/event-eventHistory.descriptor.prototxt +++ b/testdata/r4/descriptors/event-eventHistory.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for eventHistory.\nEvents of interest in the resource lifecycle.\nSee http://hl7.org/fhir/StructureDefinition/event-eventHistory" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/event-eventHistory" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/event-location.descriptor.prototxt b/testdata/r4/descriptors/event-location.descriptor.prototxt index f8e4be0f0..5917bb657 100644 --- a/testdata/r4/descriptors/event-location.descriptor.prototxt +++ b/testdata/r4/descriptors/event-location.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for location.\nWhere event occurred.\nSee http://hl7.org/fhir/StructureDefinition/event-location" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/event-location" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/event-partOf.descriptor.prototxt b/testdata/r4/descriptors/event-partOf.descriptor.prototxt index 3dd6d38e3..aca40978b 100644 --- a/testdata/r4/descriptors/event-partOf.descriptor.prototxt +++ b/testdata/r4/descriptors/event-partOf.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for partOf.\nPart of referenced event.\nSee http://hl7.org/fhir/StructureDefinition/event-partOf" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/event-partOf" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/event-performerFunction.descriptor.prototxt b/testdata/r4/descriptors/event-performerFunction.descriptor.prototxt index 41621f132..1df869f4e 100644 --- a/testdata/r4/descriptors/event-performerFunction.descriptor.prototxt +++ b/testdata/r4/descriptors/event-performerFunction.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for performerFunction.\nType of performance.\nSee http://hl7.org/fhir/StructureDefinition/event-performerFunction" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/event-performerFunction" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/event-statusReason.descriptor.prototxt b/testdata/r4/descriptors/event-statusReason.descriptor.prototxt index 0b525d697..51fb76afb 100644 --- a/testdata/r4/descriptors/event-statusReason.descriptor.prototxt +++ b/testdata/r4/descriptors/event-statusReason.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for statusReason.\nReason for current status.\nSee http://hl7.org/fhir/StructureDefinition/event-statusReason" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/event-statusReason" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/family-member-history-genetics-observation.descriptor.prototxt b/testdata/r4/descriptors/family-member-history-genetics-observation.descriptor.prototxt index ada46419c..15f0eb799 100644 --- a/testdata/r4/descriptors/family-member-history-genetics-observation.descriptor.prototxt +++ b/testdata/r4/descriptors/family-member-history-genetics-observation.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for observation.\nGenetic markers, ethnicity, etc.\nSee http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-observation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-observation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/family-member-history-genetics-parent.descriptor.prototxt b/testdata/r4/descriptors/family-member-history-genetics-parent.descriptor.prototxt index 13cca83fa..b7e236a00 100644 --- a/testdata/r4/descriptors/family-member-history-genetics-parent.descriptor.prototxt +++ b/testdata/r4/descriptors/family-member-history-genetics-parent.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for parent.\nMother(s) & Father(s) - genetic & other.\nSee http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-parent" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-parent" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/family-member-history-genetics-sibling.descriptor.prototxt b/testdata/r4/descriptors/family-member-history-genetics-sibling.descriptor.prototxt index 1e9141931..2f7498f5a 100644 --- a/testdata/r4/descriptors/family-member-history-genetics-sibling.descriptor.prototxt +++ b/testdata/r4/descriptors/family-member-history-genetics-sibling.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for sibling.\nnatural brother(s) & natural sister(s) - genetic & other.\nSee http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-sibling" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-sibling" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/familymemberhistory-abatement.descriptor.prototxt b/testdata/r4/descriptors/familymemberhistory-abatement.descriptor.prototxt index b0b298f12..776e37646 100644 --- a/testdata/r4/descriptors/familymemberhistory-abatement.descriptor.prototxt +++ b/testdata/r4/descriptors/familymemberhistory-abatement.descriptor.prototxt @@ -58,4 +58,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for abatement.\nWhen (or if) the family member\'s condition resolved.\nSee http://hl7.org/fhir/StructureDefinition/familymemberhistory-abatement" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/familymemberhistory-abatement" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/familymemberhistory-patient-record.descriptor.prototxt b/testdata/r4/descriptors/familymemberhistory-patient-record.descriptor.prototxt index 2b8aec956..c35c12d3f 100644 --- a/testdata/r4/descriptors/familymemberhistory-patient-record.descriptor.prototxt +++ b/testdata/r4/descriptors/familymemberhistory-patient-record.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for patient-record.\nLink to patient record.\nSee http://hl7.org/fhir/StructureDefinition/familymemberhistory-patient-record" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/familymemberhistory-patient-record" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/familymemberhistory-severity.descriptor.prototxt b/testdata/r4/descriptors/familymemberhistory-severity.descriptor.prototxt index 13b6af312..386f88dec 100644 --- a/testdata/r4/descriptors/familymemberhistory-severity.descriptor.prototxt +++ b/testdata/r4/descriptors/familymemberhistory-severity.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for severity.\nThe seriousness of the family member condition.\nSee http://hl7.org/fhir/StructureDefinition/familymemberhistory-severity" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/familymemberhistory-severity" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/familymemberhistory-type.descriptor.prototxt b/testdata/r4/descriptors/familymemberhistory-type.descriptor.prototxt index 4c2321e16..8952f909b 100644 --- a/testdata/r4/descriptors/familymemberhistory-type.descriptor.prototxt +++ b/testdata/r4/descriptors/familymemberhistory-type.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for type.\nPurpose of the family member history.\nSee http://hl7.org/fhir/StructureDefinition/familymemberhistory-type" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/familymemberhistory-type" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/flag-detail.descriptor.prototxt b/testdata/r4/descriptors/flag-detail.descriptor.prototxt index 009b32454..ae13c71a1 100644 --- a/testdata/r4/descriptors/flag-detail.descriptor.prototxt +++ b/testdata/r4/descriptors/flag-detail.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for detail.\nResource with details for flag.\nSee http://hl7.org/fhir/StructureDefinition/flag-detail" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/flag-detail" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/flag-priority.descriptor.prototxt b/testdata/r4/descriptors/flag-priority.descriptor.prototxt index 6151b5567..7f7d51cd3 100644 --- a/testdata/r4/descriptors/flag-priority.descriptor.prototxt +++ b/testdata/r4/descriptors/flag-priority.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for priority.\nAn alarm code.\nSee http://hl7.org/fhir/StructureDefinition/flag-priority" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/flag-priority" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/geolocation.descriptor.prototxt b/testdata/r4/descriptors/geolocation.descriptor.prototxt index b48b11da9..a572494b6 100644 --- a/testdata/r4/descriptors/geolocation.descriptor.prototxt +++ b/testdata/r4/descriptors/geolocation.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Geolocation.\nThe absolute geographic location.\nSee http://hl7.org/fhir/StructureDefinition/geolocation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/geolocation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/goal-acceptance.descriptor.prototxt b/testdata/r4/descriptors/goal-acceptance.descriptor.prototxt index a42c0677e..49de2d7ff 100644 --- a/testdata/r4/descriptors/goal-acceptance.descriptor.prototxt +++ b/testdata/r4/descriptors/goal-acceptance.descriptor.prototxt @@ -82,4 +82,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for acceptance.\nIndividual acceptance of goal.\nSee http://hl7.org/fhir/StructureDefinition/goal-acceptance" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/goal-acceptance" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/goal-reasonRejected.descriptor.prototxt b/testdata/r4/descriptors/goal-reasonRejected.descriptor.prototxt index 0e5552a17..1a3eea4a6 100644 --- a/testdata/r4/descriptors/goal-reasonRejected.descriptor.prototxt +++ b/testdata/r4/descriptors/goal-reasonRejected.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reasonRejected.\nThe reason the goal was not accepted.\nSee http://hl7.org/fhir/StructureDefinition/goal-reasonRejected" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/goal-reasonRejected" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/goal-relationship.descriptor.prototxt b/testdata/r4/descriptors/goal-relationship.descriptor.prototxt index c7c752c1e..cc0c914f8 100644 --- a/testdata/r4/descriptors/goal-relationship.descriptor.prototxt +++ b/testdata/r4/descriptors/goal-relationship.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for relationship.\nGoals related to this Goal.\nSee http://hl7.org/fhir/StructureDefinition/goal-relationship" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/goal-relationship" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/groupdefinition.descriptor.prototxt b/testdata/r4/descriptors/groupdefinition.descriptor.prototxt index 1b3fdce6c..8dc08cc36 100644 --- a/testdata/r4/descriptors/groupdefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/groupdefinition.descriptor.prototxt @@ -179,7 +179,6 @@ field { type_name: ".google.fhir.r4.core.GroupDefinition.Characteristic" options { [google.fhir.proto.field_description]: "Include / Exclude group members by Trait" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -345,4 +344,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Group Definition.\nGroup of multiple entities.\nSee http://hl7.org/fhir/StructureDefinition/groupdefinition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Group" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/groupdefinition" + [google.fhir.proto.fhir_path_message_constraint]: "member.empty() or (actual = true)" } diff --git a/testdata/r4/descriptors/hdlcholesterol.descriptor.prototxt b/testdata/r4/descriptors/hdlcholesterol.descriptor.prototxt index f27e6cbd1..5fa57025d 100644 --- a/testdata/r4/descriptors/hdlcholesterol.descriptor.prototxt +++ b/testdata/r4/descriptors/hdlcholesterol.descriptor.prototxt @@ -323,8 +323,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -347,7 +345,6 @@ field { type_name: ".google.fhir.r4.core.HdlCholesterol.Component" options { [google.fhir.proto.field_description]: "Component results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -476,7 +473,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A fixed quantity (no comparator)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "code.empty() or system.exists()" [google.fhir.proto.fhir_path_constraint]: "comparator.empty()" } @@ -515,6 +511,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -703,4 +702,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Example Lipid Profile.\nHDL Cholesterol Result.\nSee http://hl7.org/fhir/StructureDefinition/hdlcholesterol" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/hdlcholesterol" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" } diff --git a/testdata/r4/descriptors/headcircum.descriptor.prototxt b/testdata/r4/descriptors/headcircum.descriptor.prototxt index a8baa7a72..2d9e41190 100644 --- a/testdata/r4/descriptors/headcircum.descriptor.prototxt +++ b/testdata/r4/descriptors/headcircum.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -323,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationHeadcircum.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -364,8 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationHeadcircum.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -479,6 +474,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -593,6 +589,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -775,6 +774,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -782,4 +784,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/headcircum" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/heartrate.descriptor.prototxt b/testdata/r4/descriptors/heartrate.descriptor.prototxt index 082dc87f1..5316be0a5 100644 --- a/testdata/r4/descriptors/heartrate.descriptor.prototxt +++ b/testdata/r4/descriptors/heartrate.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -323,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationHeartrate.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -364,8 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationHeartrate.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -479,6 +474,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -593,6 +589,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -775,6 +774,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -782,4 +784,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/heartrate" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/hla-genotyping-results-allele-database.descriptor.prototxt b/testdata/r4/descriptors/hla-genotyping-results-allele-database.descriptor.prototxt index 8ec06b475..acbee72b8 100644 --- a/testdata/r4/descriptors/hla-genotyping-results-allele-database.descriptor.prototxt +++ b/testdata/r4/descriptors/hla-genotyping-results-allele-database.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for allele-database.\nAllele Database.\nSee http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-allele-database" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-allele-database" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/hla-genotyping-results-glstring.descriptor.prototxt b/testdata/r4/descriptors/hla-genotyping-results-glstring.descriptor.prototxt index d98ad1f5f..7679aa44e 100644 --- a/testdata/r4/descriptors/hla-genotyping-results-glstring.descriptor.prototxt +++ b/testdata/r4/descriptors/hla-genotyping-results-glstring.descriptor.prototxt @@ -44,4 +44,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for glstring.\nglstring.\nSee http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-glstring" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-glstring" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/hla-genotyping-results-haploid.descriptor.prototxt b/testdata/r4/descriptors/hla-genotyping-results-haploid.descriptor.prototxt index 730b62181..7bcae2e93 100644 --- a/testdata/r4/descriptors/hla-genotyping-results-haploid.descriptor.prototxt +++ b/testdata/r4/descriptors/hla-genotyping-results-haploid.descriptor.prototxt @@ -54,4 +54,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for haploid.\nhaploid.\nSee http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-haploid" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-haploid" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/hla-genotyping-results-method.descriptor.prototxt b/testdata/r4/descriptors/hla-genotyping-results-method.descriptor.prototxt index 551251ca5..7454c5db8 100644 --- a/testdata/r4/descriptors/hla-genotyping-results-method.descriptor.prototxt +++ b/testdata/r4/descriptors/hla-genotyping-results-method.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for method.\nThe platform, methodology and software applied at the time of the\ngenotyping.\nSee http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-method" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-method" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/hlaresult.descriptor.prototxt b/testdata/r4/descriptors/hlaresult.descriptor.prototxt index aa2346f78..d9de48b84 100644 --- a/testdata/r4/descriptors/hlaresult.descriptor.prototxt +++ b/testdata/r4/descriptors/hlaresult.descriptor.prototxt @@ -256,7 +256,6 @@ field { type_name: ".google.fhir.r4.core.ProfileForHLAGenotypingResults.Media" options { [google.fhir.proto.field_description]: "Key images associated with this report" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -298,7 +297,6 @@ field { options { [google.fhir.proto.field_description]: "Allele Database" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-allele-database" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } } @@ -311,7 +309,6 @@ field { options { [google.fhir.proto.field_description]: "Glstring" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-glstring" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } } @@ -324,7 +321,6 @@ field { options { [google.fhir.proto.field_description]: "Haploid" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-haploid" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } } @@ -337,7 +333,6 @@ field { options { [google.fhir.proto.field_description]: "The platform, methodology and software applied at the time of the\rgenotyping" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/hla-genotyping-results-method" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } } diff --git a/testdata/r4/descriptors/http-response-header.descriptor.prototxt b/testdata/r4/descriptors/http-response-header.descriptor.prototxt index 05dbdfc2d..09bff37c4 100644 --- a/testdata/r4/descriptors/http-response-header.descriptor.prototxt +++ b/testdata/r4/descriptors/http-response-header.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for http-response-header.\nHTTP header returned by the interaction.\nSee http://hl7.org/fhir/StructureDefinition/http-response-header" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/http-response-header" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/humanname-assembly-order.descriptor.prototxt b/testdata/r4/descriptors/humanname-assembly-order.descriptor.prototxt index 465610e3d..b5f88c9e2 100644 --- a/testdata/r4/descriptors/humanname-assembly-order.descriptor.prototxt +++ b/testdata/r4/descriptors/humanname-assembly-order.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for assembly-order.\nPreferred display order of name parts.\nSee http://hl7.org/fhir/StructureDefinition/humanname-assembly-order" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/humanname-assembly-order" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/humanname-fathers-family.descriptor.prototxt b/testdata/r4/descriptors/humanname-fathers-family.descriptor.prototxt index c48736f81..e3e344516 100644 --- a/testdata/r4/descriptors/humanname-fathers-family.descriptor.prototxt +++ b/testdata/r4/descriptors/humanname-fathers-family.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for fathers-family.\nPortion of family name derived from father.\nSee http://hl7.org/fhir/StructureDefinition/humanname-fathers-family" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/humanname-fathers-family" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/humanname-mothers-family.descriptor.prototxt b/testdata/r4/descriptors/humanname-mothers-family.descriptor.prototxt index f2e2f5adc..c04d42337 100644 --- a/testdata/r4/descriptors/humanname-mothers-family.descriptor.prototxt +++ b/testdata/r4/descriptors/humanname-mothers-family.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for mothers-family.\nPortion of family name derived from mother.\nSee http://hl7.org/fhir/StructureDefinition/humanname-mothers-family" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/humanname-mothers-family" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/humanname-own-name.descriptor.prototxt b/testdata/r4/descriptors/humanname-own-name.descriptor.prototxt index 656f225fc..f59523da7 100644 --- a/testdata/r4/descriptors/humanname-own-name.descriptor.prototxt +++ b/testdata/r4/descriptors/humanname-own-name.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for own-name.\nPortion derived from person\'s own surname.\nSee http://hl7.org/fhir/StructureDefinition/humanname-own-name" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/humanname-own-name" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/humanname-own-prefix.descriptor.prototxt b/testdata/r4/descriptors/humanname-own-prefix.descriptor.prototxt index f4fe98e4c..0131d6cd4 100644 --- a/testdata/r4/descriptors/humanname-own-prefix.descriptor.prototxt +++ b/testdata/r4/descriptors/humanname-own-prefix.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for own-prefix.\nVoorvoegsel derived from person\'s own surname.\nSee http://hl7.org/fhir/StructureDefinition/humanname-own-prefix" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/humanname-own-prefix" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/humanname-partner-name.descriptor.prototxt b/testdata/r4/descriptors/humanname-partner-name.descriptor.prototxt index 131e01a6d..8a17e2941 100644 --- a/testdata/r4/descriptors/humanname-partner-name.descriptor.prototxt +++ b/testdata/r4/descriptors/humanname-partner-name.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for partner-name.\nPortion derived from person\'s partner\'s surname.\nSee http://hl7.org/fhir/StructureDefinition/humanname-partner-name" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/humanname-partner-name" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/humanname-partner-prefix.descriptor.prototxt b/testdata/r4/descriptors/humanname-partner-prefix.descriptor.prototxt index 24722f7bb..2d0de9ed9 100644 --- a/testdata/r4/descriptors/humanname-partner-prefix.descriptor.prototxt +++ b/testdata/r4/descriptors/humanname-partner-prefix.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for partner-prefix.\nVoorvoegsel derived from person\'s partner\'s surname.\nSee http://hl7.org/fhir/StructureDefinition/humanname-partner-prefix" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/humanname-partner-prefix" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/identifier-validDate.descriptor.prototxt b/testdata/r4/descriptors/identifier-validDate.descriptor.prototxt index b2ee2c1bb..ce5d05260 100644 --- a/testdata/r4/descriptors/identifier-validDate.descriptor.prototxt +++ b/testdata/r4/descriptors/identifier-validDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for validDate.\nExternal Identifier associated with this element.\nSee http://hl7.org/fhir/StructureDefinition/identifier-validDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/identifier-validDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-AD-use.descriptor.prototxt b/testdata/r4/descriptors/iso21090-AD-use.descriptor.prototxt index 0495fb3f7..011132154 100644 --- a/testdata/r4/descriptors/iso21090-AD-use.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-AD-use.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for AD-use.\nBAD | CONF | HP | HV | DIR | PUB | PHYS | PST.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-AD-use" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-AD-use" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-additionalLocator.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-additionalLocator.descriptor.prototxt index b93f1dad9..13d44df92 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-additionalLocator.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-additionalLocator.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-additionalLocator.\nadditionalLocator.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-additionalLocator" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-additionalLocator" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-buildingNumberSuffix.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-buildingNumberSuffix.descriptor.prototxt index fec352d92..64db55caf 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-buildingNumberSuffix.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-buildingNumberSuffix.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-buildingNumberSuffix.\nbuildingNumberSuffix.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-buildingNumberSuffix" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-buildingNumberSuffix" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-careOf.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-careOf.descriptor.prototxt index e47c90b0f..c4f3b9ed1 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-careOf.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-careOf.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-careOf.\ncareOf.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-careOf" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-careOf" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-censusTract.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-censusTract.descriptor.prototxt index 81641f49d..5de0a9349 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-censusTract.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-censusTract.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-censusTract.\ncensusTract.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-censusTract" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-censusTract" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-delimiter.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-delimiter.descriptor.prototxt index 2d46319c9..9ed46e6ff 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-delimiter.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-delimiter.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-delimiter.\ndelimiter.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-delimiter" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-delimiter" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-deliveryAddressLine.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-deliveryAddressLine.descriptor.prototxt index d808fef48..bb3f1a63f 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-deliveryAddressLine.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-deliveryAddressLine.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-deliveryAddressLine.\ndeliveryAddressLine.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryAddressLine" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryAddressLine" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationArea.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationArea.descriptor.prototxt index 150a39c61..93367a9a4 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationArea.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationArea.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-deliveryInstallationArea.\ndeliveryInstallationArea.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationArea" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationArea" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationQualifier.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationQualifier.descriptor.prototxt index 85a228985..60207c99d 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationQualifier.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationQualifier.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-deliveryInstallationQualifier.\ndeliveryInstallationQualifier.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationQualifier" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationQualifier" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationType.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationType.descriptor.prototxt index 5b3014284..e628aa20d 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationType.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-deliveryInstallationType.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-deliveryInstallationType.\ndeliveryInstallationType.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryInstallationType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-deliveryMode.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-deliveryMode.descriptor.prototxt index 2b1a7d864..d92488eab 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-deliveryMode.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-deliveryMode.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-deliveryMode.\ndeliveryMode.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryMode" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryMode" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-deliveryModeIdentifier.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-deliveryModeIdentifier.descriptor.prototxt index de487c8ef..a5208d824 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-deliveryModeIdentifier.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-deliveryModeIdentifier.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-deliveryModeIdentifier.\ndeliveryModeIdentifier.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryModeIdentifier" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-deliveryModeIdentifier" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-direction.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-direction.descriptor.prototxt index 29808fa8d..24c0076f2 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-direction.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-direction.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-direction.\ndirection.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-direction" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-direction" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-houseNumber.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-houseNumber.descriptor.prototxt index aa6456e8b..a19ed2b7e 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-houseNumber.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-houseNumber.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-houseNumber.\nhouseNumber.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-houseNumberNumeric.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-houseNumberNumeric.descriptor.prototxt index 9bf5ee680..d404fda89 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-houseNumberNumeric.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-houseNumberNumeric.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-houseNumberNumeric.\nhouseNumberNumeric.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumberNumeric" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumberNumeric" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-postBox.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-postBox.descriptor.prototxt index e15c91292..fe2423110 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-postBox.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-postBox.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-postBox.\npostBox.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-postBox" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-precinct.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-precinct.descriptor.prototxt index bdd053213..0ff3b7f09 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-precinct.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-precinct.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-precinct.\nprecinct.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-precinct" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-precinct" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-streetAddressLine.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-streetAddressLine.descriptor.prototxt index 4f7eeddf4..0e833d381 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-streetAddressLine.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-streetAddressLine.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-streetAddressLine.\nstreetAddressLine.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetAddressLine" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetAddressLine" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-streetName.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-streetName.descriptor.prototxt index 13101111e..da6320066 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-streetName.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-streetName.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-streetName.\nstreetName.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-streetNameBase.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-streetNameBase.descriptor.prototxt index 7d4785dab..8fb2a259f 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-streetNameBase.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-streetNameBase.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-streetNameBase.\nstreetNameBase.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameBase" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameBase" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-streetNameType.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-streetNameType.descriptor.prototxt index 91ead9576..5bb4be514 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-streetNameType.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-streetNameType.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-streetNameType.\nstreetNameType.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetNameType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-unitID.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-unitID.descriptor.prototxt index 619c1a34f..3aad778e8 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-unitID.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-unitID.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-unitID.\nunitID.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitID" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitID" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-ADXP-unitType.descriptor.prototxt b/testdata/r4/descriptors/iso21090-ADXP-unitType.descriptor.prototxt index 4a27abe1c..0ae3b689f 100644 --- a/testdata/r4/descriptors/iso21090-ADXP-unitType.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-ADXP-unitType.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ADXP-unitType.\nunitType.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-unitType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-EN-qualifier.descriptor.prototxt b/testdata/r4/descriptors/iso21090-EN-qualifier.descriptor.prototxt index e731a076a..475601ac3 100644 --- a/testdata/r4/descriptors/iso21090-EN-qualifier.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-EN-qualifier.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for EN-qualifier.\nLS | AC | NB | PR | HON | BR | AD | SP | MID | CL | IN | VV.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-EN-qualifier" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-EN-representation.descriptor.prototxt b/testdata/r4/descriptors/iso21090-EN-representation.descriptor.prototxt index 252d3b018..c463c20e3 100644 --- a/testdata/r4/descriptors/iso21090-EN-representation.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-EN-representation.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for EN-representation.\nABC | IDE | SYL.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-EN-representation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-EN-use.descriptor.prototxt b/testdata/r4/descriptors/iso21090-EN-use.descriptor.prototxt index b1569c2da..e4c62f04b 100644 --- a/testdata/r4/descriptors/iso21090-EN-use.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-EN-use.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for EN-use.\nA | ANON | I | P | R | C | M | ABC | IDE | SYL | OLD | DN | OR | PHON | SRCH | T.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-EN-use" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-EN-use" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-PQ-translation.descriptor.prototxt b/testdata/r4/descriptors/iso21090-PQ-translation.descriptor.prototxt index f2696b1b2..eca961449 100644 --- a/testdata/r4/descriptors/iso21090-PQ-translation.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-PQ-translation.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for PQ-translation.\nSame quantity with different units.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-PQ-translation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-PQ-translation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-SC-coding.descriptor.prototxt b/testdata/r4/descriptors/iso21090-SC-coding.descriptor.prototxt index 2941b42b3..522a5bb83 100644 --- a/testdata/r4/descriptors/iso21090-SC-coding.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-SC-coding.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for SC-coding.\ncode for string.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-SC-coding" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-TEL-address.descriptor.prototxt b/testdata/r4/descriptors/iso21090-TEL-address.descriptor.prototxt index 00681280d..41cee6605 100644 --- a/testdata/r4/descriptors/iso21090-TEL-address.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-TEL-address.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for TEL-address.\nRFC 3966 compliant telephone or fax number.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-TEL-address" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-nullFlavor.descriptor.prototxt b/testdata/r4/descriptors/iso21090-nullFlavor.descriptor.prototxt index 737b3343b..f416ff8ed 100644 --- a/testdata/r4/descriptors/iso21090-nullFlavor.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-nullFlavor.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for nullFlavor.\nNI | OTH | NINF | PINF | UNK | ASKU | NAV | NASK | TRC | MSK | NA | QS.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-nullFlavor" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-preferred.descriptor.prototxt b/testdata/r4/descriptors/iso21090-preferred.descriptor.prototxt index 315cdc654..85e4496c3 100644 --- a/testdata/r4/descriptors/iso21090-preferred.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-preferred.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for preferred.\nPreferred.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-preferred" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-preferred" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-uncertainty.descriptor.prototxt b/testdata/r4/descriptors/iso21090-uncertainty.descriptor.prototxt index 71fc52010..9a791f1f7 100644 --- a/testdata/r4/descriptors/iso21090-uncertainty.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-uncertainty.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for uncertainty.\nStandard Deviation (same units as the quantity).\nSee http://hl7.org/fhir/StructureDefinition/iso21090-uncertainty" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-uncertainty" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/iso21090-uncertaintyType.descriptor.prototxt b/testdata/r4/descriptors/iso21090-uncertaintyType.descriptor.prototxt index c2368de27..20eee5afc 100644 --- a/testdata/r4/descriptors/iso21090-uncertaintyType.descriptor.prototxt +++ b/testdata/r4/descriptors/iso21090-uncertaintyType.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for uncertaintyType.\nProbability Distribution Type for uncertainty.\nSee http://hl7.org/fhir/StructureDefinition/iso21090-uncertaintyType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/iso21090-uncertaintyType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/language.descriptor.prototxt b/testdata/r4/descriptors/language.descriptor.prototxt index 5849c76dc..a00f7818c 100644 --- a/testdata/r4/descriptors/language.descriptor.prototxt +++ b/testdata/r4/descriptors/language.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Human Language.\nHuman Language for the item.\nSee http://hl7.org/fhir/StructureDefinition/language" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/language" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/ldlcholesterol.descriptor.prototxt b/testdata/r4/descriptors/ldlcholesterol.descriptor.prototxt index f4e014533..2f2ae6867 100644 --- a/testdata/r4/descriptors/ldlcholesterol.descriptor.prototxt +++ b/testdata/r4/descriptors/ldlcholesterol.descriptor.prototxt @@ -323,8 +323,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -347,7 +345,6 @@ field { type_name: ".google.fhir.r4.core.LdlCholesterol.Component" options { [google.fhir.proto.field_description]: "Component results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -482,7 +479,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "A fixed quantity (no comparator)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "code.empty() or system.exists()" [google.fhir.proto.fhir_path_constraint]: "comparator.empty()" } @@ -515,6 +511,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -703,4 +702,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Example Lipid Profile.\nLDL Cholesterol Result.\nSee http://hl7.org/fhir/StructureDefinition/ldlcholesterol" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ldlcholesterol" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" } diff --git a/testdata/r4/descriptors/lipidprofile.descriptor.prototxt b/testdata/r4/descriptors/lipidprofile.descriptor.prototxt index efa722adc..026fc761d 100644 --- a/testdata/r4/descriptors/lipidprofile.descriptor.prototxt +++ b/testdata/r4/descriptors/lipidprofile.descriptor.prototxt @@ -256,7 +256,6 @@ field { type_name: ".google.fhir.r4.core.LipidProfile.Media" options { [google.fhir.proto.field_description]: "Key images associated with this report" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/list-changeBase.descriptor.prototxt b/testdata/r4/descriptors/list-changeBase.descriptor.prototxt index afdd836e5..b67073454 100644 --- a/testdata/r4/descriptors/list-changeBase.descriptor.prototxt +++ b/testdata/r4/descriptors/list-changeBase.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for changeBase.\nBase List for changes.\nSee http://hl7.org/fhir/StructureDefinition/list-changeBase" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/list-changeBase" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/location-boundary-geojson.descriptor.prototxt b/testdata/r4/descriptors/location-boundary-geojson.descriptor.prototxt index 7ea62a675..b7864705f 100644 --- a/testdata/r4/descriptors/location-boundary-geojson.descriptor.prototxt +++ b/testdata/r4/descriptors/location-boundary-geojson.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for boundary-geojson.\nA boundary shape that represents the outside edge of the location (in GeoJSON format).\nSee http://hl7.org/fhir/StructureDefinition/location-boundary-geojson" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/location-boundary-geojson" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/location-distance.descriptor.prototxt b/testdata/r4/descriptors/location-distance.descriptor.prototxt index eaa5e52e1..a4d64ce3c 100644 --- a/testdata/r4/descriptors/location-distance.descriptor.prototxt +++ b/testdata/r4/descriptors/location-distance.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for location-distance.\nThe distance this resource is from a provided location (geocode point).\nSee http://hl7.org/fhir/StructureDefinition/location-distance" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/location-distance" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/match-grade.descriptor.prototxt b/testdata/r4/descriptors/match-grade.descriptor.prototxt index de44b8fbb..a8803c92d 100644 --- a/testdata/r4/descriptors/match-grade.descriptor.prototxt +++ b/testdata/r4/descriptors/match-grade.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for match-grade.\nHow likely this resource is to be a match.\nSee http://hl7.org/fhir/StructureDefinition/match-grade" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/match-grade" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/maxDecimalPlaces.descriptor.prototxt b/testdata/r4/descriptors/maxDecimalPlaces.descriptor.prototxt index 7bde84539..bd2f2480c 100644 --- a/testdata/r4/descriptors/maxDecimalPlaces.descriptor.prototxt +++ b/testdata/r4/descriptors/maxDecimalPlaces.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for maxDecimalPlaces.\nMaximum digits after decimal.\nSee http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/maxSize.descriptor.prototxt b/testdata/r4/descriptors/maxSize.descriptor.prototxt index fc3e94813..81ad47a62 100644 --- a/testdata/r4/descriptors/maxSize.descriptor.prototxt +++ b/testdata/r4/descriptors/maxSize.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for maxSize.\nMax size in MB.\nSee http://hl7.org/fhir/StructureDefinition/maxSize" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/maxSize" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/maxValue.descriptor.prototxt b/testdata/r4/descriptors/maxValue.descriptor.prototxt index 1bbf7eca0..87f223355 100644 --- a/testdata/r4/descriptors/maxValue.descriptor.prototxt +++ b/testdata/r4/descriptors/maxValue.descriptor.prototxt @@ -82,4 +82,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for maxValue.\nMust be <= this value.\nSee http://hl7.org/fhir/StructureDefinition/maxValue" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/maxValue" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/messageheader-response-request.descriptor.prototxt b/testdata/r4/descriptors/messageheader-response-request.descriptor.prototxt index f2e14d624..0826865f9 100644 --- a/testdata/r4/descriptors/messageheader-response-request.descriptor.prototxt +++ b/testdata/r4/descriptors/messageheader-response-request.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for messageheader-response-request.\nmessageheader initiator requests a response.\nSee http://hl7.org/fhir/StructureDefinition/messageheader-response-request" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/messageheader-response-request" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/mimeType.descriptor.prototxt b/testdata/r4/descriptors/mimeType.descriptor.prototxt index df8d06799..fd9a78ede 100644 --- a/testdata/r4/descriptors/mimeType.descriptor.prototxt +++ b/testdata/r4/descriptors/mimeType.descriptor.prototxt @@ -59,4 +59,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for mimeType.\nType of attachment.\nSee http://hl7.org/fhir/StructureDefinition/mimeType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/mimeType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/minLength.descriptor.prototxt b/testdata/r4/descriptors/minLength.descriptor.prototxt index 0b1b5b1bd..b716459f7 100644 --- a/testdata/r4/descriptors/minLength.descriptor.prototxt +++ b/testdata/r4/descriptors/minLength.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for minLength.\nAt least this many characters.\nSee http://hl7.org/fhir/StructureDefinition/minLength" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/minLength" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/minValue.descriptor.prototxt b/testdata/r4/descriptors/minValue.descriptor.prototxt index 61cb64ddb..f703a4126 100644 --- a/testdata/r4/descriptors/minValue.descriptor.prototxt +++ b/testdata/r4/descriptors/minValue.descriptor.prototxt @@ -74,4 +74,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for minValue.\nMust be >= this value.\nSee http://hl7.org/fhir/StructureDefinition/minValue" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/minValue" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/narrativeLink.descriptor.prototxt b/testdata/r4/descriptors/narrativeLink.descriptor.prototxt index 3322a4c0d..812433689 100644 --- a/testdata/r4/descriptors/narrativeLink.descriptor.prototxt +++ b/testdata/r4/descriptors/narrativeLink.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Narrative Link.\nNarrative Link.\nSee http://hl7.org/fhir/StructureDefinition/narrativeLink" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/narrativeLink" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/nutritionorder-adaptiveFeedingDevice.descriptor.prototxt b/testdata/r4/descriptors/nutritionorder-adaptiveFeedingDevice.descriptor.prototxt index 1f40c3ccc..e07de0b8b 100644 --- a/testdata/r4/descriptors/nutritionorder-adaptiveFeedingDevice.descriptor.prototxt +++ b/testdata/r4/descriptors/nutritionorder-adaptiveFeedingDevice.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for adaptiveFeedingDevice.\nAdaptive Feeding Device.\nSee http://hl7.org/fhir/StructureDefinition/nutritionorder-adaptiveFeedingDevice" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/nutritionorder-adaptiveFeedingDevice" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/oauth-uris.descriptor.prototxt b/testdata/r4/descriptors/oauth-uris.descriptor.prototxt index 948e46d12..7c06c499b 100644 --- a/testdata/r4/descriptors/oauth-uris.descriptor.prototxt +++ b/testdata/r4/descriptors/oauth-uris.descriptor.prototxt @@ -66,4 +66,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for oauth-uris.\nAutomated discovery of OAuth2 endpoints.\nSee http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-bodyPosition.descriptor.prototxt b/testdata/r4/descriptors/observation-bodyPosition.descriptor.prototxt index 591ca3802..e6ecd812f 100644 --- a/testdata/r4/descriptors/observation-bodyPosition.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-bodyPosition.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for bodyPosition.\nThe body position during the observation.\nSee http://hl7.org/fhir/StructureDefinition/observation-bodyPosition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-bodyPosition" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-delta.descriptor.prototxt b/testdata/r4/descriptors/observation-delta.descriptor.prototxt index 3a8f167ee..169bf0466 100644 --- a/testdata/r4/descriptors/observation-delta.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-delta.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for delta.\nQualitative change or trend in the measurement.\nSee http://hl7.org/fhir/StructureDefinition/observation-delta" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-delta" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-deviceCode.descriptor.prototxt b/testdata/r4/descriptors/observation-deviceCode.descriptor.prototxt index e02692a7f..afffd7dac 100644 --- a/testdata/r4/descriptors/observation-deviceCode.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-deviceCode.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for deviceCode.\nA code representing the the type of device used for this observation. Should only be used if not implicit in the code found in `Observation.code`.\nSee http://hl7.org/fhir/StructureDefinition/observation-deviceCode" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-deviceCode" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-focusCode.descriptor.prototxt b/testdata/r4/descriptors/observation-focusCode.descriptor.prototxt index 9c2cd5585..1d91a4310 100644 --- a/testdata/r4/descriptors/observation-focusCode.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-focusCode.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for focusCode.\nFocus Code.\nSee http://hl7.org/fhir/StructureDefinition/observation-focusCode" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-focusCode" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-gatewayDevice.descriptor.prototxt b/testdata/r4/descriptors/observation-gatewayDevice.descriptor.prototxt index bc473dc63..d0b100d7b 100644 --- a/testdata/r4/descriptors/observation-gatewayDevice.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-gatewayDevice.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for gatewayDevice.\nGateway Device.\nSee http://hl7.org/fhir/StructureDefinition/observation-gatewayDevice" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-gatewayDevice" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-genetics.descriptor.prototxt b/testdata/r4/descriptors/observation-genetics.descriptor.prototxt index 0899d79d2..b417642bd 100644 --- a/testdata/r4/descriptors/observation-genetics.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-genetics.descriptor.prototxt @@ -322,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationGenetics.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -363,7 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationGenetics.Component" options { [google.fhir.proto.field_description]: "Component results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -375,7 +372,6 @@ field { options { [google.fhir.proto.field_description]: "HGNC gene symbol" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "Gene" @@ -389,7 +385,6 @@ field { options { [google.fhir.proto.field_description]: "DNA region name" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "DNARegionName" @@ -403,7 +398,6 @@ field { options { [google.fhir.proto.field_description]: "Copy number variation" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsCopyNumberEvent" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "CopyNumberEvent" @@ -417,7 +411,6 @@ field { options { [google.fhir.proto.field_description]: "Genomic source class" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "GenomicSourceClass" @@ -431,7 +424,6 @@ field { options { [google.fhir.proto.field_description]: "Clinical interpretations for variant" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsInterpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "InterpretationSlice" @@ -445,7 +437,6 @@ field { options { [google.fhir.proto.field_description]: "Variant" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsVariant" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "Variant" @@ -459,7 +450,6 @@ field { options { [google.fhir.proto.field_description]: "AminoAcidChange" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsAminoAcidChange" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "AminoAcidChange" @@ -473,7 +463,6 @@ field { options { [google.fhir.proto.field_description]: "Allele" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsAllele" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "Allele" @@ -487,7 +476,6 @@ field { options { [google.fhir.proto.field_description]: "Ancestry" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsAncestry" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "Ancestry" @@ -501,7 +489,6 @@ field { options { [google.fhir.proto.field_description]: "Phase set" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsPhaseSet" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "PhaseSet" @@ -764,6 +751,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -952,4 +942,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Observation-genetics.\nMeasurements and simple assertions.\nSee http://hl7.org/fhir/StructureDefinition/observation-genetics" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-genetics" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" } diff --git a/testdata/r4/descriptors/observation-geneticsAllele.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsAllele.descriptor.prototxt index e8fc5f232..516df4e14 100644 --- a/testdata/r4/descriptors/observation-geneticsAllele.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsAllele.descriptor.prototxt @@ -57,4 +57,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Allele.\nAllele.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsAllele" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsAllele" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsAminoAcidChange.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsAminoAcidChange.descriptor.prototxt index 0febc04ad..511b6b461 100644 --- a/testdata/r4/descriptors/observation-geneticsAminoAcidChange.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsAminoAcidChange.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for AminoAcidChange.\nAminoAcidChange.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsAminoAcidChange" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsAminoAcidChange" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsAncestry.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsAncestry.descriptor.prototxt index 5e02d25a0..83b063884 100644 --- a/testdata/r4/descriptors/observation-geneticsAncestry.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsAncestry.descriptor.prototxt @@ -58,4 +58,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Ancestry.\nAncestry.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsAncestry" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsAncestry" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsCopyNumberEvent.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsCopyNumberEvent.descriptor.prototxt index 2fa484049..c6337f67a 100644 --- a/testdata/r4/descriptors/observation-geneticsCopyNumberEvent.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsCopyNumberEvent.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for CopyNumberEvent.\nCopy number variation.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsCopyNumberEvent" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsCopyNumberEvent" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsDNARegionName.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsDNARegionName.descriptor.prototxt index 2e323af3e..50ad957dc 100644 --- a/testdata/r4/descriptors/observation-geneticsDNARegionName.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsDNARegionName.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for DNARegionName.\nDNA region name.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsGene.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsGene.descriptor.prototxt index 343ed440d..fc9902fab 100644 --- a/testdata/r4/descriptors/observation-geneticsGene.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsGene.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Gene.\nHGNC gene symbol.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsGene" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsGenomicSourceClass.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsGenomicSourceClass.descriptor.prototxt index 241d58f51..73e29225c 100644 --- a/testdata/r4/descriptors/observation-geneticsGenomicSourceClass.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsGenomicSourceClass.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for GenomicSourceClass.\nGenomic source class.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsInterpretation.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsInterpretation.descriptor.prototxt index 39f2368c4..b7f837217 100644 --- a/testdata/r4/descriptors/observation-geneticsInterpretation.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsInterpretation.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Interpretation.\nClinical interpretations for variant.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsInterpretation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsInterpretation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsPhaseSet.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsPhaseSet.descriptor.prototxt index 61a1a93a2..bfdc75280 100644 --- a/testdata/r4/descriptors/observation-geneticsPhaseSet.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsPhaseSet.descriptor.prototxt @@ -48,4 +48,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for PhaseSet.\nPhase set.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsPhaseSet" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsPhaseSet" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-geneticsVariant.descriptor.prototxt b/testdata/r4/descriptors/observation-geneticsVariant.descriptor.prototxt index 27a809071..eb6c45dbf 100644 --- a/testdata/r4/descriptors/observation-geneticsVariant.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-geneticsVariant.descriptor.prototxt @@ -58,4 +58,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Variant.\nVariant.\nSee http://hl7.org/fhir/StructureDefinition/observation-geneticsVariant" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-geneticsVariant" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-precondition.descriptor.prototxt b/testdata/r4/descriptors/observation-precondition.descriptor.prototxt index 2cf235d4f..44210e647 100644 --- a/testdata/r4/descriptors/observation-precondition.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-precondition.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for precondition.\nOther Observations needed to aid in the interpretation of the source observation.\nSee http://hl7.org/fhir/StructureDefinition/observation-precondition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-precondition" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-reagent.descriptor.prototxt b/testdata/r4/descriptors/observation-reagent.descriptor.prototxt index be0ad61ae..45df6006e 100644 --- a/testdata/r4/descriptors/observation-reagent.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-reagent.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reagent.\nReference to reagents used to generate this observation.\nSee http://hl7.org/fhir/StructureDefinition/observation-reagent" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-reagent" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-replaces.descriptor.prototxt b/testdata/r4/descriptors/observation-replaces.descriptor.prototxt index 034ab457e..a83a1d1a2 100644 --- a/testdata/r4/descriptors/observation-replaces.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-replaces.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for replaces.\nReplaces referenced Observation.\nSee http://hl7.org/fhir/StructureDefinition/observation-replaces" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-replaces" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-secondaryFinding.descriptor.prototxt b/testdata/r4/descriptors/observation-secondaryFinding.descriptor.prototxt index d2067a886..e14dbfee1 100644 --- a/testdata/r4/descriptors/observation-secondaryFinding.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-secondaryFinding.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for secondaryFinding.\nSecondary findings are genetic test results that provide information about variants in a gene unrelated to the primary purpose for the testing, most often discovered when [Whole Exome Sequencing (WES)](https://en.wikipedia.org/wiki/Exome_sequencing) or [Whole Genome Sequencing (WGS)](https://en.wikipedia.org/wiki/Whole_genome_sequencing) is performed. This extension should be used to denote when a genetic finding is being shared as a secondary finding, and ideally refer to a corresponding guideline or policy statement.\n\nFor more detail, please see:\nhttps://ghr.nlm.nih.gov/primer/testing/secondaryfindings.\nSee http://hl7.org/fhir/StructureDefinition/observation-secondaryFinding" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-secondaryFinding" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-sequelTo.descriptor.prototxt b/testdata/r4/descriptors/observation-sequelTo.descriptor.prototxt index df496744b..cfd544a86 100644 --- a/testdata/r4/descriptors/observation-sequelTo.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-sequelTo.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for sequelTo.\nSequel to referenced Observation.\nSee http://hl7.org/fhir/StructureDefinition/observation-sequelTo" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-sequelTo" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-specimenCode.descriptor.prototxt b/testdata/r4/descriptors/observation-specimenCode.descriptor.prototxt index 9f1b71813..ea941546d 100644 --- a/testdata/r4/descriptors/observation-specimenCode.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-specimenCode.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for specimenCode.\nA code representing the the type of specimen used for this observation. Should only be used if not implicit in the code found in `Observation.code`.\nSee http://hl7.org/fhir/StructureDefinition/observation-specimenCode" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-specimenCode" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/observation-timeOffset.descriptor.prototxt b/testdata/r4/descriptors/observation-timeOffset.descriptor.prototxt index 5c75aeaf5..1a8b39959 100644 --- a/testdata/r4/descriptors/observation-timeOffset.descriptor.prototxt +++ b/testdata/r4/descriptors/observation-timeOffset.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for timeOffset.\nTime Offset for interlacing.\nSee http://hl7.org/fhir/StructureDefinition/observation-timeOffset" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/observation-timeOffset" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/openEHR-administration.descriptor.prototxt b/testdata/r4/descriptors/openEHR-administration.descriptor.prototxt index 12592aa74..c05c75a1c 100644 --- a/testdata/r4/descriptors/openEHR-administration.descriptor.prototxt +++ b/testdata/r4/descriptors/openEHR-administration.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for administration.\nActual medication record, if known.\nSee http://hl7.org/fhir/StructureDefinition/openEHR-administration" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/openEHR-administration" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/openEHR-careplan.descriptor.prototxt b/testdata/r4/descriptors/openEHR-careplan.descriptor.prototxt index cd0e270a6..4569b159b 100644 --- a/testdata/r4/descriptors/openEHR-careplan.descriptor.prototxt +++ b/testdata/r4/descriptors/openEHR-careplan.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for careplan.\nClinical Management Details.\nSee http://hl7.org/fhir/StructureDefinition/openEHR-careplan" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/openEHR-careplan" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/openEHR-exposureDate.descriptor.prototxt b/testdata/r4/descriptors/openEHR-exposureDate.descriptor.prototxt index c3de5f049..6c7e611c0 100644 --- a/testdata/r4/descriptors/openEHR-exposureDate.descriptor.prototxt +++ b/testdata/r4/descriptors/openEHR-exposureDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for exposureDate.\nDate(/time) of first exposure to Substance.\nSee http://hl7.org/fhir/StructureDefinition/openEHR-exposureDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/openEHR-exposureDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/openEHR-exposureDescription.descriptor.prototxt b/testdata/r4/descriptors/openEHR-exposureDescription.descriptor.prototxt index 51a904a36..07b1492a9 100644 --- a/testdata/r4/descriptors/openEHR-exposureDescription.descriptor.prototxt +++ b/testdata/r4/descriptors/openEHR-exposureDescription.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for exposureDescription.\nText description about exposure to the Substance.\nSee http://hl7.org/fhir/StructureDefinition/openEHR-exposureDescription" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/openEHR-exposureDescription" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/openEHR-exposureDuration.descriptor.prototxt b/testdata/r4/descriptors/openEHR-exposureDuration.descriptor.prototxt index 14f34f9cf..58c572e18 100644 --- a/testdata/r4/descriptors/openEHR-exposureDuration.descriptor.prototxt +++ b/testdata/r4/descriptors/openEHR-exposureDuration.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for exposureDuration.\nAmount of time individual was exposed to Substance.\nSee http://hl7.org/fhir/StructureDefinition/openEHR-exposureDuration" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/openEHR-exposureDuration" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/openEHR-location.descriptor.prototxt b/testdata/r4/descriptors/openEHR-location.descriptor.prototxt index e8ffd9df1..71d668c62 100644 --- a/testdata/r4/descriptors/openEHR-location.descriptor.prototxt +++ b/testdata/r4/descriptors/openEHR-location.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for location.\nBody site of manifestations.\nSee http://hl7.org/fhir/StructureDefinition/openEHR-location" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/openEHR-location" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/openEHR-management.descriptor.prototxt b/testdata/r4/descriptors/openEHR-management.descriptor.prototxt index bb1c2225a..c5318c18a 100644 --- a/testdata/r4/descriptors/openEHR-management.descriptor.prototxt +++ b/testdata/r4/descriptors/openEHR-management.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for management.\nClinical Management Description.\nSee http://hl7.org/fhir/StructureDefinition/openEHR-management" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/openEHR-management" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/openEHR-test.descriptor.prototxt b/testdata/r4/descriptors/openEHR-test.descriptor.prototxt index a4af97c4f..b8454d3e3 100644 --- a/testdata/r4/descriptors/openEHR-test.descriptor.prototxt +++ b/testdata/r4/descriptors/openEHR-test.descriptor.prototxt @@ -27,4 +27,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for test.\nObservations that confirm or refute.\nSee http://hl7.org/fhir/StructureDefinition/openEHR-test" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/openEHR-test" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/operationdefinition-profile.descriptor.prototxt b/testdata/r4/descriptors/operationdefinition-profile.descriptor.prototxt index ee6ebe11b..59093fe8c 100644 --- a/testdata/r4/descriptors/operationdefinition-profile.descriptor.prototxt +++ b/testdata/r4/descriptors/operationdefinition-profile.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for profile.\nProfiles (StructureDefinition or IG) - one must apply.\nSee http://hl7.org/fhir/StructureDefinition/operationdefinition-profile" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/operationdefinition-profile" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/operationoutcome-authority.descriptor.prototxt b/testdata/r4/descriptors/operationoutcome-authority.descriptor.prototxt index c1ffa274c..224c62a3a 100644 --- a/testdata/r4/descriptors/operationoutcome-authority.descriptor.prototxt +++ b/testdata/r4/descriptors/operationoutcome-authority.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for authority.\nReference to where the rule is defined.\nSee http://hl7.org/fhir/StructureDefinition/operationoutcome-authority" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/operationoutcome-authority" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/operationoutcome-detectedIssue.descriptor.prototxt b/testdata/r4/descriptors/operationoutcome-detectedIssue.descriptor.prototxt index 0016d95db..bf2f2ae97 100644 --- a/testdata/r4/descriptors/operationoutcome-detectedIssue.descriptor.prototxt +++ b/testdata/r4/descriptors/operationoutcome-detectedIssue.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for detectedIssue.\nReference to a contra-indication that is the basis for this error.\nSee http://hl7.org/fhir/StructureDefinition/operationoutcome-detectedIssue" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/operationoutcome-detectedIssue" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/operationoutcome-issue-source.descriptor.prototxt b/testdata/r4/descriptors/operationoutcome-issue-source.descriptor.prototxt index d71e3b431..64d821ca9 100644 --- a/testdata/r4/descriptors/operationoutcome-issue-source.descriptor.prototxt +++ b/testdata/r4/descriptors/operationoutcome-issue-source.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for issue-source.\nSource of a validation message.\nSee http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-source" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-source" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/ordinalValue.descriptor.prototxt b/testdata/r4/descriptors/ordinalValue.descriptor.prototxt index d1e9d1531..04359c55a 100644 --- a/testdata/r4/descriptors/ordinalValue.descriptor.prototxt +++ b/testdata/r4/descriptors/ordinalValue.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Ordinal Value.\nAssigned Ordinal Value.\nSee http://hl7.org/fhir/StructureDefinition/ordinalValue" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/ordinalValue" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/organization-period.descriptor.prototxt b/testdata/r4/descriptors/organization-period.descriptor.prototxt index e9eb934d8..3f71b7f7c 100644 --- a/testdata/r4/descriptors/organization-period.descriptor.prototxt +++ b/testdata/r4/descriptors/organization-period.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for period.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/organization-period" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/organization-period" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/organization-preferredContact.descriptor.prototxt b/testdata/r4/descriptors/organization-preferredContact.descriptor.prototxt index 21c15f950..f29878cbd 100644 --- a/testdata/r4/descriptors/organization-preferredContact.descriptor.prototxt +++ b/testdata/r4/descriptors/organization-preferredContact.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for preferredContact.\nExtension.\nSee http://hl7.org/fhir/StructureDefinition/organization-preferredContact" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/organization-preferredContact" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/organizationaffiliation-primaryInd.descriptor.prototxt b/testdata/r4/descriptors/organizationaffiliation-primaryInd.descriptor.prototxt index e8887ed9e..e0db6fcea 100644 --- a/testdata/r4/descriptors/organizationaffiliation-primaryInd.descriptor.prototxt +++ b/testdata/r4/descriptors/organizationaffiliation-primaryInd.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for primaryInd.\nIndicator of primary specialty.\nSee http://hl7.org/fhir/StructureDefinition/organizationaffiliation-primaryInd" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/organizationaffiliation-primaryInd" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/originalText.descriptor.prototxt b/testdata/r4/descriptors/originalText.descriptor.prototxt index 29357ddd3..6b993664b 100644 --- a/testdata/r4/descriptors/originalText.descriptor.prototxt +++ b/testdata/r4/descriptors/originalText.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Original Text.\nOriginal Text that represents the data as seen/selected/uttered originally.\nSee http://hl7.org/fhir/StructureDefinition/originalText" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/originalText" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/oxygensat.descriptor.prototxt b/testdata/r4/descriptors/oxygensat.descriptor.prototxt index f12dfdc2b..655eb569b 100644 --- a/testdata/r4/descriptors/oxygensat.descriptor.prototxt +++ b/testdata/r4/descriptors/oxygensat.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -323,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationOxygensat.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -364,8 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationOxygensat.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -479,6 +474,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -593,6 +589,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -775,6 +774,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -782,4 +784,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/oxygensat" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/parameters-fullUrl.descriptor.prototxt b/testdata/r4/descriptors/parameters-fullUrl.descriptor.prototxt index e004d656a..58d489681 100644 --- a/testdata/r4/descriptors/parameters-fullUrl.descriptor.prototxt +++ b/testdata/r4/descriptors/parameters-fullUrl.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for fullUrl.\nfullUrl for resource.\nSee http://hl7.org/fhir/StructureDefinition/parameters-fullUrl" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/parameters-fullUrl" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-adoptionInfo.descriptor.prototxt b/testdata/r4/descriptors/patient-adoptionInfo.descriptor.prototxt index f1962d371..68c39b91a 100644 --- a/testdata/r4/descriptors/patient-adoptionInfo.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-adoptionInfo.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for adoptionInfo.\nThe adoption status of the patient.\nSee http://hl7.org/fhir/StructureDefinition/patient-adoptionInfo" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-adoptionInfo" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-animal.descriptor.prototxt b/testdata/r4/descriptors/patient-animal.descriptor.prototxt index 47f0ba1d0..53b081538 100644 --- a/testdata/r4/descriptors/patient-animal.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-animal.descriptor.prototxt @@ -55,4 +55,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for animal.\nThis patient is known to be an animal (non-human).\nSee http://hl7.org/fhir/StructureDefinition/patient-animal" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-animal" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-birthPlace.descriptor.prototxt b/testdata/r4/descriptors/patient-birthPlace.descriptor.prototxt index 7724fd0f3..cd0af0f66 100644 --- a/testdata/r4/descriptors/patient-birthPlace.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-birthPlace.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for birthPlace.\nPlace of Birth for patient.\nSee http://hl7.org/fhir/StructureDefinition/patient-birthPlace" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-birthPlace" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-birthTime.descriptor.prototxt b/testdata/r4/descriptors/patient-birthTime.descriptor.prototxt index 1b3056dca..f16be8360 100644 --- a/testdata/r4/descriptors/patient-birthTime.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-birthTime.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for birthTime.\nTime of day of birth.\nSee http://hl7.org/fhir/StructureDefinition/patient-birthTime" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-birthTime" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-cadavericDonor.descriptor.prototxt b/testdata/r4/descriptors/patient-cadavericDonor.descriptor.prototxt index ead676a45..2c4b8e17e 100644 --- a/testdata/r4/descriptors/patient-cadavericDonor.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-cadavericDonor.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for cadavericDonor.\nPost-mortem donor status.\nSee http://hl7.org/fhir/StructureDefinition/patient-cadavericDonor" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-cadavericDonor" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-citizenship.descriptor.prototxt b/testdata/r4/descriptors/patient-citizenship.descriptor.prototxt index bf0ce3d67..a42e7f922 100644 --- a/testdata/r4/descriptors/patient-citizenship.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-citizenship.descriptor.prototxt @@ -44,4 +44,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for citizenship.\nNation(s) where the patient claims citizenship.\nSee http://hl7.org/fhir/StructureDefinition/patient-citizenship" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-citizenship" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-congregation.descriptor.prototxt b/testdata/r4/descriptors/patient-congregation.descriptor.prototxt index a471a4fa2..6887a43d9 100644 --- a/testdata/r4/descriptors/patient-congregation.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-congregation.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for congregation.\nA group of place of religious practice.\nSee http://hl7.org/fhir/StructureDefinition/patient-congregation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-congregation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-disability.descriptor.prototxt b/testdata/r4/descriptors/patient-disability.descriptor.prototxt index 2d448864c..b23eafe29 100644 --- a/testdata/r4/descriptors/patient-disability.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-disability.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for disability.\nCondition(s) limiting movement, senses, or activities.\nSee http://hl7.org/fhir/StructureDefinition/patient-disability" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-disability" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-genderIdentity.descriptor.prototxt b/testdata/r4/descriptors/patient-genderIdentity.descriptor.prototxt index a2ce0fb7c..dd8d6fa59 100644 --- a/testdata/r4/descriptors/patient-genderIdentity.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-genderIdentity.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for genderIdentity.\nThe patient\'s gender identity.\nSee http://hl7.org/fhir/StructureDefinition/patient-genderIdentity" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-genderIdentity" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-importance.descriptor.prototxt b/testdata/r4/descriptors/patient-importance.descriptor.prototxt index 027a64095..437375cb9 100644 --- a/testdata/r4/descriptors/patient-importance.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-importance.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for importance.\nSpecial status given the patient.\nSee http://hl7.org/fhir/StructureDefinition/patient-importance" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-importance" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-interpreterRequired.descriptor.prototxt b/testdata/r4/descriptors/patient-interpreterRequired.descriptor.prototxt index 3f93380e7..23b0a8aec 100644 --- a/testdata/r4/descriptors/patient-interpreterRequired.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-interpreterRequired.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for interpreterRequired.\nWhether the patient needs an interpreter.\nSee http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-interpreterRequired" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-mothersMaidenName.descriptor.prototxt b/testdata/r4/descriptors/patient-mothersMaidenName.descriptor.prototxt index cfea9cafb..21992041c 100644 --- a/testdata/r4/descriptors/patient-mothersMaidenName.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-mothersMaidenName.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for mothersMaidenName.\nMother\'s Maiden name.\nSee http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-nationality.descriptor.prototxt b/testdata/r4/descriptors/patient-nationality.descriptor.prototxt index f33b93513..908493d30 100644 --- a/testdata/r4/descriptors/patient-nationality.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-nationality.descriptor.prototxt @@ -44,4 +44,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for nationality.\nNationality.\nSee http://hl7.org/fhir/StructureDefinition/patient-nationality" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-nationality" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-preferenceType.descriptor.prototxt b/testdata/r4/descriptors/patient-preferenceType.descriptor.prototxt index 84d41a3b2..c5bd019fd 100644 --- a/testdata/r4/descriptors/patient-preferenceType.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-preferenceType.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for preferenceType.\nThe type of the patient\'s preferred language.\nSee http://hl7.org/fhir/StructureDefinition/patient-preferenceType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-preferenceType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-proficiency.descriptor.prototxt b/testdata/r4/descriptors/patient-proficiency.descriptor.prototxt index 3fd14ae96..6c4965c09 100644 --- a/testdata/r4/descriptors/patient-proficiency.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-proficiency.descriptor.prototxt @@ -44,4 +44,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for proficiency.\nProficiency level of the communication.\nSee http://hl7.org/fhir/StructureDefinition/patient-proficiency" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-proficiency" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-relatedPerson.descriptor.prototxt b/testdata/r4/descriptors/patient-relatedPerson.descriptor.prototxt index cf70bbb6f..20f95fab7 100644 --- a/testdata/r4/descriptors/patient-relatedPerson.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-relatedPerson.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for relatedPerson.\nThis contact may have further details in this RelatedPerson.\nSee http://hl7.org/fhir/StructureDefinition/patient-relatedPerson" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-relatedPerson" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/patient-religion.descriptor.prototxt b/testdata/r4/descriptors/patient-religion.descriptor.prototxt index 84475e7f3..dd35d8bd2 100644 --- a/testdata/r4/descriptors/patient-religion.descriptor.prototxt +++ b/testdata/r4/descriptors/patient-religion.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for religion.\nThe patient\'s professed religious affiliations.\nSee http://hl7.org/fhir/StructureDefinition/patient-religion" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/patient-religion" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/picoelement.descriptor.prototxt b/testdata/r4/descriptors/picoelement.descriptor.prototxt index 7ee5e99c6..1b6ccb1ad 100644 --- a/testdata/r4/descriptors/picoelement.descriptor.prototxt +++ b/testdata/r4/descriptors/picoelement.descriptor.prototxt @@ -355,7 +355,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "What defines the members of the evidence element" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -649,4 +648,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for PICO Element Profile.\nA population, intervention, or exposure definition.\nSee http://hl7.org/fhir/StructureDefinition/picoelement" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/EvidenceVariable" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/picoelement" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/practitioner-animalSpecies.descriptor.prototxt b/testdata/r4/descriptors/practitioner-animalSpecies.descriptor.prototxt index 360fc25da..2666e557f 100644 --- a/testdata/r4/descriptors/practitioner-animalSpecies.descriptor.prototxt +++ b/testdata/r4/descriptors/practitioner-animalSpecies.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for animalSpecies.\nThe Species of the Service Animal.\nSee http://hl7.org/fhir/StructureDefinition/practitioner-animalSpecies" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/practitioner-animalSpecies" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/practitionerrole-primaryInd.descriptor.prototxt b/testdata/r4/descriptors/practitionerrole-primaryInd.descriptor.prototxt index 67a8c703e..235e002e0 100644 --- a/testdata/r4/descriptors/practitionerrole-primaryInd.descriptor.prototxt +++ b/testdata/r4/descriptors/practitionerrole-primaryInd.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for primaryInd.\nIndicator of primary specialty.\nSee http://hl7.org/fhir/StructureDefinition/practitionerrole-primaryInd" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/practitionerrole-primaryInd" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/procedure-approachBodyStructure.descriptor.prototxt b/testdata/r4/descriptors/procedure-approachBodyStructure.descriptor.prototxt index ec979d903..25c154d76 100644 --- a/testdata/r4/descriptors/procedure-approachBodyStructure.descriptor.prototxt +++ b/testdata/r4/descriptors/procedure-approachBodyStructure.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for approachBodyStructure.\nThe access point or points used for this procedure.\nSee http://hl7.org/fhir/StructureDefinition/procedure-approachBodyStructure" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/procedure-approachBodyStructure" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/procedure-causedBy.descriptor.prototxt b/testdata/r4/descriptors/procedure-causedBy.descriptor.prototxt index 7465749f3..77e5e0139 100644 --- a/testdata/r4/descriptors/procedure-causedBy.descriptor.prototxt +++ b/testdata/r4/descriptors/procedure-causedBy.descriptor.prototxt @@ -36,4 +36,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for causedBy.\nRelated item that caused this procedure.\nSee http://hl7.org/fhir/StructureDefinition/procedure-causedBy" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/procedure-causedBy" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/procedure-directedBy.descriptor.prototxt b/testdata/r4/descriptors/procedure-directedBy.descriptor.prototxt index 16d2d932d..9605fdc6a 100644 --- a/testdata/r4/descriptors/procedure-directedBy.descriptor.prototxt +++ b/testdata/r4/descriptors/procedure-directedBy.descriptor.prototxt @@ -56,4 +56,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for directedBy.\nWho has decision-making authority.\nSee http://hl7.org/fhir/StructureDefinition/procedure-directedBy" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/procedure-directedBy" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/procedure-incisionDateTime.descriptor.prototxt b/testdata/r4/descriptors/procedure-incisionDateTime.descriptor.prototxt index ec10ea1f0..f875578aa 100644 --- a/testdata/r4/descriptors/procedure-incisionDateTime.descriptor.prototxt +++ b/testdata/r4/descriptors/procedure-incisionDateTime.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for incisionDateTime.\nThe first incision time.\nSee http://hl7.org/fhir/StructureDefinition/procedure-incisionDateTime" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/procedure-incisionDateTime" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/procedure-method.descriptor.prototxt b/testdata/r4/descriptors/procedure-method.descriptor.prototxt index 9e212d709..55fe1781b 100644 --- a/testdata/r4/descriptors/procedure-method.descriptor.prototxt +++ b/testdata/r4/descriptors/procedure-method.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for method.\nThe method used to perform the procedure.\nSee http://hl7.org/fhir/StructureDefinition/procedure-method" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/procedure-method" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/procedure-progressStatus.descriptor.prototxt b/testdata/r4/descriptors/procedure-progressStatus.descriptor.prototxt index 40e0fe212..608d20040 100644 --- a/testdata/r4/descriptors/procedure-progressStatus.descriptor.prototxt +++ b/testdata/r4/descriptors/procedure-progressStatus.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for progressStatus.\nA details procedure progress.\nSee http://hl7.org/fhir/StructureDefinition/procedure-progressStatus" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/procedure-progressStatus" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/procedure-schedule.descriptor.prototxt b/testdata/r4/descriptors/procedure-schedule.descriptor.prototxt index 0d1beaa27..058094389 100644 --- a/testdata/r4/descriptors/procedure-schedule.descriptor.prototxt +++ b/testdata/r4/descriptors/procedure-schedule.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for schedule.\nSchedule followed.\nSee http://hl7.org/fhir/StructureDefinition/procedure-schedule" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/procedure-schedule" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/procedure-targetBodyStructure.descriptor.prototxt b/testdata/r4/descriptors/procedure-targetBodyStructure.descriptor.prototxt index 7c9b4f342..4e541c278 100644 --- a/testdata/r4/descriptors/procedure-targetBodyStructure.descriptor.prototxt +++ b/testdata/r4/descriptors/procedure-targetBodyStructure.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for targetBodyStructure.\nThe target point for this procedure.\nSee http://hl7.org/fhir/StructureDefinition/procedure-targetBodyStructure" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/procedure-targetBodyStructure" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/provenance-relevant-history.descriptor.prototxt b/testdata/r4/descriptors/provenance-relevant-history.descriptor.prototxt index 81be4dfa9..ebec9aa08 100644 --- a/testdata/r4/descriptors/provenance-relevant-history.descriptor.prototxt +++ b/testdata/r4/descriptors/provenance-relevant-history.descriptor.prototxt @@ -170,7 +170,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Who was involved with change" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -181,7 +180,6 @@ field { type_name: ".google.fhir.r4.core.ProvenanceRelevantHistory.Entity" options { [google.fhir.proto.field_description]: "An entity used in this activity" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { diff --git a/testdata/r4/descriptors/quantity-precision.descriptor.prototxt b/testdata/r4/descriptors/quantity-precision.descriptor.prototxt index e366d0de7..2e4f49b43 100644 --- a/testdata/r4/descriptors/quantity-precision.descriptor.prototxt +++ b/testdata/r4/descriptors/quantity-precision.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for precision.\nExplicit precision (number of significant decimal places).\nSee http://hl7.org/fhir/StructureDefinition/quantity-precision" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/quantity-precision" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-baseType.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-baseType.descriptor.prototxt index 963872306..887952130 100644 --- a/testdata/r4/descriptors/questionnaire-baseType.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-baseType.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for baseType.\nBase Type for answer.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-baseType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-baseType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-choiceOrientation.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-choiceOrientation.descriptor.prototxt index 62cd12eff..3329d9862 100644 --- a/testdata/r4/descriptors/questionnaire-choiceOrientation.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-choiceOrientation.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for choiceOrientation.\nhorizontal | vertical.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-constraint.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-constraint.descriptor.prototxt index 8e1779fe2..7a11d2cc9 100644 --- a/testdata/r4/descriptors/questionnaire-constraint.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-constraint.descriptor.prototxt @@ -115,4 +115,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for constraint.\nConstraint.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-constraint" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-constraint" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-displayCategory.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-displayCategory.descriptor.prototxt index f34a500e0..ef66b1873 100644 --- a/testdata/r4/descriptors/questionnaire-displayCategory.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-displayCategory.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for displayCategory.\nPurpose of rendered text.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-displayCategory" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-fhirType.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-fhirType.descriptor.prototxt index 273de2a78..e54b87465 100644 --- a/testdata/r4/descriptors/questionnaire-fhirType.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-fhirType.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for fhirType.\nThe underlying FHIR data type.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-hidden.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-hidden.descriptor.prototxt index dec7e841f..d8146fb17 100644 --- a/testdata/r4/descriptors/questionnaire-hidden.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-hidden.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for hidden.\nDon\'t display to user.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-hidden" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-hidden" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-itemControl.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-itemControl.descriptor.prototxt index 1ba08b0f5..f483813ba 100644 --- a/testdata/r4/descriptors/questionnaire-itemControl.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-itemControl.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for itemControl.\nE.g. Fly-over, Table, Checkbox, Combo-box, Lookup, etc.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-maxOccurs.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-maxOccurs.descriptor.prototxt index 0fd932599..d27f4b53c 100644 --- a/testdata/r4/descriptors/questionnaire-maxOccurs.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-maxOccurs.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for maxOccurs.\nMaximum repetitions.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-minOccurs.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-minOccurs.descriptor.prototxt index 49986af29..2c9952fd5 100644 --- a/testdata/r4/descriptors/questionnaire-minOccurs.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-minOccurs.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for minOccurs.\nMinimum repetitions.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-optionExclusive.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-optionExclusive.descriptor.prototxt index 608a73181..83c14668a 100644 --- a/testdata/r4/descriptors/questionnaire-optionExclusive.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-optionExclusive.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for optionExclusive.\nOption is exclusive.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-optionExclusive" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-optionExclusive" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-optionPrefix.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-optionPrefix.descriptor.prototxt index 9168e1497..ac863c590 100644 --- a/testdata/r4/descriptors/questionnaire-optionPrefix.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-optionPrefix.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for optionPrefix.\nE.g. \"(a)\", \"1.\", etc.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-optionPrefix" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-optionPrefix" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-referenceFilter.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-referenceFilter.descriptor.prototxt index f446c60fa..34435b40e 100644 --- a/testdata/r4/descriptors/questionnaire-referenceFilter.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-referenceFilter.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for referenceFilter.\nFilter to apply when looking up references.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-referenceProfile.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-referenceProfile.descriptor.prototxt index 7d0043515..211c8ab95 100644 --- a/testdata/r4/descriptors/questionnaire-referenceProfile.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-referenceProfile.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for referenceProfile.\nAllowed profile for reference.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-referenceProfile" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceProfile" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-referenceResource.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-referenceResource.descriptor.prototxt index 0fbf0deb3..907d9b71c 100644 --- a/testdata/r4/descriptors/questionnaire-referenceResource.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-referenceResource.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for referenceResource.\nAllowed resource for reference.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-signatureRequired.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-signatureRequired.descriptor.prototxt index 797f94567..feb10d865 100644 --- a/testdata/r4/descriptors/questionnaire-signatureRequired.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-signatureRequired.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for signatureRequired.\nIs signature needed?.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-signatureRequired" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-signatureRequired" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-sliderStepValue.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-sliderStepValue.descriptor.prototxt index 8733e2ed6..1f7de0d8e 100644 --- a/testdata/r4/descriptors/questionnaire-sliderStepValue.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-sliderStepValue.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for sliderStepValue.\nIncrement value for slider.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-sliderStepValue" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-sliderStepValue" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-supportLink.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-supportLink.descriptor.prototxt index 90865f7f5..34f28a9b9 100644 --- a/testdata/r4/descriptors/questionnaire-supportLink.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-supportLink.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for supportLink.\nSupporting information.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-unit.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-unit.descriptor.prototxt index d00462b1d..2201f77c0 100644 --- a/testdata/r4/descriptors/questionnaire-unit.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-unit.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for unit.\nUnit for numeric answer.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-unit" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-unit" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-unitOption.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-unitOption.descriptor.prototxt index 54db4a114..aba5b4057 100644 --- a/testdata/r4/descriptors/questionnaire-unitOption.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-unitOption.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for unitOption.\nUnit choice.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-unitValueSet.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-unitValueSet.descriptor.prototxt index 5f8074223..f91ab91f8 100644 --- a/testdata/r4/descriptors/questionnaire-unitValueSet.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-unitValueSet.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for unitValueSet.\nUnit choices.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-unitValueSet" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-unitValueSet" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaire-usageMode.descriptor.prototxt b/testdata/r4/descriptors/questionnaire-usageMode.descriptor.prototxt index 3be76d8b9..b69d904cb 100644 --- a/testdata/r4/descriptors/questionnaire-usageMode.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaire-usageMode.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for usageMode.\ncapture | display | display-non-empty | capture-display | capture-display-non-empty.\nSee http://hl7.org/fhir/StructureDefinition/questionnaire-usageMode" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaire-usageMode" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaireresponse-author.descriptor.prototxt b/testdata/r4/descriptors/questionnaireresponse-author.descriptor.prototxt index e316777ab..696dbd0ab 100644 --- a/testdata/r4/descriptors/questionnaireresponse-author.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaireresponse-author.descriptor.prototxt @@ -29,4 +29,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for author.\nWho answered question/group.\nSee http://hl7.org/fhir/StructureDefinition/questionnaireresponse-author" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-author" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaireresponse-completionMode.descriptor.prototxt b/testdata/r4/descriptors/questionnaireresponse-completionMode.descriptor.prototxt index 74c26e9e1..6dc11b52b 100644 --- a/testdata/r4/descriptors/questionnaireresponse-completionMode.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaireresponse-completionMode.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for completionMode.\nE.g. Verbal, written, electronic.\nSee http://hl7.org/fhir/StructureDefinition/questionnaireresponse-completionMode" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-completionMode" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaireresponse-reason.descriptor.prototxt b/testdata/r4/descriptors/questionnaireresponse-reason.descriptor.prototxt index f78887b0f..ba48f0232 100644 --- a/testdata/r4/descriptors/questionnaireresponse-reason.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaireresponse-reason.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reason.\nWhy response was created.\nSee http://hl7.org/fhir/StructureDefinition/questionnaireresponse-reason" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-reason" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaireresponse-reviewer.descriptor.prototxt b/testdata/r4/descriptors/questionnaireresponse-reviewer.descriptor.prototxt index dc14304bd..9dc86a130 100644 --- a/testdata/r4/descriptors/questionnaireresponse-reviewer.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaireresponse-reviewer.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reviewer.\nWho verified completion of form?.\nSee http://hl7.org/fhir/StructureDefinition/questionnaireresponse-reviewer" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-reviewer" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/questionnaireresponse-signature.descriptor.prototxt b/testdata/r4/descriptors/questionnaireresponse-signature.descriptor.prototxt index ed3aa3173..21367a747 100644 --- a/testdata/r4/descriptors/questionnaireresponse-signature.descriptor.prototxt +++ b/testdata/r4/descriptors/questionnaireresponse-signature.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for signature.\nA signature attesting to the content.\nSee http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/questionnaireresponse-signature" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/regex.descriptor.prototxt b/testdata/r4/descriptors/regex.descriptor.prototxt index 1b6ea2ccd..a6297be53 100644 --- a/testdata/r4/descriptors/regex.descriptor.prototxt +++ b/testdata/r4/descriptors/regex.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for regex.\nRegular expression pattern.\nSee http://hl7.org/fhir/StructureDefinition/regex" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/regex" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/relative-date.descriptor.prototxt b/testdata/r4/descriptors/relative-date.descriptor.prototxt index b1a656067..39b6c1216 100644 --- a/testdata/r4/descriptors/relative-date.descriptor.prototxt +++ b/testdata/r4/descriptors/relative-date.descriptor.prototxt @@ -112,4 +112,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Relative Date Criteria.\nRelative Date Criteria.\nSee http://hl7.org/fhir/StructureDefinition/relative-date" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/relative-date" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/rendered-value.descriptor.prototxt b/testdata/r4/descriptors/rendered-value.descriptor.prototxt index 4bdbcf8fa..a6168555f 100644 --- a/testdata/r4/descriptors/rendered-value.descriptor.prototxt +++ b/testdata/r4/descriptors/rendered-value.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Rendered Value.\nWhat should be displayed to human (if default is not appropriate).\nSee http://hl7.org/fhir/StructureDefinition/rendered-value" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/rendered-value" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/rendering-markdown.descriptor.prototxt b/testdata/r4/descriptors/rendering-markdown.descriptor.prototxt index a31b5f91e..386153261 100644 --- a/testdata/r4/descriptors/rendering-markdown.descriptor.prototxt +++ b/testdata/r4/descriptors/rendering-markdown.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for markdown.\nString equivalent with markdown.\nSee http://hl7.org/fhir/StructureDefinition/rendering-markdown" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/rendering-markdown" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/rendering-style.descriptor.prototxt b/testdata/r4/descriptors/rendering-style.descriptor.prototxt index 398dad840..f8f0269ce 100644 --- a/testdata/r4/descriptors/rendering-style.descriptor.prototxt +++ b/testdata/r4/descriptors/rendering-style.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for style.\nHtml style value.\nSee http://hl7.org/fhir/StructureDefinition/rendering-style" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/rendering-style" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/rendering-styleSensitive.descriptor.prototxt b/testdata/r4/descriptors/rendering-styleSensitive.descriptor.prototxt index 30152fc4f..29bd059c0 100644 --- a/testdata/r4/descriptors/rendering-styleSensitive.descriptor.prototxt +++ b/testdata/r4/descriptors/rendering-styleSensitive.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for styleSensitive.\nAre styles important for processing?.\nSee http://hl7.org/fhir/StructureDefinition/rendering-styleSensitive" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/rendering-styleSensitive" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/rendering-xhtml.descriptor.prototxt b/testdata/r4/descriptors/rendering-xhtml.descriptor.prototxt index 2fcd5a31b..d95b60825 100644 --- a/testdata/r4/descriptors/rendering-xhtml.descriptor.prototxt +++ b/testdata/r4/descriptors/rendering-xhtml.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for xhtml.\nString equivalent with html markup.\nSee http://hl7.org/fhir/StructureDefinition/rendering-xhtml" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/rendering-xhtml" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/replaces.descriptor.prototxt b/testdata/r4/descriptors/replaces.descriptor.prototxt index f27f60236..0313ed535 100644 --- a/testdata/r4/descriptors/replaces.descriptor.prototxt +++ b/testdata/r4/descriptors/replaces.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for replaces.\nReferences a resource that this resource replaces.\nSee http://hl7.org/fhir/StructureDefinition/replaces" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/replaces" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/request-doNotPerform.descriptor.prototxt b/testdata/r4/descriptors/request-doNotPerform.descriptor.prototxt index fed7397ad..ac0643003 100644 --- a/testdata/r4/descriptors/request-doNotPerform.descriptor.prototxt +++ b/testdata/r4/descriptors/request-doNotPerform.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for doNotPerform.\ntrue if request is prohibiting action.\nSee http://hl7.org/fhir/StructureDefinition/request-doNotPerform" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/request-doNotPerform" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/request-insurance.descriptor.prototxt b/testdata/r4/descriptors/request-insurance.descriptor.prototxt index 68f1d1280..187e83769 100644 --- a/testdata/r4/descriptors/request-insurance.descriptor.prototxt +++ b/testdata/r4/descriptors/request-insurance.descriptor.prototxt @@ -27,4 +27,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for insurance.\nAssociated insurance coverage.\nSee http://hl7.org/fhir/StructureDefinition/request-insurance" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/request-insurance" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/request-performerOrder.descriptor.prototxt b/testdata/r4/descriptors/request-performerOrder.descriptor.prototxt index cb1dad993..ea813e794 100644 --- a/testdata/r4/descriptors/request-performerOrder.descriptor.prototxt +++ b/testdata/r4/descriptors/request-performerOrder.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for performerOrder.\nPerformer Order.\nSee http://hl7.org/fhir/StructureDefinition/request-performerOrder" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/request-performerOrder" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/request-relevantHistory.descriptor.prototxt b/testdata/r4/descriptors/request-relevantHistory.descriptor.prototxt index d9bb495bb..ce9b3bf2a 100644 --- a/testdata/r4/descriptors/request-relevantHistory.descriptor.prototxt +++ b/testdata/r4/descriptors/request-relevantHistory.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for relevantHistory.\nKey events in history of request.\nSee http://hl7.org/fhir/StructureDefinition/request-relevantHistory" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/request-relevantHistory" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/request-replaces.descriptor.prototxt b/testdata/r4/descriptors/request-replaces.descriptor.prototxt index 6e29db993..2aecad912 100644 --- a/testdata/r4/descriptors/request-replaces.descriptor.prototxt +++ b/testdata/r4/descriptors/request-replaces.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for replaces.\nRequest(s) replaced by this request.\nSee http://hl7.org/fhir/StructureDefinition/request-replaces" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/request-replaces" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/request-statusReason.descriptor.prototxt b/testdata/r4/descriptors/request-statusReason.descriptor.prototxt index c227fbe93..817bb7604 100644 --- a/testdata/r4/descriptors/request-statusReason.descriptor.prototxt +++ b/testdata/r4/descriptors/request-statusReason.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for statusReason.\nReason for current status.\nSee http://hl7.org/fhir/StructureDefinition/request-statusReason" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/request-statusReason" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/resource-approvalDate.descriptor.prototxt b/testdata/r4/descriptors/resource-approvalDate.descriptor.prototxt index 87955c225..38a768061 100644 --- a/testdata/r4/descriptors/resource-approvalDate.descriptor.prototxt +++ b/testdata/r4/descriptors/resource-approvalDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for approvalDate.\nWhen resource approved by publisher.\nSee http://hl7.org/fhir/StructureDefinition/resource-approvalDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/resource-approvalDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/resource-effectivePeriod.descriptor.prototxt b/testdata/r4/descriptors/resource-effectivePeriod.descriptor.prototxt index 7c96d5325..08336a910 100644 --- a/testdata/r4/descriptors/resource-effectivePeriod.descriptor.prototxt +++ b/testdata/r4/descriptors/resource-effectivePeriod.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for effectivePeriod.\nThe effective date range for the resource.\nSee http://hl7.org/fhir/StructureDefinition/resource-effectivePeriod" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/resource-effectivePeriod" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/resource-lastReviewDate.descriptor.prototxt b/testdata/r4/descriptors/resource-lastReviewDate.descriptor.prototxt index 85d010147..a1b979982 100644 --- a/testdata/r4/descriptors/resource-lastReviewDate.descriptor.prototxt +++ b/testdata/r4/descriptors/resource-lastReviewDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for lastReviewDate.\nLast review date for the resource.\nSee http://hl7.org/fhir/StructureDefinition/resource-lastReviewDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/resource-lastReviewDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/resource-pertainsToGoal.descriptor.prototxt b/testdata/r4/descriptors/resource-pertainsToGoal.descriptor.prototxt index 88e242d51..27b22669c 100644 --- a/testdata/r4/descriptors/resource-pertainsToGoal.descriptor.prototxt +++ b/testdata/r4/descriptors/resource-pertainsToGoal.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for pertainsToGoal.\nPertains to goal.\nSee http://hl7.org/fhir/StructureDefinition/resource-pertainsToGoal" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/resource-pertainsToGoal" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/resprate.descriptor.prototxt b/testdata/r4/descriptors/resprate.descriptor.prototxt index da6a2db0f..8ef19a999 100644 --- a/testdata/r4/descriptors/resprate.descriptor.prototxt +++ b/testdata/r4/descriptors/resprate.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -323,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationResprate.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -364,8 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationResprate.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -479,6 +474,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -593,6 +589,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -775,6 +774,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -782,4 +784,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/resprate" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/servicerequest-genetics.descriptor.prototxt b/testdata/r4/descriptors/servicerequest-genetics.descriptor.prototxt index c33f4a9c8..312343b19 100644 --- a/testdata/r4/descriptors/servicerequest-genetics.descriptor.prototxt +++ b/testdata/r4/descriptors/servicerequest-genetics.descriptor.prototxt @@ -460,7 +460,6 @@ field { options { [google.fhir.proto.field_description]: "The items the orderer requested" [google.fhir.proto.fhir_inlined_extension_url]: "http://hl7.org/fhir/StructureDefinition/servicerequest-geneticsItem" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" [google.fhir.proto.fhir_path_constraint]: "extension.exists() != value.exists()" } json_name: "Item" @@ -642,4 +641,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ServiceRequest-Genetics.\nA request for a service to be performed.\nSee http://hl7.org/fhir/StructureDefinition/servicerequest-genetics" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/ServiceRequest" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/servicerequest-genetics" + [google.fhir.proto.fhir_path_message_constraint]: "orderDetail.empty() or code.exists()" } diff --git a/testdata/r4/descriptors/servicerequest-geneticsItem.descriptor.prototxt b/testdata/r4/descriptors/servicerequest-geneticsItem.descriptor.prototxt index 3bec55f43..9fb16ddc8 100644 --- a/testdata/r4/descriptors/servicerequest-geneticsItem.descriptor.prototxt +++ b/testdata/r4/descriptors/servicerequest-geneticsItem.descriptor.prototxt @@ -65,4 +65,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Item.\nThe items the orderer requested.\nSee http://hl7.org/fhir/StructureDefinition/servicerequest-geneticsItem" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/servicerequest-geneticsItem" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/servicerequest-precondition.descriptor.prototxt b/testdata/r4/descriptors/servicerequest-precondition.descriptor.prototxt index ee9dd9cb6..18642f64d 100644 --- a/testdata/r4/descriptors/servicerequest-precondition.descriptor.prototxt +++ b/testdata/r4/descriptors/servicerequest-precondition.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for precondition.\nThe condition or state of the patient for this test.\nSee http://hl7.org/fhir/StructureDefinition/servicerequest-precondition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/servicerequest-precondition" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/servicerequest-questionnaireRequest.descriptor.prototxt b/testdata/r4/descriptors/servicerequest-questionnaireRequest.descriptor.prototxt index 880e5878e..b056f3b28 100644 --- a/testdata/r4/descriptors/servicerequest-questionnaireRequest.descriptor.prototxt +++ b/testdata/r4/descriptors/servicerequest-questionnaireRequest.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for questionnaireRequest.\nQuestionnaire to be ordered.\nSee http://hl7.org/fhir/StructureDefinition/servicerequest-questionnaireRequest" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/servicerequest-questionnaireRequest" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/shareableactivitydefinition.descriptor.prototxt b/testdata/r4/descriptors/shareableactivitydefinition.descriptor.prototxt index 076b7f9f4..5d40bca0f 100644 --- a/testdata/r4/descriptors/shareableactivitydefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/shareableactivitydefinition.descriptor.prototxt @@ -461,7 +461,6 @@ field { type_name: ".google.fhir.r4.core.ShareableActivityDefinition.Participant" options { [google.fhir.proto.field_description]: "Who should participate in the action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -555,7 +554,6 @@ field { type_name: ".google.fhir.r4.core.ShareableActivityDefinition.DynamicValue" options { [google.fhir.proto.field_description]: "Dynamic aspects of the definition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -921,4 +919,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Shareable ActivityDefinition.\nThe definition of a specific activity to be taken, independent of any particular patient or context.\nSee http://hl7.org/fhir/StructureDefinition/shareableactivitydefinition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/shareableactivitydefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/shareablecodesystem.descriptor.prototxt b/testdata/r4/descriptors/shareablecodesystem.descriptor.prototxt index b4a25bf77..86260b246 100644 --- a/testdata/r4/descriptors/shareablecodesystem.descriptor.prototxt +++ b/testdata/r4/descriptors/shareablecodesystem.descriptor.prototxt @@ -331,7 +331,6 @@ field { type_name: ".google.fhir.r4.core.ShareableCodeSystem.Filter" options { [google.fhir.proto.field_description]: "Filter that can be used in a value set" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -342,7 +341,6 @@ field { type_name: ".google.fhir.r4.core.ShareableCodeSystem.Property" options { [google.fhir.proto.field_description]: "Additional information supplied about each concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -354,7 +352,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Concepts in the code system" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -714,7 +711,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableCodeSystem.ConceptDefinition.Designation" options { [google.fhir.proto.field_description]: "Additional representations for the concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -725,7 +721,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableCodeSystem.ConceptDefinition.ConceptProperty" options { [google.fhir.proto.field_description]: "Property value for the concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -929,4 +924,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Shareable CodeSystem.\nDeclares the existence of and describes a code system or code system supplement.\nSee http://hl7.org/fhir/StructureDefinition/shareablecodesystem" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/CodeSystem" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/shareablecodesystem" + [google.fhir.proto.fhir_path_message_constraint]: "concept.code.combine($this.descendants().concept.code).isDistinct()" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/shareablelibrary.descriptor.prototxt b/testdata/r4/descriptors/shareablelibrary.descriptor.prototxt index 899697fbd..737e07ab2 100644 --- a/testdata/r4/descriptors/shareablelibrary.descriptor.prototxt +++ b/testdata/r4/descriptors/shareablelibrary.descriptor.prototxt @@ -463,4 +463,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Shareable Library.\nRepresents a library of quality improvement components.\nSee http://hl7.org/fhir/StructureDefinition/shareablelibrary" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Library" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/shareablelibrary" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/shareablemeasure.descriptor.prototxt b/testdata/r4/descriptors/shareablemeasure.descriptor.prototxt index 7fd3c9b92..406d47451 100644 --- a/testdata/r4/descriptors/shareablemeasure.descriptor.prototxt +++ b/testdata/r4/descriptors/shareablemeasure.descriptor.prototxt @@ -490,7 +490,6 @@ field { type_name: ".google.fhir.r4.core.ShareableMeasure.Group" options { [google.fhir.proto.field_description]: "Population criteria group" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -501,7 +500,6 @@ field { type_name: ".google.fhir.r4.core.ShareableMeasure.SupplementalData" options { [google.fhir.proto.field_description]: "What other data should be reported with the measure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -619,7 +617,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableMeasure.Group.Population" options { [google.fhir.proto.field_description]: "Population criteria" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -630,7 +627,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableMeasure.Group.Stratifier" options { [google.fhir.proto.field_description]: "Stratifier criteria for the measure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -767,7 +763,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableMeasure.Group.Stratifier.Component" options { [google.fhir.proto.field_description]: "Stratifier criteria component for the measure" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -915,4 +910,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Shareable Measure.\nA quality measure definition.\nSee http://hl7.org/fhir/StructureDefinition/shareablemeasure" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Measure" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/shareablemeasure" + [google.fhir.proto.fhir_path_message_constraint]: "group.stratifier.all((code | description | criteria).exists() xor component.exists())" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/shareableplandefinition.descriptor.prototxt b/testdata/r4/descriptors/shareableplandefinition.descriptor.prototxt index 1602a6fcf..8fc89afc6 100644 --- a/testdata/r4/descriptors/shareableplandefinition.descriptor.prototxt +++ b/testdata/r4/descriptors/shareableplandefinition.descriptor.prototxt @@ -390,7 +390,6 @@ field { type_name: ".google.fhir.r4.core.ShareablePlanDefinition.Goal" options { [google.fhir.proto.field_description]: "What the plan is trying to accomplish" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -401,7 +400,6 @@ field { type_name: ".google.fhir.r4.core.ShareablePlanDefinition.Action" options { [google.fhir.proto.field_description]: "Action defined by the plan" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -560,7 +558,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareablePlanDefinition.Goal.Target" options { [google.fhir.proto.field_description]: "Target outcome for the goal" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -810,7 +807,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareablePlanDefinition.Action.Condition" options { [google.fhir.proto.field_description]: "Whether or not the action is applicable" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -841,7 +837,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareablePlanDefinition.Action.RelatedAction" options { [google.fhir.proto.field_description]: "Relationship to another action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -862,7 +857,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareablePlanDefinition.Action.Participant" options { [google.fhir.proto.field_description]: "Who should participate in the action" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -953,7 +947,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareablePlanDefinition.Action.DynamicValue" options { [google.fhir.proto.field_description]: "Dynamic aspects of the definition" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -1576,4 +1569,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Shareable PlanDefinition.\nThe definition of a plan for a series of actions, independent of any specific patient or context.\nSee http://hl7.org/fhir/StructureDefinition/shareableplandefinition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/PlanDefinition" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/shareableplandefinition" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/shareablevalueset.descriptor.prototxt b/testdata/r4/descriptors/shareablevalueset.descriptor.prototxt index 8602093a4..94300bb3a 100644 --- a/testdata/r4/descriptors/shareablevalueset.descriptor.prototxt +++ b/testdata/r4/descriptors/shareablevalueset.descriptor.prototxt @@ -260,7 +260,6 @@ field { type_name: ".google.fhir.r4.core.ShareableValueSet.Compose" options { [google.fhir.proto.field_description]: "Content logical definition of the value set (CLD)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -271,7 +270,6 @@ field { type_name: ".google.fhir.r4.core.ShareableValueSet.Expansion" options { [google.fhir.proto.field_description]: "Used when the value set is \"expanded\"" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -362,10 +360,6 @@ nested_type { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Include one or more codes from a code system or other value set(s)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "(concept.exists() or filter.exists()) implies system.exists()" - [google.fhir.proto.fhir_path_constraint]: "concept.empty() or filter.empty()" - [google.fhir.proto.fhir_path_constraint]: "valueSet.exists() or system.exists()" } } field { @@ -438,7 +432,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableValueSet.Compose.ConceptSet.ConceptReference" options { [google.fhir.proto.field_description]: "A concept defined in the system" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -449,7 +442,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableValueSet.Compose.ConceptSet.Filter" options { [google.fhir.proto.field_description]: "Select codes/concepts by their properties (including relationships)" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -523,7 +515,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableValueSet.Compose.ConceptSet.ConceptReference.Designation" options { [google.fhir.proto.field_description]: "Additional representations for this concept" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -684,6 +675,11 @@ nested_type { } } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "(concept.exists() or filter.exists()) implies system.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "concept.empty() or filter.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "valueSet.exists() or system.exists()" + } } } nested_type { @@ -767,7 +763,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableValueSet.Expansion.Parameter" options { [google.fhir.proto.field_description]: "Parameter that controlled the expansion process" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } field { @@ -778,10 +773,6 @@ nested_type { type_name: ".google.fhir.r4.core.ShareableValueSet.Expansion.Contains" options { [google.fhir.proto.field_description]: "Codes in the value set" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "code.exists() or display.exists()" - [google.fhir.proto.fhir_path_constraint]: "code.exists() or abstract = true" - [google.fhir.proto.fhir_path_constraint]: "code.empty() or system.exists()" } } nested_type { @@ -1016,6 +1007,11 @@ nested_type { [google.fhir.proto.field_description]: "Codes contained under this entry" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "code.exists() or display.exists()" + [google.fhir.proto.fhir_path_message_constraint]: "code.exists() or abstract = true" + [google.fhir.proto.fhir_path_message_constraint]: "code.empty() or system.exists()" + } } } options { @@ -1023,4 +1019,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Shareable ValueSet.\nA set of codes drawn from one or more code systems.\nSee http://hl7.org/fhir/StructureDefinition/shareablevalueset" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/ValueSet" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/shareablevalueset" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/specimen-collectionPriority.descriptor.prototxt b/testdata/r4/descriptors/specimen-collectionPriority.descriptor.prototxt index 2b3a6168a..acf4cb423 100644 --- a/testdata/r4/descriptors/specimen-collectionPriority.descriptor.prototxt +++ b/testdata/r4/descriptors/specimen-collectionPriority.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for collectionPriority.\nUrgency for collection.\nSee http://hl7.org/fhir/StructureDefinition/specimen-collectionPriority" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/specimen-collectionPriority" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/specimen-isDryWeight.descriptor.prototxt b/testdata/r4/descriptors/specimen-isDryWeight.descriptor.prototxt index 8d8aaf72d..d0b746b0d 100644 --- a/testdata/r4/descriptors/specimen-isDryWeight.descriptor.prototxt +++ b/testdata/r4/descriptors/specimen-isDryWeight.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for isDryWeight.\nWhether quantity is a dry weight.\nSee http://hl7.org/fhir/StructureDefinition/specimen-isDryWeight" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/specimen-isDryWeight" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/specimen-processingTime.descriptor.prototxt b/testdata/r4/descriptors/specimen-processingTime.descriptor.prototxt index 82d47f641..57affda4e 100644 --- a/testdata/r4/descriptors/specimen-processingTime.descriptor.prototxt +++ b/testdata/r4/descriptors/specimen-processingTime.descriptor.prototxt @@ -50,4 +50,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for processingTime.\nTime of processing.\nSee http://hl7.org/fhir/StructureDefinition/specimen-processingTime" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/specimen-processingTime" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/specimen-sequenceNumber.descriptor.prototxt b/testdata/r4/descriptors/specimen-sequenceNumber.descriptor.prototxt index 5093c0dba..3a779da1b 100644 --- a/testdata/r4/descriptors/specimen-sequenceNumber.descriptor.prototxt +++ b/testdata/r4/descriptors/specimen-sequenceNumber.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for sequenceNumber.\nThe sequence number of the sample.\nSee http://hl7.org/fhir/StructureDefinition/specimen-sequenceNumber" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/specimen-sequenceNumber" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/specimen-specialHandling.descriptor.prototxt b/testdata/r4/descriptors/specimen-specialHandling.descriptor.prototxt index b886f3898..019e6eae0 100644 --- a/testdata/r4/descriptors/specimen-specialHandling.descriptor.prototxt +++ b/testdata/r4/descriptors/specimen-specialHandling.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for specialHandling.\nSpecial handling of the specimen.\nSee http://hl7.org/fhir/StructureDefinition/specimen-specialHandling" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/specimen-specialHandling" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-ancestor.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-ancestor.descriptor.prototxt index 8709a1a7c..9f3f6a2f6 100644 --- a/testdata/r4/descriptors/structuredefinition-ancestor.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-ancestor.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for ancestor.\nStructureDefinition this is derived from.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-ancestor" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-ancestor" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-applicable-version.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-applicable-version.descriptor.prototxt index 22cfb2ff7..08415b222 100644 --- a/testdata/r4/descriptors/structuredefinition-applicable-version.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-applicable-version.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for applicable-version.\nAnother Version this applies to.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-applicable-version" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-applicable-version" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-category.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-category.descriptor.prototxt index 20973e1d9..82c79cde1 100644 --- a/testdata/r4/descriptors/structuredefinition-category.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-category.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for category.\nCategory from official resource list.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-category" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-category" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-codegen-super.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-codegen-super.descriptor.prototxt index 1055ecee0..54c6c7054 100644 --- a/testdata/r4/descriptors/structuredefinition-codegen-super.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-codegen-super.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for codegen-super.\nUse a different base when generating code.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-codegen-super" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-codegen-super" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-dependencies.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-dependencies.descriptor.prototxt index ae70d4a2f..43e14eb65 100644 --- a/testdata/r4/descriptors/structuredefinition-dependencies.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-dependencies.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for dependencies.\nDependent Profiles - must be valid against these too.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-dependencies" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-dependencies" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-display-hint.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-display-hint.descriptor.prototxt index 9f8db0e83..38953d085 100644 --- a/testdata/r4/descriptors/structuredefinition-display-hint.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-display-hint.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for display-hint.\nHinting information for the narrative generator.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-explicit-type-name.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-explicit-type-name.descriptor.prototxt index 17803b38d..50283ee18 100644 --- a/testdata/r4/descriptors/structuredefinition-explicit-type-name.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-explicit-type-name.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for explicit-type-name.\nAdvisory - name of Type for implementations.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-fmm-no-warnings.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-fmm-no-warnings.descriptor.prototxt index c57b45286..a1de26e79 100644 --- a/testdata/r4/descriptors/structuredefinition-fmm-no-warnings.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-fmm-no-warnings.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for fmm-no-warnings.\nFMM Level (if no warnings).\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-no-warnings" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm-no-warnings" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-fmm.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-fmm.descriptor.prototxt index c956eb318..9da3b85e4 100644 --- a/testdata/r4/descriptors/structuredefinition-fmm.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-fmm.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for fmm.\nFMM Level.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-hierarchy.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-hierarchy.descriptor.prototxt index 0b09ea1d1..379673fbf 100644 --- a/testdata/r4/descriptors/structuredefinition-hierarchy.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-hierarchy.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for hierarchy.\nWhether a circular reference is allowed to (transitively) point back to the same instance.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-json-type.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-json-type.descriptor.prototxt index f768aed17..4d499ccc6 100644 --- a/testdata/r4/descriptors/structuredefinition-json-type.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-json-type.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for json-type.\nJson type of value property.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-normative-version.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-normative-version.descriptor.prototxt index ef73e23df..4b301634c 100644 --- a/testdata/r4/descriptors/structuredefinition-normative-version.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-normative-version.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for normative-version.\nIf normative, which was the first normative version.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-rdf-type.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-rdf-type.descriptor.prototxt index b86c12b0b..75f3dc842 100644 --- a/testdata/r4/descriptors/structuredefinition-rdf-type.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-rdf-type.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for rdf-type.\nXML (Schema) type of attribute for RDF.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-security-category.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-security-category.descriptor.prototxt index e367455fe..4a1507e53 100644 --- a/testdata/r4/descriptors/structuredefinition-security-category.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-security-category.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for security-category.\nSecurity Categorization for Resource.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-standards-status.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-standards-status.descriptor.prototxt index 5aa73a400..b662978dd 100644 --- a/testdata/r4/descriptors/structuredefinition-standards-status.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-standards-status.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for standards-status.\nHL7 Ballot/Standards status of artifact.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-summary.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-summary.descriptor.prototxt index 86124b3f4..b1e5fcd24 100644 --- a/testdata/r4/descriptors/structuredefinition-summary.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-summary.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for summary.\nAdditional text for the summary presentation.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-summary" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-summary" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-table-name.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-table-name.descriptor.prototxt index 88f949cf3..14fd223cc 100644 --- a/testdata/r4/descriptors/structuredefinition-table-name.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-table-name.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for table-name.\nShow mappings in the summary table with this name.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-table-name" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-table-name" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-template-status.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-template-status.descriptor.prototxt index 47d470463..23b675886 100644 --- a/testdata/r4/descriptors/structuredefinition-template-status.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-template-status.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for template-status.\nTemplate Status Code (more authoring statuses).\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-template-status" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-template-status" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-wg.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-wg.descriptor.prototxt index 81b67396e..be44fb85d 100644 --- a/testdata/r4/descriptors/structuredefinition-wg.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-wg.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for wg.\nOwning Work Group.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-xml-no-order.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-xml-no-order.descriptor.prototxt index 5c1c6fb8b..6fc11bf51 100644 --- a/testdata/r4/descriptors/structuredefinition-xml-no-order.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-xml-no-order.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for xml-no-order.\nWhether elements can come in any order (XML).\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-no-order" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/structuredefinition-xml-type.descriptor.prototxt b/testdata/r4/descriptors/structuredefinition-xml-type.descriptor.prototxt index d00707179..ac7494173 100644 --- a/testdata/r4/descriptors/structuredefinition-xml-type.descriptor.prototxt +++ b/testdata/r4/descriptors/structuredefinition-xml-type.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for xml-type.\nXML (Schema) type of attribute.\nSee http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/synthesis.descriptor.prototxt b/testdata/r4/descriptors/synthesis.descriptor.prototxt index 1c27f22c5..48070282a 100644 --- a/testdata/r4/descriptors/synthesis.descriptor.prototxt +++ b/testdata/r4/descriptors/synthesis.descriptor.prototxt @@ -404,4 +404,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Evidence Synthesis Profile.\nA research context or question.\nSee http://hl7.org/fhir/StructureDefinition/synthesis" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Evidence" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/synthesis" + [google.fhir.proto.fhir_path_message_constraint]: "name.matches(\'[A-Z]([A-Za-z0-9_]){0,254}\')" } diff --git a/testdata/r4/descriptors/task-candidateList.descriptor.prototxt b/testdata/r4/descriptors/task-candidateList.descriptor.prototxt index 738c54f92..da27f023b 100644 --- a/testdata/r4/descriptors/task-candidateList.descriptor.prototxt +++ b/testdata/r4/descriptors/task-candidateList.descriptor.prototxt @@ -30,4 +30,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for candidateList.\nList of possible owners of Task.\nSee http://hl7.org/fhir/StructureDefinition/task-candidateList" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/task-candidateList" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/task-replaces.descriptor.prototxt b/testdata/r4/descriptors/task-replaces.descriptor.prototxt index 37d295fc3..caf6ff999 100644 --- a/testdata/r4/descriptors/task-replaces.descriptor.prototxt +++ b/testdata/r4/descriptors/task-replaces.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for replaces.\nTask(s) replaced by this Task.\nSee http://hl7.org/fhir/StructureDefinition/task-replaces" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/task-replaces" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/timing-dayOfMonth.descriptor.prototxt b/testdata/r4/descriptors/timing-dayOfMonth.descriptor.prototxt index b9580ee29..4890ed629 100644 --- a/testdata/r4/descriptors/timing-dayOfMonth.descriptor.prototxt +++ b/testdata/r4/descriptors/timing-dayOfMonth.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for dayOfMonth.\nDay of Month for schedule.\nSee http://hl7.org/fhir/StructureDefinition/timing-dayOfMonth" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/timing-dayOfMonth" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/timing-daysOfCycle.descriptor.prototxt b/testdata/r4/descriptors/timing-daysOfCycle.descriptor.prototxt index 089f0c7f0..ed2fa76dd 100644 --- a/testdata/r4/descriptors/timing-daysOfCycle.descriptor.prototxt +++ b/testdata/r4/descriptors/timing-daysOfCycle.descriptor.prototxt @@ -35,4 +35,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for daysOfCycle.\nDays on which the action should be performed.\nSee http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/timing-daysOfCycle" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/timing-exact.descriptor.prototxt b/testdata/r4/descriptors/timing-exact.descriptor.prototxt index 2acfb9ceb..14a225cf1 100644 --- a/testdata/r4/descriptors/timing-exact.descriptor.prototxt +++ b/testdata/r4/descriptors/timing-exact.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for exact.\nWhether specified times must be followed as closely as possible.\nSee http://hl7.org/fhir/StructureDefinition/timing-exact" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/timing-exact" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/translation.descriptor.prototxt b/testdata/r4/descriptors/translation.descriptor.prototxt index 02cceb37c..0e54f4afd 100644 --- a/testdata/r4/descriptors/translation.descriptor.prototxt +++ b/testdata/r4/descriptors/translation.descriptor.prototxt @@ -72,4 +72,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Translation.\nLanguage Translation (Localization).\nSee http://hl7.org/fhir/StructureDefinition/translation" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/translation" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/triglyceride.descriptor.prototxt b/testdata/r4/descriptors/triglyceride.descriptor.prototxt index 4bdae0bee..c3e362ba4 100644 --- a/testdata/r4/descriptors/triglyceride.descriptor.prototxt +++ b/testdata/r4/descriptors/triglyceride.descriptor.prototxt @@ -323,8 +323,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -347,7 +345,6 @@ field { type_name: ".google.fhir.r4.core.Triglyceride.Component" options { [google.fhir.proto.field_description]: "Component results" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" } } nested_type { @@ -512,6 +509,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -700,4 +700,6 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Example Lipid Profile.\nTriglyceride Result.\nSee http://hl7.org/fhir/StructureDefinition/triglyceride" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/triglyceride" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" } diff --git a/testdata/r4/descriptors/tz-code.descriptor.prototxt b/testdata/r4/descriptors/tz-code.descriptor.prototxt index ca3f2c0d5..60333df2d 100644 --- a/testdata/r4/descriptors/tz-code.descriptor.prototxt +++ b/testdata/r4/descriptors/tz-code.descriptor.prototxt @@ -59,4 +59,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Timezone Code.\nIANA Timezone Code per BCP 175.\nSee http://hl7.org/fhir/StructureDefinition/tz-code" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/tz-code" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/tz-offset.descriptor.prototxt b/testdata/r4/descriptors/tz-offset.descriptor.prototxt index 3883eaeb1..088587dff 100644 --- a/testdata/r4/descriptors/tz-offset.descriptor.prototxt +++ b/testdata/r4/descriptors/tz-offset.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Timezone Offset.\nTimezone offset, for dates (no timezone in date).\nSee http://hl7.org/fhir/StructureDefinition/tz-offset" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/tz-offset" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/usagecontext-group.descriptor.prototxt b/testdata/r4/descriptors/usagecontext-group.descriptor.prototxt index 84ae2a125..3016ea760 100644 --- a/testdata/r4/descriptors/usagecontext-group.descriptor.prototxt +++ b/testdata/r4/descriptors/usagecontext-group.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for group.\nThe group which this usage context is part of.\nSee http://hl7.org/fhir/StructureDefinition/usagecontext-group" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/usagecontext-group" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-activityStatusDate.descriptor.prototxt b/testdata/r4/descriptors/valueset-activityStatusDate.descriptor.prototxt index 91dc907d4..5dbb36d4b 100644 --- a/testdata/r4/descriptors/valueset-activityStatusDate.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-activityStatusDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for activityStatusDate.\nDate when the activity status is in effect.\nSee http://hl7.org/fhir/StructureDefinition/valueset-activityStatusDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-activityStatusDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-author.descriptor.prototxt b/testdata/r4/descriptors/valueset-author.descriptor.prototxt index 8b65be493..1adaec83c 100644 --- a/testdata/r4/descriptors/valueset-author.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-author.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for author.\nEntity/entities that create and may modify the Value Set.\nSee http://hl7.org/fhir/StructureDefinition/valueset-author" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-author" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-authoritativeSource.descriptor.prototxt b/testdata/r4/descriptors/valueset-authoritativeSource.descriptor.prototxt index 5495733ed..2b4939a3a 100644 --- a/testdata/r4/descriptors/valueset-authoritativeSource.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-authoritativeSource.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for authoritativeSource.\nReference to the current trusted source of the ValueSet resource (metadata and definition).\nSee http://hl7.org/fhir/StructureDefinition/valueset-authoritativeSource" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-authoritativeSource" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-caseSensitive.descriptor.prototxt b/testdata/r4/descriptors/valueset-caseSensitive.descriptor.prototxt index f6c8f25c4..9215ead62 100644 --- a/testdata/r4/descriptors/valueset-caseSensitive.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-caseSensitive.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for caseSensitive.\nIf code is case sensitive.\nSee http://hl7.org/fhir/StructureDefinition/valueset-caseSensitive" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-caseSensitive" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-concept-comments.descriptor.prototxt b/testdata/r4/descriptors/valueset-concept-comments.descriptor.prototxt index 013f3ecdc..6dad2ab96 100644 --- a/testdata/r4/descriptors/valueset-concept-comments.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-concept-comments.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for concept-comments.\nComment about the use of this code in this context.\nSee http://hl7.org/fhir/StructureDefinition/valueset-concept-comments" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-concept-comments" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-concept-definition.descriptor.prototxt b/testdata/r4/descriptors/valueset-concept-definition.descriptor.prototxt index 2367a8f1a..674c4ba3b 100644 --- a/testdata/r4/descriptors/valueset-concept-definition.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-concept-definition.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for concept-definition.\nA definition for this code.\nSee http://hl7.org/fhir/StructureDefinition/valueset-concept-definition" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-concept-definition" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-conceptOrder.descriptor.prototxt b/testdata/r4/descriptors/valueset-conceptOrder.descriptor.prototxt index f5d25762b..5dd7893f6 100644 --- a/testdata/r4/descriptors/valueset-conceptOrder.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-conceptOrder.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for conceptOrder.\nAppearance order for user selection.\nSee http://hl7.org/fhir/StructureDefinition/valueset-conceptOrder" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-conceptOrder" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-deprecated.descriptor.prototxt b/testdata/r4/descriptors/valueset-deprecated.descriptor.prototxt index 6c2f5d320..d653815a3 100644 --- a/testdata/r4/descriptors/valueset-deprecated.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-deprecated.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for deprecated.\nThe concept should not be used.\nSee http://hl7.org/fhir/StructureDefinition/valueset-deprecated" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-deprecated" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-effectiveDate.descriptor.prototxt b/testdata/r4/descriptors/valueset-effectiveDate.descriptor.prototxt index cc4728481..63acf025f 100644 --- a/testdata/r4/descriptors/valueset-effectiveDate.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-effectiveDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for effectiveDate.\nWhen the value set version becomes Active and is available for use.\nSee http://hl7.org/fhir/StructureDefinition/valueset-effectiveDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-effectiveDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-expand-group.descriptor.prototxt b/testdata/r4/descriptors/valueset-expand-group.descriptor.prototxt index 541e88c6b..ecbbd4b54 100644 --- a/testdata/r4/descriptors/valueset-expand-group.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-expand-group.descriptor.prototxt @@ -55,4 +55,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for expand-group.\nDefines a hierarchy structure (when in UI mode).\nSee http://hl7.org/fhir/StructureDefinition/valueset-expand-group" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-expand-group" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-expand-rules.descriptor.prototxt b/testdata/r4/descriptors/valueset-expand-rules.descriptor.prototxt index 53b4a6f02..c0a4374ba 100644 --- a/testdata/r4/descriptors/valueset-expand-rules.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-expand-rules.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for expand-rules.\nall-codes | ungrouped | groups-only.\nSee http://hl7.org/fhir/StructureDefinition/valueset-expand-rules" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-expand-rules" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-expansionSource.descriptor.prototxt b/testdata/r4/descriptors/valueset-expansionSource.descriptor.prototxt index 074754ad8..940884428 100644 --- a/testdata/r4/descriptors/valueset-expansionSource.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-expansionSource.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for expansionSource.\nValueSet definition used to generate this expansion (logical URL).\nSee http://hl7.org/fhir/StructureDefinition/valueset-expansionSource" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-expansionSource" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-expirationDate.descriptor.prototxt b/testdata/r4/descriptors/valueset-expirationDate.descriptor.prototxt index 71e05fb59..8cf539d58 100644 --- a/testdata/r4/descriptors/valueset-expirationDate.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-expirationDate.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for expirationDate.\nWhen the value set version should no longer be used.\nSee http://hl7.org/fhir/StructureDefinition/valueset-expirationDate" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-expirationDate" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-expression.descriptor.prototxt b/testdata/r4/descriptors/valueset-expression.descriptor.prototxt index a867fa5bf..9546a5a9b 100644 --- a/testdata/r4/descriptors/valueset-expression.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-expression.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for expression.\nAn alternative computable expression of the value set content.\nSee http://hl7.org/fhir/StructureDefinition/valueset-expression" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-expression" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-extensible.descriptor.prototxt b/testdata/r4/descriptors/valueset-extensible.descriptor.prototxt index f67fb78b2..4bb4eaee0 100644 --- a/testdata/r4/descriptors/valueset-extensible.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-extensible.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for extensible.\nIntended to be used with an extensible binding (e.g. \'open\').\nSee http://hl7.org/fhir/StructureDefinition/valueset-extensible" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-extensible" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-keyWord.descriptor.prototxt b/testdata/r4/descriptors/valueset-keyWord.descriptor.prototxt index 6907b8248..f56cbcca1 100644 --- a/testdata/r4/descriptors/valueset-keyWord.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-keyWord.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for keyWord.\nDescriptors and key terms for search.\nSee http://hl7.org/fhir/StructureDefinition/valueset-keyWord" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-keyWord" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-label.descriptor.prototxt b/testdata/r4/descriptors/valueset-label.descriptor.prototxt index 5b15d625b..5d4b36862 100644 --- a/testdata/r4/descriptors/valueset-label.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-label.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for label.\nE.g. \"(a)\", \"1.\", etc.\nSee http://hl7.org/fhir/StructureDefinition/valueset-label" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-label" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-map.descriptor.prototxt b/testdata/r4/descriptors/valueset-map.descriptor.prototxt index 46c3a5ee7..1caaa207d 100644 --- a/testdata/r4/descriptors/valueset-map.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-map.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for map.\nA concept map relevant to interpret this value set.\nSee http://hl7.org/fhir/StructureDefinition/valueset-map" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-map" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-otherName.descriptor.prototxt b/testdata/r4/descriptors/valueset-otherName.descriptor.prototxt index f6d86071e..b60f5a5f8 100644 --- a/testdata/r4/descriptors/valueset-otherName.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-otherName.descriptor.prototxt @@ -45,4 +45,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for otherName.\nAlternative names.\nSee http://hl7.org/fhir/StructureDefinition/valueset-otherName" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-otherName" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-parameterSource.descriptor.prototxt b/testdata/r4/descriptors/valueset-parameterSource.descriptor.prototxt index 7e9f9a00d..201b2742f 100644 --- a/testdata/r4/descriptors/valueset-parameterSource.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-parameterSource.descriptor.prototxt @@ -51,4 +51,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for parameterSource.\nDeclares the source of the parameter.\nSee http://hl7.org/fhir/StructureDefinition/valueset-parameterSource" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-parameterSource" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-reference.descriptor.prototxt b/testdata/r4/descriptors/valueset-reference.descriptor.prototxt index 742607ed5..d502223e4 100644 --- a/testdata/r4/descriptors/valueset-reference.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-reference.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reference.\nUrl of Value set the code was chosen from.\nSee http://hl7.org/fhir/StructureDefinition/valueset-reference" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-reference" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-rules-text.descriptor.prototxt b/testdata/r4/descriptors/valueset-rules-text.descriptor.prototxt index bc43bf0a9..87ec8ffa7 100644 --- a/testdata/r4/descriptors/valueset-rules-text.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-rules-text.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for rules-text.\nAn alternative non-computable expression of the value set content.\nSee http://hl7.org/fhir/StructureDefinition/valueset-rules-text" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-rules-text" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-sourceReference.descriptor.prototxt b/testdata/r4/descriptors/valueset-sourceReference.descriptor.prototxt index 5114f5eeb..547b0a72b 100644 --- a/testdata/r4/descriptors/valueset-sourceReference.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-sourceReference.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for sourceReference.\nWhere did this content come from.\nSee http://hl7.org/fhir/StructureDefinition/valueset-sourceReference" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-sourceReference" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-special-status.descriptor.prototxt b/testdata/r4/descriptors/valueset-special-status.descriptor.prototxt index 12fc25efa..313441f59 100644 --- a/testdata/r4/descriptors/valueset-special-status.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-special-status.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for special-status.\nSpecial note about status for implementers.\nSee http://hl7.org/fhir/StructureDefinition/valueset-special-status" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-special-status" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-steward.descriptor.prototxt b/testdata/r4/descriptors/valueset-steward.descriptor.prototxt index 254546d1d..d6d0bdd04 100644 --- a/testdata/r4/descriptors/valueset-steward.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-steward.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for steward.\nEntity responsible for Value Set.\nSee http://hl7.org/fhir/StructureDefinition/valueset-steward" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-steward" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-supplement.descriptor.prototxt b/testdata/r4/descriptors/valueset-supplement.descriptor.prototxt index 1c519fe2f..0563221ec 100644 --- a/testdata/r4/descriptors/valueset-supplement.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-supplement.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for supplement.\nDeclares dependency on a particular supplment.\nSee http://hl7.org/fhir/StructureDefinition/valueset-supplement" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-supplement" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-system.descriptor.prototxt b/testdata/r4/descriptors/valueset-system.descriptor.prototxt index 89d5462de..938312760 100644 --- a/testdata/r4/descriptors/valueset-system.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-system.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for system.\nCode system resource.\nSee http://hl7.org/fhir/StructureDefinition/valueset-system" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-system" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-systemName.descriptor.prototxt b/testdata/r4/descriptors/valueset-systemName.descriptor.prototxt index e363f6d6f..a8675e5c3 100644 --- a/testdata/r4/descriptors/valueset-systemName.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-systemName.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for systemName.\nCode system name.\nSee http://hl7.org/fhir/StructureDefinition/valueset-systemName" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-systemName" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-systemRef.descriptor.prototxt b/testdata/r4/descriptors/valueset-systemRef.descriptor.prototxt index 57b6d4f6a..a52589654 100644 --- a/testdata/r4/descriptors/valueset-systemRef.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-systemRef.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for systemRef.\nWhere to find code system.\nSee http://hl7.org/fhir/StructureDefinition/valueset-systemRef" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-systemRef" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-toocostly.descriptor.prototxt b/testdata/r4/descriptors/valueset-toocostly.descriptor.prototxt index 2f89bc9f0..22ea03b83 100644 --- a/testdata/r4/descriptors/valueset-toocostly.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-toocostly.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for toocostly.\nThe expansion is incomplete because the full expansion is too large.\nSee http://hl7.org/fhir/StructureDefinition/valueset-toocostly" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-toocostly" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-trusted-expansion.descriptor.prototxt b/testdata/r4/descriptors/valueset-trusted-expansion.descriptor.prototxt index 45c76fdf6..87c672414 100644 --- a/testdata/r4/descriptors/valueset-trusted-expansion.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-trusted-expansion.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for trusted-expansion.\nReference to a trusted expansion.\nSee http://hl7.org/fhir/StructureDefinition/valueset-trusted-expansion" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-trusted-expansion" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-unclosed.descriptor.prototxt b/testdata/r4/descriptors/valueset-unclosed.descriptor.prototxt index 2f5aaeb2a..615633d15 100644 --- a/testdata/r4/descriptors/valueset-unclosed.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-unclosed.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for unclosed.\nThe expansion is incomplete (perhaps because of post-coordination).\nSee http://hl7.org/fhir/StructureDefinition/valueset-unclosed" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-unclosed" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-usage.descriptor.prototxt b/testdata/r4/descriptors/valueset-usage.descriptor.prototxt index 5628b7659..76568ea0c 100644 --- a/testdata/r4/descriptors/valueset-usage.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-usage.descriptor.prototxt @@ -46,4 +46,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for usage.\nWho has used and how?.\nSee http://hl7.org/fhir/StructureDefinition/valueset-usage" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-usage" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-warning.descriptor.prototxt b/testdata/r4/descriptors/valueset-warning.descriptor.prototxt index d0974c7db..61cf72019 100644 --- a/testdata/r4/descriptors/valueset-warning.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-warning.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for warning.\nExtra warning about the correct use of the value set.\nSee http://hl7.org/fhir/StructureDefinition/valueset-warning" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-warning" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/valueset-workflowStatus.descriptor.prototxt b/testdata/r4/descriptors/valueset-workflowStatus.descriptor.prototxt index 5a83f7bd7..a644655bf 100644 --- a/testdata/r4/descriptors/valueset-workflowStatus.descriptor.prototxt +++ b/testdata/r4/descriptors/valueset-workflowStatus.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for workflowStatus.\nIndicates the state of development of the value set.\nSee http://hl7.org/fhir/StructureDefinition/valueset-workflowStatus" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/valueset-workflowStatus" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/variable.descriptor.prototxt b/testdata/r4/descriptors/variable.descriptor.prototxt index 387f38ea5..5c8be48e0 100644 --- a/testdata/r4/descriptors/variable.descriptor.prototxt +++ b/testdata/r4/descriptors/variable.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for Variable.\nVariable for processing.\nSee http://hl7.org/fhir/StructureDefinition/variable" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/variable" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/vitalsigns.descriptor.prototxt b/testdata/r4/descriptors/vitalsigns.descriptor.prototxt index c2228e624..d11807582 100644 --- a/testdata/r4/descriptors/vitalsigns.descriptor.prototxt +++ b/testdata/r4/descriptors/vitalsigns.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -323,8 +322,6 @@ field { type_name: ".google.fhir.r4.core.ObservationVitalsigns.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -364,8 +361,6 @@ field { type_name: ".google.fhir.r4.core.ObservationVitalsigns.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -421,6 +416,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -616,6 +612,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -798,10 +797,16 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for observation-vitalsigns.\nFHIR Vital Signs Profile.\nSee http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/vitalspanel.descriptor.prototxt b/testdata/r4/descriptors/vitalspanel.descriptor.prototxt index d13a5757f..1c3077ca8 100644 --- a/testdata/r4/descriptors/vitalspanel.descriptor.prototxt +++ b/testdata/r4/descriptors/vitalspanel.descriptor.prototxt @@ -203,7 +203,6 @@ field { options { [google.fhir.proto.validation_requirement]: REQUIRED_BY_FHIR [google.fhir.proto.field_description]: "Often just a dateTime for Vital Signs" - [google.fhir.proto.fhir_path_constraint]: "($this as dateTime).toString().length() >= 8" } } field { @@ -319,8 +318,6 @@ field { type_name: ".google.fhir.r4.core.ObservationVitalspanel.ReferenceRange" options { [google.fhir.proto.field_description]: "Provides guide for interpretation" - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "low.exists() or high.exists() or text.exists()" } } field { @@ -361,8 +358,6 @@ field { type_name: ".google.fhir.r4.core.ObservationVitalspanel.Component" options { [google.fhir.proto.field_description]: "Used when reporting systolic and diastolic blood pressure." - [google.fhir.proto.fhir_path_constraint]: "hasValue() or (children().count() > id.count())" - [google.fhir.proto.fhir_path_constraint]: "value.exists() or dataAbsentReason.exists()" } } field { @@ -476,6 +471,7 @@ nested_type { } options { [google.fhir.proto.is_choice_type]: true + [google.fhir.proto.fhir_path_message_constraint]: "($this as dateTime).toString().length() >= 8" } oneof_decl { name: "choice" @@ -573,6 +569,9 @@ nested_type { [google.fhir.proto.field_description]: "Text based reference range in an observation" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "low.exists() or high.exists() or text.exists()" + } } nested_type { name: "Component" @@ -755,6 +754,9 @@ nested_type { name: "choice" } } + options { + [google.fhir.proto.fhir_path_message_constraint]: "value.exists() or dataAbsentReason.exists()" + } } options { [google.fhir.proto.structure_definition_kind]: KIND_RESOURCE @@ -762,4 +764,7 @@ options { [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/vitalsigns" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Observation" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/vitalspanel" + [google.fhir.proto.fhir_path_message_constraint]: "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()" + [google.fhir.proto.fhir_path_message_constraint]: "dataAbsentReason.empty() or value.empty()" + [google.fhir.proto.fhir_path_message_constraint]: "(component.empty() and hasMember.empty()) implies (dataAbsentReason or value)" } diff --git a/testdata/r4/descriptors/workflow-episodeOfCare.descriptor.prototxt b/testdata/r4/descriptors/workflow-episodeOfCare.descriptor.prototxt index f096443b4..80f8e7a3e 100644 --- a/testdata/r4/descriptors/workflow-episodeOfCare.descriptor.prototxt +++ b/testdata/r4/descriptors/workflow-episodeOfCare.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for episodeOfCare.\nAssociated Encounter episode of care.\nSee http://hl7.org/fhir/StructureDefinition/workflow-episodeOfCare" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/workflow-episodeOfCare" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/workflow-instantiatesCanonical.descriptor.prototxt b/testdata/r4/descriptors/workflow-instantiatesCanonical.descriptor.prototxt index 09b111761..13a973602 100644 --- a/testdata/r4/descriptors/workflow-instantiatesCanonical.descriptor.prototxt +++ b/testdata/r4/descriptors/workflow-instantiatesCanonical.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for instantiatesCanonical.\nFHIR protocol or definition.\nSee http://hl7.org/fhir/StructureDefinition/workflow-instantiatesCanonical" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/workflow-instantiatesCanonical" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/workflow-instantiatesUri.descriptor.prototxt b/testdata/r4/descriptors/workflow-instantiatesUri.descriptor.prototxt index f7e39449a..dc7533e61 100644 --- a/testdata/r4/descriptors/workflow-instantiatesUri.descriptor.prototxt +++ b/testdata/r4/descriptors/workflow-instantiatesUri.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for instantiatesUri.\nExternal protocol or definition.\nSee http://hl7.org/fhir/StructureDefinition/workflow-instantiatesUri" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/workflow-instantiatesUri" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/workflow-reasonCode.descriptor.prototxt b/testdata/r4/descriptors/workflow-reasonCode.descriptor.prototxt index 908d45ae5..bb1c35e19 100644 --- a/testdata/r4/descriptors/workflow-reasonCode.descriptor.prototxt +++ b/testdata/r4/descriptors/workflow-reasonCode.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reasonCode.\nWhy was event performed?.\nSee http://hl7.org/fhir/StructureDefinition/workflow-reasonCode" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/workflow-reasonCode" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/workflow-reasonReference.descriptor.prototxt b/testdata/r4/descriptors/workflow-reasonReference.descriptor.prototxt index b1cd576d7..7e07918bf 100644 --- a/testdata/r4/descriptors/workflow-reasonReference.descriptor.prototxt +++ b/testdata/r4/descriptors/workflow-reasonReference.descriptor.prototxt @@ -30,4 +30,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for reasonReference.\nWhy was event performed?.\nSee http://hl7.org/fhir/StructureDefinition/workflow-reasonReference" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/workflow-reasonReference" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/workflow-relatedArtifact.descriptor.prototxt b/testdata/r4/descriptors/workflow-relatedArtifact.descriptor.prototxt index 3443c1363..5d526211d 100644 --- a/testdata/r4/descriptors/workflow-relatedArtifact.descriptor.prototxt +++ b/testdata/r4/descriptors/workflow-relatedArtifact.descriptor.prototxt @@ -24,4 +24,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for relatedArtifact.\nDocumentation relevant to the \'parent\' resource.\nSee http://hl7.org/fhir/StructureDefinition/workflow-relatedArtifact" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/workflow-relatedArtifact" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/workflow-researchStudy.descriptor.prototxt b/testdata/r4/descriptors/workflow-researchStudy.descriptor.prototxt index e3adffe19..642eb4553 100644 --- a/testdata/r4/descriptors/workflow-researchStudy.descriptor.prototxt +++ b/testdata/r4/descriptors/workflow-researchStudy.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for researchStudy.\nAssociated research study.\nSee http://hl7.org/fhir/StructureDefinition/workflow-researchStudy" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/workflow-researchStudy" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/descriptors/workflow-supportingInfo.descriptor.prototxt b/testdata/r4/descriptors/workflow-supportingInfo.descriptor.prototxt index 0cb8759ab..f874cf953 100644 --- a/testdata/r4/descriptors/workflow-supportingInfo.descriptor.prototxt +++ b/testdata/r4/descriptors/workflow-supportingInfo.descriptor.prototxt @@ -25,4 +25,5 @@ options { [google.fhir.proto.message_description]: "Auto-generated from StructureDefinition for supportingInfo.\nOther information that may be relevant to this event.\nSee http://hl7.org/fhir/StructureDefinition/workflow-supportingInfo" [google.fhir.proto.fhir_profile_base]: "http://hl7.org/fhir/StructureDefinition/Extension" [google.fhir.proto.fhir_structure_definition_url]: "http://hl7.org/fhir/StructureDefinition/workflow-supportingInfo" + [google.fhir.proto.fhir_path_message_constraint]: "extension.exists() != value.exists()" } diff --git a/testdata/r4/profiles/test.proto b/testdata/r4/profiles/test.proto index 72a0f8239..eab9063f0 100755 --- a/testdata/r4/profiles/test.proto +++ b/testdata/r4/profiles/test.proto @@ -35,6 +35,24 @@ message Bundle { "http://hl7.org/fhir/StructureDefinition/Bundle"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://test/url/base/Bundle"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "(type = 'history') or entry.where(fullUrl.exists()).select(fullUrl&resource.meta.versionId).isDistinct()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type = 'document' implies (identifier.system.exists() and identifier.value.exists())"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "entry.all(request.exists() = (%resource.type = 'batch' or %resource.type = 'transaction' or %resource.type = 'history'))"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "entry.all(response.exists() = (%resource.type = 'batch-response' or %resource.type = 'transaction-response' or %resource.type = 'history'))"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type = 'message' implies entry.first().resource.is(MessageHeader)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "total.empty() or (type = 'searchset') or (type = 'history')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "entry.search.empty() or (type = 'searchset')"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type = 'document' implies entry.first().resource.is(Composition)"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "type = 'document' implies (meta.lastUpdated.hasValue())"; // Logical id of this artifact core.Id id = 1; @@ -95,12 +113,15 @@ message Bundle { core.Uri url = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Link link = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Link link = 9; // Entry in the bundle - will have a resource or information message Entry { + option (.google.fhir.proto.fhir_path_message_constraint) = + "fullUrl.contains('/_history/').not()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "resource.exists() or request.exists() or response.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -150,8 +171,7 @@ message Bundle { // Search ranking (between 0 and 1) core.Decimal score = 5; } - Search search = 7 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Search search = 7; // Additional execution information (transaction/batch/history) message Request { @@ -198,8 +218,7 @@ message Bundle { // For conditional creates core.String if_none_exist = 9; } - Request request = 8 [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Request request = 8; // Results of execution (transaction/batch/history) message Response { @@ -228,13 +247,9 @@ message Bundle { // OperationOutcome with hints and warnings (for batch/transaction) ContainedResource outcome = 8; } - Response response = 9 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Response response = 9; } repeated Entry entry = 10 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "fullUrl.contains('/_history/').not()", (.google.fhir.proto.fhir_path_constraint) = @@ -396,6 +411,9 @@ message TestPatient { // A contact party (e.g. guardian, partner, friend) for the patient message Contact { + option (.google.fhir.proto.fhir_path_message_constraint) = + "name.exists() or telecom.exists() or address.exists() or organization.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -443,8 +461,6 @@ message TestPatient { core.Period period = 10; } repeated Contact contact = 21 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "name.exists() or telecom.exists() or address.exists() or organization.exists()" ]; @@ -469,9 +485,7 @@ message TestPatient { // Language preference indicator core.Boolean preferred = 5; } - repeated Communication communication = 22 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Communication communication = 22; // Patient's nominated primary care provider repeated core.Reference general_practitioner = 23 [ @@ -520,17 +534,13 @@ message TestPatient { TypeCode type = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated Link link = 25 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Link link = 25; // Decimal Extension core.Decimal dec_ext = 26 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, (.google.fhir.proto.fhir_inlined_extension_url) = "http://test/url/base/SimpleDecimalExt", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -545,6 +555,10 @@ message TestObservation { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://test/url/base/TestObservation"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact core.Id id = 1; @@ -889,6 +903,9 @@ message TestObservation { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -916,12 +933,9 @@ message TestObservation { // Text based reference range in an observation core.String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30 + [(.google.fhir.proto.fhir_path_constraint) = + "low.exists() or high.exists() or text.exists()"]; // Related resource that belongs to the Observation group repeated core.Reference has_member = 31 [ @@ -1041,22 +1055,16 @@ message TestObservation { core.Decimal on_nested = 9 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://test/url/base/SimpleDecimalExt", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; // ComplexExt my_complex_extension = 34 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://test/url/base/ComplexExt", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -1073,6 +1081,10 @@ message TestObservationLvl2 { "http://hl7.org/fhir/StructureDefinition/Observation"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://test/url/base/TestObservationLvl2"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "value.empty() or component.code.where( (coding.code = %resource.code.coding.code) and (coding.system = %resource.code.coding.system)).empty()"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "dataAbsentReason.empty() or value.empty()"; // Logical id of this artifact core.Id id = 1; @@ -1453,6 +1465,9 @@ message TestObservationLvl2 { // Provides guide for interpretation message ReferenceRange { + option (.google.fhir.proto.fhir_path_message_constraint) = + "low.exists() or high.exists() or text.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -1480,12 +1495,9 @@ message TestObservationLvl2 { // Text based reference range in an observation core.String text = 9; } - repeated ReferenceRange reference_range = 30 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "low.exists() or high.exists() or text.exists()" - ]; + repeated ReferenceRange reference_range = 30 + [(.google.fhir.proto.fhir_path_constraint) = + "low.exists() or high.exists() or text.exists()"]; // Related resource that belongs to the Observation group repeated core.Reference has_member = 31 [ @@ -1605,22 +1617,16 @@ message TestObservationLvl2 { core.Decimal on_nested = 9 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://test/url/base/SimpleDecimalExt", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; } - repeated Component component = 33 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Component component = 33; // ComplexExt my_complex_extension = 34 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://test/url/base/ComplexExt", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -1629,8 +1635,6 @@ message TestObservationLvl2 { core.Decimal new_ext = 35 [ (.google.fhir.proto.fhir_inlined_extension_url) = "http://test/url/base/SimpleDecimalExt", - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ]; @@ -1729,9 +1733,7 @@ message TestEncounter { core.Period period = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated StatusHistory status_history = 12 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated StatusHistory status_history = 12; // Classification of patient encounter core.Coding class_value = 13 [ @@ -1760,9 +1762,7 @@ message TestEncounter { core.Period period = 5 [(.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR]; } - repeated ClassHistory class_history = 14 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated ClassHistory class_history = 14; // Specific type of encounter repeated core.CodeableConcept type = 15; @@ -1880,9 +1880,7 @@ message TestEncounter { (.google.fhir.proto.valid_reference_type) = "RelatedPerson" ]; } - repeated Participant participant = 21 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Participant participant = 21; // The appointment that scheduled this encounter repeated core.Reference appointment = 22 @@ -1930,9 +1928,7 @@ message TestEncounter { // Ranking of the diagnosis (for each role type) core.PositiveInt rank = 6; } - repeated Diagnosis diagnosis = 27 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Diagnosis diagnosis = 27; // The set of accounts that may be used for billing for this Encounter repeated core.Reference account = 28 @@ -1983,9 +1979,7 @@ message TestEncounter { // Category or kind of location after discharge core.CodeableConcept discharge_disposition = 12; } - Hospitalization hospitalization = 29 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + Hospitalization hospitalization = 29; // List of locations where the patient has been message Location { @@ -2028,9 +2022,7 @@ message TestEncounter { // Time period during which the patient was present at the location core.Period period = 7; } - repeated Location location = 30 - [(.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())"]; + repeated Location location = 30; // The organization (facility) responsible for this encounter core.Reference service_provider = 31 diff --git a/testdata/r4/profiles/test_extensions.proto b/testdata/r4/profiles/test_extensions.proto index 63e89cc87..d1e3cc3b2 100755 --- a/testdata/r4/profiles/test_extensions.proto +++ b/testdata/r4/profiles/test_extensions.proto @@ -33,6 +33,8 @@ message SimpleDecimalExt { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://test/url/base/SimpleDecimalExt"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing core.String id = 1; @@ -53,6 +55,8 @@ message SimpleCodeableConceptExtension { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://test/url/base/SimpleCodeableConceptExtension"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing core.String id = 1; @@ -83,6 +87,8 @@ message DigitalMediaType { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://test/url/base/DigitalMediaType"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing core.String id = 1; @@ -125,20 +131,21 @@ message ComplexExt { "http://hl7.org/fhir/StructureDefinition/Extension"; option (.google.fhir.proto.fhir_structure_definition_url) = "http://test/url/base/ComplexExt"; + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; // Unique id for inter-element referencing core.String id = 1; // simple subfield - core.String simple_subfield = 4 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() != value.exists()" - ]; + core.String simple_subfield = 4 [(.google.fhir.proto.fhir_path_constraint) = + "extension.exists() != value.exists()"]; // complex subfield message ComplexSubfield { + option (.google.fhir.proto.fhir_path_message_constraint) = + "extension.exists() != value.exists()"; + // Unique id for inter-element referencing core.String id = 1; @@ -158,25 +165,17 @@ message ComplexExt { core.Boolean boolean = 3; } } - SimpleSubSubFieldA simple_sub_sub_field_a = 4 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() != value.exists()" - ]; + SimpleSubSubFieldA simple_sub_sub_field_a = 4 + [(.google.fhir.proto.fhir_path_constraint) = + "extension.exists() != value.exists()"]; // simple sub sub field b - repeated core.UnsignedInt simple_sub_sub_field_b = 5 [ - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", - (.google.fhir.proto.fhir_path_constraint) = - "extension.exists() != value.exists()" - ]; + repeated core.UnsignedInt simple_sub_sub_field_b = 5 + [(.google.fhir.proto.fhir_path_constraint) = + "extension.exists() != value.exists()"]; } ComplexSubfield complex_subfield = 5 [ (.google.fhir.proto.validation_requirement) = REQUIRED_BY_FHIR, - (.google.fhir.proto.fhir_path_constraint) = - "hasValue() or (children().count() > id.count())", (.google.fhir.proto.fhir_path_constraint) = "extension.exists() != value.exists()" ];