Create FHIR resource from text and store it

POST/tools/lang2fhir-and-create
RequiresBearerauthentication

Header parameters

Body parameters

resourcestringrequired
autoappointmentcondition-encounter-diagnosismedicationrequestcareplancondition-problems-health-concernscoverageencounterobservation-clinical-resultobservation-labpatientprocedurequestionnairequestionnaireresponseservicerequestsimple-observationvital-signs
textstringrequired
providerstring (uuid)optional
Returns  

Response fields

fhir_resourceobjectoptional
fhir_idstringoptional
successbooleanoptional
messagestringoptional
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" \
  -H "Authorization: Bearer $PHENOML_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "resource": "condition-encounter-diagnosis",
  "text": "Patient has severe persistent asthma with acute exacerbation",
  "provider": "550e8400-e29b-41d4-a716-446655440000"
}'
200 OKExample Response
{
  "success": true,
  "message": "FHIR resource created successfully",
  "fhir_id": "condition-123",
  "fhir_resource": {
    "resourceType": "Condition",
    "id": "condition-123",
    "clinicalStatus": {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
          "code": "active"
        }
      ]
    },
    "verificationStatus": {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
          "code": "confirmed"
        }
      ]
    },
    "category": [
      {
        "coding": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/condition-category",
            "code": "encounter-diagnosis"
          }
        ]
      }
    ],
    "code": {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "195967001",
          "display": "Asthma"
        }
      ],
      "text": "Severe persistent asthma with acute exacerbation"
    },
    "subject": {
      "reference": "Patient/patient-123"
    }
  }
}