From 3fca8aa8b42b2e1e73934080fe8b63d61b95e0b0 Mon Sep 17 00:00:00 2001
From: Gajendra8911 <157461535+Gajendra8911@users.noreply.github.com>
Date: Fri, 4 Oct 2024 16:42:34 +0530
Subject: [PATCH 1/4] update
---
api-reference/user-app/records/records.yaml | 743 ------------------
.../{link-record.mdx => update-record.mdx} | 0
mint.json | 2 +-
3 files changed, 1 insertion(+), 744 deletions(-)
delete mode 100644 api-reference/user-app/records/records.yaml
rename api-reference/user-app/records/{link-record.mdx => update-record.mdx} (100%)
diff --git a/api-reference/user-app/records/records.yaml b/api-reference/user-app/records/records.yaml
deleted file mode 100644
index aaa4752f..00000000
--- a/api-reference/user-app/records/records.yaml
+++ /dev/null
@@ -1,743 +0,0 @@
-openapi: 3.1.0
-info:
- title: Document Upload API
- description: API to pre-sign the URL for uploading documents.
- version: 1.0.0
- license:
- name: Proprietary License
- url: https://developer.eka.care/license
-
-servers:
- - url: https://api.eka.care
- description: Production server
- - url: https://api.dev.eka.care
- description: Development server
-tags:
- - name: Records
- description: API related to records document management.
-paths:
- /mr/api/v1/docs:
- get:
- summary: Fetch documents based on filters
- description: To get the list of all the records for a given authenticated user.
- operationId: getDocuments
- parameters:
- - name: u_at__gt
- in: query
- schema:
- type: string
- nullable: true
- example: 1614556800
- description: Filters the documents by returning all documents that were updated after the specified u_at__gt timestamp. The value should be a valid epoch timestamp.
- - name: offset
- in: query
- schema:
- type: string
- nullable: true
- description: Please include the nextPageToken from the API response to enable pagination.
- - name: accept
- in: header
- required: true
- schema:
- type: string
- enum:
- - application/json
- example: application/json
- description: To get response in json format
- responses:
- '200':
- description: A list of documents matching the query.
- content:
- application/json:
- schema:
- type: object
- properties:
- response:
- type: object
- properties:
- items:
- type: array
- items:
- type: object
- properties:
- record:
- type: object
- properties:
- item:
- type: object
- properties:
- documentId:
- type: string
- description: Unique ID of the document.
- example: df04c7e6-577b-4990-948c-5a31820c6a67
- uploadDate:
- type: string
- format: date-time
- description: Date when the document was uploaded.
- example: 2024-08-06T07:39:35Z
- documentType:
- type: string
- description: Type of the document.
- example: TYPE_LAB_REPORT
- metadata:
- type: object
- properties:
- thumbnail:
- type: string
- format: uri
- description: URL of the document's thumbnail.
- example: https://vault-cdn.dev.eka.care/fac0704e-a0e3-4c93-a972-e6c1f188592d/df04c7e6-577b-4990-948c-5a31820c6a67/5dbc4b75-df1a-412d-82a3-77d54671398c.jpeg
- documentDate:
- type: string
- format: date-time
- description: Date of the document.
- example: 2021-09-08T18:30:00Z
- tags:
- type: array
- items:
- type: string
- description: Tags associated with the document.
- example: TYPE_TAG_SMART
- abha:
- type: object
- nullable: true
- properties:
- health_id:
- type: string
- example: mayank.singh@abdm
- link_status:
- type: string
- enum:
- - LINKED
- - INITIATED
- - SCHEDULED
- - ERRORED
- - RESCHEDULED
- patientOid:
- type: string
- description: Patient OID associated with the document.
- example: 161494290947153
- '400':
- description: Bad Request. Invalid or missing parameters.
- '401':
- description: Unauthorized. Invalid JWT token or client ID.
- '500':
- description: Internal Server Error.
- security:
- - auth: []
- post:
- operationId: getAuthorization
- tags:
- - Records
- summary: Obtain a Presigned URL for Document Upload
- description: Generate a presigned URL that allows you to securely upload a document to the server. This URL can be used to upload the document directly without needing additional authentication or authorization steps.
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- batch_request:
- type: array
- items:
- $ref: '#/components/schemas/UpdateDocumentV3Request'
- example:
- batch_request:
- -
- dt: "ps"
- sh: false
- dd_e: 1614556800
- tg: ["tag1", "tag2"]
- files:
- -
- contentType: "image/jpeg"
- file_size: 110000
- responses:
- '200':
- description: Presigned URL successfully retrieved
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/UploadResponse'
- '400':
- description: Bad Request
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorUploadResponse'
- examples:
- ErrorUploadResponse:
- summary: Example of an error response with an empty batch_request
- value:
- error: true
- message: "Invalid document type."
- batch_response: [] # Empty array for batch_request
- upload_time: null
- '500':
- description: Internal Server Error. No response body is expected.
- '502':
- description: Bad Gateway. No response body is expected.
- '503':
- description: Service Unavailable. No response body is expected.
- '504':
- description: Gateway Timeout. No response body is expected.
- security:
- - auth: []
-
- /upload:
- post:
- summary: Upload Records
- description: Upload a records using the signed URL for each document requested in obtain authorization API
- requestBody:
- content:
- multipart/form-data:
- schema:
- type: object
- additionalProperties:
- type: string
- properties:
- file:
- type: string
- format: binary
- description: The file to upload.
- required:
- - file
- responses:
- '204':
- description: No Content - Successful Upload with No Response Body
- '403':
- description: Forbidden - Access Denied
- content:
- application/xml:
- schema:
- type: object
- properties:
- Error:
- type: object
- properties:
- Code:
- type: string
- description: Error code.
- Message:
- type: string
- description: Error message.
- RequestId:
- type: string
- description: Request ID.
- HostId:
- type: string
- description: Host ID.
- example:
- Error:
- Code: "AccessDenied"
- Message: "Invalid according to Policy: Extra input fields: content-type"
- RequestId: "JGD23XY93Z00Z2DB"
- HostId: "NjZf6f4Yo3LwikPHTwtyS02TEftaoWWvS8BmfRlQmA5pwllX6FHyMuO4hNVT0AIBOwKHFoEFkk8="
- '500':
- description: Internal Server Error
- /mr/api/v1/docs/{document_id}:
- patch:
- summary: Update Document
- description: This API is used to update the document.
- parameters:
- - in: path
- name: document_id
- required: true
- description: Document ID to update the document details.
- schema:
- type: string
- example: 2df9e795-d368-4ceb-be9d-b44281703827
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- dt:
- type: string
- description: |
- The following values are allowed:
- - `ps`: Prescription
- - `lr`: Lab Report
- - `ot`: Other
- - `ds`: Discharge Summary
- - `vc`: Vaccine Certificate
- - `in`: Insurance
- - `iv`: Invoice
- - `sc`: Scan
- enum:
- - ps
- - lr
- - ot
- - ds
- - vc
- - in
- - iv
- - sc
- example: lr
- ndhm:
- type: boolean
- nullable: true
- description: If true, the record will be linked.
- example: true
- oid:
- type: string
- description: OID associated with the document.
- example: "161847797963700"
- required:
- - dt
- - ndhm
- - oid
- responses:
- '200':
- description: Document linked successfully.
- '404':
- description: No such document.
- '5XX':
- description: Unexpected error.
- security:
- - auth: []
-
- delete:
- summary: Delete a document.
- description : This API is used to delete a document using a document ID.
- parameters:
- - in: path
- name: document_id
- required: true
- description: Document ID to delete the document.
- schema:
- type: string
- example: 2df9e795-d368-4ceb-be9d-b44281703827
- responses:
- '200':
- description: Document deleted successfully.
- '404':
- description: No such document.
- '5XX':
- description: Unexpected error.
- security:
- - auth: []
-
- get:
- summary: Describes a document.
- description: Once you get the list of all the documents with coresponding id's, you can this to know more details about the document.
- operationId: getDocument
- parameters:
- - in: path
- name: document_id
- required: true
- description: Document ID to fetch the document details.
- schema:
- type: string
- example: 2df9e795-d368-4ceb-be9d-b44281703827
- responses:
- '200':
- description: Description of a document.
- content:
- application/json:
- schema:
- type: object
- properties:
- source:
- type: string
- document_date_epoch:
- type: integer
- tags:
- type: array
- items:
- type: string
- dt:
- type: string
- enum:
- - TYPE_LAB_REPORT
- - TYPE_PRESCRIPTION
- - TYPE_DISCHARGE_SUMMARY
- - TYPE_VACCINE_CERTIFICATE
- - TYPE_INSURANCE
- - TYPE_INVOICE
- - TYPE_SCAN
- - TYPE_OTHER
- files:
- type: array
- items:
- type: object
- properties:
- asset_url:
- type: string
- format: uri
- file_type:
- type: string
- enum:
- - IMG
- - PDF
- example:
- source: "androidp"
- document_date: "2021-03-13T13:01:59Z"
- document_type: TYPE_LAB_REPORT
- tags: ["covid"]
- files:
- - asset_url: https://sample-lab-report.s3.ap-south-1.amazonaws.com/161494290947153/2df9e795-d368-4ceb-be9d-b44281703827/0cb1277e-1c4d-42cc-acd1-9630497e4f9d.jpeg
- file_type: IMG
- - asset_url: https://sample-lab-report.s3.ap-south-1.amazonaws.com/161494290947153/2df9e795-d368-4ceb-be9d-b44281703827/0cb1277e-1c4d-42cc-acd1-9630497e4f9d.pdf
- file_type: PDF
- '5XX':
- description: Unexpected error.
- '404':
- description: No such document.
- security:
- - auth: []
-
- /health/api/v1/fhir/retrieve:
- get:
- summary: Retrieve health records
- description: Retrieve a health record based on the given identifier, hip_id, and health_id in nrces FHIR json format.
- parameters:
- - name: identifier
- in: query
- required: true
- description: The unique identifier for the health record.
- schema:
- type: string
- - name: hip_id
- in: query
- required: true
- description: The HIP (Health Information Provider) ID.
- schema:
- type: string
- - name: health_id
- in: query
- required: true
- description: The health ID associated with the record.
- schema:
- type: string
- responses:
- '200':
- description: Successful retrieval of health records.
- content:
- application/json:
- schema:
- type: object
- properties:
- resourceType:
- type: string
- example: Bundle
- type:
- type: string
- example: document
- link:
- type: array
- items:
- type: object
- properties:
- url:
- type: string
- relation:
- type: string
- entry:
- type: array
- items:
- type: object
- properties:
- resource:
- type: object
- properties:
- author:
- type: array
- items:
- type: object
- properties:
- reference:
- type: string
- date:
- type: string
- format: date-time
- extension:
- type: array
- items:
- type: object
- properties:
- url:
- type: string
- valueString:
- type: string
- id:
- type: string
- identifier:
- type: object
- properties:
- system:
- type: string
- value:
- type: string
- meta:
- type: object
- properties:
- lastUpdated:
- type: string
- format: date-time
- resourceType:
- type: string
- section:
- type: array
- items:
- type: object
- properties:
- entry:
- type: array
- items:
- type: object
- properties:
- reference:
- type: string
- title:
- type: string
- status:
- type: string
- subject:
- type: object
- properties:
- reference:
- type: string
- title:
- type: string
- type:
- type: object
- properties:
- text:
- type: string
- id:
- type: string
- meta:
- type: object
- properties:
- versionId:
- type: string
- lastUpdated:
- type: string
- format: date-time
- profile:
- type: array
- items:
- type: string
- security:
- type: array
- items:
- type: object
- properties:
- code:
- type: string
- display:
- type: string
- system:
- type: string
- identifier:
- type: object
- properties:
- system:
- type: string
- value:
- type: string
- timestamp:
- type: string
- format: date-time
- '404':
- description: when request identifier, hip_id, health_id has no data
- content:
- application/json:
- schema:
- type: object
- properties:
- resourceType:
- type: string
- example: Bundle
- type:
- type: string
- example: document
- meta:
- type: object
- properties:
- lastUpdated:
- type: string
- format: date-time
- '401':
- description: Unauthorized. Invalid or missing authentication.
- content:
- application/json:
- schema:
- type: object
- properties:
- message:
- type: string
- example: Unauthorized
- security:
- - auth: []
- /mr/webhook/smart-report:
- post:
- summary: Smart Report Events
- description: >-
- When the records get uploaded, a webhook event is sent to register to get the smart report of the record upload. If there are multiple records upload in upload docs API we need to register web hook for all the document id recevied in the reponse. Use the below request payload to register to webhook. You can find [here](https://ekacare.notion.site/726b13df13ea4409b0cd30c6f3a80315?v=dcd10c722d3149d880ae889b06f4820a) list of parsing capablities we have as of now.
- requestBody:
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- event_type:
- type: string
- example: "smart-report"
- timestamp:
- type: string
- example: "2023-07-30T18:07:24.000Z"
- data:
- type: object
- properties:
- document_id:
- type: string
- description: This is document_id which you have recevied Obtain a Presigned URL for Document Upload response
- webook_url:
- type: string
- description: This url we will use to send the payload upon successful parsing of the record
-
- responses:
- '200':
- description: Event registered successfully
- '204':
- description: Event created successfully
- '400':
- description: Bad request
- '403':
- description: Forbidden - Access Denied
- '500':
- description: Something went wrong
- security:
- - auth: []
-components:
- schemas:
- DocumentTypeQueryParam:
- type: string
- description: |
- Specifies the type of document being uploaded.
- The following values are allowed:
- - `ps`: Prescription
- - `lr`: Lab Report
- - `ot`: Other
- - `ds`: Discharge Summary
- - `vc`: Vaccine Certificate
- - `in`: Insurance
- - `iv`: Invoice
- - `sc`: Scan
- enum:
- - ps
- - lr
- - ot
- - ds
- - vc
- - in
- - iv
- - sc
-
- FileUploadRequest:
- type: object
- properties:
- contentType:
- type: string
- description: The MIME type of the file (e.g., image/jpeg, application/pdf).
- file_size:
- type: integer
- format: int64
- description: Unit of file size should be bytes
- required:
- - contentType
- - file_size
-
- UpdateDocumentV3Request:
- type: object
- properties:
- dt:
- $ref: '#/components/schemas/DocumentTypeQueryParam'
- dd_e:
- type: integer
- format: int64
- description: Format should be in epoch time.
- sh:
- type: boolean
- description: Indicates if the record can be shared with a doctor.
- tg:
- type: array
- description: The tag array can contain a maximum of **10 tags**.
- If more than 10 tags are provided in the request, only the **first 10 tags** will be considered.
- items:
- type: string
- description: Each tag must be between **2 to 20 characters** in length.
-
- files:
- type: array
- description: A list of files to be uploaded, each with a specified content type and size.
- items:
- $ref: '#/components/schemas/FileUploadRequest'
- required :
- - dt
- - files
- UploadResponse:
- type: object
- properties:
- error:
- type: boolean
- example: false
- message:
- type: string
- example: ""
- batch_response:
- type: array
- items:
- $ref: '#/components/schemas/UploadResponseBody'
- token:
- type: string
- format: date-time
-
- ErrorUploadResponse:
- type: object
- properties:
- error:
- type: boolean
- example: true
- message:
- type: string
- description: Description of the error encountered
- batch_response:
- type: array
- items:
- $ref: '#/components/schemas/UploadResponseBody'
- token:
- type: string
- format: date-time
-
- UploadResponseBody:
- type: object
- properties:
- document_id:
- type: string
- forms:
- type: array
- items:
- $ref: '#/components/schemas/UploadResponseBodyForms'
-
- UploadResponseBodyForms:
- type: object
- properties:
- url:
- type: string
- fields:
- type: object
- additionalProperties:
- type: string
- securitySchemes:
- auth:
- type: apiKey
- in: header
- name: auth
- description: |
- The API requires the following auth in headers for authentication.
diff --git a/api-reference/user-app/records/link-record.mdx b/api-reference/user-app/records/update-record.mdx
similarity index 100%
rename from api-reference/user-app/records/link-record.mdx
rename to api-reference/user-app/records/update-record.mdx
diff --git a/mint.json b/mint.json
index c00f787e..e287e682 100644
--- a/mint.json
+++ b/mint.json
@@ -354,7 +354,7 @@
"api-reference/user-app/records/upload-record_overview",
"api-reference/user-app/records/obtain-authorization",
"api-reference/user-app/records/upload-records",
- "api-reference/user-app/records/link-record"
+ "api-reference/user-app/records/update-record"
]
},
{
From d45b91f768bdce45289aa2097898cf1abffa96d9 Mon Sep 17 00:00:00 2001
From: Gajendra8911 <157461535+Gajendra8911@users.noreply.github.com>
Date: Mon, 7 Oct 2024 10:09:24 +0530
Subject: [PATCH 2/4] generate yaml file with generator
---
api-reference/user-app/records/records.yaml | 655 ++++++++++++++++++++
1 file changed, 655 insertions(+)
create mode 100644 api-reference/user-app/records/records.yaml
diff --git a/api-reference/user-app/records/records.yaml b/api-reference/user-app/records/records.yaml
new file mode 100644
index 00000000..fa4f7291
--- /dev/null
+++ b/api-reference/user-app/records/records.yaml
@@ -0,0 +1,655 @@
+openapi: 3.1.0
+info:
+ description: Vaults Api
+ title: Vaults Api
+ version: 1.0.0
+servers:
+- url: https://api.eka.care
+- url: https://api.dev.eka.care
+paths:
+ /health/api/v1/fhir/retrieve:
+ get:
+ description: Retrieve a health record based on the given identifier, hip_id,
+ and health_id in nrces FHIR json format.
+ parameters:
+ - description: The unique identifier for the health record.
+ in: query
+ name: identifier
+ required: true
+ schema:
+ description: The unique identifier for the health record.
+ examples:
+ - "170781696111222"
+ type: string
+ - description: The HIP (Health Information Provider) ID.
+ in: query
+ name: hip_id
+ required: true
+ schema:
+ description: The HIP (Health Information Provider) ID.
+ examples:
+ - eka
+ type: string
+ - description: The health ID associated with the record.
+ in: query
+ name: health_id
+ required: true
+ schema:
+ description: The health ID associated with the record.
+ examples:
+ - test@sbx
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/HealthRecordsResponse'
+ description: OK
+ "400":
+ description: Bad Request
+ "500":
+ description: Internal Server Error
+ security:
+ - authApiKey: []
+ /mr/api/v1/docs:
+ get:
+ description: To get the list of all the records for a given authenticated user.
+ parameters:
+ - description: Filters the documents by returning all documents that were updated
+ after the specified u_at__gt timestamp. The value should be a valid epoch
+ timestamp.
+ in: query
+ name: u_at__gt
+ schema:
+ description: Filters the documents by returning all documents that were
+ updated after the specified u_at__gt timestamp. The value should be a
+ valid epoch timestamp.
+ examples:
+ - "1614556800"
+ type:
+ - "null"
+ - string
+ - description: Please include the nextPageToken from the API response to enable
+ pagination.
+ in: query
+ name: offset
+ schema:
+ description: Please include the nextPageToken from the API response to enable
+ pagination.
+ type:
+ - "null"
+ - string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ListRecordsResponse'
+ description: OK
+ "400":
+ description: Bad Request
+ "500":
+ description: Internal Server Error
+ security:
+ - authApiKey: []
+ post:
+ description: Generate a presigned URL that allows you to securely upload a document
+ to the server. This URL can be used to upload the document directly without
+ needing additional authentication or authorization steps.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RequestRequest'
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/RequestResponse'
+ description: OK
+ "400":
+ description: Bad Request
+ "500":
+ description: Internal Server Error
+ security:
+ - authApiKey: []
+ /mr/api/v1/docs/{document_id}:
+ delete:
+ description: This API is used to delete a document using a document ID.
+ parameters:
+ - description: Document ID to delete the document.
+ in: path
+ name: document_id
+ required: true
+ schema:
+ description: Document ID to delete the document.
+ type: string
+ responses:
+ "400":
+ description: Bad Request
+ "500":
+ description: Internal Server Error
+ security:
+ - authApiKey: []
+ get:
+ description: Once you get the list of all the documents with corresponding id’s,
+ you can this to know more details about the document.
+ parameters:
+ - description: Document ID to fetch the document details.
+ in: path
+ name: document_id
+ required: true
+ schema:
+ description: Document ID to fetch the document details.
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/DescribeResponse'
+ description: OK
+ "400":
+ description: Bad Request
+ "500":
+ description: Internal Server Error
+ security:
+ - authApiKey: []
+ patch:
+ description: This API is used to update the document.
+ parameters:
+ - description: Document ID to update the document details.
+ in: path
+ name: document_id
+ required: true
+ schema:
+ description: Document ID to update the document details.
+ examples:
+ - 6dc7a3d9-003b-45f6-b4bc-9c334e95b390
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateRequest'
+ responses:
+ "400":
+ description: Bad Request
+ "500":
+ description: Internal Server Error
+ security:
+ - authApiKey: []
+ /mr/webhook/smart-report:
+ post:
+ description: When the records get uploaded, a webhook event is sent to register
+ to get the smart report of the record upload. If there are multiple records
+ upload in upload docs API we need to register web hook for all the document
+ id recevied in the reponse. Use the below request payload to register to webhook.
+ You can find here list of parsing capabilities we have as of now.
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/SmartReportRequest'
+ responses:
+ "400":
+ description: Bad Request
+ "500":
+ description: Internal Server Error
+ security:
+ - authApiKey: []
+ /upload:
+ post:
+ description: Upload a records using the signed URL for each document requested
+ in obtain authorization API.
+ requestBody:
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/FormDataUploadRequest'
+ responses:
+ "400":
+ description: Bad Request
+ "500":
+ description: Internal Server Error
+components:
+ schemas:
+ DescribeFile:
+ properties:
+ asset_url:
+ examples:
+ - https://sample-lab-report.s3.ap-south-1.amazonaws.com/filename.jpg
+ type: string
+ file_type:
+ examples:
+ - IMG
+ type: string
+ type: object
+ DescribeResponse:
+ properties:
+ document_date:
+ examples:
+ - "2021-03-13T13:01:59Z"
+ type: string
+ document_type:
+ examples:
+ - TYPE_LAB_REPORT
+ type: string
+ files:
+ examples:
+ - - asset_url: https://sample-lab-report.s3.ap-south-1.amazonaws.com/filename.jpg
+ file_type: IMG
+ - asset_url: https://sample-lab-report.s3.ap-south-1.amazonaws.com/filename.pdf
+ file_type: PDF
+ items:
+ $ref: '#/components/schemas/DescribeFile'
+ type: array
+ source:
+ examples:
+ - androidp
+ type: string
+ tags:
+ examples:
+ - - covid
+ items:
+ type: string
+ type: array
+ type: object
+ FormDataUploadRequest:
+ properties:
+ file:
+ $ref: '#/components/schemas/MultipartFile'
+ description: The file to upload.
+ required:
+ - file
+ type: object
+ HealthRecordsAuthor:
+ properties:
+ reference:
+ type: string
+ type: object
+ HealthRecordsEntry:
+ properties:
+ resource:
+ $ref: '#/components/schemas/HealthRecordsResource'
+ type: object
+ HealthRecordsEntryReference:
+ properties:
+ reference:
+ type: string
+ type: object
+ HealthRecordsExtension:
+ properties:
+ url:
+ type: string
+ valueString:
+ type: string
+ type: object
+ HealthRecordsIdentifier:
+ properties:
+ system:
+ type: string
+ value:
+ type: string
+ type: object
+ HealthRecordsLink:
+ properties:
+ relation:
+ type: string
+ url:
+ type: string
+ type: object
+ HealthRecordsMeta:
+ properties:
+ lastUpdated:
+ format: date-time
+ type: string
+ profile:
+ items:
+ type: string
+ type:
+ - array
+ - "null"
+ security:
+ items:
+ $ref: '#/components/schemas/HealthRecordsSecurity'
+ type:
+ - array
+ - "null"
+ versionId:
+ type: string
+ type: object
+ HealthRecordsResource:
+ properties:
+ author:
+ items:
+ $ref: '#/components/schemas/HealthRecordsAuthor'
+ type:
+ - array
+ - "null"
+ date:
+ format: date-time
+ type: string
+ extension:
+ items:
+ $ref: '#/components/schemas/HealthRecordsExtension'
+ type:
+ - array
+ - "null"
+ id:
+ type: string
+ identifier:
+ $ref: '#/components/schemas/HealthRecordsIdentifier'
+ meta:
+ $ref: '#/components/schemas/HealthRecordsMeta'
+ resourceType:
+ type: string
+ section:
+ items:
+ $ref: '#/components/schemas/HealthRecordsSection'
+ type:
+ - array
+ - "null"
+ status:
+ type: string
+ subject:
+ $ref: '#/components/schemas/HealthRecordsSubject'
+ title:
+ type: string
+ type:
+ $ref: '#/components/schemas/HealthRecordsType'
+ type: object
+ HealthRecordsResponse:
+ properties:
+ entry:
+ items:
+ $ref: '#/components/schemas/HealthRecordsEntry'
+ type:
+ - array
+ - "null"
+ id:
+ type: string
+ identifier:
+ $ref: '#/components/schemas/HealthRecordsIdentifier'
+ link:
+ items:
+ $ref: '#/components/schemas/HealthRecordsLink'
+ type:
+ - array
+ - "null"
+ meta:
+ $ref: '#/components/schemas/HealthRecordsMeta'
+ resourceType:
+ type: string
+ timestamp:
+ format: date-time
+ type: string
+ type:
+ type: string
+ type: object
+ HealthRecordsSection:
+ properties:
+ entry:
+ items:
+ $ref: '#/components/schemas/HealthRecordsEntryReference'
+ type:
+ - array
+ - "null"
+ title:
+ type: string
+ type: object
+ HealthRecordsSecurity:
+ properties:
+ code:
+ type: string
+ display:
+ type: string
+ system:
+ type: string
+ type: object
+ HealthRecordsSubject:
+ properties:
+ reference:
+ type: string
+ type: object
+ HealthRecordsType:
+ properties:
+ text:
+ type: string
+ type: object
+ ListRecordsAbha:
+ properties:
+ health_id:
+ type: string
+ link_status:
+ type: string
+ type: object
+ ListRecordsDocument:
+ properties:
+ documentId:
+ type: string
+ documentType:
+ type: string
+ metadata:
+ $ref: '#/components/schemas/ListRecordsMetadata'
+ patientOid:
+ type: integer
+ uploadDate:
+ format: date-time
+ type: string
+ type: object
+ ListRecordsItem:
+ properties:
+ record:
+ $ref: '#/components/schemas/ListRecordsRecord'
+ type: object
+ ListRecordsListResponse:
+ properties:
+ items:
+ items:
+ $ref: '#/components/schemas/ListRecordsItem'
+ type:
+ - array
+ - "null"
+ type: object
+ ListRecordsMetadata:
+ properties:
+ abha:
+ $ref: '#/components/schemas/ListRecordsAbha'
+ documentDate:
+ format: date-time
+ type: string
+ tags:
+ items:
+ type: string
+ type:
+ - array
+ - "null"
+ thumbnail:
+ type: string
+ type: object
+ ListRecordsRecord:
+ properties:
+ item:
+ $ref: '#/components/schemas/ListRecordsDocument'
+ type: object
+ ListRecordsResponse:
+ properties:
+ response:
+ $ref: '#/components/schemas/ListRecordsListResponse'
+ type: object
+ MultipartFile:
+ contentMediaType: application/octet-stream
+ format: binary
+ type: string
+ RequestBatchRequestItem:
+ properties:
+ dd_e:
+ description: Format should be in epoch time.
+ examples:
+ - 1.6145568e+09
+ type: integer
+ dt:
+ description: Specifies the type of document being uploaded.
+ enum:
+ - ps
+ - lr
+ - ot
+ - ds
+ - vc
+ - in
+ - iv
+ - sc
+ examples:
+ - ps
+ type: string
+ files:
+ description: A list of files to be uploaded, each with a specified content
+ type and size.
+ items:
+ $ref: '#/components/schemas/RequestFile'
+ type: array
+ sh:
+ description: Indicates if the record can be shared with a doctor.
+ examples:
+ - false
+ type: boolean
+ tg:
+ description: The tag array can contain a maximum of 10 tags. If more than
+ 10 tags are provided in the request, only the first 10 tags will be considered
+ and each tag must be between 2 to 20 characters in length.
+ items:
+ type: string
+ type: array
+ required:
+ - dt
+ - files
+ type: object
+ RequestFile:
+ properties:
+ contentType:
+ description: The MIME type of the file (e.g., image/jpeg, application/pdf).
+ examples:
+ - image/jpeg
+ type: string
+ file_size:
+ description: Unit of file size should be bytes
+ examples:
+ - 110000
+ type: integer
+ required:
+ - contentType
+ - file_size
+ type: object
+ RequestRequest:
+ properties:
+ batch_request:
+ items:
+ $ref: '#/components/schemas/RequestBatchRequestItem'
+ type: array
+ type: object
+ RequestResponse:
+ properties:
+ batch_response:
+ items:
+ $ref: '#/components/schemas/RequestUploadResponseBody'
+ type:
+ - array
+ - "null"
+ error:
+ type: boolean
+ message:
+ type: string
+ token:
+ examples:
+ - "2023-11-07T05:31:56Z"
+ type:
+ - "null"
+ - string
+ type: object
+ RequestUploadResponseBody:
+ properties:
+ document_id:
+ examples:
+ - 6dc7a3d9-003b-45f6-b4bc-9c334e95b390
+ type: string
+ forms:
+ items:
+ $ref: '#/components/schemas/RequestUploadResponseBodyForms'
+ type:
+ - array
+ - "null"
+ type: object
+ RequestUploadResponseBodyForms:
+ properties:
+ fields:
+ additionalProperties:
+ type: string
+ type:
+ - object
+ - "null"
+ url:
+ type: string
+ type: object
+ SmartReportData:
+ properties:
+ document_id:
+ description: This is document_id which you have received Obtain a Presigned
+ URL for Document Upload response
+ type: string
+ webook_url:
+ description: This url we will use to send the payload upon successful parsing
+ of the record
+ type: string
+ type: object
+ SmartReportRequest:
+ properties:
+ data:
+ $ref: '#/components/schemas/SmartReportData'
+ event_type:
+ type: string
+ timestamp:
+ format: date-time
+ type: string
+ type: object
+ UpdateRequest:
+ properties:
+ dt:
+ description: Specifies the type of document being updated.
+ enum:
+ - ps
+ - lr
+ - ot
+ - ds
+ - vc
+ - in
+ - iv
+ - sc
+ examples:
+ - ps
+ type: string
+ ndhm:
+ description: If true, the record will be linked.
+ examples:
+ - false
+ type:
+ - "null"
+ - boolean
+ oid:
+ description: OID associated with the document.
+ examples:
+ - "161847797963700"
+ type: string
+ required:
+ - dt
+ - ndhm
+ - oid
+ type: object
+ securitySchemes:
+ authApiKey:
+ description: The API requires the following auth in headers for authentication.
+ in: header
+ name: auth
+ type: apiKey
From 823365502779b524396aef15d9bd57930bd5a8fe Mon Sep 17 00:00:00 2001
From: Gajendra8911 <157461535+Gajendra8911@users.noreply.github.com>
Date: Mon, 7 Oct 2024 10:35:13 +0530
Subject: [PATCH 3/4] summary
---
api-reference/user-app/records/records.yaml | 24 +++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/api-reference/user-app/records/records.yaml b/api-reference/user-app/records/records.yaml
index fa4f7291..a4a3d62c 100644
--- a/api-reference/user-app/records/records.yaml
+++ b/api-reference/user-app/records/records.yaml
@@ -52,6 +52,7 @@ paths:
description: Internal Server Error
security:
- authApiKey: []
+ summary: Retrieve health records
/mr/api/v1/docs:
get:
description: To get the list of all the records for a given authenticated user.
@@ -93,6 +94,7 @@ paths:
description: Internal Server Error
security:
- authApiKey: []
+ summary: Fetch documents based on filters
post:
description: Generate a presigned URL that allows you to securely upload a document
to the server. This URL can be used to upload the document directly without
@@ -115,6 +117,7 @@ paths:
description: Internal Server Error
security:
- authApiKey: []
+ summary: Obtain a Presigned URL for Document Upload
/mr/api/v1/docs/{document_id}:
delete:
description: This API is used to delete a document using a document ID.
@@ -125,6 +128,8 @@ paths:
required: true
schema:
description: Document ID to delete the document.
+ examples:
+ - 6dc7a3d9-003b-45f6-b4bc-9c334e95b390
type: string
responses:
"400":
@@ -133,6 +138,7 @@ paths:
description: Internal Server Error
security:
- authApiKey: []
+ summary: Delete a document.
get:
description: Once you get the list of all the documents with corresponding id’s,
you can this to know more details about the document.
@@ -143,6 +149,8 @@ paths:
required: true
schema:
description: Document ID to fetch the document details.
+ examples:
+ - 6dc7a3d9-003b-45f6-b4bc-9c334e95b390
type: string
responses:
"200":
@@ -157,6 +165,7 @@ paths:
description: Internal Server Error
security:
- authApiKey: []
+ summary: Describes a document.
patch:
description: This API is used to update the document.
parameters:
@@ -181,13 +190,15 @@ paths:
description: Internal Server Error
security:
- authApiKey: []
+ summary: Update Document
/mr/webhook/smart-report:
post:
description: When the records get uploaded, a webhook event is sent to register
to get the smart report of the record upload. If there are multiple records
upload in upload docs API we need to register web hook for all the document
id recevied in the reponse. Use the below request payload to register to webhook.
- You can find here list of parsing capabilities we have as of now.
+ You can find [here](https://ekacare.notion.site/726b13df13ea4409b0cd30c6f3a80315?v=dcd10c722d3149d880ae889b06f4820a)
+ list of parsing capabilities we have as of now.
requestBody:
content:
application/json:
@@ -200,6 +211,7 @@ paths:
description: Internal Server Error
security:
- authApiKey: []
+ summary: Smart Report Events
/upload:
post:
description: Upload a records using the signed URL for each document requested
@@ -214,6 +226,7 @@ paths:
description: Bad Request
"500":
description: Internal Server Error
+ summary: Upload Records
components:
schemas:
DescribeFile:
@@ -492,7 +505,9 @@ components:
- 1.6145568e+09
type: integer
dt:
- description: Specifies the type of document being uploaded.
+ description: 'Specifies the type of document being uploaded. Allowed values:
+ ps (Prescription), lr (Lab Report), ot (Other), ds (Discharge Summary),
+ vc (Vaccine Certificate), in (Insurance), iv (Invoice), sc (Scan)'
enum:
- ps
- lr
@@ -524,7 +539,6 @@ components:
type: string
type: array
required:
- - dt
- files
type: object
RequestFile:
@@ -617,7 +631,9 @@ components:
UpdateRequest:
properties:
dt:
- description: Specifies the type of document being updated.
+ description: 'Specifies the type of document being uploaded. Allowed values:
+ ps (Prescription), lr (Lab Report), ot (Other), ds (Discharge Summary),
+ vc (Vaccine Certificate), in (Insurance), iv (Invoice), sc (Scan)'
enum:
- ps
- lr
From 5eab3c63ca5f8dc541dcd2eb01b52b8ed8c063f8 Mon Sep 17 00:00:00 2001
From: Gajendra8911 <157461535+Gajendra8911@users.noreply.github.com>
Date: Mon, 7 Oct 2024 14:23:18 +0530
Subject: [PATCH 4/4] updated
---
.../user-app/records/constraints.mdx | 29 +++++++++++++++++++
.../user-app/records/obtain-authorization.mdx | 17 -----------
api-reference/user-app/records/records.yaml | 11 +++----
mint.json | 1 +
4 files changed, 34 insertions(+), 24 deletions(-)
create mode 100644 api-reference/user-app/records/constraints.mdx
diff --git a/api-reference/user-app/records/constraints.mdx b/api-reference/user-app/records/constraints.mdx
new file mode 100644
index 00000000..d9d495ca
--- /dev/null
+++ b/api-reference/user-app/records/constraints.mdx
@@ -0,0 +1,29 @@
+
+ Constraints for File Upload:
+ 1. A client can create a maximum of 20 batches at a time.
+ 2. Each batch can include up to 10 files.
+ 3. All files in a batch must have the same content type.
+
+ Valid Content Types:
+ - Images:
+ - `contentTypeJpg` = "image/jpg"
+ - `contentTypePng` = "image/png"
+ - Documents:
+ - `contentTypePdf` = "application/pdf"
+
+ Valid File Sizes:
+ - Maximum size for PDF files: `pdfMaxSizeMb` = 25 MB
+ - Maximum size for image files: `imageMaxSizeMb` = 10 MB
+
+ Valid Document Types:
+ - The following values are allowed:
+ - `ps`: Prescription
+ - `lr`: Lab Report
+ - `ot`: Other
+ - `ds`: Discharge Summary
+ - `vc`: Vaccine Certificate
+ - `in`: Insurance
+ - `iv`: Invoice
+ - `sc`: Scan
+
+
diff --git a/api-reference/user-app/records/obtain-authorization.mdx b/api-reference/user-app/records/obtain-authorization.mdx
index 8a91998a..bd306406 100644
--- a/api-reference/user-app/records/obtain-authorization.mdx
+++ b/api-reference/user-app/records/obtain-authorization.mdx
@@ -3,20 +3,3 @@ openapi: post /mr/api/v1/docs
---
-
- Constraints for File Upload:
- 1. A client can create a maximum of 20 batches at a time.
- 2. Each batch can include up to 10 files.
- 3. All files in a batch must have the same content type.
-
- Valid Content Types:
- - Images:
- - `contentTypeJpg` = "image/jpg"
- - `contentTypePng` = "image/png"
- - Documents:
- - `contentTypePdf` = "application/pdf"
-
- Valid File Sizes:
- - Maximum size for PDF files: `pdfMaxSizeMb` = 25 MB
- - Maximum size for image files: `imageMaxSizeMb` = 10 MB
-
diff --git a/api-reference/user-app/records/records.yaml b/api-reference/user-app/records/records.yaml
index a4a3d62c..95113ff7 100644
--- a/api-reference/user-app/records/records.yaml
+++ b/api-reference/user-app/records/records.yaml
@@ -37,7 +37,7 @@ paths:
schema:
description: The health ID associated with the record.
examples:
- - test@sbx
+ - test@abdm
type: string
responses:
"200":
@@ -505,9 +505,7 @@ components:
- 1.6145568e+09
type: integer
dt:
- description: 'Specifies the type of document being uploaded. Allowed values:
- ps (Prescription), lr (Lab Report), ot (Other), ds (Discharge Summary),
- vc (Vaccine Certificate), in (Insurance), iv (Invoice), sc (Scan)'
+ description: Specifies the type of document being uploaded.
enum:
- ps
- lr
@@ -539,6 +537,7 @@ components:
type: string
type: array
required:
+ - dt
- files
type: object
RequestFile:
@@ -631,9 +630,7 @@ components:
UpdateRequest:
properties:
dt:
- description: 'Specifies the type of document being uploaded. Allowed values:
- ps (Prescription), lr (Lab Report), ot (Other), ds (Discharge Summary),
- vc (Vaccine Certificate), in (Insurance), iv (Invoice), sc (Scan)'
+ description: Specifies the type of document being uploaded.
enum:
- ps
- lr
diff --git a/mint.json b/mint.json
index e287e682..b89dd095 100644
--- a/mint.json
+++ b/mint.json
@@ -352,6 +352,7 @@
"icon": "up",
"pages": [
"api-reference/user-app/records/upload-record_overview",
+ "api-reference/user-app/records/constraints",
"api-reference/user-app/records/obtain-authorization",
"api-reference/user-app/records/upload-records",
"api-reference/user-app/records/update-record"