Generate FHIR search parameters from text

POST/lang2fhir/search

Converts natural language text into FHIR search parameters. Automatically identifies the appropriate FHIR resource type and generates valid search query parameters.

Supported resource types include: AllergyIntolerance, Appointment, CarePlan, CareTeam, Condition, Coverage, Device, DiagnosticReport, DocumentReference, Encounter, Goal, Immunization, Location, Medication, MedicationRequest, Observation, Organization, Patient, PlanDefinition, Practitioner, PractitionerRole, Procedure, Provenance, Questionnaire, QuestionnaireResponse, RelatedPerson, Schedule, ServiceRequest, Slot, and Specimen.

RequiresBearerauthentication

Body parameters

textstringrequired

Natural language text to convert into FHIR search parameters. The system will automatically identify the appropriate resource type and generate valid search parameters.

Examples:

  • "Appointments between March 2-9, 2025" → Appointment search with date range
  • "Patients with diabetes" → Condition search with code parameter
  • "Active medication requests for metformin" → MedicationRequest search
  • "Lab results for creatinine" → DiagnosticReport search
  • "Dr. Smith's schedule" → Practitioner or Schedule search
Returns  

Successfully generated FHIR search parameters

Response fields

resource_typestringoptional

The FHIR resource type identified for the search

AllergyIntoleranceAppointmentCarePlanCareTeamConditionCoverageDeviceDiagnosticReportDocumentReferenceEncounterGoalImmunizationLocationMedicationMedicationRequestObservationOrganizationPatientPlanDefinitionPractitionerPractitionerRoleProcedureProvenanceQuestionnaireQuestionnaireResponseRelatedPersonScheduleServiceRequestSlotSpecimen
search_paramsstringoptional

FHIR search parameters in standard query string format. Parameters are formatted according to the FHIR specification with appropriate operators. Code parameters are resolved to standard terminology codes (SNOMED CT, LOINC, RxNorm, ICD-10-CM).

POSTRequest
curl -X POST 'https://experiment.app.pheno.ml/lang2fhir/search' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "Appointments between March 2-9, 2025"
}'
200 OKResponse
{
  "resource_type": "Appointment",
  "search_params": "date=ge2025-03-02&date=le2025-03-09"
}