IaBulaAPI
Menu
API V1Português
Browse documentation
Interactive Swagger / FastAPI
API Reference

Medication name normalization and resolution

.md

Integrate POST /v1/resolve and handle resolved and unresolved safely without assuming every name identifies a unique variant.

On this page

Resolve an identity when evidence is sufficient#

POST /v1/resolve accepts a required query string of 1–512 characters. It identifies a canonical MedicationVariant; it does not select medication for a patient. The response preserves the original query.

bash
curl --fail-with-body "$IABULA_API_BASE/v1/resolve" \
  --header "X-API-Key: $IABULA_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"query":"NATULAXE CAPSULA"}'

Verified positive example#

NATULAXE CAPSULA was confirmed as resolved in the RapidAPI Hub. Confirmed facts are product_name = NATULAXE, entity_type = medication_variant and dosage_form = cápsula. These facts are documented without inventing a UUID or additional response values.

When status is resolved, resolved contains id, entity_type, product_name, brand_name, dosage_form and active_ingredient_text. brand_name and active_ingredient_text may be null. Ingredient text does not guarantee a canonical link to an ingredient entity.

Abstention is a valid outcome#

When evidence is insufficient for a safe identity, status is unresolved and resolved is null. Both outcomes use HTTP 200. Short, ambiguous or misspelled queries are not guaranteed to resolve. In default mode, candidates and internal gate diagnostics are not public fields. Scores are never public.

javascript
const response = await fetch(`${process.env.IABULA_API_BASE}/v1/resolve`, {
  method: "POST",
  headers: {
    "X-API-Key": process.env.IABULA_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "NATULAXE CAPSULA" }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.code}`);
if (result.status === "unresolved") {
  // Ask for more source information or route to manual review.
} else {
  console.log(result.resolved.product_name, result.resolved.dosage_form);
}

Assisted commercial identification#

Send {"query":"ANADOR 500MG 24CPR","mode":"assisted"} to opt into assisted matching. A textual presentation requires exact name, proven strength, form and count, and a unique match. Valid EAN or GGREM codes use exact lookup. Omitting mode preserves the V1 contract.

ANADOR 500MG may return ambiguous, resolved:null and up to five candidates with catalog facts. AMOXILINA returns similar names without selecting a presentation. Inspect reason, missing_fields and candidates_truncated. A limited list never proves uniqueness; never automatically select the first candidate.

Spelling hints and identity#

AMOXILINA may suggest AMOXICILINA; ANADRO 500MG 24CPR may retrieve a compatible package. suggested_query and name_suggestions are hints, not confirmed identity. Check name, strength, form and package. The API never converts units or ignores incompatible attributes.

Distinguish no match from failure#

HTTP 503 indicates temporary unavailability, not unresolved. Do not translate authentication, quota or service errors into absence of identity. Applications should allow manual review or request more source information after abstention.

POST /v1/resolve#

Contract and types
JSON fieldType and boundsRequired
querystring; minLength=1, maxLength=512yes
modestring: legacy, assisted; default=legacyno
Contract and types
HTTPContent-TypeSchema
200application/jsonAssistedResolveResponse | ResolveSuccess | ResolveUnresolved
400application/problem+jsonProblem
401application/problem+jsonProblem
403application/problem+jsonProblem
500application/problem+jsonProblem
503application/problem+jsonProblem
429application/problem+jsonProblem
422application/jsonHTTPValidationError

OpenAPI contract fields#

Contract and types
Schema.fieldType and boundsRequired
AssistedResolveResponse.modestring: assistedyes
AssistedResolveResponse.statusstring: resolved, ambiguous, unresolvedyes
AssistedResolveResponse.querystringyes
AssistedResolveResponse.resolvedResolvePresentation | ResolvedMedicationVariant | nullyes
AssistedResolveResponse.reasonstring: unique_identifier, unique_presentation, variant_identified, multiple_matches, insufficient_information, similar_names, no_match, invalid_identifier, unsupported_descriptionyes
AssistedResolveResponse.candidatesarray<ResolvePresentation>yes
AssistedResolveResponse.candidates_truncatedbooleanyes
AssistedResolveResponse.missing_fieldsarray<string: dosage_form, strength, unit_count, laboratory_or_identifier>yes
AssistedResolveResponse.suggested_querystring | nullno
AssistedResolveResponse.name_suggestionsarray<ResolveNameSuggestion>no
Evidence.classstringyes
Evidence.sourcestring | nullno
Evidence.attributestring | nullno
HTTPValidationError.detailarray<ValidationError>no
PackageContent.amountstringyes
PackageContent.unitstringyes
PackageContent.classstring: DERIVEDyes
Problem.typestringyes
Problem.titlestringyes
Problem.statusintegeryes
Problem.codestringyes
Problem.detailstring | nullno
Problem.request_idstringyes
ResolveNameSuggestion.namestringyes
ResolveNameSuggestion.kindstring: product, substanceyes
ResolvePresentation.strengthstring | nullno
ResolvePresentation.package_descriptionstring | nullno
ResolvePresentation.structured_strengthStructuredStrength | nullno
ResolvePresentation.package_contentPackageContent | nullno
ResolvePresentation.idstring (uuid)yes
ResolvePresentation.unit_countinteger | nullno
ResolvePresentation.identifiersarray<SupportedSourceIdentifier>yes
ResolvePresentation.evidencearray<Evidence>yes
ResolvePresentation.entity_typestring: presentationyes
ResolvePresentation.product_idstring (uuid)yes
ResolvePresentation.product_namestringyes
ResolvePresentation.variant_idstring (uuid)yes
ResolvePresentation.dosage_formstring | nullyes
ResolvePresentation.source_laboratoriesarray<SupportedSourceValue>yes
ResolvePresentation.source_substancesarray<SupportedSourceValue>yes
ResolveRequest.querystring; minLength=1, maxLength=512yes
ResolveRequest.modestring: legacy, assisted; default=legacyno
ResolveSuccess.statusstring: resolvedyes
ResolveSuccess.querystringyes
ResolveSuccess.resolvedResolvedMedicationVariantyes
ResolveUnresolved.statusstring: unresolvedyes
ResolveUnresolved.querystringyes
ResolveUnresolved.resolvednullyes
ResolvedMedicationVariant.idstring (uuid)yes
ResolvedMedicationVariant.entity_typestring: medication_variantyes
ResolvedMedicationVariant.product_namestringyes
ResolvedMedicationVariant.brand_namestring | nullyes
ResolvedMedicationVariant.dosage_formstringyes
ResolvedMedicationVariant.active_ingredient_textstring | nullyes
StrengthComponent.amountstringyes
StrengthComponent.unitstringyes
StrengthComponent.per_amountstring | nullyes
StrengthComponent.per_unitstring | nullyes
StructuredStrength.statusstring: structured, missing, unparsedyes
StructuredStrength.componentsarray<StrengthComponent>yes
StructuredStrength.classstring: DERIVEDyes
SupportedSourceIdentifier.valuestringyes
SupportedSourceIdentifier.evidencearray<Evidence>yes
SupportedSourceIdentifier.format_statusstring: checksum_valid, checksum_invalid, invalid_format, not_checked; default=not_checkedno
SupportedSourceIdentifier.schemestring: CMED_REGISTRO, CMED_CNPJ, CMED_GGREM, EANyes
SupportedSourceValue.valuestringyes
SupportedSourceValue.evidencearray<Evidence>yes
ValidationError.locarray<string | integer>yes
ValidationError.msgstringyes
ValidationError.typestringyes
ValidationError.inputobjectno
ValidationError.ctxobjectno