[Alpha] Extract medical codes with phenocr

POST/construe/phenocr
RequiresBearerauthentication

Body parameters

textstringrequired
systemobjectrequired
namestringrequired
versionstringrequired
Returns  

Response fields

systemobjectrequired
namestringoptional
versionstringoptional
codesobject[]required
codestringrequired
descriptionstringrequired
validbooleanrequired
reasonstringoptional
is_ancestorbooleanoptional
citationsobject[]optional
textstringrequired
begin_offsetintegerrequired
end_offsetintegerrequired
categoriesobject[]optional
uristringrequired
labelstringrequired
POSTRequest
# Get authentication token
PHENOML_TOKEN=$(curl -X POST "https://experiment.app.pheno.ml/v2/auth/token" \
  -u "$PHENOML_CLIENT_ID:$PHENOML_CLIENT_SECRET" \
  | jq -r '.access_token')

curl -X POST "https://experiment.app.pheno.ml/construe/phenocr" \
  -H "Authorization: Bearer $PHENOML_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "5-year-old male with seizures, severe intellectual disability, microcephaly, and hypotonia.",
  "system": {
    "name": "HPO",
    "version": "umls-2026AA"
  }
}'
200 OKExample Response
{
  "system": {
    "name": "SNOMED_CT_US_LITE",
    "version": "umls-2026aa"
  },
  "codes": [
    {
      "code": "195967001",
      "description": "Asthma",
      "valid": true,
      "reason": "example",
      "is_ancestor": true,
      "citations": [
        {
          "text": "Patient has type 2 diabetes",
          "begin_offset": 0,
          "end_offset": 27
        }
      ],
      "categories": [
        {
          "uri": "HP:0025142",
          "label": "Constitutional symptom"
        }
      ]
    }
  ]
}