/**
 * iCure Data Stack API Documentation
 * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
 *
 * OpenAPI spec version: v1
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */
import { XHR } from './XHR';
import { AbstractFilterPatient } from '../model/AbstractFilterPatient';
import { Content } from '../model/Content';
import { DataOwnerRegistrationSuccess } from '../model/DataOwnerRegistrationSuccess';
import { DocIdentifier } from '../model/DocIdentifier';
import { FilterChainPatient } from '../model/FilterChainPatient';
import { IdWithRev } from '../model/IdWithRev';
import { ListOfIds } from '../model/ListOfIds';
import { PaginatedListPatient } from '../model/PaginatedListPatient';
import { PaginatedListString } from '../model/PaginatedListString';
import { Patient } from '../model/Patient';
import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider';
import { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult';
import { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams';
import { TimingInfo } from '../model/TimingInfo';
export declare class IccPatientApi {
    host: string;
    _headers: Array<XHR.Header>;
    authenticationProvider: AuthenticationProvider;
    fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
    get headers(): Promise<Array<XHR.Header>>;
    constructor(host: string, headers: any, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
    setHeaders(h: Array<XHR.Header>): void;
    handleError(e: XHR.XHRError): never;
    /**
     * Returns the id and _rev of created patients
     * @summary Create patients in bulk
     * @param body
     */
    bulkCreatePatients(body?: Array<Patient>): Promise<Array<IdWithRev>>;
    /**
     * Returns the id and _rev of modified patients
     * @summary Modify patients in bulk
     * @param body
     */
    bulkUpdatePatients(body?: Array<Patient>): Promise<Array<IdWithRev>>;
    /**
     * Returns the count of patients shared directly with the provided hcp (ignoring hierarchies).
     * WARNING: the current implementation can count some patients twice if they have both security metadata and legacy
     * delegations from before v8.
     */
    countOfPatients(hcPartyId: string): Promise<Content>;
    /**
     * Name, last name, date of birth, and gender are required. After creation of the patient and obtaining the ID, you need to create an initial delegation.
     * @summary Create a patient
     * @param body
     */
    createPatient(body?: Patient): Promise<Patient>;
    /**
     * @summary Deletes a batch of patients.
     *
     * @param patientIds a ListOfIds containing the ids of the patients to delete.
     * @return a Promise that will resolve in an array of DocIdentifiers of the successfully deleted patients.
     */
    deletePatients(patientIds: ListOfIds): Promise<Array<DocIdentifier>>;
    /**
     * @summary Deletes a single patient by id.
     *
     * @param patientId the id of the patient to delete.
     * @return a Promise that will resolve in the DocIdentifier of the deleted patient.
     */
    deletePatient(patientId: string): Promise<DocIdentifier>;
    /**
     * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
     * @summary Filter patients for the current user (HcParty)
     * @param body
     * @param startKey The start key for pagination, depends on the filters used
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     * @param skip Skip rows
     * @param sort Sort key
     * @param desc Descending
     * @param collectTiming if true, include server-side filter timing information in the response
     */
    filterPatientsBy(startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, body?: FilterChainPatient, collectTiming?: false): Promise<PaginatedListPatient>;
    filterPatientsBy(startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, body?: FilterChainPatient, collectTiming?: true): Promise<PaginatedListPatient & TimingInfo>;
    /**
     *
     * @summary Get Paginated List of Patients sorted by Access logs descending
     * @param userId A User ID
     * @param accessType The type of access (COMPUTER or USER)
     * @param startDate The start search epoch
     * @param startKey The start key for pagination
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     */
    findByAccessLogUserAfterDate(userId: string, accessType?: string, startDate?: number, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListPatient>;
    /**
     *
     * @summary Get the patient having the provided externalId
     * @param externalId A external ID
     */
    findByExternalId(externalId: string): Promise<Patient>;
    /**
     * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
     * @summary Find patients for the current user (HcParty)
     * @param healthcarePartyId HealthcareParty Id. If not set, will use user&#x27;s hcpId
     * @param filterValue Optional value for filtering results
     * @param startKey The start key for pagination: a JSON representation of an array containing all the necessary components to form the Complex Key&#x27;s startKey
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     * @param sortDirection Optional value for providing a sorting direction (&#x27;asc&#x27;, &#x27;desc&#x27;). Set to &#x27;asc&#x27; by default.
     */
    findByNameBirthSsinAuto(healthcarePartyId?: string, filterValue?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise<PaginatedListPatient>;
    /**
     *
     * @summary Provides a paginated list of patients with duplicate name for an hecparty
     * @param hcPartyId Healthcare party id
     * @param startKey The start key for pagination, depends on the filters used
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     */
    findDuplicatesByName(hcPartyId: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListPatient>;
    /**
     *
     * @summary Provides a paginated list of patients with duplicate ssin for an hecparty
     * @param hcPartyId Healthcare party id
     * @param startKey The start key for pagination, depends on the filters used
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     */
    findDuplicatesBySsin(hcPartyId: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListPatient>;
    /**
     * Returns a list of patients
     * @summary Filter patients for the current user (HcParty)
     * @param firstName The first name
     * @param lastName The last name
     * @param dateOfBirth The date of birth
     */
    fuzzySearch(firstName?: string, lastName?: string, dateOfBirth?: number): Promise<Array<Patient>>;
    /**
     * It gets patient administrative data.
     * @summary Get patient
     * @param patientId
     */
    getPatient(patientId: string): Promise<Patient>;
    /**
     * (key, value) of the map is as follows: (ID of the owner of the encrypted AES key, encrypted AES keys)
     * @summary Get the HcParty encrypted AES keys indexed by owner.
     * @param patientId
     */
    getPatientAesExchangeKeysForDelegate(patientId: string): Promise<{
        [delegatorId: string]: {
            [delegatorPubKeyFingerprint: string]: {
                [delegatePubKeyFingerprint: string]: string;
            };
        };
    }>;
    /**
     * It gets patient administrative data based on the identifier (root & extension) parameters.
     * @summary Get patient by identifier
     * @param hcPartyId
     * @param id
     * @param system
     */
    getPatientByHealthcarepartyAndIdentifier(hcPartyId: string, id: string, system?: string): Promise<Patient>;
    /**
     * This endpoint is used to recover all keys that have already been created and that can be used to share information with this patient. It returns a map with the following structure: ID of the owner of the encrypted AES key -> encrypted AES key. The returned encrypted AES keys will have to be decrypted using the patient's private key.                  {                     \"hcparty 1 delegator ID\": \"AES hcparty key (encrypted using patient public RSA key)\"                     \"hcparty 2 delegator ID\": \"other AES hcparty key (encrypted using patient public RSA key)\"                 }
     * @summary Get the patient (identified by patientId) hcparty keys. Those keys are AES keys (encrypted) used to share information between HCPs and a patient.
     * @param patientId The patient Id for which information is shared
     */
    getPatientHcPartyKeysForDelegate(patientId: string): Promise<{
        [key: string]: string;
    }>;
    /**
     * It gets patient administrative data.
     * @summary Get patients by id
     * @param body
     */
    getPatients(body?: ListOfIds): Promise<Array<Patient>>;
    /**
     * Returns a list of deleted patients, within the specified time period, if any.
     * @summary Find deleted patients
     * @param startDate Filter deletions after this date (unix epoch), included
     * @param endDate Filter deletions before this date (unix epoch), included
     * @param startKey the startKey provided by the previous page or undefined for the first page.
     * @param desc Descending
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     */
    listDeletedPatients(startDate?: number, endDate?: number, desc?: boolean, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListPatient>;
    /**
     * Returns a list of deleted patients, by name and/or firstname prefix, if any.
     * @summary Find deleted patients
     * @param firstName First name prefix
     * @param lastName Last name prefix
     */
    listDeletedPatientsByName(firstName?: string, lastName?: string): Promise<Array<Patient>>;
    /**
     * Returns a list of patients that have been merged after the provided date
     * @summary List patients that have been merged towards another patient
     * @param date
     */
    listOfMergesAfter(date: number): Promise<Array<Patient>>;
    /**
     * Returns a list of patients that have been modified after the provided date
     * @summary List patients that have been modified after the provided date
     * @param date
     * @param startKey The start key for pagination the date of the first element of the new page
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     */
    listOfPatientsModifiedAfter(date: number, startKey?: number, startDocumentId?: string, limit?: number): Promise<PaginatedListPatient>;
    /**
     * @deprecated This method is not intuitive and will be removed in a future version
     * Currently there is no direct replacement that can do everything this method does.
     * If you need all patients unsorted or sorted by ssin/date of birth use `PatientByHcPartyFilter`/`PatientByHcPartyDateOfBirthFilter`
     * with {@link matchPatientsBy} to get the ids of all the patients shared directly with an HCP (ignoring hierarchies).
     * Note that on databases with many patients (>50k) the matches request could take various seconds as it is not
     * paginated.
     * If you want to use pagination or need to sort by name instead you can use the {@link listPatientsSortedByName}.
     * Usage of PatientByHcPartyNameFilter or PatientByHcPartyNameContainsFuzzyFilter as a replacement of this method is
     * discouraged as the sorting done by those filter is unintuitive.
     * Contact us if your use case is not covered by the suggested alternatives.
     *
     * This method returns all the patients (with pagination) that are shared directly with the parent of {@link hcPartyId},
     * or if undefined the current user's parent. Note that this doesn't allow to get patients that are shared only with
     * the current user and not its parent.
     */
    listPatients(hcPartyId?: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise<PaginatedListPatient>;
    /**
     * Get all patients shared directly with the provided hcparty (ignoring hierarchies) sorted by lastName, firstName.
     */
    listPatientsSortedByName(hcPartyId?: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListPatient>;
    /**
     * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
     * @summary List patients for a specific HcParty or for the current HcParty
     * @param hcPartyId
     * @param sortField Optional value for sorting results by a given field (&#x27;name&#x27;, &#x27;ssin&#x27;, &#x27;dateOfBirth&#x27;). Specifying this deactivates filtering
     * @param startKey The start key for pagination: a JSON representation of an array containing all the necessary components to form the Complex Key&#x27;s startKey
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     * @param sortDirection Optional value for providing a sorting direction (&#x27;asc&#x27;, &#x27;desc&#x27;). Set to &#x27;asc&#x27; by default.
     */
    listPatientsByHcParty(hcPartyId: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise<PaginatedListPatient>;
    /**
     * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
     * @summary List patients by pages for a specific HcParty
     * @param hcPartyId Healthcare party id
     * @param startKey The page first id
     * @param startDocumentId A patient document ID
     * @param limit Page size
     */
    listPatientsIds(hcPartyId: string, startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListString>;
    /**
     * Returns a list of patients along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.
     * @summary List patients of a specific HcParty or of the current HcParty
     * @param hcPartyId
     * @param sortField Optional value for sorting results by a given field (&#x27;name&#x27;, &#x27;ssin&#x27;, &#x27;dateOfBirth&#x27;). Specifying this deactivates filtering
     * @param startKey The start key for pagination: a JSON representation of an array containing all the necessary components to form the Complex Key&#x27;s startKey
     * @param startDocumentId A patient document ID
     * @param limit Number of rows
     * @param sortDirection Optional value for providing a sorting direction (&#x27;asc&#x27;, &#x27;desc&#x27;). Set to &#x27;asc&#x27; by default.
     */
    listPatientsOfHcParty(hcPartyId: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise<PaginatedListPatient>;
    /**
     *
     * @summary Get ids of patients matching the provided filter for the current user (HcParty)
     * @param body
     * @param collectTiming if true, include server-side filter timing information in the response
     */
    matchPatientsBy(body?: AbstractFilterPatient, collectTiming?: false): Promise<Array<string>>;
    matchPatientsBy(body?: AbstractFilterPatient, collectTiming?: true): Promise<Array<string> & TimingInfo>;
    /**
     *
     * @summary Merge a series of patients into another patient
     * @param toId
     * @param fromIds
     */
    mergeInto(toId: string, fromIds: string): Promise<Patient>;
    /**
     * No particular return value. It's just a message.
     * @summary Modify a patient
     * @param body
     */
    modifyPatient(body?: Patient): Promise<Patient>;
    /**
     *
     * @summary Set a patient referral doctor
     * @param patientId
     * @param referralId The referal id. Accepts &#x27;none&#x27; for referral removal.
     * @param start Optional value for start of referral
     * @param end Optional value for end of referral
     */
    modifyPatientReferral(patientId: string, referralId: string, start?: number, end?: number): Promise<Patient>;
    /**
     * Register a new patient into the system
     * @summary Register a patient
     * @param body
     * @param hcPartyId
     * @param groupId
     * @param token
     * @param useShortToken
     */
    registerPatient(hcPartyId: string, groupId: string, token?: string, useShortToken?: boolean, body?: Patient): Promise<DataOwnerRegistrationSuccess>;
    /**
     * Response is an array containing the ID of undeleted patient..
     * @summary undelete previously deleted patients
     * @param patientIds
     */
    undeletePatient(patientIds: string): Promise<Array<DocIdentifier>>;
    /**
     * @internal this method is for internal use only and may be changed without notice
     */
    bulkSharePatients(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Patient>[]>;
    /**
     * @internal use mergePatients from the extended api instead
     */
    baseMergePatients(fromId: string, expectedFromRev: string, updatedInto: Patient): Promise<Patient>;
}
