Generate a summary from FHIR resources

POST/fhir2summary/create
RequiresBearerauthentication

Body parameters

modestringoptionaldefault narrative
narrativeflattenips
template_idstring (uuid)optional
fhir_resourcesobjectrequired
Returns  

Response fields

successbooleanoptional
messagestringoptional
summarystringoptional
warningsstring[]optional
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/fhir2summary/create" \
  -H "Authorization: Bearer $PHENOML_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "mode": "narrative",
  "template_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "fhir_resources": {
    "resourceType": "Bundle",
    "type": "collection",
    "entry": [
      {
        "resource": {
          "resourceType": "Patient",
          "name": [
            {
              "given": [
                "John"
              ],
              "family": "Doe"
            }
          ],
          "gender": "male",
          "birthDate": "1979-03-15"
        }
      },
      {
        "resource": {
          "resourceType": "Condition",
          "code": {
            "text": "Type 2 Diabetes Mellitus"
          },
          "onsetDateTime": "2024-01-15"
        }
      }
    ]
  }
}'
200 OKExample Response
{
  "success": true,
  "summary": "Patient John Doe is a 45-year-old male diagnosed with Type 2 Diabetes Mellitus on January 15, 2024. Current treatment plan includes lifestyle modifications and medication management.",
  "warnings": []
}