/** * 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'; import { ConflictResolutionRequest } from '../model/ConflictResolutionRequest'; import { ConflictResolutionResult } from '../model/ConflictResolutionResult'; import { ConflictResolutionStrategy } from '../model/ConflictResolutionStrategy'; import { MergeResult } from '../model/MergeResult'; export declare class IccPatientApi { host: string; _headers: Array; authenticationProvider: AuthenticationProvider; fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise; get headers(): Promise>; constructor(host: string, headers: any, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise); setHeaders(h: Array): void; handleError(e: XHR.XHRError): never; /** * Returns the id and _rev of created patients * @summary Create patients in bulk * @param body */ bulkCreatePatients(body?: Array): Promise>; /** * Returns the id and _rev of modified patients * @summary Modify patients in bulk * @param body */ bulkUpdatePatients(body?: Array): Promise>; /** * 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; /** * 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; /** * @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>; /** * @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; /** * 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; filterPatientsBy(startKey?: string, startDocumentId?: string, limit?: number, skip?: number, sort?: string, desc?: boolean, body?: FilterChainPatient, collectTiming?: true): Promise; /** * * @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; /** * * @summary Get the patient having the provided externalId * @param externalId A external ID */ findByExternalId(externalId: string): Promise; /** * 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'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's startKey * @param startDocumentId A patient document ID * @param limit Number of rows * @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default. */ findByNameBirthSsinAuto(healthcarePartyId?: string, filterValue?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise; /** * * @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; /** * * @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; /** * 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>; /** * It gets patient administrative data. * @summary Get patient * @param patientId */ getPatient(patientId: string): Promise; /** * (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; /** * 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>; /** * 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; /** * 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>; /** * 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>; /** * 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; /** * @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; /** * 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; /** * 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 ('name', 'ssin', 'dateOfBirth'). 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's startKey * @param startDocumentId A patient document ID * @param limit Number of rows * @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default. */ listPatientsByHcParty(hcPartyId: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise; /** * 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; /** * 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 ('name', 'ssin', 'dateOfBirth'). 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's startKey * @param startDocumentId A patient document ID * @param limit Number of rows * @param sortDirection Optional value for providing a sorting direction ('asc', 'desc'). Set to 'asc' by default. */ listPatientsOfHcParty(hcPartyId: string, sortField?: string, startKey?: string, startDocumentId?: string, limit?: number, sortDirection?: string): Promise; /** * * @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>; matchPatientsBy(body?: AbstractFilterPatient, collectTiming?: true): Promise & TimingInfo>; /** * * @summary Merge a series of patients into another patient * @param toId * @param fromIds */ mergeInto(toId: string, fromIds: string): Promise; /** * No particular return value. It's just a message. * @summary Modify a patient * @param body */ modifyPatient(body?: Patient): Promise; /** * * @summary Set a patient referral doctor * @param patientId * @param referralId The referal id. Accepts 'none' 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; /** * 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; /** * Response is an array containing the ID of undeleted patient.. * @summary undelete previously deleted patients * @param patientIds */ undeletePatient(patientIds: string): Promise>; /** * @internal this method is for internal use only and may be changed without notice */ bulkSharePatients(request: BulkShareOrUpdateMetadataParams): Promise[]>; /** * @internal use mergePatients from the extended api instead */ baseMergePatients(fromId: string, expectedFromRev: string, updatedInto: Patient, omitEncryptionKeysOfFrom: boolean): Promise; /** * Retrieves the ids of all the patients that currently have conflicting revisions and therefore need to * be resolved. * @summary List the ids of the patients that have conflicts. * @return the ids of the patients with unresolved conflicts. */ getConflictingEntitiesIds(): Promise>; /** * Retrieves all the conflicting revisions of the patient with the given id (the current revision is not * included). The returned entities are still encrypted. * @summary Get the conflicting revisions of a patient. * @param entityId the id of the patient to retrieve the conflicts for. * @return the conflicting revisions of the patient. */ getConflictsForEntity(entityId: string): Promise>; /** * Resolves a conflict by declaring which revision of the patient should be kept as winner and which * conflicting revisions should be purged. The provided document must already be encrypted. * @summary Declare the winning revision of a conflicting patient. * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge. * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved. */ declareConflictWinner(body: ConflictResolutionRequest): Promise>; /** * Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id. * @summary List the ids of the patients that have conflicts, in the given group. * @param groupId the id of the group to look into. * @return the ids of the patients with unresolved conflicts in the group. */ getConflictingEntitiesIdsInGroup(groupId: string): Promise>; /** * Like {@link getConflictsForEntity} but targets the entity of the group with the given id. * @summary Get the conflicting revisions of a patient, in the given group. * @param groupId the id of the group the patient belongs to. * @param entityId the id of the patient to retrieve the conflicts for. * @return the conflicting revisions of the patient. */ getConflictsForEntityInGroup(groupId: string, entityId: string): Promise>; /** * Like {@link declareConflictWinner} but targets the entity of the group with the given id. * @summary Declare the winning revision of a conflicting patient, in the given group. * @param groupId the id of the group the patient belongs to. * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge. * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved. */ declareConflictWinnerInGroup(groupId: string, body: ConflictResolutionRequest): Promise>; /** * Automatically resolves the conflicting revisions of the patients with the given ids, according to the provided * {@link ConflictResolutionStrategy}. * @summary Automatically solve the conflicts of the patients with the given ids. * @param entityIds the ids of the patients to solve the conflicts for. * @param strategy the {@link ConflictResolutionStrategy} to use to resolve the conflicts. Defaults to `FullMergeability`. * @return the {@link MergeResult} of the conflict resolution for each requested entity. */ autoSolveConflicts(entityIds: Array, strategy?: ConflictResolutionStrategy): Promise>; /** * Like {@link autoSolveConflicts} but targets the entities of the group with the given id. * @summary Automatically solve the conflicts of the patients with the given ids, in the given group. * @param groupId the id of the group to look into. * @param entityIds the ids of the patients to solve the conflicts for. * @param strategy the {@link ConflictResolutionStrategy} to use to resolve the conflicts. Defaults to `FullMergeability`. * @return the {@link MergeResult} of the conflict resolution for each requested entity. */ autoSolveConflictsInGroup(groupId: string, entityIds: Array, strategy?: ConflictResolutionStrategy): Promise>; }