diff --git a/docs.json b/docs.json index d87d6e28..d3718cff 100644 --- a/docs.json +++ b/docs.json @@ -19,11 +19,7 @@ "groups": [ { "group": "Eka Care Developer API guide", - "pages": [ - "introduction", - "abdm-connect", - "getting-started" - ] + "pages": ["introduction", "abdm-connect", "getting-started"] } ] }, @@ -111,9 +107,7 @@ { "group": "Actors", "icon": "user", - "pages": [ - "api-reference/doc-tool/Actors/actors" - ] + "pages": ["api-reference/doc-tool/Actors/actors"] }, { "group": "Instructions", @@ -174,9 +168,7 @@ { "group": "Notify", "icon": "bell", - "pages": [ - "api-reference/doc-tool/notify/notify" - ] + "pages": ["api-reference/doc-tool/notify/notify"] }, { "group": "Webhooks", @@ -385,9 +377,7 @@ { "group": "Errors", "icon": "circle-exclamation", - "pages": [ - "api-reference/user-app/abdm-connect/errors" - ] + "pages": ["api-reference/user-app/abdm-connect/errors"] } ] }, @@ -411,7 +401,6 @@ "pages": [ "api-reference/eka_mcp/medications/search", "api-reference/eka_mcp/medications/interactions" - ] } ] @@ -458,9 +447,7 @@ { "group": "Webhooks", "icon": "webhook", - "pages": [ - "api-reference/user-app/records/smart-report" - ] + "pages": ["api-reference/user-app/records/smart-report"] } ] }, @@ -487,16 +474,12 @@ { "group": "Webhooks", "icon": "webhook", - "pages": [ - "api-reference/user-app/webhook/right-to-access" - ] + "pages": ["api-reference/user-app/webhook/right-to-access"] }, { "group": "Privacy", "icon": "shield-halved", - "pages": [ - "api-reference/user-app/privacy/right-to-access" - ] + "pages": ["api-reference/user-app/privacy/right-to-access"] } ] }, @@ -533,9 +516,7 @@ }, { "group": "Medical Speech Understanding", - "pages": [ - "eka-medai/technologies/medical-scribe" - ] + "pages": ["eka-medai/technologies/medical-scribe"] }, { "group": "Clinical Text Processing", @@ -556,10 +537,7 @@ }, { "group": "Highlights", - "pages": [ - "eka-medai/spotlight", - "eka-medai/datasets" - ] + "pages": ["eka-medai/spotlight", "eka-medai/datasets"] } ] }, @@ -575,8 +553,16 @@ }, { "group": "iOS", + "pages": ["mobile-sdk/ios/medical-records"] + }, + { + "group": "Web", "pages": [ - "mobile-sdk/ios/medical-records" + { + "group": "Self Assessments", + "icon": "comments-question-check", + "pages": ["mobile-sdk/web/assessments/how-to-use"] + } ] } ] diff --git a/mint.json b/mint.json index a952d127..afe81b25 100644 --- a/mint.json +++ b/mint.json @@ -53,11 +53,7 @@ "navigation": [ { "group": "Eka Care Developer API guide", - "pages": [ - "introduction", - "abdm-connect", - "getting-started" - ] + "pages": ["introduction", "abdm-connect", "getting-started"] }, { "group": "Authorization", @@ -78,8 +74,16 @@ }, { "group": "iOS", + "pages": ["mobile-sdk/ios/medical-records"] + }, + { + "group": "Web", "pages": [ - "mobile-sdk/ios/medical-records" + { + "group": "Self Assessments", + "icon": "comments-question-check", + "pages": ["mobile-sdk/web/assessments/how-to-use"] + } ] }, { @@ -99,9 +103,7 @@ }, { "group": "Medical Speech Understanding", - "pages": [ - "eka-medai/technologies/medical-scribe" - ] + "pages": ["eka-medai/technologies/medical-scribe"] }, { "group": "Clinical Text Processing", @@ -119,15 +121,11 @@ }, "eka-medai/technologies/health-bot" - ] }, { "group": "Highlights", - "pages": [ - "eka-medai/spotlight", - "eka-medai/datasets" - ] + "pages": ["eka-medai/spotlight", "eka-medai/datasets"] }, { "group": "Connect", @@ -141,7 +139,6 @@ "api-reference/connect/webhooks/register-webhook", "api-reference/connect/webhooks/get-webhooks", "api-reference/connect/webhooks/delete-webhook" - ] } ] @@ -201,16 +198,12 @@ { "group": "Actors", "icon": "user", - "pages": [ - "api-reference/doc-tool/Actors/actors" - ] + "pages": ["api-reference/doc-tool/Actors/actors"] }, { "group": "Instructions", "icon": "star", - "pages": [ - "api-reference/doc-tool/Instructions/before-you-begin" - ] + "pages": ["api-reference/doc-tool/Instructions/before-you-begin"] }, { "group": "Patient Registration API", @@ -250,9 +243,7 @@ { "group": "Payments API", "icon": "money-bill-wave", - "pages": [ - "api-reference/doc-tool/payment-api/get-transaction-status" - ] + "pages": ["api-reference/doc-tool/payment-api/get-transaction-status"] }, { "group": "Prescription API", @@ -264,9 +255,7 @@ { "group": "Notify", "icon": "bell", - "pages": [ - "api-reference/doc-tool/notify/notify" - ] + "pages": ["api-reference/doc-tool/notify/notify"] }, { "group": "Webhooks", @@ -289,9 +278,7 @@ { "group": "Doctor", "icon": "stethoscope", - "pages": [ - "api-reference/doc-tool/post_webhooks/doctor-webhook" - ] + "pages": ["api-reference/doc-tool/post_webhooks/doctor-webhook"] } ] } @@ -343,19 +330,19 @@ "api-reference/user-app/abdm-connect/login/login" ] }, - { - "group": "Commons", - "icon": "tape", - "pages": [ - "api-reference/user-app/abdm-connect/commons/does-health-id-exist", - "api-reference/user-app/abdm-connect/commons/pincode-details", - "api-reference/user-app/abdm-connect/commons/suggest-abha-address" - ] - } + { + "group": "Commons", + "icon": "tape", + "pages": [ + "api-reference/user-app/abdm-connect/commons/does-health-id-exist", + "api-reference/user-app/abdm-connect/commons/pincode-details", + "api-reference/user-app/abdm-connect/commons/suggest-abha-address" + ] + } ] - }, + }, - { + { "group": "User Session", "icon": "user-shield", "pages": [ @@ -472,12 +459,11 @@ "api-reference/user-app/abdm-connect/scan-and-share/getting-started", "api-reference/user-app/abdm-connect/scan-and-share/scanandshare" ] - },{ + }, + { "group": "Errors", "icon": "circle-exclamation", - "pages": [ - "api-reference/user-app/abdm-connect/errors" - ] + "pages": ["api-reference/user-app/abdm-connect/errors"] } ] }, @@ -523,9 +509,7 @@ { "group": "Webhooks", "icon": "webhook", - "pages": [ - "api-reference/user-app/records/smart-report" - ] + "pages": ["api-reference/user-app/records/smart-report"] } ] }, @@ -549,7 +533,6 @@ "pages": [ "api-reference/eka_mcp/medications/search", "api-reference/eka_mcp/medications/interactions" - ] } ] @@ -575,18 +558,14 @@ ] }, { - "group": "Webhooks", + "group": "Webhooks", "icon": "webhook", - "pages": [ - "api-reference/user-app/webhook/right-to-access" - ] + "pages": ["api-reference/user-app/webhook/right-to-access"] }, { "group": "Privacy", "icon": "shield-halved", - "pages": [ - "api-reference/user-app/privacy/right-to-access" - ] + "pages": ["api-reference/user-app/privacy/right-to-access"] } ] }, @@ -595,9 +574,7 @@ "pages": [ { "group": "ABDM Connect", - "pages": [ - "api-reference/user-app/abdm-connect/release-notes" - ] + "pages": ["api-reference/user-app/abdm-connect/release-notes"] } ] } diff --git a/mobile-sdk/web/assessments/how-to-use.mdx b/mobile-sdk/web/assessments/how-to-use.mdx new file mode 100644 index 00000000..17014a22 --- /dev/null +++ b/mobile-sdk/web/assessments/how-to-use.mdx @@ -0,0 +1,163 @@ +# Integration Guide + +To integrate the SDK into your application, follow these steps: + +## Step 1: Add the JavaScript File + +Include the following JavaScript file in the header of your HTML: + +```html + +``` + +**Note**: The required CSS is automatically injected, so there is no need to include a separate stylesheet. This happens internally (see main.tsx line 132). + +**Optional CSS Usage** +Though the CSS is injected automatically, you can include it manually if needed: + +```html + +``` + +## Step 2: Initialize the SDK + +The SDK will add a function to the `window` object called `runSaApp`. + +You can call this function to run SA app as shown below: + +```javascript +window.runSaApp({ + workflow_id: 1234, // Replace with your actual workflow ID + container_id: "sa-container", + auth_token: developerAuthInitData.data.access_token, + refresh_token: developerAuthInitData.data.refresh_token, + params: { + gender: "M", // "M" for Male, "F" for Female, "O" for Other + age: 30, // Replace with the user's age + }, + onEndCallback: ({ success, data, error }) => { + // Handle the callback here + }, + // Optional parameters: + practice_info: { + practitioner_uuid: "your-practitioner-uuid", + patient_uuid: "your-patient-uuid", + unique_identifier: "optional-unique-identifier", + }, + onSaRedirectCallback: ({ success, data, error }) => { + // Handle the redirect callback here + }, + onSaSubmitCallback: ({ data, error }) => { + // Handle the redirect callback here + }, +}); +``` + +You can call this function to show SA submissions as shown below: + +```javascript +window.showSaSubmission({ + container_id: "sa-container", + auth_token: developerAuthInitData.data.access_token, + refresh_token: developerAuthInitData.data.refresh_token, + assessment_ids: ["sa_25010214342273227", "sa_24122717143498525"], // Replace with your actual assessment ID +}); +``` + +## Additional Global Functions + +You can manually close the SA app or the SA submission flow if needed: + +```javascript +window.closeSaApp(); +window.closeSaSubmissionApp(); +``` + +## onSaSubmitCallback + +The `onSaSubmitCallback` is called immediately after a successful SA submission. This callback receives an object containing the following information: + +```typescript +(params: { + data?: { + assessment_id: string; // The unique ID of the submitted assessment + workflow_id: number; // The workflow ID associated with the submission + }; + error?: string; // An error message if the submission failed +}) => void; +``` + +## Using onCopyToRxPad + +You can optionally pass a callback function for copying data to an Rx Pad: + +```javascript +window.showSaSubmission({ + container_id: "sa-container", + auth_token: developerAuthInitData.data.access_token, + refresh_token: developerAuthInitData.data.refresh_token, + assessment_ids: ["sa_25010214342273227", "sa_24122717143498525"], // Replace with your actual assessment ID + onCopyToRxPad: ({ fhirData, title }) => { + // Handle FHIR data as needed + }, +}); +``` + +## Example + +Here is a complete example of how to integrate the SDK: + +```html + + + + + + SDK Integration + + + +
+ + + +```