-
Notifications
You must be signed in to change notification settings - Fork 401
MSC4302: Exchanging FHIR resources via Matrix events #4302
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
Open
Johennes
wants to merge
5
commits into
matrix-org:main
Choose a base branch
from
gematik:johannes/fhir-resources
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2c81e3f
MSC4302: Exchanging FHIR resources via Matrix events
Johennes 7665142
Remove the fun
Johennes 404ce36
Rearrange points from introduction and alternatives section to better…
Johennes d7a27ea
Remove surplus spaces
Johennes 9b23cc9
Use correct mimetype in example
Johennes 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
Johennes marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# MSC4302: Exchanging FHIR resources via Matrix events | ||
|
||
[FHIR] (pronounced 🔥) is a globally established standard for exchanging healthcare information | ||
electronically. The base building block of FHIR are so called resources, such as [`Patient`]. These | ||
resources can be serialised into JSON or XML which allows them to be transmitted via the [`m.file`] | ||
message type. This is insufficient, however, because a generic MIME type of `application/xml` or | ||
`application/json` doesn't let clients recognise the content as FHIR before downloading it. The | ||
`m.file` mechanism also doesn't allow clients to infer any details about the types of resources | ||
contained in the file ahead of downloading it. Furthermore, in many cases FHIR resources are small | ||
enough to be inlined into Matrix events which significantly simplifies client-side processing. | ||
|
||
This proposal introduces an event type for transmitting FHIR resources and type information over | ||
Matrix in either inlined or uploaded form. | ||
|
||
## Proposal | ||
|
||
A new event type `m.fhir.resource` is introduced with the following properties in `content`: | ||
|
||
- `canonical_url` (string, required): The resource's [canonical URL], that is the globally unique | ||
identifier defining its schema. MAY contain a version suffix separated by `|` as per the FHIR | ||
specification. | ||
- `m.fhir.resource` (object): The serialised JSON if it fits within the [64 KiB event size limit]. | ||
Required if `m.file` is missing. | ||
- `m.file` (object): An [MSC3551] content block describing an uploaded JSON or XML serialisation of | ||
the resource if it is too large to be inlined. Required if `m.fhir.resource` is missing. | ||
|
||
``` json5 | ||
{ | ||
"type": "m.fhir.resource", | ||
"content": { | ||
"canonical_url": "http://hl7.org/fhir/patient.html|4.0.1", | ||
"m.fhir.resource": { | ||
"resourceType" : "Patient", | ||
"name" : [{ | ||
"use" : "official", | ||
"given" : ["John", "James"], | ||
"family" : "Doe" | ||
}], | ||
"gender" : "male", | ||
"birthDate" : "1970-01-01", | ||
// further properties as per the Patient schema | ||
}, | ||
"m.file": { | ||
"url": "mxc://example.org/abcd1234", | ||
"mimetype": "application/json", | ||
// further properties as per MSC3551 | ||
} | ||
} | ||
``` | ||
|
||
## Potential issues | ||
|
||
FHIR includes generic resources such as [`Bundle`] which wrap other resources. The `canonical_url` | ||
will not help clients understand the wrapped content without downloading it in these cases. | ||
Dedicated event types may be introduced in future to cater to these situations. | ||
|
||
## Alternatives | ||
|
||
A dedicated MIME type such as `application/fhir+xml` would allow clients to recognise an uploaded | ||
file as FHIR ahead of the download. It would not provide clients with information about the types of | ||
contained resources, however. Since FHIR supports a vast number of resources it doesn't appear | ||
practical to introduce dedicated mimetypes per resource, version and serialisation format | ||
|
||
## Security considerations | ||
|
||
None. | ||
|
||
## Unstable prefix | ||
|
||
While this MSC is not considered stable, the event type `m.fhir.resource` should be referred to as | ||
`de.gematik.msc4302.fhir.resource`. | ||
|
||
## Dependencies | ||
|
||
None. | ||
|
||
[FHIR]: https://hl7.org/fhir/ | ||
[`Patient`]: http://hl7.org/fhir/R4/patient.html | ||
[`m.file`]: https://spec.matrix.org/v1.14/client-server-api/#mfile | ||
[canonical URL]: https://build.fhir.org/references.html#canonical | ||
[64 KiB event size limit]: https://spec.matrix.org/v1.14/client-server-api/#size-limits | ||
[MSC3551]: https://github.com/matrix-org/matrix-spec-proposals/pull/3551 | ||
[`Bundle`]: http://hl7.org/fhir/StructureDefinition/Bundle |
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.
Implementation requirements: