Metriport · Arazzo Workflow

Metriport Patient Document Retrieval

Version 1.0.0

Register a patient, trigger an IHE document query across the networks, poll until retrieval completes, list the resulting documents, and obtain a signed download URL.

1 workflow 1 source API 1 provider
View Spec View on GitHub HealthcareMedical RecordsFHIRHealth DataWearablesOpen-SourceArazzoWorkflows

Provider

metriport

Workflows

patient-document-retrieval
Create a patient, run an IHE document query, then list and download the retrieved documents.
Implements the Metriport document-retrieval sequence end to end: patient registration, document query launch, status polling, document listing, and signed download URL retrieval.
5 steps inputs: conversionType, facilityId, fileName, patient outputs: documents, patientId, url
1
createPatient
createPatient
Register the patient under the given facility so document queries can resolve against the networks.
2
startDocQuery
startDocumentQuery
Start an IHE document query that fans the patient out to the connected health information networks.
3
pollDocQuery
getDocumentQueryStatus
Poll the document query until the download progress reports complete.
4
listDocs
listDocuments
List the retrieved FHIR R4 DocumentReferences available for the patient.
5
getDownloadUrl
getDocumentUrl
Request a signed download URL for a specific retrieved document.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Metriport Patient Document Retrieval
  summary: Register a patient, trigger an IHE document query across the networks, poll until retrieval completes, list the resulting documents, and obtain a signed download URL.
  description: >-
    The canonical Metriport document-retrieval flow, modeled on the IHE
    cross-community document query (XCA) pattern. A patient is created under a
    facility, a document query is started to gather clinical documents from the
    connected health information networks, the query is polled until the download
    progress reports complete, the retrieved FHIR R4 DocumentReferences are
    listed, and a signed download URL is requested for a specific file. Every step
    inlines its request so the flow is self-contained.
  version: 1.0.0
sourceDescriptions:
- name: metriportApi
  url: ../openapi/metriport-openapi.yml
  type: openapi
workflows:
- workflowId: patient-document-retrieval
  summary: Create a patient, run an IHE document query, then list and download the retrieved documents.
  description: >-
    Implements the Metriport document-retrieval sequence end to end: patient
    registration, document query launch, status polling, document listing, and
    signed download URL retrieval.
  inputs:
    type: object
    required:
    - facilityId
    - patient
    - fileName
    - conversionType
    properties:
      facilityId:
        type: string
        description: Identifier of the facility the patient is registered under.
      patient:
        type: object
        description: Patient demographic packet used to create the Metriport patient.
      fileName:
        type: string
        description: File name of the retrieved document to request a download URL for.
      conversionType:
        type: string
        description: Desired conversion type for the downloaded document (e.g. pdf, html).
  steps:
  - stepId: createPatient
    description: Register the patient under the given facility so document queries can resolve against the networks.
    operationId: createPatient
    parameters:
    - name: facilityId
      in: query
      value: $inputs.facilityId
    requestBody:
      contentType: application/json
      payload: $inputs.patient
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      patientId: $response.body#/id
  - stepId: startDocQuery
    description: Start an IHE document query that fans the patient out to the connected health information networks.
    operationId: startDocumentQuery
    parameters:
    - name: patientId
      in: query
      value: $steps.createPatient.outputs.patientId
    - name: facilityId
      in: query
      value: $inputs.facilityId
    successCriteria:
    - condition: $statusCode == 200
  - stepId: pollDocQuery
    description: Poll the document query until the download progress reports complete.
    operationId: getDocumentQueryStatus
    parameters:
    - name: patientId
      in: query
      value: $steps.createPatient.outputs.patientId
    successCriteria:
    - context: $response.body
      condition: $.download.status == "completed"
      type: jsonpath
    outputs:
      status: $response.body#/download/status
  - stepId: listDocs
    description: List the retrieved FHIR R4 DocumentReferences available for the patient.
    operationId: listDocuments
    parameters:
    - name: patientId
      in: query
      value: $steps.createPatient.outputs.patientId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      documents: $response.body#/documents
  - stepId: getDownloadUrl
    description: Request a signed download URL for a specific retrieved document.
    operationId: getDocumentUrl
    parameters:
    - name: fileName
      in: query
      value: $inputs.fileName
    - name: conversionType
      in: query
      value: $inputs.conversionType
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      url: $response.body#/url
  outputs:
    patientId: $steps.createPatient.outputs.patientId
    documents: $steps.listDocs.outputs.documents
    url: $steps.getDownloadUrl.outputs.url

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/metriport-patient-document-retrieval-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.