@awell-health/awell-extensions 2.1.166 → 2.1.168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/markdown.json +1 -1
- package/dist/extensions/metriport/actions/facility/dataPoints.d.ts +46 -0
- package/dist/extensions/metriport/actions/facility/dataPoints.js +28 -0
- package/dist/extensions/metriport/actions/facility/dataPoints.js.map +1 -0
- package/dist/extensions/metriport/actions/facility/fields.d.ts +10 -0
- package/dist/extensions/metriport/actions/facility/fields.js +14 -0
- package/dist/extensions/metriport/actions/facility/fields.js.map +1 -0
- package/dist/extensions/metriport/actions/facility/getFacilityByName.d.ts +5 -0
- package/dist/extensions/metriport/actions/facility/getFacilityByName.js +78 -0
- package/dist/extensions/metriport/actions/facility/getFacilityByName.js.map +1 -0
- package/dist/extensions/metriport/actions/facility/validation.d.ts +4 -0
- package/dist/extensions/metriport/actions/facility/validation.js +11 -0
- package/dist/extensions/metriport/actions/facility/validation.js.map +1 -0
- package/dist/extensions/metriport/actions/index.d.ts +38 -0
- package/dist/extensions/metriport/actions/index.js +2 -0
- package/dist/extensions/metriport/actions/index.js.map +1 -1
- package/dist/src/test-server.js +2 -0
- package/dist/src/test-server.js.map +1 -1
- package/package.json +2 -1
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"changelog": "# MessageBird changelog"
|
|
161
161
|
},
|
|
162
162
|
"metriport": {
|
|
163
|
-
"readme": "---\ntitle: Metriport\ndescription: Metriport is Plaid for healthcare data.\n---\n# Metriport\n\nMetriport is Plaid for healthcare data. We help digital health companies access and manage patient health and medical data, through an open-source and universal API.\n\nThrough a single integration, our API enables modern health companies to get the comprehensive patient data they need from both HIEs and EHRs, as well as popular wearable devices.\n\nAs a developer-first interoperability solution, Metriport is powering the next wave of innovative companies, accelerating a revolution in digital health.\n\nTo learn more visit [https://www.metriport.com/](https://www.metriport.com/)\n# Extension settings\n\nIn order to set up this extension, **you will need to provide a Metriport API key**. You can obtain an API key via the Metriport dashboard by selecting the `Developers tab`. To learn more on how to get started with Metriport visit our [quick start docs](https://docs.metriport.com/medical-api/getting-started/quickstart) for our Medical API. Also, to better understand how our API keys work check out the [API Keys section](https://docs.metriport.com/home/api-info/api-keys) of our docs as well.\n\n# Custom Actions\n\n**GENERAL NOTE: Make sure to create Organizations and Facilities in Metriport before using this extension. A Patient must be associated with a Facility by providing the facilityId when stated in the actions.**\n\n## Create Patient\n\nCreates a Patient in Metriport for the specified Facility where the Patient is receiving care.\n\nOptionally, providing a **Cohort** ID enrolls the Patient in real-time monitoring by adding them to that cohort. Note that enrolling a Patient in real-time monitoring has downstream consequences: once you start receiving updates about the Patient, you are expected to contribute data back to Metriport.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/patient/create-patient) for more info.\n\n## Update Patient\n\nUpdates the specified Patient.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/patient/update-patient) for more info.\n\n## Get Patient\n\nRetrieves the specified Patient.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/patient/get-patient) for more info.\n\n## Remove Patient\n\nRemoves a Patient at Metriport and at HIEs the Patient is linked to.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/patient/delete-patient) for more info.\n\n## List Documents\n\nLists all Documents that can be retrieved for a Patient.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/document/list-documents) for more info.\n\n**NOTE: It also returns the status of querying Document references across HIEs, indicating whether there is an asynchronous query in progress (status processing) or not (status completed). If the query is in progress, you will also receive the total number of Documents to be queried as well as the ones that have already been completed.**\n\n## Query Documents\n\nTriggers a Document query for the specified Patient across HIEs.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/document/start-document-query) for more info.\n\n**NOTE: When executed, this endpoint triggers an asynchronous Document query with HIEs and immediately returns the status of Document query, processing .**\n\n## Get Document Url\n\nGets a presigned URL for downloading the specified Document.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/document/get-document) for more info.\n\n**NOTE: This endpoint returns a URL which you can use to download the specified Document using the file name provided from the List Documents endpoint.**\n\n## Remove Patient from Cohort\n\nRemoves the specified Patient from a cohort.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/cohort/remove-patients-from-cohort) for more info.\n\n## Get Webhook Bundle\n\nFetches the FHIR bundle from a Metriport webhook payload URL — e.g. the [Encounter Bundle](https://docs.metriport.com/medical-api/handling-data/patient-encounter-bundle) from an ADT notification, or a discharge summary. Pass the `bundleUrl` data point emitted by the **Realtime Update** webhook; the action downloads the bundle and returns it on the `bundle` data point.\n\nWhen the payload is a Patient Encounter Bundle, the action also rewrites it into an executable FHIR transaction and returns that on the `transactionBundle` data point, ready to hand to the Medplum **Find or create resource** action.\n\nThe Encounter's Metriport id is returned separately on the `encounterId` data point, so a later step can address the imported Encounter without re-parsing the bundle.\n\n**NOTE: Metriport pre-signed URLs are only valid for 10 minutes, so this action should run early in the care flow, shortly after the realtime update webhook fires.**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `url` | string | The pre-signed payload URL to fetch (the webhook's `bundleUrl` data point). |\n| `eventType` | string (optional) | The Metriport notification type — wire this from the realtime update webhook's `eventType` data point. Recorded on the import Provenance so admit, transfer and discharge can be told apart. |\n| `provenanceReason` | text (optional) | Free-text reason recorded on the import Provenance, describing why the data was imported. |\n\n| Data point | Type | Description |\n| --- | --- | --- |\n| `bundle` | json | The FHIR bundle fetched from the URL, exactly as Metriport sent it. |\n| `transactionBundle` | json | The same data rewritten as an executable FHIR transaction. Omitted when the payload is not a Patient Encounter Bundle. |\n| `encounterId` | string | Metriport's UUID for the Encounter in the bundle. Resolve the imported Encounter in Medplum with `Encounter?identifier=https://metriport.com/fhir/encounter\\|<encounterId>`. Omitted when the bundle carries no Encounter. |\n\n### Building the transaction bundle\n\nMetriport delivers a bundle of `type: 'collection'`, which is **not executable**. Handing it straight to Medplum does nothing useful: no entry carries `request` metadata saying what to do with it, and every internal reference points at a Metriport UUID that means nothing in Medplum. The action therefore builds a second, executable bundle rather than passing the original through.\n\nThe transformation is a pure function with no Medplum access of its own — this extension holds Metriport credentials only. That rules out reading Medplum to reconcile against what is already there, so every lookup is expressed declaratively and resolved by the server when the transaction executes.\n\n**The Patient is never written.** Awell/Medplum is the source of truth for patient demographics, so the Patient entry is dropped entirely and every reference to it becomes a conditional reference:\n\n```\nPatient?identifier=https://awellhealth.com/patients|<awell patient id>\n```\n\nOmitting the entry guarantees structurally that a Metriport ADT feed can never overwrite the patient record.\n\n**Everything else is written idempotently.** Each Metriport resource is stamped with an identifier derived from its Metriport id and written with a conditional update:\n\n```\nidentifier: { system: 'https://metriport.com/fhir/encounter', value: '<metriport id>' }\nrequest: PUT Encounter?identifier=https://metriport.com/fhir/encounter|<metriport id>\n```\n\nA conditional update creates on zero matches and updates on one, so a redelivered notification updates in place instead of duplicating Conditions, Observations, Practitioners and Locations — and the admit and discharge notifications for one visit converge on a single Encounter. Existing identifiers are kept, so the Encounter keeps its HL7 `VN` visit number alongside ours.\n\n**References are rewritten to Metriport's own `fullUrl`s.** Metriport resolves its relationships correctly, but emits them in a form FHIR cannot match: entries carry `urn:uuid:` fullUrls while references to them are relative.\n\n```\nfullUrl: urn:uuid:3ca5e8d2-7c84-45ab-91e7-834f8becde12\nreference: Location/3ca5e8d2-7c84-45ab-91e7-834f8becde12\n```\n\nA transaction resolves an internal reference by matching it against `fullUrl` verbatim, and a relative reference does not match a `urn:uuid:` one — Medplum would read it as a reference to a *Medplum* Location with that id, which does not exist. Rewriting the reference to the entry's `fullUrl` closes the gap while keeping Metriport's identity. This is also why the result is a `transaction` and not a `batch`: `urn:uuid` resolution is a transaction feature.\n\n**`meta` is stripped from every resource.** Medplum's `meta.accounts` is inherited from the compartment of the Patient a resource references, but specifying `meta` at all on a create or update replaces those inherited accounts instead of adding to them. Metriport's Encounter arrives with a `meta`, so it is removed. `resource.id` is dropped too, for a separate reason: Medplum assigns identity, and the entry's `fullUrl` already carries the local identity the transaction needs.\n\n**Two entries are synthesised.** An `Organization` named *Metriport Realtime Monitoring*, created with `ifNoneExist` so an existing one is reused rather than overwritten; and a `Provenance` recording the import — what it created, when, which Metriport bundle it came from, and which ADT event triggered it (`patient.admit` → `A01`, `patient.transfer` → `A02`, `patient.discharge` → `A03`).\n\n`extensions/metriport/actions/webhookBundle/bundle/transform.test.ts` asserts the complete output for a real `patient.admit` bundle, if you want to see the whole before/after in one place.\n\n### Wiring it into a care flow\n\n1. **Realtime Update** webhook fires and emits `bundleUrl` and `eventType`.\n2. **Get Webhook Bundle** — pass `bundleUrl` to `url` and `eventType` to `eventType`. Run this early; the URL expires after 10 minutes.\n3. Medplum **Find or create resource** — pass the `transactionBundle` data point to its `resourceJson` field. No changes to that action are needed; it detects a Bundle and executes it.\n\n**PREREQUISITE: for imported resources to be tagged with the Metriport organization, the Medplum Patient must already carry it in `meta.accounts` before the notification arrives.** Resources created without a `meta` inherit their accounts from the compartment of the Patient they reference, so tagging the Patient once causes every subsequent import to inherit it automatically. Note that this only covers resources *in* the patient compartment — `Location` and `Practitioner` are shared directory resources and are intentionally created untagged, since scoping a hospital or a physician to one patient's tenant would be wrong.\n\n**NOTE: the conditional Patient reference only resolves if your Medplum Patients carry an identifier under the `https://awellhealth.com/patients` system with the Awell patient id as its value. A conditional reference that matches no Patient fails the whole transaction.**\n\n### When the transaction bundle is omitted\n\n`Get Webhook Bundle` serves several Metriport webhook types and only ADT notifications carry encounter bundles. For any payload that is not a `collection` bundle, `transactionBundle` is simply omitted and `bundle` is emitted on its own — the action still succeeds.\n\nA `collection` bundle that is missing its Patient or Encounter entry is treated differently: that is an encounter bundle which does not describe an encounter, so the action **fails** rather than silently emitting a partial result.\n\n# Webhooks\n\n## Realtime Update\n\nAn enrollment trigger that starts a care flow when Metriport sends a [real-time patient notification](https://docs.metriport.com/medical-api/handling-data/realtime-patient-notifications).\n\nMetriport POSTs every notification type to the same endpoint. Four of them share one payload shape — a `meta` envelope plus a `payload` pointing at a pre-signed bundle URL — and this webhook enrolls a patient on all four:\n\n- `patient.admit` (HL7 ADT^A01)\n- `patient.discharge` (HL7 ADT^A03)\n- `patient.transfer` (HL7 ADT^A02)\n- `medical.discharge-summary`\n\nThe `eventType` data point carries the raw Metriport webhook type, so a care flow can branch on it. The payload's `url` is a pre-signed link to the [FHIR Encounter Bundle](https://docs.metriport.com/medical-api/handling-data/patient-encounter-bundle).\n\nThe webhook validates the request, emits the data points (including the pre-signed bundle URL on `bundleUrl`), and replies immediately — it does **not** download the bundle. Fetch the bundle later in the care flow with the **Get Webhook Bundle** action, using the `bundleUrl` data point. Because the URL expires after 10 minutes, run that action early.\n\nAny other notification type Metriport sends — `medical.document-download`, `medical.consolidated-data`, and anything added in future — is acknowledged with a `200` and does not enroll a patient. A notification whose type *is* handled but whose payload is malformed fails loudly instead, so a genuine integration problem is not mistaken for an event we chose to ignore. Metriport [verification `ping` messages](https://docs.metriport.com/medical-api/getting-started/webhooks#the-ping-message) are answered with a `200` that echoes the ping value back as `pong: <value>`.\n\n### Data points\n\n| Data point | Type | Description |\n| --- | --- | --- |\n| `eventType` | string | The Metriport webhook type: `patient.admit`, `patient.discharge`, `patient.transfer` or `medical.discharge-summary` |\n| `metriportPatientId` | string | The Metriport patient ID (also used as the patient identifier for enrollment) |\n| `externalId` | string | Your external patient ID, if provided to Metriport |\n| `when` | date | When the event occurred — the admit time on an admit event, the discharge time on a discharge event |\n| `messageId` | string | The Metriport message ID for the notification |\n| `bundleUrl` | string | Pre-signed URL to the FHIR bundle; fetch it with the **Get Webhook Bundle** action (valid for 10 minutes) |\n\n### Verifying incoming requests\n\nOptionally set the **Webhook Key** setting to the webhook key from the Metriport dashboard (Settings/Developers tab). Metriport [authenticates each webhook](https://docs.metriport.com/medical-api/getting-started/webhooks#authentication) with an HMAC-SHA256 signature of the raw request body, keyed with your webhook key and sent in the `x-metriport-signature` header. When the setting is populated, the webhook recomputes the HMAC over the raw body and rejects any request whose signature is missing or does not match (`401`). When left empty, requests are not verified.\n\n## More Info\n\nFor more information on how to integrate with Metriport please visit our [Medical API docs](https://docs.metriport.com/medical-api/getting-started/quickstart)\n",
|
|
163
|
+
"readme": "---\ntitle: Metriport\ndescription: Metriport is Plaid for healthcare data.\n---\n# Metriport\n\nMetriport is Plaid for healthcare data. We help digital health companies access and manage patient health and medical data, through an open-source and universal API.\n\nThrough a single integration, our API enables modern health companies to get the comprehensive patient data they need from both HIEs and EHRs, as well as popular wearable devices.\n\nAs a developer-first interoperability solution, Metriport is powering the next wave of innovative companies, accelerating a revolution in digital health.\n\nTo learn more visit [https://www.metriport.com/](https://www.metriport.com/)\n# Extension settings\n\nIn order to set up this extension, **you will need to provide a Metriport API key**. You can obtain an API key via the Metriport dashboard by selecting the `Developers tab`. To learn more on how to get started with Metriport visit our [quick start docs](https://docs.metriport.com/medical-api/getting-started/quickstart) for our Medical API. Also, to better understand how our API keys work check out the [API Keys section](https://docs.metriport.com/home/api-info/api-keys) of our docs as well.\n\n# Custom Actions\n\n**GENERAL NOTE: Make sure to create Organizations and Facilities in Metriport before using this extension. A Patient must be associated with a Facility by providing the facilityId when stated in the actions.**\n\n## Create Patient\n\nCreates a Patient in Metriport for the specified Facility where the Patient is receiving care.\n\nOptionally, providing a **Cohort** ID enrolls the Patient in real-time monitoring by adding them to that cohort. Note that enrolling a Patient in real-time monitoring has downstream consequences: once you start receiving updates about the Patient, you are expected to contribute data back to Metriport.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/patient/create-patient) for more info.\n\n## Update Patient\n\nUpdates the specified Patient.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/patient/update-patient) for more info.\n\n## Get Patient\n\nRetrieves the specified Patient.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/patient/get-patient) for more info.\n\n## Remove Patient\n\nRemoves a Patient at Metriport and at HIEs the Patient is linked to.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/patient/delete-patient) for more info.\n\n## List Documents\n\nLists all Documents that can be retrieved for a Patient.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/document/list-documents) for more info.\n\n**NOTE: It also returns the status of querying Document references across HIEs, indicating whether there is an asynchronous query in progress (status processing) or not (status completed). If the query is in progress, you will also receive the total number of Documents to be queried as well as the ones that have already been completed.**\n\n## Query Documents\n\nTriggers a Document query for the specified Patient across HIEs.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/document/start-document-query) for more info.\n\n**NOTE: When executed, this endpoint triggers an asynchronous Document query with HIEs and immediately returns the status of Document query, processing .**\n\n## Get Document Url\n\nGets a presigned URL for downloading the specified Document.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/document/get-document) for more info.\n\n**NOTE: This endpoint returns a URL which you can use to download the specified Document using the file name provided from the List Documents endpoint.**\n\n## Get Facility by Name\n\nGets the Facility with the given name, so a care flow can resolve a human-readable Facility name into the `facilityId` that the Patient and Document actions require.\n\nMetriport has no endpoint to filter Facilities by name, so this action lists all Facilities in your Organization and matches in memory. The name is matched case-insensitively and ignoring surrounding whitespace, and must match **exactly one** Facility: the action errors if no Facility matches, and also if several do, rather than guessing which one was meant.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/facility/list-facilities) for more info.\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `facilityName` | string | The name of the Facility to look up. Matched case-insensitively, ignoring surrounding whitespace, and must match exactly one Facility in your Organization. |\n\nThe data points mirror the Facility object Metriport returns from [Get Facility](https://docs.metriport.com/medical-api/api-reference/facility/get-facility), one data point per response field:\n\n| Data point | Type | Metriport field | Description |\n| --- | --- | --- | --- |\n| `facilityId` | string | `id` | Metriport's UUID for the Facility. This is the `facilityId` the Patient and Document actions take. |\n| `facilityName` | string | `name` | The Facility name, as stored at Metriport — the canonical casing and spacing, not the name that was searched for. |\n| `npi` | string | `npi` | The Facility's National Provider Identifier. |\n| `tin` | string | `tin` | The Facility's Taxpayer Identification Number. Optional at Metriport; left unset when absent. |\n| `active` | boolean | `active` | Whether the Facility is active. Optional at Metriport; left unset when absent. |\n| `addressLine1` | string | `address.addressLine1` | Street address line 1. |\n| `addressLine2` | string | `address.addressLine2` | Street address line 2. Optional; left unset when absent. |\n| `city` | string | `address.city` | Address city. |\n| `state` | string | `address.state` | Two-letter US state or territory code. |\n| `zip` | string | `address.zip` | Address ZIP code. |\n| `country` | string | `address.country` | Address country — always `USA` at Metriport today. Left unset when absent. |\n\n## Remove Patient from Cohort\n\nRemoves the specified Patient from a cohort.\n\nVisit [endpoint docs](https://docs.metriport.com/medical-api/api-reference/cohort/remove-patients-from-cohort) for more info.\n\n## Get Webhook Bundle\n\nFetches the FHIR bundle from a Metriport webhook payload URL — e.g. the [Encounter Bundle](https://docs.metriport.com/medical-api/handling-data/patient-encounter-bundle) from an ADT notification, or a discharge summary. Pass the `bundleUrl` data point emitted by the **Realtime Update** webhook; the action downloads the bundle and returns it on the `bundle` data point.\n\nWhen the payload is a Patient Encounter Bundle, the action also rewrites it into an executable FHIR transaction and returns that on the `transactionBundle` data point, ready to hand to the Medplum **Find or create resource** action.\n\nThe Encounter's Metriport id is returned separately on the `encounterId` data point, so a later step can address the imported Encounter without re-parsing the bundle.\n\n**NOTE: Metriport pre-signed URLs are only valid for 10 minutes, so this action should run early in the care flow, shortly after the realtime update webhook fires.**\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `url` | string | The pre-signed payload URL to fetch (the webhook's `bundleUrl` data point). |\n| `eventType` | string (optional) | The Metriport notification type — wire this from the realtime update webhook's `eventType` data point. Recorded on the import Provenance so admit, transfer and discharge can be told apart. |\n| `provenanceReason` | text (optional) | Free-text reason recorded on the import Provenance, describing why the data was imported. |\n\n| Data point | Type | Description |\n| --- | --- | --- |\n| `bundle` | json | The FHIR bundle fetched from the URL, exactly as Metriport sent it. |\n| `transactionBundle` | json | The same data rewritten as an executable FHIR transaction. Omitted when the payload is not a Patient Encounter Bundle. |\n| `encounterId` | string | Metriport's UUID for the Encounter in the bundle. Resolve the imported Encounter in Medplum with `Encounter?identifier=https://metriport.com/fhir/encounter\\|<encounterId>`. Omitted when the bundle carries no Encounter. |\n\n### Building the transaction bundle\n\nMetriport delivers a bundle of `type: 'collection'`, which is **not executable**. Handing it straight to Medplum does nothing useful: no entry carries `request` metadata saying what to do with it, and every internal reference points at a Metriport UUID that means nothing in Medplum. The action therefore builds a second, executable bundle rather than passing the original through.\n\nThe transformation is a pure function with no Medplum access of its own — this extension holds Metriport credentials only. That rules out reading Medplum to reconcile against what is already there, so every lookup is expressed declaratively and resolved by the server when the transaction executes.\n\n**The Patient is never written.** Awell/Medplum is the source of truth for patient demographics, so the Patient entry is dropped entirely and every reference to it becomes a conditional reference:\n\n```\nPatient?identifier=https://awellhealth.com/patients|<awell patient id>\n```\n\nOmitting the entry guarantees structurally that a Metriport ADT feed can never overwrite the patient record.\n\n**Everything else is written idempotently.** Each Metriport resource is stamped with an identifier derived from its Metriport id and written with a conditional update:\n\n```\nidentifier: { system: 'https://metriport.com/fhir/encounter', value: '<metriport id>' }\nrequest: PUT Encounter?identifier=https://metriport.com/fhir/encounter|<metriport id>\n```\n\nA conditional update creates on zero matches and updates on one, so a redelivered notification updates in place instead of duplicating Conditions, Observations, Practitioners and Locations — and the admit and discharge notifications for one visit converge on a single Encounter. Existing identifiers are kept, so the Encounter keeps its HL7 `VN` visit number alongside ours.\n\n**References are rewritten to Metriport's own `fullUrl`s.** Metriport resolves its relationships correctly, but emits them in a form FHIR cannot match: entries carry `urn:uuid:` fullUrls while references to them are relative.\n\n```\nfullUrl: urn:uuid:3ca5e8d2-7c84-45ab-91e7-834f8becde12\nreference: Location/3ca5e8d2-7c84-45ab-91e7-834f8becde12\n```\n\nA transaction resolves an internal reference by matching it against `fullUrl` verbatim, and a relative reference does not match a `urn:uuid:` one — Medplum would read it as a reference to a *Medplum* Location with that id, which does not exist. Rewriting the reference to the entry's `fullUrl` closes the gap while keeping Metriport's identity. This is also why the result is a `transaction` and not a `batch`: `urn:uuid` resolution is a transaction feature.\n\n**`meta` is stripped from every resource.** Medplum's `meta.accounts` is inherited from the compartment of the Patient a resource references, but specifying `meta` at all on a create or update replaces those inherited accounts instead of adding to them. Metriport's Encounter arrives with a `meta`, so it is removed. `resource.id` is dropped too, for a separate reason: Medplum assigns identity, and the entry's `fullUrl` already carries the local identity the transaction needs.\n\n**Two entries are synthesised.** An `Organization` named *Metriport Realtime Monitoring*, created with `ifNoneExist` so an existing one is reused rather than overwritten; and a `Provenance` recording the import — what it created, when, which Metriport bundle it came from, and which ADT event triggered it (`patient.admit` → `A01`, `patient.transfer` → `A02`, `patient.discharge` → `A03`).\n\n`extensions/metriport/actions/webhookBundle/bundle/transform.test.ts` asserts the complete output for a real `patient.admit` bundle, if you want to see the whole before/after in one place.\n\n### Wiring it into a care flow\n\n1. **Realtime Update** webhook fires and emits `bundleUrl` and `eventType`.\n2. **Get Webhook Bundle** — pass `bundleUrl` to `url` and `eventType` to `eventType`. Run this early; the URL expires after 10 minutes.\n3. Medplum **Find or create resource** — pass the `transactionBundle` data point to its `resourceJson` field. No changes to that action are needed; it detects a Bundle and executes it.\n\n**PREREQUISITE: for imported resources to be tagged with the Metriport organization, the Medplum Patient must already carry it in `meta.accounts` before the notification arrives.** Resources created without a `meta` inherit their accounts from the compartment of the Patient they reference, so tagging the Patient once causes every subsequent import to inherit it automatically. Note that this only covers resources *in* the patient compartment — `Location` and `Practitioner` are shared directory resources and are intentionally created untagged, since scoping a hospital or a physician to one patient's tenant would be wrong.\n\n**NOTE: the conditional Patient reference only resolves if your Medplum Patients carry an identifier under the `https://awellhealth.com/patients` system with the Awell patient id as its value. A conditional reference that matches no Patient fails the whole transaction.**\n\n### When the transaction bundle is omitted\n\n`Get Webhook Bundle` serves several Metriport webhook types and only ADT notifications carry encounter bundles. For any payload that is not a `collection` bundle, `transactionBundle` is simply omitted and `bundle` is emitted on its own — the action still succeeds.\n\nA `collection` bundle that is missing its Patient or Encounter entry is treated differently: that is an encounter bundle which does not describe an encounter, so the action **fails** rather than silently emitting a partial result.\n\n# Webhooks\n\n## Realtime Update\n\nAn enrollment trigger that starts a care flow when Metriport sends a [real-time patient notification](https://docs.metriport.com/medical-api/handling-data/realtime-patient-notifications).\n\nMetriport POSTs every notification type to the same endpoint. Four of them share one payload shape — a `meta` envelope plus a `payload` pointing at a pre-signed bundle URL — and this webhook enrolls a patient on all four:\n\n- `patient.admit` (HL7 ADT^A01)\n- `patient.discharge` (HL7 ADT^A03)\n- `patient.transfer` (HL7 ADT^A02)\n- `medical.discharge-summary`\n\nThe `eventType` data point carries the raw Metriport webhook type, so a care flow can branch on it. The payload's `url` is a pre-signed link to the [FHIR Encounter Bundle](https://docs.metriport.com/medical-api/handling-data/patient-encounter-bundle).\n\nThe webhook validates the request, emits the data points (including the pre-signed bundle URL on `bundleUrl`), and replies immediately — it does **not** download the bundle. Fetch the bundle later in the care flow with the **Get Webhook Bundle** action, using the `bundleUrl` data point. Because the URL expires after 10 minutes, run that action early.\n\nAny other notification type Metriport sends — `medical.document-download`, `medical.consolidated-data`, and anything added in future — is acknowledged with a `200` and does not enroll a patient. A notification whose type *is* handled but whose payload is malformed fails loudly instead, so a genuine integration problem is not mistaken for an event we chose to ignore. Metriport [verification `ping` messages](https://docs.metriport.com/medical-api/getting-started/webhooks#the-ping-message) are answered with a `200` that echoes the ping value back as `pong: <value>`.\n\n### Data points\n\n| Data point | Type | Description |\n| --- | --- | --- |\n| `eventType` | string | The Metriport webhook type: `patient.admit`, `patient.discharge`, `patient.transfer` or `medical.discharge-summary` |\n| `metriportPatientId` | string | The Metriport patient ID (also used as the patient identifier for enrollment) |\n| `externalId` | string | Your external patient ID, if provided to Metriport |\n| `when` | date | When the event occurred — the admit time on an admit event, the discharge time on a discharge event |\n| `messageId` | string | The Metriport message ID for the notification |\n| `bundleUrl` | string | Pre-signed URL to the FHIR bundle; fetch it with the **Get Webhook Bundle** action (valid for 10 minutes) |\n\n### Verifying incoming requests\n\nOptionally set the **Webhook Key** setting to the webhook key from the Metriport dashboard (Settings/Developers tab). Metriport [authenticates each webhook](https://docs.metriport.com/medical-api/getting-started/webhooks#authentication) with an HMAC-SHA256 signature of the raw request body, keyed with your webhook key and sent in the `x-metriport-signature` header. When the setting is populated, the webhook recomputes the HMAC over the raw body and rejects any request whose signature is missing or does not match (`401`). When left empty, requests are not verified.\n\n## More Info\n\nFor more information on how to integrate with Metriport please visit our [Medical API docs](https://docs.metriport.com/medical-api/getting-started/quickstart)\n",
|
|
164
164
|
"changelog": "# Metriport changelog\n\n## August 2026\n\n- Rename the `enrollment` webhook to `realtimeUpdate`. The old name described what Awell does with the notification rather than what Metriport sends, which read confusingly next to the genuine enrolment concepts (the `Cohort` field, enrolling a patient into a care flow). Behaviour is unchanged. **Breaking: the webhook endpoint URL changes, so any webhook already configured in the Metriport dashboard must be repointed.**\n- `Date of Birth` on the `Create Patient` and `Update Patient` actions is now a date field rather than a free-text string, so care flows can map a date onto it directly instead of hand-formatting `YYYY-MM-DD`. The value is normalised to the date-only string Metriport expects, so care flows already passing `YYYY-MM-DD` are unaffected.\n\n## July 2026\n\n- Add `enrollment` webhook: an enrollment trigger for Metriport real-time patient notifications. The `eventType` data point carries the Metriport webhook type (`patient.admit` or `medical.discharge-summary`) so care flows can distinguish on it. The webhook validates and replies immediately, emitting the pre-signed FHIR bundle URL on the `bundleUrl` data point rather than downloading the bundle inline.\n- Add `Get Webhook Bundle` action: fetches the FHIR bundle from a Metriport webhook payload URL (the webhook's `bundleUrl`), for use later in the care flow.\n- Add optional `Webhook Key` setting used to verify incoming webhook requests via Metriport's HMAC-SHA256 signature (`x-metriport-signature` header), computed over the raw request body."
|
|
165
165
|
},
|
|
166
166
|
"nexuzhealth": {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const facilityDataPoints: {
|
|
2
|
+
addressLine1: {
|
|
3
|
+
key: string;
|
|
4
|
+
valueType: "string";
|
|
5
|
+
};
|
|
6
|
+
addressLine2: {
|
|
7
|
+
key: string;
|
|
8
|
+
valueType: "string";
|
|
9
|
+
};
|
|
10
|
+
city: {
|
|
11
|
+
key: string;
|
|
12
|
+
valueType: "string";
|
|
13
|
+
};
|
|
14
|
+
state: {
|
|
15
|
+
key: string;
|
|
16
|
+
valueType: "string";
|
|
17
|
+
};
|
|
18
|
+
zip: {
|
|
19
|
+
key: string;
|
|
20
|
+
valueType: "string";
|
|
21
|
+
};
|
|
22
|
+
country: {
|
|
23
|
+
key: string;
|
|
24
|
+
valueType: "string";
|
|
25
|
+
};
|
|
26
|
+
facilityId: {
|
|
27
|
+
key: string;
|
|
28
|
+
valueType: "string";
|
|
29
|
+
};
|
|
30
|
+
facilityName: {
|
|
31
|
+
key: string;
|
|
32
|
+
valueType: "string";
|
|
33
|
+
};
|
|
34
|
+
npi: {
|
|
35
|
+
key: string;
|
|
36
|
+
valueType: "string";
|
|
37
|
+
};
|
|
38
|
+
tin: {
|
|
39
|
+
key: string;
|
|
40
|
+
valueType: "string";
|
|
41
|
+
};
|
|
42
|
+
active: {
|
|
43
|
+
key: string;
|
|
44
|
+
valueType: "boolean";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.facilityDataPoints = void 0;
|
|
4
|
+
const dataPoints_1 = require("../../shared/dataPoints");
|
|
5
|
+
exports.facilityDataPoints = {
|
|
6
|
+
facilityId: {
|
|
7
|
+
key: 'facilityId',
|
|
8
|
+
valueType: 'string',
|
|
9
|
+
},
|
|
10
|
+
facilityName: {
|
|
11
|
+
key: 'facilityName',
|
|
12
|
+
valueType: 'string',
|
|
13
|
+
},
|
|
14
|
+
npi: {
|
|
15
|
+
key: 'npi',
|
|
16
|
+
valueType: 'string',
|
|
17
|
+
},
|
|
18
|
+
tin: {
|
|
19
|
+
key: 'tin',
|
|
20
|
+
valueType: 'string',
|
|
21
|
+
},
|
|
22
|
+
active: {
|
|
23
|
+
key: 'active',
|
|
24
|
+
valueType: 'boolean',
|
|
25
|
+
},
|
|
26
|
+
...dataPoints_1.address,
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=dataPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../extensions/metriport/actions/facility/dataPoints.ts"],"names":[],"mappings":";;;AACA,wDAAiD;AAEpC,QAAA,kBAAkB,GAAG;IAChC,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,QAAQ;KACpB;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,QAAQ;KACpB;IACD,GAAG,EAAE;QACH,GAAG,EAAE,KAAK;QACV,SAAS,EAAE,QAAQ;KACpB;IACD,GAAG,EAAE;QACH,GAAG,EAAE,KAAK;QACV,SAAS,EAAE,QAAQ;KACpB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,SAAS;KACrB;IACD,GAAG,oBAAO;CACmC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getByNameFields = void 0;
|
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
5
|
+
exports.getByNameFields = {
|
|
6
|
+
facilityName: {
|
|
7
|
+
id: 'facilityName',
|
|
8
|
+
label: 'Facility Name',
|
|
9
|
+
description: 'The name of the Facility to look up. Matched case-insensitively, ignoring surrounding whitespace, and must match exactly one Facility in your Organization.',
|
|
10
|
+
type: extensions_core_1.FieldType.STRING,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../extensions/metriport/actions/facility/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAExD,QAAA,eAAe,GAAG;IAC7B,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,6JAA6J;QAC/J,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Action } from '@awell-health/extensions-core';
|
|
2
|
+
import { type settings } from '../../settings';
|
|
3
|
+
import { getByNameFields } from './fields';
|
|
4
|
+
import { facilityDataPoints as dataPoints } from './dataPoints';
|
|
5
|
+
export declare const getFacilityByName: Action<typeof getByNameFields, typeof settings, keyof typeof dataPoints>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFacilityByName = void 0;
|
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
5
|
+
const client_1 = require("../../client");
|
|
6
|
+
const errorHandler_1 = require("../../shared/errorHandler");
|
|
7
|
+
const fields_1 = require("./fields");
|
|
8
|
+
const validation_1 = require("./validation");
|
|
9
|
+
const dataPoints_1 = require("./dataPoints");
|
|
10
|
+
/**
|
|
11
|
+
* Metriport types the optional Facility values as nullable, and `state` as
|
|
12
|
+
* `unknown`, so they are normalised to a data point value or left unset.
|
|
13
|
+
*/
|
|
14
|
+
const asDataPoint = (value) => value === undefined || value === null ? undefined : String(value);
|
|
15
|
+
exports.getFacilityByName = {
|
|
16
|
+
key: 'getFacilityByName',
|
|
17
|
+
category: extensions_core_1.Category.EHR_INTEGRATIONS,
|
|
18
|
+
title: 'Get Facility by Name',
|
|
19
|
+
description: 'Gets the Facility with the given name by listing all Facilities in your Organization and matching on the name.',
|
|
20
|
+
fields: fields_1.getByNameFields,
|
|
21
|
+
previewable: true,
|
|
22
|
+
supports_automated_retries: true,
|
|
23
|
+
dataPoints: dataPoints_1.facilityDataPoints,
|
|
24
|
+
onEvent: async ({ payload, onComplete, onError, helpers }) => {
|
|
25
|
+
helpers.log({ fields: payload.fields }, 'Processing getFacilityByName');
|
|
26
|
+
try {
|
|
27
|
+
const { facilityName } = validation_1.getByNameSchema.parse(payload.fields);
|
|
28
|
+
const api = (0, client_1.createMetriportApi)(payload.settings);
|
|
29
|
+
/**
|
|
30
|
+
* Metriport has no endpoint to filter Facilities by name, so the full
|
|
31
|
+
* list is fetched and matched in memory. An Organization holds a handful
|
|
32
|
+
* of Facilities, so the list is small enough to scan on every activity.
|
|
33
|
+
*/
|
|
34
|
+
const facilities = await api.listFacilities();
|
|
35
|
+
const target = facilityName.toLowerCase();
|
|
36
|
+
const matches = facilities.filter((facility) => facility.name.trim().toLowerCase() === target);
|
|
37
|
+
if (matches.length !== 1) {
|
|
38
|
+
const message = matches.length === 0
|
|
39
|
+
? `No Facility found with the name "${facilityName}"`
|
|
40
|
+
: `${matches.length} Facilities found with the name "${facilityName}". The name must identify exactly one Facility.`;
|
|
41
|
+
await onError({
|
|
42
|
+
events: [
|
|
43
|
+
{
|
|
44
|
+
date: new Date().toISOString(),
|
|
45
|
+
text: { en: message },
|
|
46
|
+
error: {
|
|
47
|
+
category: 'WRONG_INPUT',
|
|
48
|
+
message,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const [facility] = matches;
|
|
56
|
+
await onComplete({
|
|
57
|
+
data_points: {
|
|
58
|
+
facilityId: facility.id,
|
|
59
|
+
facilityName: facility.name,
|
|
60
|
+
npi: facility.npi,
|
|
61
|
+
tin: asDataPoint(facility.tin),
|
|
62
|
+
active: asDataPoint(facility.active),
|
|
63
|
+
addressLine1: facility.address.addressLine1,
|
|
64
|
+
addressLine2: asDataPoint(facility.address.addressLine2),
|
|
65
|
+
city: facility.address.city,
|
|
66
|
+
state: asDataPoint(facility.address.state),
|
|
67
|
+
zip: facility.address.zip,
|
|
68
|
+
country: asDataPoint(facility.address.country),
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
helpers.log({ err }, 'error', err);
|
|
74
|
+
await (0, errorHandler_1.handleErrorMessage)(err, onError);
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=getFacilityByName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFacilityByName.js","sourceRoot":"","sources":["../../../../../extensions/metriport/actions/facility/getFacilityByName.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AAExD,yCAAiD;AACjD,4DAA8D;AAC9D,qCAA0C;AAC1C,6CAA8C;AAC9C,6CAA+D;AAE/D;;;GAGG;AACH,MAAM,WAAW,GAAG,CAAC,KAAc,EAAsB,EAAE,CACzD,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAEtD,QAAA,iBAAiB,GAI1B;IACF,GAAG,EAAE,mBAAmB;IACxB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,gHAAgH;IAClH,MAAM,EAAE,wBAAe;IACvB,WAAW,EAAE,IAAI;IACjB,0BAA0B,EAAE,IAAI;IAChC,UAAU,EAAV,+BAAU;IACV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;QAC1E,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,8BAA8B,CAAC,CAAA;QAEvE,IAAI,CAAC;YACH,MAAM,EAAE,YAAY,EAAE,GAAG,4BAAe,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAE9D,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,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC;oBACxD,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI;oBAC3B,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;oBAC1C,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG;oBACzB,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC;iBAC/C;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAY,CAAC,CAAA;YAC3C,MAAM,IAAA,iCAAkB,EAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QACxC,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getByNameSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.getByNameSchema = zod_1.z.object({
|
|
6
|
+
facilityName: zod_1.z.coerce
|
|
7
|
+
.string({ error: 'Requires a Facility name' })
|
|
8
|
+
.trim()
|
|
9
|
+
.min(1, 'Requires a Facility name'),
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../../extensions/metriport/actions/facility/validation.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,YAAY,EAAE,OAAC,CAAC,MAAM;SACnB,MAAM,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC;SAC7C,IAAI,EAAE;SACN,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;CACtC,CAAC,CAAA"}
|
|
@@ -724,4 +724,42 @@ export declare const actions: {
|
|
|
724
724
|
required: false;
|
|
725
725
|
};
|
|
726
726
|
}, "message" | "cohort">;
|
|
727
|
+
getFacilityByName: import("@awell-health/extensions-core").Action<{
|
|
728
|
+
facilityName: {
|
|
729
|
+
id: string;
|
|
730
|
+
label: string;
|
|
731
|
+
description: string;
|
|
732
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
733
|
+
required: true;
|
|
734
|
+
};
|
|
735
|
+
}, {
|
|
736
|
+
apiKey: {
|
|
737
|
+
key: string;
|
|
738
|
+
label: string;
|
|
739
|
+
obfuscated: true;
|
|
740
|
+
description: string;
|
|
741
|
+
required: true;
|
|
742
|
+
};
|
|
743
|
+
baseUrl: {
|
|
744
|
+
key: string;
|
|
745
|
+
label: string;
|
|
746
|
+
obfuscated: false;
|
|
747
|
+
description: string;
|
|
748
|
+
required: false;
|
|
749
|
+
};
|
|
750
|
+
webhookKey: {
|
|
751
|
+
key: string;
|
|
752
|
+
label: string;
|
|
753
|
+
obfuscated: true;
|
|
754
|
+
description: string;
|
|
755
|
+
required: false;
|
|
756
|
+
};
|
|
757
|
+
rateLimitDuration: {
|
|
758
|
+
key: string;
|
|
759
|
+
label: string;
|
|
760
|
+
obfuscated: false;
|
|
761
|
+
description: string;
|
|
762
|
+
required: false;
|
|
763
|
+
};
|
|
764
|
+
}, "active" | "city" | "country" | "state" | "zip" | "npi" | "addressLine1" | "addressLine2" | "facilityId" | "facilityName" | "tin">;
|
|
727
765
|
};
|
|
@@ -13,6 +13,7 @@ const startConsolidatedQuery_1 = require("./consolidated/startConsolidatedQuery"
|
|
|
13
13
|
const getConsolidatedQueryStatus_1 = require("./consolidated/getConsolidatedQueryStatus");
|
|
14
14
|
const getWebhookBundle_1 = require("./webhookBundle/getWebhookBundle");
|
|
15
15
|
const removePatientFromCohort_1 = require("./cohort/removePatientFromCohort");
|
|
16
|
+
const getFacilityByName_1 = require("./facility/getFacilityByName");
|
|
16
17
|
exports.actions = {
|
|
17
18
|
getPatient: get_1.getPatient,
|
|
18
19
|
createPatient: create_1.createPatient,
|
|
@@ -26,5 +27,6 @@ exports.actions = {
|
|
|
26
27
|
getConsolidatedQueryStatus: getConsolidatedQueryStatus_1.getConsolidatedQueryStatus,
|
|
27
28
|
getWebhookBundle: getWebhookBundle_1.getWebhookBundle,
|
|
28
29
|
removePatientFromCohort: removePatientFromCohort_1.removePatientFromCohort,
|
|
30
|
+
getFacilityByName: getFacilityByName_1.getFacilityByName,
|
|
29
31
|
};
|
|
30
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/metriport/actions/index.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAC1C,6CAAgD;AAChD,6CAAgD;AAChD,6CAAgD;AAChD,0CAA+C;AAC/C,4CAA4C;AAC5C,8CAA0C;AAC1C,mEAA+D;AAC/D,kFAA8E;AAC9E,0FAAsF;AACtF,uEAAmE;AACnE,8EAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/metriport/actions/index.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAC1C,6CAAgD;AAChD,6CAAgD;AAChD,6CAAgD;AAChD,0CAA+C;AAC/C,4CAA4C;AAC5C,8CAA0C;AAC1C,mEAA+D;AAC/D,kFAA8E;AAC9E,0FAAsF;AACtF,uEAAmE;AACnE,8EAA0E;AAC1E,oEAAgE;AAEnD,QAAA,OAAO,GAAG;IACrB,UAAU,EAAV,gBAAU;IACV,aAAa,EAAb,sBAAa;IACb,aAAa,EAAb,sBAAa;IACb,aAAa,EAAb,sBAAa;IACb,aAAa,EAAb,oBAAa;IACb,SAAS,EAAT,iBAAS;IACT,MAAM,EAAN,eAAM;IACN,iBAAiB,EAAjB,qCAAiB;IACjB,sBAAsB,EAAtB,+CAAsB;IACtB,0BAA0B,EAA1B,uDAA0B;IAC1B,gBAAgB,EAAhB,mCAAgB;IAChB,uBAAuB,EAAvB,iDAAuB;IACvB,iBAAiB,EAAjB,qCAAiB;CAClB,CAAA"}
|
package/dist/src/test-server.js
CHANGED
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
8
|
const body_parser_1 = __importDefault(require("body-parser"));
|
|
9
|
+
const helmet_1 = __importDefault(require("helmet"));
|
|
9
10
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
10
11
|
const extensions_1 = require("../extensions");
|
|
11
12
|
const app = (0, express_1.default)();
|
|
12
13
|
const port = 3000;
|
|
14
|
+
app.use((0, helmet_1.default)());
|
|
13
15
|
app.use(body_parser_1.default.json());
|
|
14
16
|
app.post('/', async (req, res) => {
|
|
15
17
|
console.log(req.body);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-server.js","sourceRoot":"","sources":["../../src/test-server.ts"],"names":[],"mappings":";;;;;AAAA,2DAA2D;AAC3D,sDAA6B;AAC7B,8DAAoC;AACpC,mEAKsC;AACtC,8CAA0C;AAE1C,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAA;AACrB,MAAM,IAAI,GAAG,IAAI,CAAA;AAEjB,GAAG,CAAC,GAAG,CAAC,qBAAU,CAAC,IAAI,EAAE,CAAC,CAAA;AAE1B,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACrB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAChB,CAAC,CAAC,CAAA;AAEF,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IACxC,MAAM,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QAAQ,EAAE,SAAS,EAAE,CAAC,CAAA;QAC5C,iDAAiD;IACnD,CAAC,CAAA;AACH,CAAC,CAAA;AACD,MAAM,qBAAqB,GAAG;AAC5B,+BAA+B;AAC/B,GAAqB,EACJ,EAAE;IACnB,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,EAAE;QAC3B,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAA;QACjD,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAA;QAC5C,iDAAiD;IACnD,CAAC,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awell-health/awell-extensions",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.168",
|
|
4
4
|
"packageManager": "yarn@4.5.3",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"eslint-plugin-promise": "^6.6.0",
|
|
78
78
|
"glob": "^11.1.0",
|
|
79
79
|
"gray-matter": "^4.0.3",
|
|
80
|
+
"helmet": "^8.3.0",
|
|
80
81
|
"husky": "^9.1.7",
|
|
81
82
|
"jest": "^29.7.0",
|
|
82
83
|
"jest-fetch-mock": "^3.2.0",
|