Analyze text for patient cohort criteria

POST/cohort

Converts natural language text into structured FHIR search queries for patient cohort analysis

RequiresBearerauthentication

Body parameters

textstringrequired

Natural language text describing patient cohort criteria

Returns  

Successfully analyzed cohort criteria

Response fields

successbooleanoptional

Whether the cohort analysis was successful

messagestringoptional

Human-readable message about the analysis result

queriesobject[]optional

Array of search concepts converted to FHIR search queries

resource_typestringoptional

The FHIR resource type for this search concept

search_paramsstringoptional

FHIR search parameters in standard format

conceptstringoptional

The original concept description

excludebooleanoptional

Whether this concept should be excluded from the search

POSTRequest
curl -X POST 'https://experiment.app.pheno.ml/cohort' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "female patients over 65 with diabetes but not hypertension"
}'
200 OKResponse
{
  "success": true,
  "message": "Successfully analyzed cohort criteria",
  "queries": [
    {
      "resource_type": "Patient",
      "search_params": "gender=female&birthdate=le1959-01-01",
      "concept": "female patients over 65",
      "exclude": false
    }
  ]
}