naftiko: 1.0.0-alpha2 info: label: Orion Health HIE API — Documents description: 'Orion Health HIE API — Documents. 4 operations. Lead operation: Orion Health Search for clinical documents. Self-contained Naftiko capability covering one Orion business surface.' tags: - Orion - Documents created: '2026-05-19' modified: '2026-05-19' binds: - namespace: env keys: ORION_API_KEY: ORION_API_KEY capability: consumes: - type: http namespace: hie-documents baseUri: https://api.orionhealth.com/hie description: Orion Health HIE API — Documents business capability. Self-contained, no shared references. resources: - name: documents path: /documents operations: - name: searchdocuments method: GET description: Orion Health Search for clinical documents outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: patientId in: query type: string required: true - name: documentType in: query type: string - name: sourceOrganization in: query type: string - name: dateFrom in: query type: string - name: dateTo in: query type: string - name: format in: query type: string description: Document format - name: submitdocument method: POST description: Orion Health Submit a clinical document outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: body in: body type: object description: Request body (JSON). required: true - name: documents-documentId path: /documents/{documentId} operations: - name: getdocument method: GET description: Orion Health Retrieve a clinical document outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: documentId in: path type: string required: true - name: format in: query type: string description: Requested document format - name: patients-patientId-record-locator path: /patients/{patientId}/record-locator operations: - name: locatepatientrecords method: GET description: Orion Health Locate patient records across organizations outputRawFormat: json outputParameters: - name: result type: object value: $. inputParameters: - name: patientId in: path type: string required: true - name: organization in: query type: string description: Filter by source organization - name: documentType in: query type: string description: Filter by document type - name: dateFrom in: query type: string - name: dateTo in: query type: string authentication: type: bearer token: '{{env.ORION_API_KEY}}' exposes: - type: rest namespace: hie-documents-rest port: 8080 description: REST adapter for Orion Health HIE API — Documents. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/documents name: documents description: REST surface for documents. operations: - method: GET name: searchdocuments description: Orion Health Search for clinical documents call: hie-documents.searchdocuments with: patientId: rest.patientId documentType: rest.documentType sourceOrganization: rest.sourceOrganization dateFrom: rest.dateFrom dateTo: rest.dateTo format: rest.format outputParameters: - type: object mapping: $. - method: POST name: submitdocument description: Orion Health Submit a clinical document call: hie-documents.submitdocument with: body: rest.body outputParameters: - type: object mapping: $. - path: /v1/documents/{documentid} name: documents-documentid description: REST surface for documents-documentId. operations: - method: GET name: getdocument description: Orion Health Retrieve a clinical document call: hie-documents.getdocument with: documentId: rest.documentId format: rest.format outputParameters: - type: object mapping: $. - path: /v1/patients/{patientid}/record-locator name: patients-patientid-record-locator description: REST surface for patients-patientId-record-locator. operations: - method: GET name: locatepatientrecords description: Orion Health Locate patient records across organizations call: hie-documents.locatepatientrecords with: patientId: rest.patientId organization: rest.organization documentType: rest.documentType dateFrom: rest.dateFrom dateTo: rest.dateTo outputParameters: - type: object mapping: $. - type: mcp namespace: hie-documents-mcp port: 9090 transport: http description: MCP adapter for Orion Health HIE API — Documents. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: orion-health-search-clinical-documents description: Orion Health Search for clinical documents hints: readOnly: true destructive: false idempotent: true call: hie-documents.searchdocuments with: patientId: tools.patientId documentType: tools.documentType sourceOrganization: tools.sourceOrganization dateFrom: tools.dateFrom dateTo: tools.dateTo format: tools.format outputParameters: - type: object mapping: $. - name: orion-health-submit-clinical-document description: Orion Health Submit a clinical document hints: readOnly: false destructive: false idempotent: false call: hie-documents.submitdocument with: body: tools.body outputParameters: - type: object mapping: $. - name: orion-health-retrieve-clinical-document description: Orion Health Retrieve a clinical document hints: readOnly: true destructive: false idempotent: true call: hie-documents.getdocument with: documentId: tools.documentId format: tools.format outputParameters: - type: object mapping: $. - name: orion-health-locate-patient-records description: Orion Health Locate patient records across organizations hints: readOnly: true destructive: false idempotent: true call: hie-documents.locatepatientrecords with: patientId: tools.patientId organization: tools.organization documentType: tools.documentType dateFrom: tools.dateFrom dateTo: tools.dateTo outputParameters: - type: object mapping: $.