{"openapi":"3.1.0","info":{"title":"IABula Pharmaceutical Intelligence API","description":"API de leitura farmacêutica brasileira. Não oferece diagnóstico ou recomendação terapêutica.","version":"1.0.0"},"paths":{"/v1/medications/search":{"get":{"tags":["Medications"],"summary":"Buscar medicamentos","operationId":"search_medications_v1_medications_search_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}],"title":"Q"}},{"name":"ingredient_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Ingredient Id"}},{"name":"dosage_form","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"title":"Dosage Form"}},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Category Id"}},{"name":"identifier_scheme","in":"query","required":false,"schema":{"anyOf":[{"enum":["EAN","CMED_GGREM","CMED_REGISTRO"],"type":"string"},{"type":"null"}],"title":"Identifier Scheme"}},{"name":"identifier_value","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"title":"Identifier Value"}},{"name":"expand","in":"query","required":false,"schema":{"anyOf":[{"const":"catalog_context","type":"string"},{"type":"null"}],"title":"Expand"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationPage"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/medications/lookup":{"get":{"tags":["Medications"],"summary":"Identificar por EAN ou identificador CMED","operationId":"lookup_medication_identifier_v1_medications_lookup_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"scheme","in":"query","required":true,"schema":{"enum":["EAN","CMED_GGREM","CMED_REGISTRO"],"type":"string","title":"Scheme"}},{"name":"value","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"title":"Value"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentifierLookup"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/medications/{id}":{"get":{"tags":["Medications"],"summary":"Obter detalhes do medicamento","operationId":"medication_detail_v1_medications__id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicationDetail"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ingredients/{id}":{"get":{"tags":["Ingredients"],"summary":"Obter ingrediente e DCBs","operationId":"ingredient_detail_v1_ingredients__id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngredientDetail"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/medications/{id}/relations":{"get":{"tags":["Medications"],"summary":"Obter relações tipadas do medicamento","operationId":"medication_relations_v1_medications__id__relations_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelationPage"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Not Found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/changes":{"get":{"tags":["Changes"],"summary":"Listar mudanças publicadas","operationId":"changes_v1_changes_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePage"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Forbidden"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Too Many Requests"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Internal Server Error"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"description":"Service Unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/resolve":{"post":{"tags":["Resolve"],"summary":"Resolver texto para uma variante de medicamento","operationId":"resolve_v1_resolve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ResolveSuccess"},{"$ref":"#/components/schemas/ResolveUnresolved"}],"title":"Response Resolve V1 Resolve Post","discriminator":{"propertyName":"status","mapping":{"resolved":"#/components/schemas/ResolveSuccess","unresolved":"#/components/schemas/ResolveUnresolved"}}}}}},"400":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Problem Details","headers":{"Retry-After":{"description":"Seconds until the next fixed one-minute UTC window.","schema":{"type":"integer","minimum":1.0}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/v1/discovery":{"get":{"tags":["Discovery (experimental)"],"summary":"Explore evidence-backed catalog entities","description":"Evidence-backed discovery, not identity resolution. One request consumes one existing V1 quota unit, including internal spelling searches. Dosage/form constraints are never silently substituted. Enabled only by explicit deployment configuration.","operationId":"discover_v1_discovery_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":256,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryPage"}}}},"400":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"500":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}},"headers":{"Retry-After":{"description":"Seconds until the next fixed one-minute UTC window.","schema":{"type":"integer","minimum":1}}}},"default":{"description":"Problem Details","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"schemas":{"CatalogContext":{"properties":{"source_substances":{"items":{"$ref":"#/components/schemas/SupportedSourceValue"},"type":"array","title":"Source Substances"},"source_laboratories":{"items":{"$ref":"#/components/schemas/SupportedSourceValue"},"type":"array","title":"Source Laboratories"},"source_identifiers":{"items":{"$ref":"#/components/schemas/SupportedSourceIdentifier"},"type":"array","title":"Source Identifiers"},"variants":{"items":{"$ref":"#/components/schemas/CatalogVariant"},"type":"array","title":"Variants"}},"type":"object","required":["source_substances","source_laboratories","source_identifiers","variants"],"title":"CatalogContext"},"CatalogIngredient":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"amount_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Text"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["id","name","evidence"],"title":"CatalogIngredient"},"CatalogPresentation":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"strength":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strength"},"unit_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Count"},"package_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Package Description"},"identifiers":{"items":{"$ref":"#/components/schemas/SupportedSourceIdentifier"},"type":"array","title":"Identifiers"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["id","identifiers","evidence"],"title":"CatalogPresentation"},"CatalogPreview":{"properties":{"source_substances":{"items":{"type":"string"},"type":"array","title":"Source Substances"},"source_laboratories":{"items":{"type":"string"},"type":"array","title":"Source Laboratories"},"cmed_registrations":{"items":{"type":"string"},"type":"array","title":"Cmed Registrations"},"has_multiple_source_values":{"type":"boolean","title":"Has Multiple Source Values"},"source_values_truncated":{"type":"boolean","title":"Source Values Truncated"},"presentation_count":{"type":"integer","title":"Presentation Count"},"presentations":{"items":{"$ref":"#/components/schemas/CatalogPreviewPresentation"},"type":"array","title":"Presentations"}},"type":"object","required":["source_substances","source_laboratories","cmed_registrations","has_multiple_source_values","source_values_truncated","presentation_count","presentations"],"title":"CatalogPreview"},"CatalogPreviewPresentation":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"variant_id":{"type":"string","format":"uuid","title":"Variant Id"},"dosage_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dosage Form"},"strength":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strength"},"unit_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Count"},"package_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Package Description"},"ggrem":{"items":{"type":"string"},"type":"array","title":"Ggrem"},"eans":{"items":{"type":"string"},"type":"array","title":"Eans"},"matches_identifier":{"type":"boolean","title":"Matches Identifier"}},"type":"object","required":["id","variant_id","ggrem","eans","matches_identifier"],"title":"CatalogPreviewPresentation"},"CatalogVariant":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"dosage_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dosage Form"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"},"ingredients":{"items":{"$ref":"#/components/schemas/CatalogIngredient"},"type":"array","title":"Ingredients"},"presentations":{"items":{"$ref":"#/components/schemas/CatalogPresentation"},"type":"array","title":"Presentations"}},"type":"object","required":["id","evidence","ingredients","presentations"],"title":"CatalogVariant"},"CategoryDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"vocabulary_name":{"type":"string","title":"Vocabulary Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"name":{"type":"string","title":"Name"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["id","vocabulary_name","name","evidence"],"title":"CategoryDetail"},"ChangeEvidence":{"properties":{"class":{"type":"string","title":"Class"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"dataset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset"},"retrieved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retrieved At"},"source_version":{"type":"string","title":"Source Version"},"source_record_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Record Id"},"source_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Run Id"},"attribute":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attribute"},"rule_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Version"},"source_url":{"type":"string","title":"Source Url"}},"type":"object","required":["class","source_version","source_url"],"title":"ChangeEvidence"},"ChangePage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ChangeRecord"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"ChangePage"},"ChangeRecord":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"entity_type":{"type":"string","title":"Entity Type"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"operation":{"type":"string","enum":["created","updated","withdrawn","observed_in_source","changed_in_source","removed_from_source"],"title":"Operation"},"before":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Before"},"after":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"After"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"evidence":{"$ref":"#/components/schemas/ChangeEvidence"}},"type":"object","required":["id","entity_type","entity_id","operation","occurred_at","evidence"],"title":"ChangeRecord"},"CompanyDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"official_name":{"type":"string","title":"Official Name"},"registry_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registry Identifier"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["id","official_name","evidence"],"title":"CompanyDetail"},"DCBDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"code":{"type":"string","title":"Code"},"denomination":{"type":"string","title":"Denomination"},"evidence":{"$ref":"#/components/schemas/Evidence"}},"type":"object","required":["id","code","denomination","evidence"],"title":"DCBDetail"},"DiscoveryEntity":{"properties":{"role":{"type":"string","const":"DISCOVERY_CANDIDATE","title":"Role","default":"DISCOVERY_CANDIDATE"},"id":{"type":"string","format":"uuid","title":"Id"},"entity_type":{"type":"string","enum":["ingredient","product","variant","presentation"],"title":"Entity Type"},"name":{"type":"string","title":"Name"},"product_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Product Id"},"variant_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Variant Id"},"dosage_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dosage Form"},"strength":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strength"},"package_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Package Description"},"evidence":{"items":{"$ref":"#/components/schemas/DiscoveryEvidence"},"type":"array","minItems":1,"title":"Evidence"},"detail_path":{"type":"string","title":"Detail Path"},"match_reason":{"type":"string","enum":["orthographic_interpretation","normalized_exact","prefix","identifier","catalog_relationship","name_only_unapplied_qualifier"],"title":"Match Reason"}},"type":"object","required":["id","entity_type","name","product_id","variant_id","dosage_form","strength","package_description","evidence","detail_path","match_reason"],"title":"DiscoveryEntity"},"DiscoveryEvidence":{"properties":{"source":{"type":"string","title":"Source"},"dataset":{"type":"string","title":"Dataset"},"source_record_id":{"type":"string","format":"uuid","title":"Source Record Id"},"source_run_id":{"type":"string","format":"uuid","title":"Source Run Id"},"retrieved_at":{"type":"string","format":"date-time","title":"Retrieved At"},"class":{"type":"string","enum":["OFFICIAL","DERIVED","INFERRED","USER_CONFIRMED"],"title":"Class"},"attribute":{"type":"string","title":"Attribute"},"rule_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Version"}},"type":"object","required":["source","dataset","source_record_id","source_run_id","retrieved_at","class","attribute"],"title":"DiscoveryEvidence"},"DiscoveryPage":{"properties":{"interpretations":{"items":{"$ref":"#/components/schemas/SearchInterpretation"},"type":"array","maxItems":3,"title":"Interpretations"},"page_scope":{"type":"string","enum":["all","original","interpretation"],"title":"Page Scope","default":"all"},"identity_status":{"type":"string","const":"not_asserted","title":"Identity Status","default":"not_asserted"},"search_version":{"type":"string","const":"discovery-search-v2","title":"Search Version","default":"discovery-search-v2"},"query":{"type":"string","title":"Query"},"normalized_query":{"type":"string","title":"Normalized Query"},"status":{"type":"string","enum":["results","suggestions_only","no_results"],"title":"Status"},"possible_intent":{"type":"string","enum":["ingredient","product","variant","presentation","identifier","ambiguous","unknown"],"title":"Possible Intent"},"interpreted":{"$ref":"#/components/schemas/Interpretation"},"suggestions":{"items":{"$ref":"#/components/schemas/Suggestion"},"type":"array","title":"Suggestions"},"data":{"items":{"$ref":"#/components/schemas/DiscoveryEntity"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"ambiguity":{"type":"string","enum":["multiple_catalog_entities","not_identity_resolution"],"title":"Ambiguity"},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"},"next_actions":{"items":{"type":"string"},"type":"array","title":"Next Actions"},"normalizer_version":{"type":"string","const":"discovery-lexical-v1","title":"Normalizer Version"}},"type":"object","required":["query","normalized_query","status","possible_intent","interpreted","suggestions","data","next_cursor","ambiguity","limitations","next_actions","normalizer_version"],"title":"DiscoveryPage"},"Evidence":{"properties":{"class":{"type":"string","title":"Class"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"dataset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dataset"},"retrieved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Retrieved At"},"source_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Version"},"source_record_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Record Id"},"source_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Run Id"},"attribute":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attribute"},"rule_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Version"}},"type":"object","required":["class"],"title":"Evidence"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IdentifierCandidate":{"properties":{"product_id":{"type":"string","format":"uuid","title":"Product Id"},"product_name":{"type":"string","title":"Product Name"},"variant_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Variant Id"},"dosage_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dosage Form"},"presentation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Presentation Id"},"strength":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strength"},"package_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Package Description"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["product_id","product_name","evidence"],"title":"IdentifierCandidate"},"IdentifierLookup":{"properties":{"status":{"type":"string","enum":["matched","ambiguous","unresolved"],"title":"Status"},"scheme":{"type":"string","enum":["EAN","CMED_GGREM","CMED_REGISTRO"],"title":"Scheme"},"value":{"type":"string","title":"Value"},"candidates":{"items":{"$ref":"#/components/schemas/IdentifierCandidate"},"type":"array","title":"Candidates"},"reason":{"anyOf":[{"type":"string","enum":["no_exact_match","multiple_exact_matches"]},{"type":"null"}],"title":"Reason"}},"type":"object","required":["status","scheme","value","candidates"],"title":"IdentifierLookup"},"IngredientDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"dcbs":{"items":{"$ref":"#/components/schemas/DCBDetail"},"type":"array","title":"Dcbs"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["id","name","dcbs","evidence"],"title":"IngredientDetail"},"Interpretation":{"properties":{"package_qualifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Package Qualifier"},"unapplied_terms":{"items":{"type":"string"},"type":"array","title":"Unapplied Terms"},"name":{"type":"string","title":"Name"},"dosage_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dosage Form"},"strength":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strength"}},"type":"object","required":["unapplied_terms","name","dosage_form","strength"],"title":"Interpretation"},"MedicationDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"product_name":{"type":"string","title":"Product Name"},"brand_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Name"},"dosage_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dosage Form"},"active_ingredient_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Ingredient Text"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"},"catalog_context":{"anyOf":[{"$ref":"#/components/schemas/CatalogContext"},{"type":"null"}]},"identity_preview":{"anyOf":[{"$ref":"#/components/schemas/CatalogPreview"},{"type":"null"}]},"product_id":{"type":"string","format":"uuid","title":"Product Id"},"presentations":{"items":{"$ref":"#/components/schemas/PresentationDetail"},"type":"array","title":"Presentations"},"registrations":{"items":{"$ref":"#/components/schemas/RegistrationDetail"},"type":"array","title":"Registrations"},"companies":{"items":{"$ref":"#/components/schemas/CompanyDetail"},"type":"array","title":"Companies"},"categories":{"items":{"$ref":"#/components/schemas/CategoryDetail"},"type":"array","title":"Categories"}},"type":"object","required":["id","product_name","evidence","product_id","presentations","registrations","companies","categories"],"title":"MedicationDetail"},"MedicationPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MedicationSummary"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["data","next_cursor"],"title":"MedicationPage"},"MedicationRelation":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"type":{"type":"string","title":"Type"},"source_id":{"type":"string","format":"uuid","title":"Source Id"},"target_id":{"type":"string","format":"uuid","title":"Target Id"},"direction":{"type":"string","title":"Direction"},"evidence":{"$ref":"#/components/schemas/Evidence"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"}},"type":"object","required":["id","type","source_id","target_id","direction","evidence"],"title":"MedicationRelation"},"MedicationSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"product_name":{"type":"string","title":"Product Name"},"brand_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Name"},"dosage_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dosage Form"},"active_ingredient_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Ingredient Text"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"},"catalog_context":{"anyOf":[{"$ref":"#/components/schemas/CatalogContext"},{"type":"null"}]},"identity_preview":{"anyOf":[{"$ref":"#/components/schemas/CatalogPreview"},{"type":"null"}]}},"type":"object","required":["id","product_name","evidence"],"title":"MedicationSummary"},"PresentationDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"strength":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strength"},"package_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Package Description"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["id","evidence"],"title":"PresentationDetail"},"Problem":{"properties":{"type":{"type":"string","title":"Type"},"title":{"type":"string","title":"Title"},"status":{"type":"integer","title":"Status"},"code":{"type":"string","title":"Code"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"request_id":{"type":"string","title":"Request Id"}},"type":"object","required":["type","title","status","code","request_id"],"title":"Problem"},"RegistrationDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"authority":{"type":"string","title":"Authority"},"registration_number":{"type":"string","title":"Registration Number"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"valid_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid From"},"valid_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid To"},"valid_to_month":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid To Month"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["id","authority","registration_number","evidence"],"title":"RegistrationDetail"},"RelationPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/MedicationRelation"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"RelationPage"},"ResolveRequest":{"properties":{"query":{"type":"string","maxLength":512,"minLength":1,"title":"Query"}},"type":"object","required":["query"],"title":"ResolveRequest"},"ResolveSuccess":{"properties":{"status":{"type":"string","const":"resolved","title":"Status"},"query":{"type":"string","title":"Query"},"resolved":{"$ref":"#/components/schemas/ResolvedMedicationVariant"}},"type":"object","required":["status","query","resolved"],"title":"ResolveSuccess"},"ResolveUnresolved":{"properties":{"status":{"type":"string","const":"unresolved","title":"Status"},"query":{"type":"string","title":"Query"},"resolved":{"type":"null","title":"Resolved"}},"type":"object","required":["status","query","resolved"],"title":"ResolveUnresolved"},"ResolvedMedicationVariant":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"entity_type":{"type":"string","const":"medication_variant","title":"Entity Type"},"product_name":{"type":"string","title":"Product Name"},"brand_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Name"},"dosage_form":{"type":"string","title":"Dosage Form"},"active_ingredient_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Ingredient Text"}},"type":"object","required":["id","entity_type","product_name","brand_name","dosage_form","active_ingredient_text"],"title":"ResolvedMedicationVariant"},"SearchInterpretation":{"properties":{"role":{"type":"string","const":"SEARCH_INTERPRETATION","title":"Role"},"term":{"type":"string","title":"Term"},"original_name":{"type":"string","title":"Original Name"},"interpreted_query":{"type":"string","title":"Interpreted Query"},"interpreted":{"$ref":"#/components/schemas/Interpretation"},"search_executed":{"type":"boolean","const":true,"title":"Search Executed"},"identity_status":{"type":"string","const":"not_asserted","title":"Identity Status"},"status":{"type":"string","enum":["candidates_found","no_compatible_candidates"],"title":"Status"},"data":{"items":{"$ref":"#/components/schemas/DiscoveryEntity"},"type":"array","maxItems":10,"title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"}},"type":"object","required":["role","term","original_name","interpreted_query","interpreted","search_executed","identity_status","status","data","next_cursor","limitations"],"title":"SearchInterpretation"},"Suggestion":{"properties":{"role":{"type":"string","const":"SPELLING_SUGGESTION","title":"Role","default":"SPELLING_SUGGESTION"},"applied_to_search":{"type":"boolean","title":"Applied To Search","default":false},"term":{"type":"string","title":"Term"},"entity_type":{"type":"string","enum":["ingredient","product"],"title":"Entity Type"},"candidate_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":15,"minItems":1,"title":"Candidate Ids"},"reason":{"type":"string","const":"orthographic_similarity","title":"Reason"},"evidence":{"items":{"$ref":"#/components/schemas/DiscoveryEvidence"},"type":"array","minItems":1,"title":"Evidence"}},"type":"object","required":["term","entity_type","candidate_ids","reason","evidence"],"title":"Suggestion"},"SupportedSourceIdentifier":{"properties":{"value":{"type":"string","title":"Value"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"},"scheme":{"type":"string","enum":["CMED_REGISTRO","CMED_CNPJ","CMED_GGREM","EAN"],"title":"Scheme"}},"type":"object","required":["value","evidence","scheme"],"title":"SupportedSourceIdentifier"},"SupportedSourceValue":{"properties":{"value":{"type":"string","title":"Value"},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence"}},"type":"object","required":["value","evidence"],"title":"SupportedSourceValue"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}