@careevolution/orchestrate
Version:
A TypeScript client for the Orchestrate API
159 lines (158 loc) • 7.67 kB
TypeScript
import { Advisories } from "./advisories.js";
import { BlindedDemographic, Demographic } from "./demographic.js";
import { IdentityMonitoringApi } from "./monitoring.js";
export type PersonStatus = {
code: "Active" | "Retired";
supercededBy: string[];
};
export type Record = {
source: string;
identifier: string;
};
export type Person = {
id: string;
records: Record[];
version: number;
status: PersonStatus;
};
export type AddOrUpdateRecordRequest = Record & {
demographic: Demographic;
};
export type AddOrUpdateBlindedRecordRequest = Record & {
blindedDemographic: BlindedDemographic;
};
export type MatchedPersonReference = {
matchedPerson: Person;
changedPersons: Person[];
};
export type AddOrUpdateRecordResponse = MatchedPersonReference & {
advisories: Advisories;
};
export type AddOrUpdateBlindedRecordResponse = MatchedPersonReference;
export type GetPersonByRecordResponse = Person;
export type GetPersonByIDRequest = {
id: string;
};
export type GetPersonByIDResponse = Person;
export type MatchDemographicsResponse = {
matchedPersons: Person[];
advisories: Advisories[];
};
export type MatchDemographicsRequest = Demographic;
export type MatchBlindedDemographicRequest = BlindedDemographic;
export type MatchBlindedDemographicsResponse = {
matchedPersons: Person[];
};
export type DeleteRecordRequest = Record;
export type DeleteRecordResponse = {
changedPersons: Person[];
};
export type MatchGuidanceRequest = {
recordOne: Record;
recordTwo: Record;
comment: string;
};
export type AddMatchGuidanceRequest = MatchGuidanceRequest & {
action: "Match" | "NoMatch";
};
export type AddMatchGuidanceResponse = {
changedPersons: Person[];
};
export type RemoveMatchGuidanceRequest = MatchGuidanceRequest;
export type RemoveMatchGuidanceResponse = {
changedPersons: Person[];
};
export type GetPersonByRecordRequest = Record;
export type IdentityApiConfiguration = {
url?: string | undefined;
apiKey?: string | undefined;
metricsKey?: string | undefined;
};
export declare class IdentityApi {
private httpHandler;
monitoring: IdentityMonitoringApi;
constructor(configuration?: IdentityApiConfiguration);
toString(): string;
/**
* Adds a new record or updates a previously created one.
* @param request The request to add or update a record.
* - `source` The system from which the record demographics were sourced.
* - `identifier` The unique identifier of the record within the source.
* - `demographic` The demographic information of the record.
* @returns The record's assigned person ID, along with any changes resulting from the addition or update.
* @link https://orchestrate.docs.careevolution.com/identity/operations/add_update_record.html
*/
addOrUpdateRecord(request: AddOrUpdateRecordRequest): Promise<AddOrUpdateRecordResponse>;
/**
* Adds a new record or updates a previously created one in privacy-preserving (blinded) mode.
* @param request The request to add or update a record.
* - `source`: The system from which the record demographics were sourced.
- `identifier`: The unique identifier of the record within the source.
- `data`: The B64 encoded hash provided by the local hashing service.
- `version`: The version number provided by the local hashing service.
* @returns Returns the record's assigned person ID, along with any changes resulting from the addition or update.
* @link https://orchestrate.docs.careevolution.com/identity/operations/add_update_record_blinded.html
*/
addOrUpdateBlindedRecord(request: AddOrUpdateBlindedRecordRequest): Promise<AddOrUpdateBlindedRecordResponse>;
/**
* Given a source system and identifier, this retrieves the person's metadata (including their Person ID) and the collection of records grouped with that individual.
* @param request The request to get a person by record.
* - `source`: The system from which the record demographics were sourced.
- `identifier`: The unique identifier of the record within the source.
* @returns The matched person.
* @link https://orchestrate.docs.careevolution.com/identity/operations/get_person_by_record.html
*/
getPersonByRecord(request: GetPersonByRecordRequest): Promise<GetPersonByRecordResponse>;
/**
* Given a Person ID, this retrieves the person's metadata and the collection of records grouped with that individual.
* @param reuest The request to get a person by ID.
* - `id`: id of the person to fetch
* @returns The matched person.
* @link https://orchestrate.docs.careevolution.com/identity/operations/get_person_by_id.html
*/
getPersonByID(request: GetPersonByIDRequest): Promise<GetPersonByIDResponse>;
/**
* Finds all persons and their associated records that match the provided demographics. This operation is read-only, and will not create or update any person records.
* @param request The demographic The demographic to match.
* @returns Persons and their associated records that match the provided demographics.
* @link https://orchestrate.docs.careevolution.com/identity/operations/match_demographics.html
*/
matchDemographics(demographic: MatchDemographicsRequest): Promise<MatchDemographicsResponse>;
/**
* Finds all persons and their associated records that match the provided demographics in privacy-preserving (blinded) mode.
* @param request The blinded demographic to match
* @returns Persons and their associated records that match the provided demographics.
* @link https://orchestrate.docs.careevolution.com/identity/operations/match_demographics_blinded.html
*/
matchBlindedDemographics(demographic: MatchBlindedDemographicRequest): Promise<MatchBlindedDemographicsResponse>;
/**
* Deletes a record using a source system and identifier.
* @param request The request to delete a record.
* - `source`: The system from which the record demographics were sourced.
* - `identifier`: The unique identifier of the record within the source.
* @returns List of persons changed by the operation.
* @link https://orchestrate.docs.careevolution.com/identity/operations/delete_record.html
*/
deleteRecord(request: DeleteRecordRequest): Promise<DeleteRecordResponse>;
/**
* Overrides automatic matching with manual guidance for a particular set of records.
* @param personId The persons to add match guidance for.
* - `record_one`: The first record
* - `record_two`: The second record
* - `action`: Use Match if the two records represent the same individual, and NoMatch if the two records represent different individuals.
* - `comment`: A comment for documentation/audit purposes.
* @returns List of persons changed by the operation.
* @link https://orchestrate.docs.careevolution.com/identity/operations/add_guidance.html
*/
addMatchGuidance(request: AddMatchGuidanceRequest): Promise<AddMatchGuidanceResponse>;
/**
* Removes a previously-created manual match guidance.
* @param personId The persons to remove match guidance for.
* - `record_one`: The first record
* - `record_two`: The second record
* - `comment`: A comment for documentation/audit purposes.
* @returns List of persons changed by the operation.
* @link https://orchestrate.docs.careevolution.com/identity/operations/remove_guidance.html
*/
removeMatchGuidance(request: RemoveMatchGuidanceRequest): Promise<RemoveMatchGuidanceResponse>;
}