Extract and store multiple FHIR resources

POST/tools/lang2fhir-and-create-multi
RequiresBearerauthentication

Header parameters

Body parameters

textstringrequired
versionstringoptionaldefault R4
providerstringrequired
Returns  

Response fields

successbooleanoptional
messagestringoptional
response_bundleobjectoptional
resourceTypestringoptional
typestringoptional
entryobject[]optional
resource_infoobject[]optional
tempIdstringoptional
resourceTypestringoptional
descriptionstringoptional
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/tools/lang2fhir-and-create-multi" \
  -H "Authorization: Bearer $PHENOML_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "John Smith, 45-year-old male, diagnosed with Type 2 Diabetes. Prescribed Metformin 500mg twice daily.",
  "version": "R4",
  "provider": "medplum"
}'
200 OKExample Response
{
  "success": true,
  "message": "Created 3 resources",
  "response_bundle": {
    "resourceType": "Bundle",
    "type": "transaction-response",
    "entry": [
      {
        "response": {
          "status": "201 Created",
          "location": "Patient/patient-001"
        }
      },
      {
        "response": {
          "status": "201 Created",
          "location": "Condition/condition-001"
        }
      },
      {
        "response": {
          "status": "201 Created",
          "location": "MedicationRequest/medication-001"
        }
      }
    ]
  },
  "resource_info": [
    {
      "tempId": "urn:uuid:patient-abc123",
      "resourceType": "Patient",
      "description": "John Smith, 45-year-old male"
    },
    {
      "tempId": "urn:uuid:condition-abc123",
      "resourceType": "Condition",
      "description": "Type 2 Diabetes diagnosis"
    },
    {
      "tempId": "urn:uuid:medication-abc123",
      "resourceType": "MedicationRequest",
      "description": "Metformin 500mg twice daily"
    }
  ]
}