-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1040 Update WH docs #2284
Merged
Merged
1040 Update WH docs #2284
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,17 @@ You should expect to get more than one Webhook message per patient per request ( | |
To enable this integration approach with Metriport, and for some prerequesite reading to understand | ||
how the Webhook flow works, see [our Webhooks guide](/home/api-info/webhooks). | ||
|
||
### Types of Messages | ||
|
||
- `medical.document-download`: result of Document Query, containing the newly downloaded documents | ||
for the patient - see [details](#patient-document-data) below; | ||
- `medical.document-conversion`: result of converting the newly downloaded C-CDA documents into FHIR - | ||
see [details](#patient-document-data) below; | ||
- `medical.document-bulk-download-urls`: list of download urls for a patient's documents, see | ||
[details](#bulk-document-download-urls) below; | ||
- `medical.consolidated-data`: result of a Consolidated Data Query, containing the patient's data in FHIR | ||
format - see [details](#patient-consolidated-data) below. | ||
|
||
Comment on lines
+26
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. while we're at it - let's add mention of these types to each endpoint page? ie for example https://docs.metriport.com/medical-api/api-reference/document/start-document-query should mention that |
||
### Passing Metadata | ||
|
||
You can pass metadata to endpoints that support webhooks, and you will receive the `meta.data` field of the webhook request. | ||
|
@@ -36,23 +47,25 @@ Below is an example payload you could send in the request body of one of those e | |
|
||
These are messages you can expect to receive in the following scenarios: | ||
|
||
1. When [queried documents](/medical-api/api-reference/document/start-document-query) have completed downloading (`type` for a patient in | ||
the message will be `document-download`, and at this point you'll be able to [download the raw files](/medical-api/api-reference/document/get-document)); | ||
1. When [queried documents](/medical-api/api-reference/document/start-document-query) have completed | ||
downloading, the message `type` will be `medical.document-download`, and at this point | ||
you'll be able to [download the raw files](/medical-api/api-reference/document/get-document); | ||
2. Then, if the downloaded documents contained C-CDA/XML files, when the conversion to FHIR has | ||
completed, the message `type` will be `medical.document-conversion`, and at this point | ||
you'll be able to query for [patient consolidated data](/medical-api/api-reference/fhir/consolidated-data-query-post) | ||
in FHIR-compliant format. | ||
|
||
<Tip> | ||
Note that the webhooks will only contain updates for new data fetched in the current document | ||
query. | ||
</Tip> | ||
|
||
2. Then, if the downloaded documents contained C-CDA/XML files, when the conversion to FHIR has completed (`type` for a patient in the message | ||
will be `document-conversion`, and at this point you'll be able to query for [patient consolidated data](#patient-consolidated-data) in FHIR-compliant format). | ||
|
||
```json | ||
{ | ||
"meta": { | ||
"messageId": "<message-id>", | ||
"when": "<date-time-in-utc>", | ||
"type": "medical.document-bulk-download-urls" | ||
"type": "medical.document-download" | ||
"data": { | ||
youCan: "putAny", | ||
stringKeyValue: "pairsHere", | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts/Qs:
200
HTTP response? Perhaps we should just tell them that, since we don't really care what they do on their end?200
right away?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, saying it should be idempotent is not the same thing as saying it should always return 200. They need to design their endpoint in a way that allows it being called multiple times w/ the same payload w/o breaking their app.
Good point, added!