Create a new summary template

POST/fhir2summary/template

Creates a summary template from an example using LLM function calling

RequiresBearerauthentication

Body parameters

namestringrequired

Name of the template

descriptionstringoptional

Description of the template

example_summarystringrequired

Example summary note to generate template from

target_resourcesstring[]required

List of target FHIR resources

example_fhir_dataobjectoptional

Optional example FHIR data that corresponds to the example summary

modestringrequired

Template mode (stored with the template)

Returns  

Template created successfully

Response fields

successbooleanoptional
messagestringoptional
template_idstring (uuid)optional
templateobjectoptional
idstring (uuid)optional
namestringoptional
descriptionstringoptional
templatestringoptional

Template with {{resource.field}} placeholders

target_resourcesstring[]optional

List of FHIR resource types/profiles

modestringoptional

Template mode (stored value)

metadataobjectoptional
created_atstring (date-time)optional
updated_atstring (date-time)optional
POSTRequest
curl -X POST 'https://experiment.app.pheno.ml/fhir2summary/template' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Discharge Summary",
  "example_summary": "Patient John Doe, age 45, was admitted on 2024-01-10 with Type 2 Diabetes. Discharged on 2024-01-15 with Metformin 500mg BID.",
  "target_resources": [
    "Patient",
    "Condition",
    "MedicationRequest"
  ],
  "mode": "narrative"
}'
200 OKResponse
{
  "success": true,
  "message": "Template created successfully",
  "template_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "template": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Discharge Summary",
    "template": "Patient <<Patient.name[0].text>>, age <<Patient.birthDate|age>>, was admitted on <<Encounter[0].period.start>> with <<Condition[0].code.coding[0].display>>. Discharged on <<Encounter[0].period.end>> with <<MedicationRequest[0].medicationCodeableConcept.coding[0].display>> <<MedicationRequest[0].dosageInstruction[0].text>>.",
    "target_resources": [
      "Patient",
      "Condition",
      "MedicationRequest"
    ],
    "mode": "narrative",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}