Content:
- The general algorithm for comparing statuses between MIS and Medflex
- The main scenario for using the API for a partner
- Description of matching methods
- Frequently Asked Questions
Status matching allows the partner service to reassign the associated status of the medical complex with the one received from the IIA.
API methods used:
- Creating or updating comparisons of admission statuses from MIS and Medflex statuses
- Getting status comparisons for appointments from the IIA with the statuses of the Medical Complex
- Removing the comparison of admission status from the IIA with the status of the Medical Complex
The general algorithm for comparing statuses between MIS and Medflex 
Medflex downloads all the admission statuses used from the clinic's MIS.
The statuses uploaded from the IIA are compared with the internal statuses of Medflex. A list of Medflex internal statuses can be found in this article.
Important! If Medflex is unable to match the status from the IIA with the internal status, such a comparison is assigned the undefined status.
The main scenario for using the API for a partner 
The service partner requests a list of status comparisons in the Medical Complex for a specific medical facility or a group of medical facilities.
Next, it selects the mapping or group of mappings that need to be redefined or modified.
After making changes, the comparisons specified by the partner service will be considered a priority.
Important! After resubmitting the API statuses, the changes will take effect after the next parsing.
Description of matching methods 
Creating or updating comparisons of admission statuses from MIS and Medflex statuses 
Using this method, you can save or change (if you have already saved) the mapping in the Medflex.
When using the method, specify:
- A list of statuses from the IIA.
- List of matched statuses: Reception statuses
- List of medical facility IDs.
The comparison of statuses to clinics works on a many-to-many basis.
Example #1: By specifying several lpu_ids and one associated status, you can change this mapping in each specified LPU.
Example #2: By specifying one lpu_id and several associated statuses, you can change each of the specified mappings in the LPU.
You can compare only those statuses from the IIA that exist among the clinic's receptions.
All the statuses that exist in the clinic's MIS can be obtained using the method: Obtaining status comparisons for appointments from the MIS with the statuses of the Medical Complex
Getting status comparisons for MIS appointments with Medflex statuses 
The method returns the following data for matching:
- lpu_id is the ID of the clinic for this mapping.
- status_from_mis is the status received from the IIA.
- status_from_medflex — the status of the medical complex, compared with the status from the IIA.
- id is the ID of the mapping to the Medflex table.
- partner_defined — the value is true — the status is matched by the partner, the value is false - the status is matched by the medical complex.
Important! When using the method for the first time, some status matching may have the value of the partner_defined=true field, which means that this status has been reassigned by the partner. This is the standard behavior of the method, we have left the comparisons that you did earlier, while they differ from our matrix of comparisons.
Removing the comparison of admission status from the IIA with the Medflex status 
This method allows you to delete the status mapping previously created by the partner.
To do this, you only need to pass the matching ID.
If successful, the method will return the response code 204.
Frequently Asked Questions 
- Question: If the status from the IIA is not matched with the Medflex status, will it be available in the API for resubmission to the partner?
- Answer: Yes, such a mapping will be available for editing or deletion.