{
  "@context": "http://www.w3.org/ns/shex.jsonld",
  "type": "Schema",
  "start": "http://schema.example/ObservationShape",
  "shapes": [
    {
      "type": "ShapeDecl",
      "id": "http://schema.example/ObservationShape",
      "shapeExpr": {
        "type": "Shape",
        "expression": {
          "type": "EachOf",
          "expressions": [
            {
              "type": "TripleConstraint",
              "predicate": "http://hl7.org/fhir/status",
              "valueExpr": {
                "type": "NodeConstraint",
                "values": [
                  { "value": "preliminary" },
                  { "value": "final" }
                ]
              }
            },
            {
              "type": "TripleConstraint",
              "predicate": "http://hl7.org/fhir/subject",
              "valueExpr": "http://schema.example/PatientShape"
            }
          ]
        }
      }
    },
    {
      "type": "ShapeDecl",
      "id": "http://schema.example/PatientShape",
      "shapeExpr": {
      "type": "Shape",
        "expression": {
          "type": "EachOf",
          "expressions": [
            {
              "type": "TripleConstraint",
              "predicate": "http://hl7.org/fhir/name",
              "valueExpr": {
                "type": "NodeConstraint",
                "datatype": "http://www.w3.org/2001/XMLSchema#string"
              },
              "min": 0, "max": -1
            },
            {
              "type": "TripleConstraint",
              "predicate": "http://hl7.org/fhir/birthdate",
              "valueExpr": {
                "type": "NodeConstraint",
                "datatype": "http://www.w3.org/2001/XMLSchema#date"
              },
              "min": 0, "max": 1
            }
          ]
        }
      }
    }
  ]
}
