From e7f1cb93be6029385d9fe4654ee2e50f6b82f18f Mon Sep 17 00:00:00 2001 From: Mercy Date: Mon, 10 Nov 2025 14:04:00 +0300 Subject: [PATCH 1/5] Create documentation for EAPTS adaptor Add documentation for EAPTS adaptor including overview, functions, and interfaces. --- adaptors/eapts.md | 122 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 adaptors/eapts.md diff --git a/adaptors/eapts.md b/adaptors/eapts.md new file mode 100644 index 000000000000..db54498745fb --- /dev/null +++ b/adaptors/eapts.md @@ -0,0 +1,122 @@ +# EAPTS + +## App Overview + +[EAPTS](https://dhpi.moh.gov.et/project/b7175989-30d8-42d6-a5ee-8d48cbad0c61) (Electronic Asset and Pharmaceutical Tracking System) is a comprehensive pharmaceutical management system used for tracking medicines, medical supplies, and assets in healthcare facilities. The system provides real-time inventory management, prescription tracking, and dispensing unit monitoring capabilities for health programs. + +The **@openfn/language-eapts** adaptor enables seamless integration between OpenFn workflows and EAPTS APIs, allowing you to automate data synchronization, validate prescriptions, monitor stock levels, and manage pharmaceutical supply chains programmatically. + +--- + +## Functions + +### get +`get(path, options) ⇒ Operation` + +Make a GET request + +| Param | Type | Description | +|-------|------|-------------| +| path | `string` | Path to resource | +| options | `RequestOptions` | Optional request options | + +This operation writes the following keys to state: + +| State Key | Description | +|-----------|-------------| +| data | the parsed response body | +| response | the response from the HTTP server, including headers, statusCode, body, etc | +| references | an array of all previous data objects used in the Job | + +**Example: Get a stockout report** +```js +get("DispensingUnit/Dashboard/StockOutReport"); +``` + +--- + +### post +`post(path, body, options) ⇒ Operation` + +Make a POST request + +| Param | Type | Description | +|-------|------|-------------| +| path | `string` | Path to resource | +| body | `object` | Object which will be attached to the POST body | +| options | `RequestOptions` | Optional request options | + +This operation writes the following keys to state: + +| State Key | Description | +|-----------|-------------| +| data | the parsed response body | +| response | the response from the HTTP server, including headers, statusCode, body, etc | +| references | an array of all previous data objects used in the Job | + +**Example** +```js +post("Patient/CheckPrescription", { + "prescriptionRowGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" +}); +``` + +--- + +### request +`request(method, path, body, options) ⇒ Operation` + +Make a general HTTP requests + +| Param | Type | Description | +|-------|------|-------------| +| method | `string` | HTTP method to use | +| path | `string` | Path to resource | +| body | `object` | Object which will be attached to the POST body | +| options | `RequestOptions` | Optional request options | + +This operation writes the following keys to state: + +| State Key | Description | +|-----------|-------------| +| data | the parsed response body | +| response | the response from the HTTP server, including headers, statusCode, body, etc | +| references | an array of all previous data objects used in the Job | + +**Example** +```js +request("POST", "DispensingUnit/Request/History", { "search": {} }); +``` + +--- + +## Interfaces + +### HttpState +State object + +**Properties** + +| Name | Description | +|------|-------------| +| data | the parsed response body | +| response | the response from the HTTP server, including headers, statusCode, body, etc | +| references | an array of all previous data objects used in the Job | + +--- + +### RequestOptions +Options provided to the HTTP request + +**Properties** + +| Name | Type | Description | +|------|------|-------------| +| body | `object` \| `string` | body data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request). | +| errors | `object` | Map of errorCodes -> error messages, ie, `{ 404: 'Resource not found;' }`. Pass `false` to suppress errors for this code. | +| form | `object` | Pass a JSON object to be serialised into a multipart HTML form (as FormData) in the body. | +| query | `object` | An object of query parameters to be encoded into the URL. | +| headers | `object` | An object of headers to append to the request. | +| parseAs | `string` | Parse the response body as json, text or stream. By default will use the response headers. | +| timeout | `number` | Request timeout in ms. Default: 300 seconds. | +| tls | `object` | TLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions | From 81d463cfefb2e491b523f999d6768788c4a41b3b Mon Sep 17 00:00:00 2001 From: Mercy Date: Tue, 11 Nov 2025 13:52:33 +0300 Subject: [PATCH 2/5] Revise EAPTS adaptor documentation Updated documentation for the EAPTS adaptor, including an overview, integration options, and functions. --- adaptors/eapts.md | 131 ++++++++++++++-------------------------------- 1 file changed, 40 insertions(+), 91 deletions(-) diff --git a/adaptors/eapts.md b/adaptors/eapts.md index db54498745fb..d16b86158632 100644 --- a/adaptors/eapts.md +++ b/adaptors/eapts.md @@ -1,122 +1,71 @@ -# EAPTS +--- +title: EAPTS Adaptor +--- -## App Overview +## About EAPTS -[EAPTS](https://dhpi.moh.gov.et/project/b7175989-30d8-42d6-a5ee-8d48cbad0c61) (Electronic Asset and Pharmaceutical Tracking System) is a comprehensive pharmaceutical management system used for tracking medicines, medical supplies, and assets in healthcare facilities. The system provides real-time inventory management, prescription tracking, and dispensing unit monitoring capabilities for health programs. +[EAPTS](https://dhpi.moh.gov.et/project/b7175989-30d8-42d6-a5ee-8d48cbad0c61) (Electronic Asset and Pharmaceutical Tracking System) is a comprehensive pharmaceutical management platform used across healthcare facilities to monitor medicines, medical supplies, and equipment. -The **@openfn/language-eapts** adaptor enables seamless integration between OpenFn workflows and EAPTS APIs, allowing you to automate data synchronization, validate prescriptions, monitor stock levels, and manage pharmaceutical supply chains programmatically. +It provides real-time visibility into inventory, prescription tracking, and dispensing unit performance to strengthen pharmaceutical logistics and health program oversight. ---- +The **@openfn/language-eapts** adaptor enables seamless integration between OpenFn workflows and EAPTS APIs—automating tasks such as: -## Functions +- Synchronizing stock and dispensing data +- Validating prescriptions and patient records +- Generating dashboards or analytics reports +- Monitoring supply chain performance programmatically -### get -`get(path, options) ⇒ Operation` +--- -Make a GET request +## Use OpenFn + EAPTS for Data-Driven Health Workflows -| Param | Type | Description | -|-------|------|-------------| -| path | `string` | Path to resource | -| options | `RequestOptions` | Optional request options | +EAPTS plays a critical role in pharmaceutical inventory control and traceability. +However, managing cross-system data exchange—such as syncing with DHIS2, KoboToolbox, or Salesforce—can be complex. -This operation writes the following keys to state: +**OpenFn workflows bridge this gap**, enabling automated data exchange, real-time validations, and notifications across multiple digital health systems. -| State Key | Description | -|-----------|-------------| -| data | the parsed response body | -| response | the response from the HTTP server, including headers, statusCode, body, etc | -| references | an array of all previous data objects used in the Job | - -**Example: Get a stockout report** -```js -get("DispensingUnit/Dashboard/StockOutReport"); -``` +Example: +> Use OpenFn to fetch updated stock levels from EAPTS nightly and automatically sync them with your national reporting system. --- -### post -`post(path, body, options) ⇒ Operation` +## Integration Options -Make a POST request +Use this adaptor to connect to the **EAPTS API**, enabling your workflows to make authenticated HTTP requests for retrieving or sending data related to medicines, stock reports, or prescription validations. -| Param | Type | Description | -|-------|------|-------------| -| path | `string` | Path to resource | -| body | `object` | Object which will be attached to the POST body | -| options | `RequestOptions` | Optional request options | +Typical workflow example: -This operation writes the following keys to state: +_Coming soon !!!_ -| State Key | Description | -|-----------|-------------| -| data | the parsed response body | -| response | the response from the HTTP server, including headers, statusCode, body, etc | -| references | an array of all previous data objects used in the Job | +--- -**Example** -```js -post("Patient/CheckPrescription", { - "prescriptionRowGuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" -}); -``` +## Authentication + +See this adaptor’s +[Configuration docs](https://docs.openfn.org/adaptors/packages/eapts-configuration-schema) +for details on the authentication parameters required to connect securely to the EAPTS API. --- -### request -`request(method, path, body, options) ⇒ Operation` +## Functions + +### `get(path, options) ⇒ Operation` -Make a general HTTP requests +Make a GET request to fetch data from EAPTS. | Param | Type | Description | |-------|------|-------------| -| method | `string` | HTTP method to use | -| path | `string` | Path to resource | -| body | `object` | Object which will be attached to the POST body | -| options | `RequestOptions` | Optional request options | +| path | `string` | Path to the API resource | +| options | `RequestOptions` | Optional request parameters | -This operation writes the following keys to state: +**Writes to state:** | State Key | Description | |-----------|-------------| -| data | the parsed response body | -| response | the response from the HTTP server, including headers, statusCode, body, etc | -| references | an array of all previous data objects used in the Job | +| data | Parsed response body | +| response | HTTP response (headers, statusCode, body, etc.) | +| references | Array of previous data objects used in the Job | -**Example** +**Example: Get a stockout report** ```js -request("POST", "DispensingUnit/Request/History", { "search": {} }); -``` - ---- - -## Interfaces - -### HttpState -State object - -**Properties** - -| Name | Description | -|------|-------------| -| data | the parsed response body | -| response | the response from the HTTP server, including headers, statusCode, body, etc | -| references | an array of all previous data objects used in the Job | - ---- - -### RequestOptions -Options provided to the HTTP request - -**Properties** - -| Name | Type | Description | -|------|------|-------------| -| body | `object` \| `string` | body data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request). | -| errors | `object` | Map of errorCodes -> error messages, ie, `{ 404: 'Resource not found;' }`. Pass `false` to suppress errors for this code. | -| form | `object` | Pass a JSON object to be serialised into a multipart HTML form (as FormData) in the body. | -| query | `object` | An object of query parameters to be encoded into the URL. | -| headers | `object` | An object of headers to append to the request. | -| parseAs | `string` | Parse the response body as json, text or stream. By default will use the response headers. | -| timeout | `number` | Request timeout in ms. Default: 300 seconds. | -| tls | `object` | TLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions | +get("DispensingUnit/Dashboard/StockOutReport"); From 10c793e84943f5ddf3fc1501bf50a70ecebeffe4 Mon Sep 17 00:00:00 2001 From: Mercy Date: Wed, 12 Nov 2025 19:55:03 +0300 Subject: [PATCH 3/5] Updated eapts.md --- adaptors/eapts.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/adaptors/eapts.md b/adaptors/eapts.md index d16b86158632..306e260f257c 100644 --- a/adaptors/eapts.md +++ b/adaptors/eapts.md @@ -32,40 +32,3 @@ Example: ## Integration Options Use this adaptor to connect to the **EAPTS API**, enabling your workflows to make authenticated HTTP requests for retrieving or sending data related to medicines, stock reports, or prescription validations. - -Typical workflow example: - -_Coming soon !!!_ - ---- - -## Authentication - -See this adaptor’s -[Configuration docs](https://docs.openfn.org/adaptors/packages/eapts-configuration-schema) -for details on the authentication parameters required to connect securely to the EAPTS API. - ---- - -## Functions - -### `get(path, options) ⇒ Operation` - -Make a GET request to fetch data from EAPTS. - -| Param | Type | Description | -|-------|------|-------------| -| path | `string` | Path to the API resource | -| options | `RequestOptions` | Optional request parameters | - -**Writes to state:** - -| State Key | Description | -|-----------|-------------| -| data | Parsed response body | -| response | HTTP response (headers, statusCode, body, etc.) | -| references | Array of previous data objects used in the Job | - -**Example: Get a stockout report** -```js -get("DispensingUnit/Dashboard/StockOutReport"); From 7687e2b93838e56fb7a21bec3ace360865fc3eb8 Mon Sep 17 00:00:00 2001 From: Mercy Date: Wed, 12 Nov 2025 19:55:50 +0300 Subject: [PATCH 4/5] Update eapts.md --- adaptors/eapts.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/adaptors/eapts.md b/adaptors/eapts.md index 306e260f257c..aa425449d104 100644 --- a/adaptors/eapts.md +++ b/adaptors/eapts.md @@ -15,7 +15,6 @@ The **@openfn/language-eapts** adaptor enables seamless integration between Open - Generating dashboards or analytics reports - Monitoring supply chain performance programmatically ---- ## Use OpenFn + EAPTS for Data-Driven Health Workflows @@ -27,7 +26,6 @@ However, managing cross-system data exchange—such as syncing with DHIS2, KoboT Example: > Use OpenFn to fetch updated stock levels from EAPTS nightly and automatically sync them with your national reporting system. ---- ## Integration Options From 1d3071a910974ef2b73f4f555a6873765b3f529d Mon Sep 17 00:00:00 2001 From: Mercy Date: Wed, 12 Nov 2025 20:32:25 +0300 Subject: [PATCH 5/5] Updated eapts.md --- adaptors/eapts.md | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/adaptors/eapts.md b/adaptors/eapts.md index aa425449d104..c02b6fed85bf 100644 --- a/adaptors/eapts.md +++ b/adaptors/eapts.md @@ -4,29 +4,44 @@ title: EAPTS Adaptor ## About EAPTS -[EAPTS](https://dhpi.moh.gov.et/project/b7175989-30d8-42d6-a5ee-8d48cbad0c61) (Electronic Asset and Pharmaceutical Tracking System) is a comprehensive pharmaceutical management platform used across healthcare facilities to monitor medicines, medical supplies, and equipment. +[EAPTS](https://dhpi.moh.gov.et/project/b7175989-30d8-42d6-a5ee-8d48cbad0c61) (Electronic Asset and Pharmaceutical Tracking System) is a comprehensive pharmaceutical management platform used across healthcare facilities in Ethiopia to monitor medicines, medical supplies, and equipment. EAPTS provides real-time visibility into inventory levels, prescription tracking, and dispensing unit performance to strengthen pharmaceutical logistics and health program oversight. -It provides real-time visibility into inventory, prescription tracking, and dispensing unit performance to strengthen pharmaceutical logistics and health program oversight. +## Integration Options -The **@openfn/language-eapts** adaptor enables seamless integration between OpenFn workflows and EAPTS APIs—automating tasks such as: +EAPTS supports integration through its REST API, which enables external services like OpenFn to: -- Synchronizing stock and dispensing data -- Validating prescriptions and patient records -- Generating dashboards or analytics reports -- Monitoring supply chain performance programmatically +1. **REST API**: Pull data from EAPTS or push data from external applications to EAPTS. This API allows you to synchronize stock and dispensing data, validate prescriptions and patient records, generate dashboards or analytics reports, and monitor supply chain performance programmatically. This option is suited for scheduled, bulk syncs, automated nightly stock level updates to national reporting systems, real-time prescription validations, or workflows that need to exchange data between EAPTS and other health information systems such as DHIS2, KoboToolbox, or Salesforce. See [functions](https://docs.openfn.org/adaptors/packages/eapts-docs) for more on how to use this adaptor to work with the API. +2. **Data Export**: Export pharmaceutical inventory, dispensing records, and stock reports for analysis and integration with external systems like DHIS2, national health databases, or reporting platforms. -## Use OpenFn + EAPTS for Data-Driven Health Workflows +## Authentication -EAPTS plays a critical role in pharmaceutical inventory control and traceability. -However, managing cross-system data exchange—such as syncing with DHIS2, KoboToolbox, or Salesforce—can be complex. +When integrating with EAPTS via OpenFn, the primary authentication method supported is: -**OpenFn workflows bridge this gap**, enabling automated data exchange, real-time validations, and notifications across multiple digital health systems. +**API Token Authentication**. See this adaptor's [Configuration docs](https://docs.openfn.org/adaptors/packages/eapts-configuration-schema) for more on required authentication parameters. -Example: -> Use OpenFn to fetch updated stock levels from EAPTS nightly and automatically sync them with your national reporting system. +See platform docs on [managing credentials](https://docs.openfn.org/documentation/manage-projects/manage-credentials) for how to configure a credential in OpenFn. +If working locally or if using a Raw JSON credential type, then your configuration will look something like this: +```json +{ + "baseUrl": "https://your-eapts-instance.example.com", + "apiToken": "sk_test_53iburgn5yb3u4nfufg477365gbvrnv348r475gf4bf485845gbrf" +} +``` -## Integration Options +**Required Fields:** +- `baseUrl`: The base URL of your EAPTS instance (e.g., `https://example.com`) +- `apiToken`: The API token for authenticating requests to EAPTS + +### Helpful Links + +1. [EAPTS Platform](https://dhpi.moh.gov.et/project/b7175989-30d8-42d6-a5ee-8d48cbad0c61) +2. [OpenFn EAPTS Adaptor](https://docs.openfn.org/adaptors/packages/eapts-readme) +3. [EAPTS Configuration Schema](https://docs.openfn.org/adaptors/packages/eapts-configuration-schema) + +### I've noticed a problem with this Adaptor, or something is out of date, what can I do? + +Thanks for asking! We are a fully Open Source Digital Public Good, and we welcome contributions from our community. Check out our [Adaptors Wiki](https://github.com/OpenFn/adaptors/wiki) for more information on how you can update Adaptors! -Use this adaptor to connect to the **EAPTS API**, enabling your workflows to make authenticated HTTP requests for retrieving or sending data related to medicines, stock reports, or prescription validations. +Or, you can always reach out to the Community through our [Community Forum here](https://community.openfn.org/).