{"openapi":"3.0.1","info":{"title":"Payer Access API","description":"Intercambio pagador-a-pagador CMS-0057-F según Da Vinci PDex 2.1.0. Búsqueda de miembro y recuperación del expediente longitudinal cuando un miembro cambia de plan. Solo de máquina a máquina, mediante SMART Backend Services.","version":"v1"},"paths":{"/health":{"get":{"tags":["Health"],"summary":"Indica que la aplicación responde y qué imagen la sirve.","operationId":"get-health","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}}}},"head":{"tags":["Health"],"summary":"Indica que la aplicación responde y qué imagen la sirve.","operationId":"head-health","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}}}}},"/metadata":{"get":{"tags":["Metadata"],"summary":"Devuelve el CapabilityStatement de FHIR R4 de este servidor.","operationId":"get-metadata","responses":{"200":{"description":"OK","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirCapabilityStatement"}}}}}}},"/Patient/$member-match":{"post":{"tags":["PayerExchange"],"summary":"Busca un afiliado entrante en los registros de First Medical.","description":"<b>Por qué existe este endpoint:</b> CMS-0057-F exige que el pagador que recibe a un afiliado nuevo obtenga su historial del pagador anterior. Antes de que se mueva ningún dato, los dos pagadores tienen que ponerse de acuerdo en <i>qué</i> afiliado es. Da Vinci HRex define la operación `$member-match` justamente para eso, y PDex 2.1.0 la exige como punto de entrada al intercambio entre pagadores.\n\n<b>Flujo de datos:</b> se valida el JWT del pagador solicitante → se identifica al cliente como un pagador registrado → se comprueba el consentimiento del afiliado → se busca al afiliado en el servidor FHIR → se devuelve un identificador del afiliado. En este paso no se transmite ningún dato clínico.\n\n<b>Por qué 422 ante una coincidencia ambigua:</b> devolver una suposición revelaría los datos de un afiliado en respuesta a una consulta sobre otro. La operación devuelve exactamente una coincidencia o ninguna.","operationId":"post-member-match","parameters":[{"name":"api-version","in":"query","schema":{"type":"string"}},{"name":"x-api-version","in":"header","schema":{"type":"string"}}],"requestBody":{"description":"FHIR Parameters resource carrying MemberPatient and CoverageToMatch.","content":{"application/json":{"schema":{}},"text/json":{"schema":{}},"application/*+json":{"schema":{}}}},"responses":{"200":{"description":"Exactly one member matched.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirMemberMatchParameters"}}}},"403":{"description":"Caller not authorized, or member has not opted in.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirOperationOutcome"}}}},"422":{"description":"Zero or multiple members matched, or the request was incomplete.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirOperationOutcome"}}}}}}},"/Patient/{id}/$everything":{"get":{"tags":["PayerExchange"],"summary":"Devuelve el historial longitudinal de un afiliado identificado.","description":"<b>Por qué existe este endpoint:</b> CMS-0057-F exige que los pagadores intercambien los datos clínicos y de reclamaciones del afiliado, con al menos 5 años de historial de reclamaciones, dentro de 1 día laborable desde la solicitud del afiliado. `Patient/$everything` es la operación de FHIR R4 para obtener el historial completo de un paciente en una sola llamada.\n\n<b>Flujo de datos:</b> se vuelve a comprobar el consentimiento → el servidor ajusta `_since` para que no sea anterior a hace 5 años → se leen del servidor FHIR Patient, Coverage, ExplanationOfBenefit, Claim, ClaimResponse, Condition, MedicationRequest, AllergyIntolerance, Observation, Procedure e Immunization, junto con los recursos Practitioner/Organization a los que hacen referencia → se quitan las autorizaciones previas denegadas y las de medicamentos, y se aplica la ventana por fecha de servicio (ExchangeScope) → se devuelve todo en un único Bundle de FHIR.\n\n<b>Por qué la ventana se ajusta en vez de validarse:</b> la regulación fija un mínimo de lo que hay que compartir, no un máximo de lo que un cliente puede pedir. Ajustarla atiende la solicitud sin revelar de más.","operationId":"get-patient-everything","parameters":[{"name":"id","in":"path","description":"Id del recurso Patient de FHIR, tal como lo devuelve $member-match.","required":true,"schema":{"type":"string"}},{"name":"_since","in":"query","description":"Límite inferior opcional en ISO 8601; se ajusta a la ventana de reclamaciones.","schema":{"type":"string"}},{"name":"api-version","in":"query","schema":{"type":"string"}},{"name":"x-api-version","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"FHIR Bundle containing the member's record.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirBundle"}}}},"403":{"description":"Caller not authorized, or member has not opted in.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirOperationOutcome"}}}},"422":{"description":"_since is not an ISO 8601 date or date-time.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirOperationOutcome"}}}},"502":{"description":"The clinical data store could not be reached.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirOperationOutcome"}}}}}}},"/api/consent/{memberId}":{"get":{"tags":["PayerExchange"],"summary":"Indica el estado del consentimiento de intercambio entre pagadores de un afiliado.","description":"<b>Por qué existe este endpoint:</b> 42 CFR 422.121(b) hace que el intercambio entre pagadores requiera la aceptación del afiliado (opt-in). El pagador solicitante puede preguntar si el afiliado que va a pedir lo aceptó antes de enviar $member-match. Devuelve solo la decisión de consentimiento, nunca datos clínicos.\n\n<b>El mismo control que las operaciones de intercambio (QA-51):</b> el gateway admite solo un token de client_credentials que otorgue payer/Exchange.read, y esta acción exige además que el cliente sea un pagador solicitante registrado, igual que $member-match y $everything. Antes aceptaba cualquier token autenticado, así que una credencial que el gateway nunca admitiría podía leer la decisión de cualquier afiliado desde dentro de la red.\n\nUn afiliado sin decisión registrada, un id que no corresponde a ningún afiliado y un afiliado sin cobertura Vital activa responden igual, optedIn false, de modo que la operación no sirve para averiguar si alguien es afiliado ni de qué línea.","operationId":"get-consent","parameters":[{"name":"memberId","in":"path","description":"Identificador del afiliado en First Medical.","required":true,"schema":{"type":"string"}},{"name":"api-version","in":"query","schema":{"type":"string"}},{"name":"x-api-version","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"The member's consent decision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentStatus"}}}},"403":{"description":"Caller is not an authorized requesting payer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirOperationOutcome"}}}}}}},"/.well-known/smart-configuration":{"get":{"tags":["SmartConfiguration"],"summary":"Devuelve la configuración de SMART Backend Services.","operationId":"get-smart-configuration","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmartConfiguration"}}}}}}},"/Patient/$everything":{"get":{"tags":["UnsupportedOperations"],"summary":"Patient/$everything a nivel de tipo no está disponible; use Patient/{id}/$everything.","operationId":"get-patient-everything-type","responses":{"404":{"description":"OperationOutcome, code not-supported.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirOperationOutcome"}}}}}},"post":{"tags":["UnsupportedOperations"],"summary":"Patient/$everything a nivel de tipo no está disponible; use Patient/{id}/$everything.","operationId":"post-patient-everything-type","responses":{"404":{"description":"OperationOutcome, code not-supported.","content":{"application/fhir+json":{"schema":{"$ref":"#/components/schemas/FhirOperationOutcome"}}}}}}},"/openapi.json":{"get":{"tags":["Discovery"],"summary":"Este documento OpenAPI","description":"La descripción OpenAPI 3 de esta API, legible sin token.","operationId":"get-openapi","responses":{"200":{"description":"The OpenAPI document.","content":{"application/json":{"schema":{"required":["openapi","info","paths"],"type":"object","description":"An OpenAPI 3.0 document."}}}}}}}},"components":{"schemas":{"ConsentStatus":{"type":"object","properties":{"memberId":{"type":"string","description":"The member identifier the caller asked about.","nullable":true},"optedIn":{"type":"boolean","description":"True only when an affirmative opt-in is on record."}},"description":"A member's payer-to-payer consent decision, and nothing else."},"FhirBundle":{"type":"object","properties":{"resourceType":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"total":{"type":"integer","format":"int32","nullable":true},"link":{"type":"array","items":{"$ref":"#/components/schemas/FhirBundleLink"},"nullable":true},"entry":{"type":"array","items":{"$ref":"#/components/schemas/FhirBundleEntry"},"nullable":true}},"description":"A FHIR R4 searchset Bundle. Entries are US Core 7.0.0 and CARIN C4BB\r\nresources, as listed on Patient/{id}/$everything."},"FhirBundleEntry":{"type":"object","properties":{"fullUrl":{"type":"string","nullable":true},"resource":{"type":"object","additionalProperties":{},"nullable":true}},"description":"A Bundle entry. resource is a FHIR R4 resource."},"FhirBundleLink":{"type":"object","properties":{"relation":{"type":"string","nullable":true},"url":{"type":"string","nullable":true}},"description":"A Bundle link, for example the next page."},"FhirCapabilityStatement":{"type":"object","properties":{"resourceType":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"date":{"type":"string","nullable":true},"kind":{"type":"string","nullable":true},"fhirVersion":{"type":"string","nullable":true},"format":{"type":"array","items":{"type":"string"},"nullable":true},"instantiates":{"type":"array","items":{"type":"string"},"nullable":true},"rest":{"type":"array","items":{"type":"object","additionalProperties":{}},"nullable":true}},"description":"The FHIR R4 CapabilityStatement, instantiating the PDex server statement.\r\nThe rest element follows the FHIR specification."},"FhirIdentifier":{"type":"object","properties":{"system":{"type":"string","nullable":true},"value":{"type":"string","nullable":true}},"description":"A FHIR Identifier."},"FhirMemberMatchParameters":{"type":"object","properties":{"resourceType":{"type":"string","nullable":true},"parameter":{"type":"array","items":{"$ref":"#/components/schemas/FhirParameter"},"nullable":true}},"description":"The FHIR Parameters resource $member-match returns (Da Vinci HRex): a\r\nMemberIdentifier and a PatientReference."},"FhirOperationOutcome":{"type":"object","properties":{"resourceType":{"type":"string","nullable":true},"issue":{"type":"array","items":{"$ref":"#/components/schemas/FhirOperationOutcomeIssue"},"nullable":true}},"description":"A FHIR R4 OperationOutcome. Every error this API answers carries one."},"FhirOperationOutcomeIssue":{"type":"object","properties":{"severity":{"type":"string","description":"fatal, error, warning or information.","nullable":true},"code":{"type":"string","description":"FHIR issue type, for example forbidden, processing or not-supported.","nullable":true},"diagnostics":{"type":"string","description":"Human readable detail. Never names a member.","nullable":true}},"description":"One issue of an OperationOutcome."},"FhirParameter":{"type":"object","properties":{"name":{"type":"string","nullable":true},"valueIdentifier":{"$ref":"#/components/schemas/FhirIdentifier"},"valueString":{"type":"string","nullable":true}},"description":"One parameter of a Parameters resource."},"HealthStatus":{"type":"object","properties":{"status":{"type":"string","nullable":true},"gitSha":{"type":"string","nullable":true},"buildNumber":{"type":"string","nullable":true},"builtAt":{"type":"string","nullable":true}},"description":"Liveness and the image serving it."},"SmartConfiguration":{"type":"object","properties":{"issuer":{"type":"string","nullable":true},"jwks_uri":{"type":"string","nullable":true},"token_endpoint":{"type":"string","nullable":true},"grant_types_supported":{"type":"array","items":{"type":"string"},"nullable":true},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"},"nullable":true},"token_endpoint_auth_signing_alg_values_supported":{"type":"array","items":{"type":"string"},"nullable":true},"scopes_supported":{"type":"array","items":{"type":"string"},"nullable":true},"capabilities":{"type":"array","items":{"type":"string"},"nullable":true}},"description":"The SMART Backend Services discovery document."}},"securitySchemes":{"Bearer":{"type":"http","description":"Paste a JWT token.","scheme":"Bearer","bearerFormat":"JWT"},"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://apim-fmcom-interoppatientaccess-qa-001.azure-api.net/smart-auth/api/token","scopes":{"payer/Exchange.read":"Payer-to-payer exchange for a matched member"}}}}}},"security":[{"Bearer":[]},{"oauth2":["payer/Exchange.read"]}],"servers":[{"url":"https://apim-fmcom-interoppatientaccess-qa-001.azure-api.net/payer-access"}]}