{
  "openapi": "3.0.0",
  "info": {
    "title": "DeepPhe Data API",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "DeepPhe",
      "description": "DeepPhe endpoints"
    }
  ],
  "components": {
    "schemas": {
      "AttributeValue": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "classUri": {
            "type": "string"
          },
          "conceptIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "confidence": {
            "type": "integer"
          },
          "historic": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "negated": {
            "type": "boolean"
          },
          "uncertain": {
            "type": "boolean"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "AttributeXn": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "values": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "classUri": {
                  "type": "string"
                },
                "conceptIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "confidence": {
                  "type": "integer"
                },
                "historic": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "negated": {
                  "type": "boolean"
                },
                "uncertain": {
                  "type": "boolean"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "BasicPatient": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object"
      },
      "BiomarkerSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "relationPrettyName": {
            "type": "string"
          },
          "tumorFactRelation": {
            "type": "string"
          },
          "valueText": {
            "type": "string"
          }
        }
      },
      "Cancer": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeoplasmAttribute"
            }
          },
          "classUri": {
            "type": "string"
          },
          "factIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "relatedFactIds": {
            "$ref": "#/components/schemas/Map(String,List(String))"
          },
          "tumors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "attributes": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NeoplasmAttribute"
                  }
                },
                "classUri": {
                  "type": "string"
                },
                "factIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "id": {
                  "type": "string"
                },
                "relatedFactIds": {
                  "$ref": "#/components/schemas/Map(String,List(String))"
                }
              }
            }
          }
        }
      },
      "Map(String,List(String))": {
        "type": "object"
      },
      "Mention": {
        "type": "object",
        "properties": {
          "begin": {
            "type": "integer"
          },
          "classUri": {
            "type": "string"
          },
          "confidence": {
            "type": "integer"
          },
          "end": {
            "type": "integer"
          },
          "historic": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "negated": {
            "type": "boolean"
          },
          "uncertain": {
            "type": "boolean"
          }
        }
      },
      "NeoplasmAttribute": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "classUri": {
            "type": "string"
          },
          "confidence": {
            "type": "integer"
          },
          "confidenceFeatures": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "directEvidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Mention"
            }
          },
          "id": {
            "type": "string"
          },
          "indirectEvidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Mention"
            }
          },
          "name": {
            "type": "string"
          },
          "notEvidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Mention"
            }
          },
          "value": {
            "type": "string"
          }
        }
      },
      "CancerAndTumorSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "cancers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "attributes": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NeoplasmAttribute"
                  }
                },
                "classUri": {
                  "type": "string"
                },
                "er": {
                  "type": "string"
                },
                "her2": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "pathologic_m": {
                  "type": "string"
                },
                "pathologic_n": {
                  "type": "string"
                },
                "pathologic_t": {
                  "type": "string"
                },
                "pr": {
                  "type": "string"
                },
                "subSummaries": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NeoplasmSummary"
                  }
                },
                "tumors": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NeoplasmSummary"
                  }
                }
              }
            }
          }
        }
      },
      "NeoplasmSummary": {
        "type": "object",
        "properties": {
          "attributes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "classUri": {
                  "type": "string"
                },
                "confidence": {
                  "type": "integer"
                },
                "confidenceFeatures": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "directEvidence": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mention"
                  }
                },
                "id": {
                  "type": "string"
                },
                "indirectEvidence": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mention"
                  }
                },
                "name": {
                  "type": "string"
                },
                "notEvidence": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mention"
                  }
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "classUri": {
            "type": "string"
          },
          "er": {
            "type": "string"
          },
          "her2": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "pathologic_m": {
            "type": "string"
          },
          "pathologic_n": {
            "type": "string"
          },
          "pathologic_t": {
            "type": "string"
          },
          "pr": {
            "type": "string"
          },
          "subSummaries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeoplasmSummary"
            }
          }
        }
      },
      "CancerFact": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "cancerFactInfo": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "prettyName": {
                "type": "string"
              }
            }
          },
          "relation": {
            "type": "string"
          },
          "relationPrettyName": {
            "type": "string"
          }
        }
      },
      "CancerSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeoplasmAttribute"
            }
          },
          "classUri": {
            "type": "string"
          },
          "er": {
            "type": "string"
          },
          "her2": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "pathologic_m": {
            "type": "string"
          },
          "pathologic_n": {
            "type": "string"
          },
          "pathologic_t": {
            "type": "string"
          },
          "pr": {
            "type": "string"
          },
          "subSummaries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeoplasmSummary"
            }
          },
          "tumors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeoplasmSummary"
            }
          }
        }
      },
      "CancerSummaryXn": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttributeXn"
            }
          },
          "classUri": {
            "type": "string"
          },
          "conceptIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "confidence": {
            "type": "integer"
          },
          "historic": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "negated": {
            "type": "boolean"
          },
          "tumors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "attributes": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AttributeXn"
                  }
                },
                "classUri": {
                  "type": "string"
                },
                "conceptIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "confidence": {
                  "type": "integer"
                },
                "historic": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "negated": {
                  "type": "boolean"
                },
                "uncertain": {
                  "type": "boolean"
                }
              }
            }
          },
          "uncertain": {
            "type": "boolean"
          }
        }
      },
      "Codification": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": "string"
          }
        }
      },
      "Concept": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "classUri": {
            "type": "string"
          },
          "codifications": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "codes": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "source": {
                  "type": "string"
                }
              }
            }
          },
          "confidence": {
            "type": "integer"
          },
          "dpheGroup": {
            "type": "string"
          },
          "historic": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "mentionIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "negated": {
            "type": "boolean"
          },
          "preferredText": {
            "type": "string"
          },
          "uncertain": {
            "type": "boolean"
          }
        }
      },
      "ConceptRelation": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "sourceId": {
            "type": "string"
          },
          "targetId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "ConfidenceOwner": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object"
      },
      "DocumentXn": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "episode": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "mentionRelations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sourceId": {
                  "type": "string"
                },
                "targetId": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "mentions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "begin": {
                  "type": "integer"
                },
                "classUri": {
                  "type": "string"
                },
                "confidence": {
                  "type": "integer"
                },
                "end": {
                  "type": "integer"
                },
                "historic": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "negated": {
                  "type": "boolean"
                },
                "uncertain": {
                  "type": "boolean"
                }
              }
            }
          },
          "name": {
            "type": "string"
          },
          "sections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "begin": {
                  "type": "integer"
                },
                "end": {
                  "type": "integer"
                },
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "text": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "Episode": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "endDate": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          }
        }
      },
      "Fact": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "classUri": {
            "type": "string"
          },
          "confidence": {
            "type": "integer"
          },
          "confidenceFeatures": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "directEvidenceIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "relatedFactIds": {
            "type": "object"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "FactInfo": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prettyName": {
            "type": "string"
          }
        }
      },
      "FactInfoAndGroupedTextProvenances": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "mentionedTerms": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "begin": {
                  "type": "integer"
                },
                "end": {
                  "type": "integer"
                },
                "reportId": {
                  "type": "string"
                },
                "reportName": {
                  "type": "string"
                },
                "reportType": {
                  "type": "string"
                },
                "term": {
                  "type": "string"
                }
              }
            }
          },
          "sourceFact": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "prettyName": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          }
        }
      },
      "FullPatient": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "birth": {
            "type": "string"
          },
          "death": {
            "type": "string"
          },
          "firstEncounter": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lastEncounter": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "corefs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "idChain": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "date": {
                  "type": "string"
                },
                "episode": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "mentions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "begin": {
                        "type": "integer"
                      },
                      "classUri": {
                        "type": "string"
                      },
                      "confidence": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      },
                      "historic": {
                        "type": "boolean"
                      },
                      "id": {
                        "type": "string"
                      },
                      "negated": {
                        "type": "boolean"
                      },
                      "uncertain": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "name": {
                  "type": "string"
                },
                "relations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "sourceId": {
                        "type": "string"
                      },
                      "targetId": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "sections": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "begin": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      },
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "text": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "GuiPatientSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "patientInfo": {
            "type": "object",
            "properties": {
              "birthDate": {
                "type": "string"
              },
              "firstEncounterAge": {
                "type": "string"
              },
              "firstEncounterDate": {
                "type": "string"
              },
              "gender": {
                "type": "string"
              },
              "lastEncounterAge": {
                "type": "string"
              },
              "lastEncounterDate": {
                "type": "string"
              },
              "patientId": {
                "type": "string"
              },
              "patientName": {
                "type": "string"
              }
            }
          },
          "reportData": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "episode": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "reportName": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "InfoNode": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "classUri": {
            "type": "string"
          },
          "confidence": {
            "type": "integer"
          },
          "historic": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "negated": {
            "type": "boolean"
          },
          "uncertain": {
            "type": "boolean"
          }
        }
      },
      "MentionCoref": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "idChain": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MentionRelation": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "sourceId": {
            "type": "string"
          },
          "targetId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "MentionedTerm": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "begin": {
            "type": "integer"
          },
          "end": {
            "type": "integer"
          },
          "reportId": {
            "type": "string"
          },
          "reportName": {
            "type": "string"
          },
          "reportType": {
            "type": "string"
          },
          "term": {
            "type": "string"
          }
        }
      },
      "NewBiomarkerSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "patientId": {
            "type": "string"
          },
          "relationPrettyName": {
            "type": "string"
          },
          "tumorFactRelation": {
            "type": "string"
          },
          "valueText": {
            "type": "string"
          }
        }
      },
      "NewCancerAndTumorSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "cancers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "cancerFacts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "cancerFactInfo": {
                        "$ref": "#/components/schemas/NewFactInfo"
                      },
                      "relation": {
                        "type": "string"
                      },
                      "relationPrettyName": {
                        "type": "string"
                      }
                    }
                  }
                },
                "cancerId": {
                  "type": "string"
                },
                "tumors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "hasTumorType": {
                        "type": "string"
                      },
                      "tumorFacts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "relation": {
                              "type": "string"
                            },
                            "relationPrettyName": {
                              "type": "string"
                            },
                            "tumorFactInfo": {
                              "$ref": "#/components/schemas/NewFactInfo"
                            }
                          }
                        }
                      },
                      "tumorId": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "NewFactInfo": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prettyName": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "NewCancerFact": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "cancerFactInfo": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "prettyName": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          },
          "relation": {
            "type": "string"
          },
          "relationPrettyName": {
            "type": "string"
          }
        }
      },
      "NewCancerSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "cancerFacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "cancerFactInfo": {
                  "$ref": "#/components/schemas/NewFactInfo"
                },
                "relation": {
                  "type": "string"
                },
                "relationPrettyName": {
                  "type": "string"
                }
              }
            }
          },
          "cancerId": {
            "type": "string"
          },
          "tumors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "hasTumorType": {
                  "type": "string"
                },
                "tumorFacts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "relation": {
                        "type": "string"
                      },
                      "relationPrettyName": {
                        "type": "string"
                      },
                      "tumorFactInfo": {
                        "$ref": "#/components/schemas/NewFactInfo"
                      }
                    }
                  }
                },
                "tumorId": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "NewFact": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string"
          },
          "relationPrettyName": {
            "type": "string"
          }
        }
      },
      "NewMentionedTerm": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "begin": {
            "type": "integer"
          },
          "end": {
            "type": "integer"
          },
          "reportId": {
            "type": "string"
          },
          "reportName": {
            "type": "string"
          },
          "reportType": {
            "type": "string"
          },
          "term": {
            "type": "string"
          }
        }
      },
      "NewPatientDiagnosis": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "diagnosis": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "diagnosisGroups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "patientId": {
            "type": "string"
          }
        }
      },
      "NewPatientSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "patientInfo": {
            "type": "object",
            "properties": {
              "birthDate": {
                "type": "string"
              },
              "firstEncounterAge": {
                "type": "string"
              },
              "firstEncounterDate": {
                "type": "string"
              },
              "gender": {
                "type": "string"
              },
              "lastEncounterAge": {
                "type": "string"
              },
              "lastEncounterDate": {
                "type": "string"
              },
              "patientId": {
                "type": "string"
              },
              "patientName": {
                "type": "string"
              }
            }
          },
          "reportData": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "episode": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "reportName": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "NewReport": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "episode": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "reportName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "NewStructuredPatientData": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "birthdate": {
            "type": "string"
          },
          "firstEncounterDate": {
            "type": "string"
          },
          "firstname": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "lastEncounterDate": {
            "type": "string"
          },
          "lastname": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          }
        }
      },
      "NewTumorFact": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string"
          },
          "relationPrettyName": {
            "type": "string"
          },
          "tumorFactInfo": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "prettyName": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          }
        }
      },
      "NewTumorSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "hasTumorType": {
            "type": "string"
          },
          "tumorFacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relation": {
                  "type": "string"
                },
                "relationPrettyName": {
                  "type": "string"
                },
                "tumorFactInfo": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "prettyName": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "tumorId": {
            "type": "string"
          }
        }
      },
      "Note": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "corefs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "idChain": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "date": {
            "type": "string"
          },
          "episode": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "mentions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "begin": {
                  "type": "integer"
                },
                "classUri": {
                  "type": "string"
                },
                "confidence": {
                  "type": "integer"
                },
                "end": {
                  "type": "integer"
                },
                "historic": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "negated": {
                  "type": "boolean"
                },
                "uncertain": {
                  "type": "boolean"
                }
              }
            }
          },
          "name": {
            "type": "string"
          },
          "relations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sourceId": {
                  "type": "string"
                },
                "targetId": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "sections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "begin": {
                  "type": "integer"
                },
                "end": {
                  "type": "integer"
                },
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "text": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "Patient": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "biomarkers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "patientId": {
                  "type": "string"
                },
                "relationPrettyName": {
                  "type": "string"
                },
                "tumorFactRelation": {
                  "type": "string"
                },
                "valueText": {
                  "type": "string"
                }
              }
            }
          },
          "birth": {
            "type": "string"
          },
          "death": {
            "type": "string"
          },
          "diagnoses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "diagnosis": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "diagnosisGroups": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "patientId": {
                  "type": "string"
                }
              }
            }
          },
          "gender": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "noteHash": {
            "type": "string"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "corefs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "idChain": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "date": {
                  "type": "string"
                },
                "episode": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "mentions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "begin": {
                        "type": "integer"
                      },
                      "classUri": {
                        "type": "string"
                      },
                      "confidence": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      },
                      "historic": {
                        "type": "boolean"
                      },
                      "id": {
                        "type": "string"
                      },
                      "negated": {
                        "type": "boolean"
                      },
                      "uncertain": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "name": {
                  "type": "string"
                },
                "relations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "sourceId": {
                        "type": "string"
                      },
                      "targetId": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "sections": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "begin": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      },
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "text": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "PatientDiagnosis": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "classUri": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          }
        }
      },
      "PatientInfo": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "birthDate": {
            "type": "string"
          },
          "firstEncounterAge": {
            "type": "string"
          },
          "firstEncounterDate": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "lastEncounterAge": {
            "type": "string"
          },
          "lastEncounterDate": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          }
        }
      },
      "PatientInfoAndStages": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "birthDate": {
            "type": "string"
          },
          "firstEncounterAge": {
            "type": "string"
          },
          "firstEncounterDate": {
            "type": "string"
          },
          "gender": {
            "type": "string"
          },
          "lastEncounterAge": {
            "type": "string"
          },
          "lastEncounterDate": {
            "type": "string"
          },
          "patientId": {
            "type": "string"
          },
          "patientName": {
            "type": "string"
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PatientSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "neoplasms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeoplasmSummary"
            }
          },
          "patient": {
            "type": "object",
            "properties": {
              "biomarkers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "patientId": {
                      "type": "string"
                    },
                    "relationPrettyName": {
                      "type": "string"
                    },
                    "tumorFactRelation": {
                      "type": "string"
                    },
                    "valueText": {
                      "type": "string"
                    }
                  }
                }
              },
              "birth": {
                "type": "string"
              },
              "death": {
                "type": "string"
              },
              "diagnoses": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "diagnosis": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "diagnosisGroups": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "patientId": {
                      "type": "string"
                    }
                  }
                }
              },
              "gender": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "noteHash": {
                "type": "string"
              },
              "notes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "corefs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "idChain": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "date": {
                      "type": "string"
                    },
                    "episode": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "mentions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Mention"
                      }
                    },
                    "name": {
                      "type": "string"
                    },
                    "relations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sourceId": {
                            "type": "string"
                          },
                          "targetId": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "sections": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "begin": {
                            "type": "integer"
                          },
                          "end": {
                            "type": "integer"
                          },
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "text": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PatientSummaryAndStagesList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "patientSummaryAndStages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "birthDate": {
                  "type": "string"
                },
                "firstEncounterAge": {
                  "type": "string"
                },
                "firstEncounterDate": {
                  "type": "string"
                },
                "gender": {
                  "type": "string"
                },
                "lastEncounterAge": {
                  "type": "string"
                },
                "lastEncounterDate": {
                  "type": "string"
                },
                "patientId": {
                  "type": "string"
                },
                "patientName": {
                  "type": "string"
                },
                "stages": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "PatientSummaryXn": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "birth": {
            "type": "string"
          },
          "cancers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "attributes": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AttributeXn"
                  }
                },
                "classUri": {
                  "type": "string"
                },
                "conceptIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "confidence": {
                  "type": "integer"
                },
                "historic": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "negated": {
                  "type": "boolean"
                },
                "tumors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "attributes": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/AttributeXn"
                        }
                      },
                      "classUri": {
                        "type": "string"
                      },
                      "conceptIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "confidence": {
                        "type": "integer"
                      },
                      "historic": {
                        "type": "boolean"
                      },
                      "id": {
                        "type": "string"
                      },
                      "negated": {
                        "type": "boolean"
                      },
                      "uncertain": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "uncertain": {
                  "type": "boolean"
                }
              }
            }
          },
          "conceptRelations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "sourceId": {
                  "type": "string"
                },
                "targetId": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "concepts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "classUri": {
                  "type": "string"
                },
                "codifications": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "codes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "source": {
                        "type": "string"
                      }
                    }
                  }
                },
                "confidence": {
                  "type": "integer"
                },
                "dpheGroup": {
                  "type": "string"
                },
                "historic": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "mentionIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "negated": {
                  "type": "boolean"
                },
                "preferredText": {
                  "type": "string"
                },
                "uncertain": {
                  "type": "boolean"
                }
              }
            }
          },
          "death": {
            "type": "string"
          },
          "documents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "episode": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "mentionRelations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "sourceId": {
                        "type": "string"
                      },
                      "targetId": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "mentions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "begin": {
                        "type": "integer"
                      },
                      "classUri": {
                        "type": "string"
                      },
                      "confidence": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      },
                      "historic": {
                        "type": "boolean"
                      },
                      "id": {
                        "type": "string"
                      },
                      "negated": {
                        "type": "boolean"
                      },
                      "uncertain": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "name": {
                  "type": "string"
                },
                "sections": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "begin": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      },
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "text": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "gender": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "PatientXn": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "biomarkers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "patientId": {
                  "type": "string"
                },
                "relationPrettyName": {
                  "type": "string"
                },
                "tumorFactRelation": {
                  "type": "string"
                },
                "valueText": {
                  "type": "string"
                }
              }
            }
          },
          "birth": {
            "type": "string"
          },
          "death": {
            "type": "string"
          },
          "diagnoses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "diagnosis": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "diagnosisGroups": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "patientId": {
                  "type": "string"
                }
              }
            }
          },
          "gender": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "noteHash": {
            "type": "string"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "corefs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "idChain": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "date": {
                  "type": "string"
                },
                "episode": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "mentions": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "begin": {
                        "type": "integer"
                      },
                      "classUri": {
                        "type": "string"
                      },
                      "confidence": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      },
                      "historic": {
                        "type": "boolean"
                      },
                      "id": {
                        "type": "string"
                      },
                      "negated": {
                        "type": "boolean"
                      },
                      "uncertain": {
                        "type": "boolean"
                      }
                    }
                  }
                },
                "name": {
                  "type": "string"
                },
                "relations": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "sourceId": {
                        "type": "string"
                      },
                      "targetId": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "sections": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "begin": {
                        "type": "integer"
                      },
                      "end": {
                        "type": "integer"
                      },
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      }
                    }
                  }
                },
                "text": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Report": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "reportDate": {
            "type": "string"
          },
          "reportEpisode": {
            "type": "string"
          },
          "reportId": {
            "type": "string"
          },
          "reportType": {
            "type": "string"
          }
        }
      },
      "Section": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "begin": {
            "type": "integer"
          },
          "end": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "SharedPatientProperties": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object"
      },
      "Text": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "Tumor": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "attributes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "classUri": {
                  "type": "string"
                },
                "confidence": {
                  "type": "integer"
                },
                "confidenceFeatures": {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  }
                },
                "directEvidence": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mention"
                  }
                },
                "id": {
                  "type": "string"
                },
                "indirectEvidence": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mention"
                  }
                },
                "name": {
                  "type": "string"
                },
                "notEvidence": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Mention"
                  }
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "classUri": {
            "type": "string"
          },
          "factIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "relatedFactIds": {
            "type": "object"
          }
        }
      },
      "TumorFact": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "relation": {
            "type": "string"
          },
          "relationPrettyName": {
            "type": "string"
          },
          "tumorFactInfo": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "prettyName": {
                "type": "string"
              }
            }
          }
        }
      },
      "TumorSummary": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "hasTumorType": {
            "type": "string"
          },
          "tumorFacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "relation": {
                  "type": "string"
                },
                "relationPrettyName": {
                  "type": "string"
                },
                "tumorFactInfo": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "prettyName": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "tumorId": {
            "type": "string"
          }
        }
      },
      "TumorSummaryXn": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "attributes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "values": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "classUri": {
                        "type": "string"
                      },
                      "conceptIds": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "confidence": {
                        "type": "integer"
                      },
                      "historic": {
                        "type": "boolean"
                      },
                      "id": {
                        "type": "string"
                      },
                      "negated": {
                        "type": "boolean"
                      },
                      "uncertain": {
                        "type": "boolean"
                      },
                      "value": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "classUri": {
            "type": "string"
          },
          "conceptIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "confidence": {
            "type": "integer"
          },
          "historic": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "negated": {
            "type": "boolean"
          },
          "uncertain": {
            "type": "boolean"
          }
        }
      }
    }
  },
  "paths": {
    "/v1/deepphe-api/deepphe/attributes/classes": {
      "get": {
        "summary": "Get all unique attribute classes",
        "description": "Returns list of unique attribute class names",
        "tags": [
          "DeepPhe"
        ],
        "responses": {
          "200": {
            "description": "List of attribute class names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/attributes/summary": {
      "get": {
        "summary": "Get all attribute classes and instances in one response",
        "description": "Returns attribute classes with instances grouped by class, with optional patient identifier data",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "includePatientIds",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "When false, omit patient identifier arrays from instance rows"
          }
        ],
        "responses": {
          "200": {
            "description": "Attribute summary payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "classes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "instancesByClass": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "totalMs": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/attributes/instances": {
      "get": {
        "summary": "Get all attribute instances for a specific class",
        "description": "Returns list of attribute objects for a specific class (without patient identifier arrays)",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "groupname",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Group name"
          }
        ],
        "responses": {
          "200": {
            "description": "List of attributes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "Unique identifier for the attribute"
                      },
                      "attribute_name": {
                        "type": "string",
                        "description": "Name of the attribute class"
                      },
                      "value": {
                        "type": "string",
                        "description": "Value of the attribute"
                      },
                      "classUri": {
                        "type": "string",
                        "description": "URI of the class"
                      },
                      "negated": {
                        "type": "integer",
                        "description": "Flag indicating if the attribute is negated (0 or 1)"
                      },
                      "uncertain": {
                        "type": "integer",
                        "description": "Flag indicating if the attribute is uncertain (0 or 1)"
                      },
                      "historic": {
                        "type": "integer",
                        "description": "Flag indicating if the attribute is historic (0 or 1)"
                      },
                      "num_patients": {
                        "type": "integer",
                        "description": "Number of patients with this attribute"
                      }
                    }
                  },
                  "example": [
                    {
                      "id": 894,
                      "attribute_name": "Genes",
                      "value": "Cyclin-Dependent Kinase Inhibitor 2A",
                      "classUri": "Cyclin_sub_DependentKinaseInhibitor2A",
                      "negated": 0,
                      "uncertain": 1,
                      "historic": 0,
                      "num_patients": 1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No attributes found for this class"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/attributes/instances/patients": {
      "get": {
        "summary": "Get all attribute instances for a specific class including patient identifiers",
        "description": "Returns list of attribute objects for a specific class with patient identifier arrays",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "groupname",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Group name"
          }
        ],
        "responses": {
          "200": {
            "description": "List of attributes with patient identifier arrays"
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No attributes found for this class"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/attributes/instances/patient/{patientId}": {
      "get": {
        "summary": "Get attribute instances for a specific class and patient",
        "description": "Returns attribute rows where the specified patient appears",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          },
          {
            "in": "query",
            "name": "groupname",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Group name"
          }
        ],
        "responses": {
          "200": {
            "description": "List of matching attributes"
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No attributes found for this class and patient"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/cancers/classes": {
      "get": {
        "summary": "Get all unique cancer classes",
        "description": "Returns list of unique cancer class classUri values",
        "tags": [
          "DeepPhe"
        ],
        "responses": {
          "200": {
            "description": "List of cancer class classUri values",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/cancers/summary": {
      "get": {
        "summary": "Get all cancer classes and instances in one response",
        "description": "Returns cancer classes with instances grouped by class, with optional patient identifier data",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "includePatientIds",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "When false, omit patient identifier arrays from instance rows"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancer summary payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "classes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "instancesByClass": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "totalMs": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/cancers/instances": {
      "get": {
        "summary": "Get all cancer instances for a specific class",
        "description": "Returns list of cancer objects for a specific class (without patient identifier arrays)",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "classUri",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Class URI"
          }
        ],
        "responses": {
          "200": {
            "description": "List of cancers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "Unique identifier for the cancer"
                      },
                      "classUri": {
                        "type": "string",
                        "description": "URI of the cancer class"
                      },
                      "value": {
                        "type": "string",
                        "description": "Value of the cancer"
                      },
                      "negated": {
                        "type": "integer",
                        "description": "Flag indicating if the cancer is negated (0 or 1)"
                      },
                      "uncertain": {
                        "type": "integer",
                        "description": "Flag indicating if the cancer is uncertain (0 or 1)"
                      },
                      "historic": {
                        "type": "integer",
                        "description": "Flag indicating if the cancer is historic (0 or 1)"
                      },
                      "num_patients": {
                        "type": "integer",
                        "description": "Number of patients with this cancer"
                      }
                    }
                  },
                  "example": [
                    {
                      "id": 123,
                      "classUri": "Breast_Cancer",
                      "value": "Breast Cancer",
                      "negated": 0,
                      "uncertain": 0,
                      "historic": 0,
                      "num_patients": 5
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No cancers found for this class"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/cancers/instances/patients": {
      "get": {
        "summary": "Get all cancer instances for a specific class including patient identifiers",
        "description": "Returns list of cancer objects for a specific class with patient identifier arrays",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "classUri",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Class URI"
          }
        ],
        "responses": {
          "200": {
            "description": "List of cancers with patient identifier arrays"
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No cancers found for this class"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/cancers/instances/patient/{patientId}": {
      "get": {
        "summary": "Get cancer instances for a specific class and patient",
        "description": "Returns cancer rows where the specified patient appears",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          },
          {
            "in": "query",
            "name": "classUri",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Class URI"
          }
        ],
        "responses": {
          "200": {
            "description": "List of matching cancers"
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No cancers found for this class and patient"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/concepts/classes": {
      "get": {
        "summary": "Get all unique concept classes",
        "description": "Returns list of unique concept class dpheGroup values",
        "tags": [
          "DeepPhe"
        ],
        "responses": {
          "200": {
            "description": "List of concept class dpheGroup values",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/concepts/summary": {
      "get": {
        "summary": "Get all concept classes and instances in one response",
        "description": "Returns concept classes with instances grouped by class, with optional patient identifier data",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "includePatientIds",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "When false, omit patient identifier arrays from instance rows"
          }
        ],
        "responses": {
          "200": {
            "description": "Concept summary payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "classes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "instancesByClass": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "totalMs": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/concepts/instances": {
      "get": {
        "summary": "Get all concept instances for a specific class",
        "description": "Returns list of concept objects for a specific class (without patient identifier arrays)",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "dpheGroup",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "DPHE Group"
          }
        ],
        "responses": {
          "200": {
            "description": "List of concepts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "Unique identifier for the concept"
                      },
                      "dpheGroup": {
                        "type": "string",
                        "description": "DPHE Group of the concept"
                      },
                      "value": {
                        "type": "string",
                        "description": "Value of the concept"
                      },
                      "classUri": {
                        "type": "string",
                        "description": "URI of the concept class"
                      },
                      "negated": {
                        "type": "integer",
                        "description": "Flag indicating if the concept is negated (0 or 1)"
                      },
                      "uncertain": {
                        "type": "integer",
                        "description": "Flag indicating if the concept is uncertain (0 or 1)"
                      },
                      "historic": {
                        "type": "integer",
                        "description": "Flag indicating if the concept is historic (0 or 1)"
                      },
                      "num_patients": {
                        "type": "integer",
                        "description": "Number of patients with this concept"
                      }
                    }
                  },
                  "example": [
                    {
                      "id": 456,
                      "dpheGroup": "Biomarkers",
                      "value": "HER2",
                      "classUri": "HER2_Biomarker",
                      "negated": 0,
                      "uncertain": 0,
                      "historic": 0,
                      "num_patients": 3
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No concepts found for this class"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/concepts/instances/patients": {
      "get": {
        "summary": "Get all concept instances for a specific class including patient identifiers",
        "description": "Returns list of concept objects for a specific class with patient identifier arrays",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "dpheGroup",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "DPHE Group"
          }
        ],
        "responses": {
          "200": {
            "description": "List of concepts with patient identifier arrays"
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No concepts found for this class"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/concepts/instances/patient/{patientId}": {
      "get": {
        "summary": "Get concept instances for a specific class and patient",
        "description": "Returns concept rows where the specified patient appears",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          },
          {
            "in": "query",
            "name": "dpheGroup",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "DPHE Group"
          }
        ],
        "responses": {
          "200": {
            "description": "List of matching concepts"
          },
          "400": {
            "description": "Missing required parameters"
          },
          "404": {
            "description": "No concepts found for this class and patient"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/filter/count": {
      "post": {
        "summary": "Count patients matching multi-criteria filters",
        "description": "Accepts an array of filter items.  Each item specifies a data type\n(omop, attributes, cancers, concepts), a class within that type,\nand one or more instance values.\n\n**Within** an item the instances are OR'd: a patient matches if they\nhave *any* of the listed values.\n\n**Across** items the results are AND'd: a patient must satisfy\n*every* filter item.\n\nTiming metrics are always returned so callers can monitor performance.\n",
        "tags": [
          "Filter"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "includePatientIds",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "When true, also return the list of matching patient IDs"
          },
          {
            "in": "query",
            "name": "autoIncludeThreshold",
            "schema": {
              "type": "integer",
              "default": 20
            },
            "description": "Automatically include patient IDs when the matching count is\nbelow this threshold, even when includePatientIds is false.\nSet to 0 to disable auto-inclusion.\n"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filters"
                ],
                "properties": {
                  "filters": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "class",
                        "instances"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "omop",
                            "attributes",
                            "cancers",
                            "concepts"
                          ]
                        },
                        "class": {
                          "type": "string"
                        },
                        "instances": {
                          "type": "array",
                          "minItems": 1,
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "filters": [
                  {
                    "type": "omop",
                    "class": "RACE",
                    "instances": [
                      "White",
                      "Black"
                    ]
                  },
                  {
                    "type": "omop",
                    "class": "CANCER",
                    "instances": [
                      "B"
                    ]
                  },
                  {
                    "type": "attributes",
                    "class": "Behavior",
                    "instances": [
                      "Benign",
                      "Invasive"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Patient count with timing metrics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "patient_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "queryMs": {
                          "type": "number"
                        },
                        "bitmapMs": {
                          "type": "number"
                        },
                        "resolveMs": {
                          "type": "number"
                        },
                        "totalMs": {
                          "type": "number"
                        },
                        "itemCounts": {
                          "type": "array",
                          "items": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/filter/count/batch": {
      "post": {
        "summary": "Batch count patients for multiple independent filter queries",
        "description": "Accepts an array of independent filter queries and returns a result for\neach in positional order.  All queries are executed concurrently on the\nserver, replacing N sequential HTTP round trips with a single request.\n\nEach query uses the same filter schema as POST /count.  Per-query errors\nare captured and returned inline rather than failing the entire batch.\n",
        "tags": [
          "Filter"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "queries"
                ],
                "properties": {
                  "queries": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 500,
                    "items": {
                      "type": "object",
                      "required": [
                        "filters"
                      ],
                      "properties": {
                        "filters": {
                          "type": "array",
                          "minItems": 1,
                          "items": {
                            "type": "object",
                            "required": [
                              "type",
                              "class",
                              "instances"
                            ],
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "omop",
                                  "attributes",
                                  "cancers",
                                  "concepts"
                                ]
                              },
                              "class": {
                                "type": "string"
                              },
                              "instances": {
                                "type": "array",
                                "minItems": 1
                              }
                            }
                          }
                        },
                        "includePatientIds": {
                          "type": "boolean",
                          "default": false
                        },
                        "autoIncludeThreshold": {
                          "type": "integer",
                          "default": 20
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Array of per-query results in positional order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "count": {
                            "type": "integer"
                          },
                          "patient_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timing": {
                            "type": "object"
                          },
                          "error": {
                            "type": "string",
                            "description": "Present only when this individual query failed"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/filter/summary": {
      "post": {
        "summary": "Get patient summaries for a list of patient IDs",
        "description": "Accepts a set of patient IDs and returns matching patient summaries\nfrom patient_summaries with uncompressed json_text payloads.\n",
        "tags": [
          "Filter"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "patient_ids"
                ],
                "properties": {
                  "patient_ids": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "List of patient summaries with uncompressed json_text",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "patient_id": {
                        "type": "string"
                      },
                      "json_text": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/omop/classes": {
      "get": {
        "summary": "Get all supported OMOP classes",
        "description": "Returns list of OMOP class names available for OMOP instances queries",
        "tags": [
          "OMOP"
        ],
        "responses": {
          "200": {
            "description": "List of OMOP class names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/omop/summary": {
      "get": {
        "summary": "Get all OMOP classes and instances in one response",
        "description": "Returns OMOP classes with instances grouped by class, with optional patient identifier data",
        "tags": [
          "OMOP"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "includePatientIds",
            "schema": {
              "type": "boolean",
              "default": true
            },
            "required": false,
            "description": "When false, omit patient identifier arrays from instance rows"
          }
        ],
        "responses": {
          "200": {
            "description": "OMOP summary payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "classes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "instancesByClass": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "totalMs": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/omop/instances": {
      "get": {
        "summary": "Get all OMOP instances for a specific class",
        "description": "Returns OMOP rows from one of the OMOP tables by class (without patient identifier arrays)",
        "tags": [
          "OMOP"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "attribute",
            "schema": {
              "type": "string",
              "enum": [
                "AGE_AT_DX",
                "ETHNICITY",
                "GENDER",
                "RACE",
                "CANCER"
              ]
            },
            "required": true,
            "description": "OMOP class to retrieve"
          }
        ],
        "responses": {
          "200": {
            "description": "OMOP class rows",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid required parameters"
          },
          "404": {
            "description": "No OMOP rows found for this class"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/omop/instances/patients": {
      "get": {
        "summary": "Get all OMOP instances for a specific class including patient identifiers",
        "description": "Returns OMOP rows from one of the OMOP tables by class with patient identifier arrays",
        "tags": [
          "OMOP"
        ],
        "parameters": [
          {
            "in": "query",
            "name": "attribute",
            "schema": {
              "type": "string",
              "enum": [
                "AGE_AT_DX",
                "ETHNICITY",
                "GENDER",
                "RACE",
                "CANCER"
              ]
            },
            "required": true,
            "description": "OMOP class to retrieve"
          }
        ],
        "responses": {
          "200": {
            "description": "OMOP class rows with patient identifier arrays"
          },
          "400": {
            "description": "Missing or invalid required parameters"
          },
          "404": {
            "description": "No OMOP rows found for this class"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/omop/instances/patient/{patientId}": {
      "get": {
        "summary": "Get OMOP instances for a specific class and patient",
        "description": "Returns OMOP rows where the specified patient appears",
        "tags": [
          "OMOP"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          },
          {
            "in": "query",
            "name": "attribute",
            "schema": {
              "type": "string",
              "enum": [
                "AGE_AT_DX",
                "ETHNICITY",
                "GENDER",
                "RACE",
                "CANCER"
              ]
            },
            "required": true,
            "description": "OMOP class to retrieve"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching OMOP class rows for the patient"
          },
          "400": {
            "description": "Missing or invalid required parameters"
          },
          "404": {
            "description": "No OMOP rows found for this class and patient"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/patient/{patientId}": {
      "get": {
        "summary": "Get patient documents with text excluded by default",
        "description": "Returns list of DocumentXn objects for a specific patient, with the text field excluded.",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          }
        ],
        "responses": {
          "200": {
            "description": "List of DocumentXn objects without text",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DocumentXn"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid patientId"
          },
          "404": {
            "description": "Patient not found"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/patient/{patientId}/documents": {
      "get": {
        "summary": "Get all documents for a patient",
        "description": "Returns list of all DocumentXn objects for a specific patient with optional property exclusions.",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          },
          {
            "in": "query",
            "name": "documentIds",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Comma-separated list of document IDs to filter by. Only documents matching these IDs will be returned.",
            "example": "DOC123,DOC456,DOC789"
          },
          {
            "in": "query",
            "name": "excludeProperties",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Comma-separated list of DocumentXn properties to exclude from results (e.g., \"mentions,mentionRelations,sections\"). Valid properties: id, name, type, date, episode, text, mentions, mentionRelations, sections",
            "example": "text,mentionRelations"
          }
        ],
        "responses": {
          "200": {
            "description": "List of DocumentXn objects with all properties",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DocumentXn"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid patientId"
          },
          "404": {
            "description": "Patient not found"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/patient/{patientId}/documents/episodes": {
      "get": {
        "summary": "Get episode counts for patient documents",
        "description": "Returns an object keyed by normalized episode type with counts for the patient's documents.",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          },
          {
            "in": "query",
            "name": "documentIds",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Optional comma-separated list of document IDs to include in the count.",
            "example": "DOC123,DOC456"
          }
        ],
        "responses": {
          "200": {
            "description": "Episode counts keyed by episode type",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                },
                "example": {
                  "unknown": 12,
                  "treatment": 6
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid patientId"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/patient/{patientId}/cancers": {
      "get": {
        "summary": "Get the cancers file for a patient",
        "description": "Returns the raw parsed JSON from the {patientId}_Cancers.json key-value entry in the database.",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancers data for the patient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Missing patientId"
          },
          "404": {
            "description": "Cancers file not found for this patient"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/v1/deepphe-api/deepphe/patient/{patientId}/concepts": {
      "get": {
        "summary": "Get the concepts file for a patient",
        "description": "Returns the raw parsed JSON from the {patientId}_Concepts.json key-value entry in the database.",
        "tags": [
          "DeepPhe"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "patientId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Patient ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Concepts data for the patient",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Missing patientId"
          },
          "404": {
            "description": "Concepts file not found for this patient"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    }
  }
}
