Skip to main content

Patients

Connect a patient

Once the practitioners are using Legit.Health, it's time to also connect the patients so they can also make use of the technology.

In order to connect patients, you must use the endpoint createPatient. By sending the information to this endpoint, your software will connect a patient's information with Legit.Health.

The patient must confirm their account. In order for that to happen, you must specify contact information about the patient.

  • If you specify an email address, an email will be sent to the patient to allow him to verify his account.
  • If you specify a telephone number, an SMS will be sent to the patient to allow him to verify his account.

It is not required, but when possible you should also specify the conditions of the patient in the request, using the property conditions. This field is a list of objects containing the code of the pathology and the body site. The full list of the codes is available in the Swagger documentation.

If you connect a patient that has some conditions diagnosed, an active episode of care will be created automatically for each condition.

Generate login credentials

Patient will be able to use the Legit.Health technology without having to log into a different system. In other words: your software will have a button, and when patients click on it, they will be automatically directed to the Legit.Health interface, as if it was the same environment – without having to log in or perform extra clicks.

For this to work, you must use the endpoint getPatientsAuthTokens to generate the corresponding tokens to allow a patient to log-in directly.

You can also program your software so that the patient receives an email with the login link. If you attach the param sendLinkToPatientByEmail to the request, the patient will receive an email with a link to log in to the Legit.Health interface.

The structure for login links is the following:

https://app.legit.health/u/home?token=token&refresh_token=refresh_token

Create an episode of care for a patient

For creating a new episode of care for a patient's condition you can use the endpoint createEpisodeOfCare.

You cannot create an active episode of care if the condition has already one active.

Create an encounter for a patient

You could create an encounter using the endpoint createEncounter.

If the field planned_for is in the future, the encounter will receive the status scheduled.

If the field planned_for is in the future, the encounter will receive the status ready so it could be completed right now by the patient.

Get patient's information

The connection of patients work both ways. After sending information about the patients, you will want to fetching the information of a patient to add it to your HRM.

To get patient information, you must use the endpoint getPatients.

You need to specify the ids in your platform of each patient in the URL param externalIds. For example:

​​?externalIds[]=a449666c710c&externalIds[]=baa3cf93-6f1c

Get patient’s episodes of care

It is possible that some episodes of care may be created in the Legit.Health platform, by the patient themselves or even by the doctor, as they upload pictures. In such cases, you will want to fetch that information to keep it in your HRM.

To fetch the patient's episodes of care you must use the endpoint _getEpisodesOfCare_.

You need to specify the id of the condition. This id is returned by the endpoint getPatients inside the conditions property.

Patch patient

You may want to edit the information of an already connected patient with Legit.Health.

To patch a patient you can use the endpoint patchPatient.

This endpoint is useful if you want to update some information about a connected patient, for example:

  • Adding a new condition. This implies that a new episode of care with the status “active” is generated in the system for that condition.
  • Pausing an existing condition. This implies that the active episode of care of the condition is moved to “finished” status.
  • Tracking an existing condition. This implies that a new episode of care with the status “active” is generated in the system for that condition. Encounters will be created automatically at the specified frequency to allow the practitioner tracking the condition.
  • Editing basic information of the patient.

You could view different examples for using this endpoint in the corresponding section of the Swagger doc.

Patch patient's episode of care

You may want to match the episodes of care, as they are identified in your HRM, with the episodes of care at Legit.Health.

To patch a patient's episodes you can use the endpoint patchEpisodeOfCare.

This endpoint is useful if you want to match your episodes of care with the ones created in Legit.Health. To make this work, the endpoint uses the internal id generated for the episodes of care in the Legit.Health application.

The recommended flow you could follow to patch an episode of care is:

  • Firstly, get the episodes of care of the patient's condition using the endpoint getEpisodesOfCare.
  • Then, use the internal id of the episode of care for creating the patch URL.