Send a document to the DMP v2
DMP is a computer record gathering the medical data of patients. The term also designates software in which hospital workers access the information contained in the patient file.
Currently, keeping the DMP up to date is mainly the responsibility of the patient, and it turns out that some health professionals also contribute. In 2022, a national project aims to generalize the DMP to all patients in France, and encourage the filling of the DMP by health professionals. With its API V2 Certification, Lifen is the ideal partner to facilitate all integration into the DMP.
Access Control
You have to use the Access Token of an authenticated user with the BINARY_CREATE
, DOCUMENTREFERENCE_CREATE
, COMMUNICATIONREQUEST_CREATE
and PATIENT_CREATE
permissions in the scope
to access the FHIR API. For user authentication, take a look at the Connect Users v2.
How does DMP integration work ?
First, make sure you have previously created a FHIR Patient on the Patient API. (see paragraph below for more information)
Next, you have to upload the document on the FHIR Document API, add some metadata to it, then create a request of communication.
Posting your CommunicationRequest will trigger several operations :
- A call to the DMP webservice in order to check if the patient has an opened DMP
- Transform your binary into CDA file (which is the only format read by the DMP)
- Send the document into the DMP
- Create a Communication.
The communication can have 2 status:
- success: the document has been added to the DMP
- entered-in-error: an error occurred during the integration. Details can be found in Lifen's App.
Requested property on the Patient
resource
Patient
resourceThe DMP webservice requires the social security number (known as NIR or NIA) to authenticate the patient, so an identifier array must be present on the Patient resource.
Patients can be created by sending a POST to
- production environment :
https://api.lifen.fr/fhir/v2/Patient
- test environment :
https://api.post-prod.lifen.fr/fhir/v2/Patient
with a JSON body following this example :
{
"resourceType": "Patient",
"meta": {
"tag": [
{
"system": "https://www.lifen.fr/default",
"code": "DEFAULT",
"display": "Default tag"
}
]
},
"identifier": [
{
"use": "usual",
"type": {
"coding": [
{
"system": "http://lifen.fr/fhir/ValueSet/patient-identifier-type",
"version": "1.0",
"code": "NIR-OD",
"display": "NIR ouvrant-droit"
}
]
},
"system": "http://lifen.fr/fhir/Identifier/patient-nir-od",
"value": "xxxxxxxxxxxxxxx"
}
],
"name": [
{
"family": "xxxxxxx",
"given": [
"xxxxxxxx"
]
}
],
"birthDate": "YYYY-MM-DD",
"multipleBirthInteger": 1
}
Take care of the following attributes :
value
: the value must be a unique identifier composed with 15 integer representing social security number of the patientfamily name
,given name
,birthDate
andmultipleBirthInteger
are mandatory fieldsmultipleBirthInteger
is an integer for birth rank. Default value is 1. (In case of twins, one person will have a birth rank = 1 the other one 2)
Create a Binary resource to upload a PDF report
See: Create Binary v2
Create a DocumentReference
resource containing the document's metadata
DocumentReference
resource containing the document's metadataSee: Create DocumentReference v2
Create a CommunicationRequest
resource
CommunicationRequest
resourceSend a POST api.lifen.fr/fhir/v2/CommunicationRequest with a JSON body referencing the previously created DocumentReference, the sender, the requester, the recipient and the subject of the document.
Example :
{
"resourceType": "CommunicationRequest",
"meta": {
"tag": [
{
"system": "http://lifen.fr/fhir/tag/processing/mode",
"code": "IMMEDIATE_MODE",
"display": "request should be treated in immediate mode"
}
]
},
"status": "suspended",
"priority": "routine",
"extension": [
{
"url": "http://lifen.fr/fhir/StructureDefinition/communicationrequest-active-devices",
"valueReference": {
"reference": "Device/xxxxxxx"
}
}
],
"category": [
{
"coding": [
{
"system": "http://lifen.fr/fhir/CodeSystem/communication-category",
"code": "MEDICAL_REPORT"
}
]
}
],
"subject": {
"reference": "Patient/XXXXXX"
},
"payload": [
{
"contentReference": {
"reference": "DocumentReference/xxxxxxxxx"
}
}
],
"sender": {
"reference": "Practitioner/xxxxxxxxx"
},
"requester": {
"agent": {
"reference": "Organization/xxxxxxxxx"
}
},
"recipient": [
{
"reference": "Device/xxxxxxxxx"
}
]
}
Take care of the following attributes :
device
: is a value provided by Lifensubject
is the value of your previously created Patient resourcesender
:- User token : one of the identities to choose in the
http://lifen.fr/userInfo.identities
array from the user's ID token - Application token : ask our solution architect at Lifen for the Organization FHIR reference corresponding to healthcare organization you are
connected to
- User token : one of the identities to choose in the
requester
:- User token : the value of
http://lifen.fr/userInfo.currentWorkspaceId
from the user's ID token - Application token : ask our solution architect at Lifen for the Organization FHIR reference corresponding to your application
- User token : the value of
Check the Connect Users v2 Guide to find out how to read user information.
After that, the CommunicationRequest will be integrated into Lifen's sending flow to add some other information and send the document to the DMP.
Updated about 2 years ago