import { IccAuthApi, IccPatientApi } from '../icc-api';
import { IccCryptoXApi } from './icc-crypto-x-api';
import { IccContactXApi } from './icc-contact-x-api';
import { IccFormXApi } from './icc-form-x-api';
import { IccHcpartyXApi } from './icc-hcparty-x-api';
import { IccInvoiceXApi } from './icc-invoice-x-api';
import { IccDocumentXApi } from './icc-document-x-api';
import { IccHelementXApi } from './icc-helement-x-api';
import { IccClassificationXApi } from './icc-classification-x-api';
import * as models from '../icc-api/model/models';
import { Patient, TimingInfo } from '../icc-api/model/models';
import { IccCalendarItemXApi } from './icc-calendar-item-x-api';
import { SubscriptionOptions } from './utils';
import { IccDataOwnerXApi } from './icc-data-owner-x-api';
import { AuthenticationProvider } from './auth/AuthenticationProvider';
import { EntityWithDelegationTypeName } from './utils/EntityWithDelegationTypeName';
import { SecureDelegation } from '../icc-api/model/SecureDelegation';
import { EntityShareRequest } from '../icc-api/model/requests/EntityShareRequest';
import { ShareMetadataBehaviour } from './crypto/ShareMetadataBehaviour';
import { ShareResult } from './utils/ShareResult';
import AccessLevelEnum = SecureDelegation.AccessLevelEnum;
import RequestedPermissionEnum = EntityShareRequest.RequestedPermissionEnum;
import { XHR } from '../icc-api/api/XHR';
import { EncryptedEntityXApi } from './basexapi/EncryptedEntityXApi';
import { IccUserXApi } from './icc-user-x-api';
import { AbstractFilter } from './filters/filters';
import { Connection } from '../icc-api/model/Connection';
export declare class IccPatientXApi extends IccPatientApi implements EncryptedEntityXApi<models.Patient> {
    private readonly crypto;
    private readonly contactApi;
    private readonly formApi;
    private readonly helementApi;
    private readonly invoiceApi;
    private readonly documentApi;
    private readonly hcpartyApi;
    private readonly classificationApi;
    private readonly dataOwnerApi;
    private readonly calendarItemApi;
    private readonly userApi;
    private readonly authApi;
    private readonly autofillAuthor;
    private readonly encryptedFields;
    get headers(): Promise<Array<XHR.Header>>;
    constructor(host: string, headers: {
        [key: string]: string;
    }, crypto: IccCryptoXApi, contactApi: IccContactXApi, formApi: IccFormXApi, helementApi: IccHelementXApi, invoiceApi: IccInvoiceXApi, documentApi: IccDocumentXApi, hcpartyApi: IccHcpartyXApi, classificationApi: IccClassificationXApi, dataOwnerApi: IccDataOwnerXApi, calendarItemApi: IccCalendarItemXApi, userApi: IccUserXApi, authApi: IccAuthApi, autofillAuthor: boolean, encryptedKeys?: Array<string>, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
    /**
     * Creates a new instance of patient with initialised encryption metadata (not in the database).
     * @param user the current user.
     * @param p initialised data for the patient. Metadata such as id, creation data, etc. will be automatically initialised, but you can specify
     * other kinds of data or overwrite generated metadata with this. You can't specify encryption metadata.
     * @param options optional parameters:
     * - additionalDelegates: delegates which will have access to the entity in addition to the current data owner and delegates from the
     * auto-delegations. Must be an object which associates each data owner id with the access level to give to that data owner. May overlap with
     * auto-delegations, in such case the access level specified here will be used.
     * - ignoreAutoDelegations: if true the data won't be shared with the autodelegations of the user, but only with additional delegates
     * - alternateRootDelegation: by default a new entity is created with a root delegation from self to self. In keyless mode this is not possible,
     * and instead the root delegation will be from self to another. You have to specify which delegate will be part of the root delegation.
     * @return a new instance of patient.
     */
    newInstance(user: models.User, p?: any, options?: {
        additionalDelegates?: {
            [dataOwnerId: string]: AccessLevelEnum;
        };
        ignoreAutoDelegations?: boolean;
        alternateRootDelegation?: string;
    }): Promise<models.Patient>;
    /**
     * Ensures patient names are consistent by synchronizing names property with firstName/lastName/maidenName/alias fields.
     * @param patient the patient to process
     * @return the patient with completed names
     */
    completeNames(patient: models.Patient): models.Patient;
    /**
     * @deprecated replace with {@link initConfidentialSecretId}
     */
    initConfidentialDelegation(patient: models.Patient, user: models.User): Promise<models.Patient>;
    /**
     * Ensures that the current data owner has some confidential secret ids for the provided patient. If not creates them and updates the patient in the
     * database.
     * @param patient the patient for which you want to initialise the confidential secret id.
     * @param user the current user.
     * @return the updated patient or the original patient if no change was necessary.
     */
    initConfidentialSecretId(patient: models.Patient, user: models.User): Promise<models.Patient>;
    createPatient(body?: models.Patient): never;
    /**
     * Creates a patient in the database with encryption.
     * @param user the current user
     * @param body the patient data to create
     * @return the created patient
     */
    createPatientWithUser(user: models.User, body?: models.Patient): Promise<models.Patient | any>;
    filterBy(startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, body?: models.FilterChainPatient): never;
    /**
     * Filters patients using a filter chain and returns decrypted results.
     * @param user the current user
     * @param filterChain the filter chain to apply
     * @param startKey optional start key for pagination
     * @param startDocumentId optional start document id for pagination
     * @param limit optional maximum number of results
     * @param skip optional number of results to skip
     * @param sort optional sort field
     * @param desc optional sort direction
     * @param collectTiming add timing information to the response
     * @return paginated list of decrypted patients
     */
    filterByWithUser(user: models.User, filterChain: models.FilterChainPatient, startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, collectTiming?: false): Promise<models.PaginatedListPatient | any>;
    filterByWithUser(user: models.User, filterChain: models.FilterChainPatient, startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, collectTiming?: true): Promise<(models.PaginatedListPatient & TimingInfo) | any>;
    findByAccessLogUserAfterDate(userId: string, accessType?: string, startDate?: number, startKey?: string, startDocumentId?: string, limit?: number): never;
    /**
     * Finds patients by access log user after a specific date and returns decrypted results.
     * @param user the current user
     * @param userId the user id to search for in access logs
     * @param accessType optional type of access
     * @param startDate optional start date timestamp
     * @param startKey optional start key for pagination
     * @param startDocumentId optional start document id for pagination
     * @param limit optional maximum number of results
     * @return paginated list of decrypted patients
     */
    findByAccessLogUserAfterDateWithUser(user: models.User, userId: string, accessType?: string, startDate?: number, startKey?: string, startDocumentId?: string, limit?: number): Promise<models.PaginatedListPatient | any>;
    findByAccessLogUserAfterDate_1(externalId: string): never;
    /**
     * Finds a patient by external id and returns the decrypted result.
     * @param user the current user
     * @param externalId the external id to search for
     * @return the decrypted patient
     */
    findByExternalIdWithUser(user: models.User, externalId: string): Promise<models.Patient | any>;
    findByNameBirthSsinAuto(healthcarePartyId?: string, filterValue?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): never;
    /**
     * Finds patients by name, birth date, or SSIN with automatic search and returns decrypted results.
     * @param user the current user
     * @param healthcarePartyId optional healthcare party id
     * @param filterValue optional search value
     * @param startKey optional start key for pagination
     * @param startDocumentId optional start document id for pagination
     * @param limit optional maximum number of results
     * @param sortDirection optional sort direction
     * @return paginated list of decrypted patients
     */
    findByNameBirthSsinAutoWithUser(user: models.User, healthcarePartyId?: string, filterValue?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise<models.PaginatedListPatient | any>;
    fuzzySearch(firstName?: string, lastName?: string, dateOfBirth?: number): never;
    /**
     * Performs a fuzzy search for patients and returns decrypted results.
     * @param user the current user
     * @param firstName optional first name to search for
     * @param lastName optional last name to search for
     * @param dateOfBirth optional date of birth timestamp
     * @return array of decrypted patients
     */
    fuzzySearchWithUser(user: models.User, firstName?: string, lastName?: string, dateOfBirth?: number): Promise<Array<models.Patient> | any>;
    getPatient(patientId: string): never;
    /**
     * Gets a patient by id without decryption.
     * @param patientId the patient id
     * @return the encrypted patient
     */
    getPatientRaw(patientId: string): Promise<models.Patient | any>;
    /**
     * Gets a patient by id with decryption.
     * @param user the current user
     * @param patientId the patient id
     * @return the decrypted patient
     */
    getPatientWithUser(user: models.User, patientId: string): Promise<models.Patient | any>;
    /**
     * Gets a patient by id and indicates whether it was successfully decrypted.
     * @param user the current user
     * @param patientId the patient id
     * @return object containing the patient and a flag indicating if it was decrypted
     */
    getPotentiallyEncryptedPatientWithUser(user: models.User, patientId: string): Promise<{
        patient: models.Patient;
        decrypted: boolean;
    }>;
    getPatients(body?: models.ListOfIds): never;
    /**
     * Gets multiple patients by their ids with decryption.
     * @param user the current user
     * @param body list of patient ids
     * @return array of decrypted patients
     */
    getPatientsWithUser(user: models.User, body?: models.ListOfIds): Promise<Array<models.Patient> | any>;
    listDeletedPatients(startDate?: number, endDate?: number, desc?: boolean, startKey?: string, startDocumentId?: string, limit?: number): never;
    /**
     * Lists deleted patients with decryption.
     * @param user the current user
     * @param startDate optional start date timestamp
     * @param endDate optional end date timestamp
     * @param desc optional sort direction
     * @param startKey optional start key for pagination
     * @param startDocumentId optional start document id for pagination
     * @param limit optional maximum number of results
     * @return paginated list of decrypted deleted patients
     */
    listDeletedPatientsWithUser(user: models.User, startDate?: number, endDate?: number, desc?: boolean, startKey?: string, startDocumentId?: string, limit?: number): Promise<models.PaginatedListPatient | any>;
    listDeletedPatients_2(firstName?: string, lastName?: string): never;
    /**
     * Lists deleted patients by name with decryption.
     * @param user the current user
     * @param firstName optional first name to filter by
     * @param lastName optional last name to filter by
     * @return array of decrypted deleted patients
     */
    listDeletedPatientsByNameWithUser(user: models.User, firstName?: string, lastName?: string): Promise<Array<models.Patient> | any>;
    listOfMergesAfter(date: number): never;
    /**
     * Lists merged patients after a specific date with decryption.
     * @param user the current user
     * @param date timestamp to start from
     * @return array of decrypted merged patients
     */
    listOfMergesAfterWithUser(user: models.User, date: number): Promise<Array<models.Patient> | any>;
    listOfPatientsModifiedAfter(date: number, startKey?: number, startDocumentId?: string, limit?: number): never;
    /**
     * Lists patients modified after a specific date with decryption.
     * @param user the current user
     * @param date timestamp to start from
     * @param startKey optional start key for pagination
     * @param startDocumentId optional start document id for pagination
     * @param limit optional maximum number of results
     * @return paginated list of decrypted modified patients
     */
    listOfPatientsModifiedAfterWithUser(user: models.User, date: number, startKey?: number, startDocumentId?: string, limit?: number): Promise<models.PaginatedListPatient | any>;
    listPatients(hcPartyId?: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): never;
    /**
     * Lists patients with decryption.
     * @param user the current user
     * @param hcPartyId optional healthcare party id
     * @param sortField optional sort field
     * @param startKey optional start key for pagination
     * @param startDocumentId optional start document id for pagination
     * @param limit optional maximum number of results
     * @param sortDirection optional sort direction
     * @return paginated list of decrypted patients
     */
    listPatientsWithUser(user: models.User, hcPartyId?: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise<models.PaginatedListPatient | any>;
    listPatientsByHcParty(hcPartyId: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): never;
    /**
     * Lists patients by healthcare party with decryption.
     * @param user the current user
     * @param hcPartyId the healthcare party id
     * @param sortField optional sort field
     * @param startKey optional start key for pagination
     * @param startDocumentId optional start document id for pagination
     * @param limit optional maximum number of results
     * @param sortDirection optional sort direction
     * @return paginated list of decrypted patients
     */
    listPatientsByHcPartyWithUser(user: models.User, hcPartyId: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise<models.PaginatedListPatient | any>;
    listPatientsOfHcParty(hcPartyId: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): never;
    /**
     * Lists patients of a healthcare party with decryption.
     * @param user the current user
     * @param hcPartyId the healthcare party id
     * @param sortField optional sort field
     * @param startKey optional start key for pagination
     * @param startDocumentId optional start document id for pagination
     * @param limit optional maximum number of results
     * @param sortDirection optional sort direction
     * @return paginated list of decrypted patients
     */
    listPatientsOfHcPartyWithUser(user: models.User, hcPartyId: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise<models.PaginatedListPatient | any>;
    mergeInto(toId: string, fromIds: string): never;
    /**
     * Merges patients and returns the decrypted result.
     * @param user the current user
     * @param toId the target patient id
     * @param fromIds the source patient ids to merge from
     * @return the decrypted merged patient
     */
    mergeIntoWithUser(user: models.User, toId: string, fromIds: string): Promise<models.Patient | any>;
    modifyPatient(body?: models.Patient): never;
    /**
     * @internal this method is for internal use only and may be changed without notice.
     */
    modifyPatientRaw(body?: models.Patient): Promise<models.Patient | any>;
    /**
     * Updates a patient with encryption.
     * @param user the current user
     * @param body the patient data to update
     * @return the updated decrypted patient
     */
    modifyPatientWithUser(user: models.User, body?: models.Patient): Promise<models.Patient | null>;
    private modifyPatientAs;
    modifyPatientReferral(patientId: string, referralId: string, start?: number, end?: number): never;
    /**
     * Updates a patient referral and returns the decrypted result.
     * @param user the current user
     * @param patientId the patient id
     * @param referralId the referral id
     * @param start optional start timestamp
     * @param end optional end timestamp
     * @return the updated decrypted patient
     */
    modifyPatientReferralWithUser(user: models.User, patientId: string, referralId: string, start?: number, end?: number): Promise<models.Patient | any>;
    /**
     * Encrypts patients using the current user's encryption keys.
     * @param user the current user
     * @param pats the patients to encrypt
     * @return the encrypted patients
     */
    encrypt(user: models.User, pats: Array<models.Patient>): Promise<Array<models.Patient>>;
    private encryptAs;
    /**
     * Decrypts patients using the current user's encryption keys. If a patient can't be decrypted, returns it with encrypted data.
     * @param user the current user
     * @param patients the patients to decrypt
     * @param fillDelegations optional flag to fill delegations (defaults to true)
     * @return the decrypted patients
     */
    decrypt(user: models.User, patients: Array<models.Patient>, fillDelegations?: boolean): Promise<Array<models.Patient>>;
    private decryptAs;
    /**
     * Attempts to decrypt patients. If decryption fails, returns the original encrypted patients.
     * @param patients the patients to decrypt
     * @return array of objects containing the patient entity and a flag indicating if it was decrypted
     */
    tryDecryptOrReturnOriginal(patients: Array<models.Patient>): Promise<{
        entity: models.Patient;
        decrypted: boolean;
    }[]>;
    /**
     * @deprecated replace with {@link shareAllDataOfPatient}
     */
    share(user: models.User, patId: string, ownerId: string, delegateIds: Array<string>, delegationTags: {
        [key: string]: Array<string>;
    }, usingPost?: boolean): Promise<{
        patient: models.Patient | null;
        statuses: {
            [key: string]: {
                success: boolean | null;
                error: Error | null;
            };
        };
    } | null>;
    /**
     * Shares a patient and all related data with specified delegates.
     * @param user the current user
     * @param patId the patient id
     * @param ownerId the owner healthcare party id
     * @param delegateIds the delegate ids to share with
     * @param delegationTags tags specifying what data to share (e.g., medicalInformation, financialInformation, all)
     * @param usingPost optional flag to use POST method instead of GET (defaults to false)
     * @return object containing the updated patient and sharing statuses for each entity type
     */
    shareAllDataOfPatient(user: models.User, patId: string, ownerId: string, delegateIds: Array<string>, delegationTags: {
        [key: string]: Array<string>;
    }, usingPost?: boolean): Promise<{
        patient: models.Patient | null;
        statuses: {
            [key: string]: {
                success: boolean | null;
                error: Error | null;
            };
        };
    } | null>;
    /**
     * Exports a patient and all related medical data.
     * @param user the current user
     * @param patId the patient id
     * @param ownerId the owner healthcare party id
     * @return object containing the patient and all related entities (contacts, forms, health elements, invoices, classifications, calendar items, documents)
     */
    export(user: models.User, patId: string, ownerId: string): Promise<{
        id: string;
        patient: Patient | null;
        contacts: models.Contact[];
        forms: models.Form[];
        healthElements: models.HealthElement[];
        invoices: models.Invoice[];
        classifications: models.Classification[];
        calItems: models.CalendarItem[];
        documents: models.Document[];
    }>;
    /**
     * Validates a Belgian INAMI number using modulo 97 check.
     * @param inami the INAMI number to validate
     * @return true if the INAMI number is valid, false otherwise
     */
    checkInami(inami: string): boolean;
    /**
     * Validates a Belgian social security identification number (SSIN/NISS) including support for bis and ter numbers.
     * @param ssin the SSIN to validate
     * @return true if the SSIN is valid, false otherwise
     */
    isValidSsin(ssin: string): boolean;
    /**
     * Extracts the patient id from a child document, following merge chains if necessary.
     * @param childDocument the child document (invoice, calendar item, contact, or access log)
     * @param hcpId the healthcare party id
     * @param childDocumentType the type of the child document
     * @return the patient id after following any merge chains
     */
    getPatientIdOfChildDocumentForHcpAndHcpParents(childDocument: models.Invoice | models.CalendarItem | models.Contact | models.AccessLog, hcpId: string, childDocumentType: EntityWithDelegationTypeName): Promise<string>;
    /**
     * @return if the logged data owner has write access to the content of the given patient
     */
    hasWriteAccess(patient: models.Patient): Promise<boolean>;
    /**
     * Share an existing patient with other data owners, allowing them to access the non-encrypted data of the patient and optionally also
     * the encrypted content, with read-only or read-write permissions.
     * @param delegateId the id of the data owner which will be granted access to the patient.
     * @param patient the patient to share.
     * @param shareSecretIds the secret ids of the Patient that the delegate will be given access to. Allows the delegate to search for data where the
     * shared Patient is the owning entity id.
     * @param options optional parameters to customize the sharing behaviour:
     * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
     * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
     * patient does not have encrypted content.
     * {@link ShareMetadataBehaviour.IF_AVAILABLE}).
     * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
     * @return the updated entity
     */
    shareWith(delegateId: string, patient: models.Patient, shareSecretIds: string[], options?: {
        requestedPermissions?: RequestedPermissionEnum;
        shareEncryptionKey?: ShareMetadataBehaviour;
    }): Promise<models.Patient>;
    /**
     * Share an existing patient with other data owners, allowing them to access the non-encrypted data of the patient and optionally also
     * the encrypted content, with read-only or read-write permissions.
     * @param patient the patient to share.
     * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
     * - shareSecretIds the secret ids of the Patient that the delegate will be given access to. Allows the delegate to search for data where the
     * shared Patient is the owning entity id.
     * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
     * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
     * patient does not have encrypted content.
     * {@link ShareMetadataBehaviour.IF_AVAILABLE}).
     * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
     * @return the updated entity
     */
    shareWithMany(patient: models.Patient, delegates: {
        [delegateIds: string]: {
            shareSecretIds: string[];
            requestedPermissions?: RequestedPermissionEnum;
            shareEncryptionKey?: ShareMetadataBehaviour;
        };
    }): Promise<models.Patient>;
    /**
     * Share an existing patient with other data owners, allowing them to access the non-encrypted data of the patient and optionally also
     * the encrypted content, with read-only or read-write permissions.
     * @param patient the patient to share.
     * @param delegates associates the id of data owners which will be granted access to the entity, to the following sharing options:
     * - shareSecretIds the secret ids of the Patient that the delegate will be given access to. Allows the delegate to search for data where the
     * shared Patient is the owning entity id.
     * - shareEncryptionKey: specifies if the encryption key of the access log should be shared with the delegate, giving access to all encrypted
     * content of the entity, excluding other encrypted metadata (defaults to {@link ShareMetadataBehaviour.IF_AVAILABLE}). Note that by default a
     * patient does not have encrypted content.
     * {@link ShareMetadataBehaviour.IF_AVAILABLE}).
     * - requestedPermissions: the requested permissions for the delegate, defaults to {@link RequestedPermissionEnum.MAX_WRITE}.
     * @return a promise which will contain the result of the operation: the updated entity if the operation was successful or details of the error if
     * the operation failed.
     */
    tryShareWithMany(patient: models.Patient, delegates: {
        [delegateIds: string]: {
            shareSecretIds: string[];
            requestedPermissions?: RequestedPermissionEnum;
            shareEncryptionKey?: ShareMetadataBehaviour;
        };
    }): Promise<ShareResult<models.Patient>>;
    /**
     * @param patient a patient
     * @return all the decryptable secret ids of the patient, retrieved from the encrypted metadata. The result may be used to find entities where the
     * patient is the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.
     */
    decryptSecretIdsOf(patient: models.Patient): Promise<string[]>;
    /**
     * @param patient a patient
     * @return the confidential secret ids of the patient, retrieved from the encrypted metadata. The result may be used to find entities where the
     * patient is the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.
     */
    decryptConfidentialSecretIdsOf(patient: models.Patient): Promise<string[]>;
    /**
     * @param patient a patient
     * @return the non-confidential secret ids of the patient, retrieved from the encrypted metadata. The result may be used to find entities where the
     * patient is the 'owning entity', or in the {@link shareWith} method in order to share it with other data owners.
     */
    decryptNonConfidentialSecretIdsOf(patient: models.Patient): Promise<string[]>;
    /**
     * Gets all data owners with access to the patient and their permission levels.
     * @param entity the patient
     * @return object containing permissions by data owner id and a flag indicating if there are unknown anonymous data owners
     */
    getDataOwnersWithAccessTo(entity: models.Patient): Promise<{
        permissionsByDataOwnerId: {
            [p: string]: AccessLevelEnum;
        };
        hasUnknownAnonymousDataOwners: boolean;
    }>;
    /**
     * Gets all encryption keys of the patient that the current user can decrypt.
     * @param entity the patient
     * @return array of encryption keys
     */
    getEncryptionKeysOf(entity: models.Patient): Promise<string[]>;
    /**
     * Merge two patients into one. This method performs the following operations:
     * - The `from` patient will be soft-deleted, and it will point to the `into` patient. Only the `deletionDate` and `mergeToPatientId` fields of the
     *   patient will be changed (automatically by this method). Note that the value of {@link from} is only used to verify that the client is aware of
     *   the last version of the `from` patient: any changes to its content and/or metadata compared to what is actually stored in the database will be
     *   ignored.
     * - The metadata of the `into` patient will be automatically updated to contain also the metadata of the `from` patient and to keep track of the
     *   merge:
     *   - the `mergedIds` will be updated to contain the `from` patient id
     *   - all secret ids of the `from` patient will be added to the `into` patient
     *   - all data owners (including anonymous data owners) with access to the `from` patient will have the same access to the merged `into` patient
     *     (unless they already had greater access to the `into` patient, in which case they keep the greater access)
     * - The content of the `into` patient will be updated to match the content (name, address, note, ...) of the provided {@link mergedInto} parameter.
     *   Note that since the metadata is automatically updated by this method you must not change the metadata of the `mergedInto` patient
     *   (`delegations`, mergedInto`, ...): if there is any change between the metadata of the provided `mergedInto` patient and the stored patient this
     *   method will fail with an error.
     *
     * In case the revisions of {@link from} and/or {@link mergedInto} does not match the latest revisions for these patients in the database this
     * method will fail without soft-deleting the `from` patient and without updating the `into` patient with the merged content and metadata. You will
     * have to retrieve the updated versions of both patients before retrying the merge.
     *
     * Finally, note that this method only merges existing data, and does not perform any automatic sharing of the data. The secret ids and encryption
     * keys will not be shared with users that had access only to one of the entity, you will have to use the {@link shareWith} method after the merge
     * if you want to do so.
     * For example consider hcps A, B with access to P' and hcps A, C with access to P'', and we merge P'' into P'. After the merge:
     * - A has access to all secret ids of the merged patient and to the encryption key of the merged patient
     * - B has access to the encryption key of the merged patient (since it is the same as in P'), but only to the secret id which was originally from
     *   the unmerged P'
     * - C has no access to the encryption key of the merged patient, and has access only to the secret id which was originally from the unmerged P''
     *
     * @param from the original, unmodified `from` patient. Its content will be unchanged and its metadata will be automatically updated by this method
     * to reflect the merge.
     * @param mergedInto the `into` patient with updated content result of the merge with the `from` patient, as specified by your application logic.
     * The metadata of the `mergedInto` patient must not differ from the metadata of the stored version of the patient, since it will be automatically
     * updated by the method.
     * @return the updated `into` patient.
     */
    mergePatients(from: Patient, mergedInto: Patient): Promise<Patient>;
    /**
     * Subscribes to patient events (create, update, delete) and automatically decrypts them.
     * @param eventTypes the types of events to subscribe to
     * @param filter optional filter to apply to events
     * @param eventFired callback function to handle each event
     * @param options optional subscription options
     * @return connection object to manage the subscription
     */
    subscribeToPatientEvents(eventTypes: ('CREATE' | 'UPDATE' | 'DELETE')[], filter: AbstractFilter<Patient> | undefined, eventFired: (patient: Patient) => Promise<void>, options?: SubscriptionOptions): Promise<Connection>;
    /**
     * Creates or updates de-anonymization metadata for patient delegations.
     * @param entity the patient
     * @param delegates array of delegate ids to create metadata for
     */
    createDelegationDeAnonymizationMetadata(entity: Patient, delegates: string[]): Promise<void>;
    /**
     * Initializes the exchange data towards a newly invited patient. This allows the doctor to share data with the
     * patient even if the patient has not yet initialized a keypair for himself.
     *
     * This method should be used only if the patient has not yet initialized a keypair for himself. If the patient has
     * already initialized a keypair this method does nothing and returns false. In this case the exchange data will be
     * automatically created the first time you share data with the patient, and your implementation of the crypto
     * strategies will be used to validate the public keys of the patient.
     *
     * Once exchange data is initialized you can use the {@link IccRecoveryXApi.createExchangeDataRecoveryInfo} to
     * generate a key that the patient will be able to use on his first login to immediately gain access to the exchange
     * data (through the {@link IccRecoveryXApi.recoverExchangeData} method).
     *
     * @param patientId the id of the newly invited patient.
     * @return true if exchange data was initialized, false if the patient already has a key pair and the exchange data
     * will be initialized in the standard way (automatically on the first time data is shared with the user).
     */
    forceInitialiseExchangeDataToNewlyInvitedPatient(patientId: string): Promise<boolean>;
}
