import { BaseFilterOptions, BaseSortableFilterOptions, FilterOptions, SortableFilterOptions } from '../cardinal-sdk-ts.mjs'; import { EntityReferenceInGroup } from '../model/EntityReferenceInGroup.mjs'; import { GroupScoped } from '../model/GroupScoped.mjs'; import { Message } from '../model/Message.mjs'; import { Patient } from '../model/Patient.mjs'; interface MessageFiltersFactory { /** * * Create options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner. * @param dataOwnerId a data owner id * @return options for message filtering */ allMessagesForDataOwner(dataOwnerId: string): BaseFilterOptions; /** * * Create options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with the current data owner. * @return options for message filtering */ allMessagesForSelf(): FilterOptions; /** * * Creates options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner that have the * provided transportGuid. * * @param dataOwnerId a data owner id * @param transportGuid a message transport guid */ byTransportGuidForDataOwner(dataOwnerId: string, transportGuid: string): BaseFilterOptions; /** * * In group version of [byTransportGuidForDataOwner]. */ byTransportGuidForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, transportGuid: string): BaseFilterOptions; /** * * Creates options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with the current data owner that have the * provided transportGuid. * * @param transportGuid a message transport guid */ byTransportGuidForSelf(transportGuid: string): FilterOptions; /** * * Filter options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner * where [Message.fromAddress] is equal to [address]. * * @param dataOwnerId the id of a data owner. * @param address the sender address. */ fromAddressForDataOwner(dataOwnerId: string, address: string): BaseFilterOptions; /** * * In group version of [fromAddressForDataOwner]. */ fromAddressForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, address: string): BaseFilterOptions; /** * * Filter options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with the current data owner * where [Message.fromAddress] is equal to [address]. * * @param address the sender address. */ fromAddressForSelf(address: string): FilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner * that are linked with one of the provided patients. * This Options also allows to restrict the messages based on [Message.sent]: * - if [from] is not null, only the messages where [Message.sent] is greater than or equal to [from] will be returned. * - if [to] is not null, only the messages where [Message.sent] is less than or equal to [to] will be returned. * * When using these options the sdk will automatically extract the secret ids from the provided patients and use * those for filtering. * If you already have the secret ids of the patient you may instead use [byPatientSecretIdsSentDateForDataOwner]. * If the current data owner does not have access to any secret id of one of the provide patients the patient will * simply be ignored. * Note that these may not be used in methods of apis from [CardinalBaseApis]. * * These options are sortable. When sorting using these options the messages will be sorted by [Message.sent] in ascending or * descending order according to the value of the [descending] parameter. * * @param dataOwnerId a data owner id * @param patients a list of patients. * @param from the minimum value for [Message.sent] (default: no limit). * @param to the maximum value for [Message.sent] (default: no limit). * @param descending whether to sort the result in descending or ascending order by [Message.sent] (default: ascending). */ byPatientsSentDateForDataOwner(dataOwnerId: string, patients: Array, options?: { from?: number | undefined; to?: number | undefined; descending?: boolean; }): SortableFilterOptions; /** * * In-group version of [byPatientsSentDateForDataOwner]. */ byPatientsSentDateForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, patients: Array>, options?: { from?: number | undefined; to?: number | undefined; descending?: boolean; }): SortableFilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner * that are linked with one of the provided patients. * This Options also allows to restrict the messages based on [Message.sent]: * - if [from] is not null, only the messages where [Message.sent] is greater than or equal to [from] will be returned. * - if [to] is not null, only the messages where [Message.sent] is less than or equal to [to] will be returned. * * When using these options the sdk will automatically extract the secret ids from the provided patients and use * those for filtering. * If you already have the secret ids of the patient you may instead use [byPatientSecretIdsSentDateForSelf]. * If the current data owner does not have access to any secret id of one of the provide patients the patient will * simply be ignored. * Note that these may not be used in methods of apis from [CardinalBaseApis]. * * These options are sortable. When sorting using these options the messages will be sorted by [Message.sent] in ascending or * descending order according to the value of the [descending] parameter. * * @param patients a list of patients. * @param from the minimum value for [Message.sent] (default: no limit). * @param to the maximum value for [Message.sent] (default: no limit). * @param descending whether to sort the result in descending or ascending order by [Message.sent] (default: ascending). */ byPatientsSentDateForSelf(patients: Array, options?: { from?: number | undefined; to?: number | undefined; descending?: boolean; }): SortableFilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner * that are linked with one of the provided patients through one of the provided secret ids. * This Options also allows to restrict the messages based on [Message.sent]: * - if [from] is not null, only the messages where [Message.sent] is greater than or equal to [from] will be returned. * - if [to] is not null, only the messages where [Message.sent] is less than or equal to [to] will be returned. * * If the current data owner does not have access to any secret id of one of the provide patients the patient will * simply be ignored. * * These options are sortable. When sorting using these options the messages will be sorted by [Message.sent] in ascending or * descending order according to the value of the [descending] parameter. * * @param dataOwnerId the id of a data owner. * @param secretIds a list of patient secret ids. * @param from the minimum value for [Message.sent] (default: no limit). * @param to the maximum value for [Message.sent] (default: no limit). * @param descending whether to sort the result in descending or ascending order by [Message.sent] (default: ascending). */ byPatientSecretIdsSentDateForDataOwner(dataOwnerId: string, secretIds: Array, options?: { from?: number | undefined; to?: number | undefined; descending?: boolean; }): BaseSortableFilterOptions; /** * * In group version of [byPatientSecretIdsSentDateForDataOwner]. */ byPatientSecretIdsSentDateForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, secretIds: Array, options?: { from?: number | undefined; to?: number | undefined; descending?: boolean; }): BaseSortableFilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with the current data owner * that are linked with one of the provided patients through one of the provided secret ids. * This Options also allows to restrict the messages based on [Message.sent]: * - if [from] is not null, only the messages where [Message.sent] is greater than or equal to [from] will be returned. * - if [to] is not null, only the messages where [Message.sent] is less than or equal to [to] will be returned. * * If the current data owner does not have access to any secret id of one of the provide patients the patient will * simply be ignored. * Note that these may not be used in methods of apis from [CardinalBaseApis]. * * These options are sortable. When sorting using these options the messages will be sorted by [Message.sent] in ascending or * descending order according to the value of the [descending] parameter. * * @param secretIds a list of patient secret ids. * @param from the minimum value for [Message.sent] (default: no limit). * @param to the maximum value for [Message.sent] (default: no limit). * @param descending whether to sort the result in descending or ascending order by [Message.sent] (default: ascending). */ byPatientSecretIdsSentDateForSelf(secretIds: Array, options?: { from?: number | undefined; to?: number | undefined; descending?: boolean; }): SortableFilterOptions; /** * * Filter options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner * where [Message.toAddresses] contains [address]. * * @param dataOwnerId the id of a data owner. * @param address a receiver address. */ toAddressForDataOwner(dataOwnerId: string, address: string): BaseFilterOptions; /** * * In-group version of [toAddressForDataOwner]. */ toAddressForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, address: string): BaseFilterOptions; /** * * Filter options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with the current data owner * where [Message.toAddresses] contains [address]. * * @param address a receiver address. */ toAddressForSelf(address: string): FilterOptions; /** * * Filter options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner * where [Message.transportGuid] is equal to [transportGuid] and [Message.sent] is between [from] (inclusive) and [to] (inclusive). * * @param dataOwnerId the id of a data owner. * @param transportGuid the transport guid to use in the filter. * @param from the minimum value for [Message.sent]. * @param to the maximum value for [Message.sent]. * @param descending whether to sort the results in descending or ascending order by [Message.sent] (default: ascending). */ byTransportGuidSentDateForDataOwner(dataOwnerId: string, transportGuid: string, from: number | undefined, to: number | undefined, options?: { descending?: boolean; }): BaseFilterOptions; /** * * In group version of [byTransportGuidSentDateForDataOwner]. */ byTransportGuidSentDateForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, transportGuid: string, from: number | undefined, to: number | undefined, options?: { descending?: boolean; }): BaseFilterOptions; /** * * Filter options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with the current data owner * where [Message.transportGuid] is equal to [transportGuid] and [Message.sent] is between [from] (inclusive) and [to] (inclusive). * * @param transportGuid the transport guid to use in the filter. * @param from the minimum value for [Message.sent]. * @param to the maximum value for [Message.sent]. * @param descending whether to sort the results in descending or ascending order by [Message.sent] (default: ascending). */ byTransportGuidSentDateForSelf(transportGuid: string, from: number | undefined, to: number | undefined, options?: { descending?: boolean; }): FilterOptions; /** * * Filter options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner * where [Message.transportGuid] is equal to [transportGuid]. * * This filter will return only the message with the greatest [Message.created]. * * @param dataOwnerId a data owner id. * @param transportGuid the transport guid to use in the filter. */ latestByTransportGuidForDataOwner(dataOwnerId: string, transportGuid: string): BaseFilterOptions; /** * * In group version of [latestByTransportGuidForDataOwner]. */ latestByTransportGuidForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, transportGuid: string): BaseFilterOptions; /** * * Filter options for message filtering that will match all messages shared directly (i.e. ignoring hierarchies) with the current data owner * where [Message.transportGuid] is equal to [transportGuid]. * * This filter will return only the message with the greatest [Message.created]. * * @param transportGuid the transport guid to use in the filter. */ latestByTransportGuidForSelf(transportGuid: string): FilterOptions; /** * * Filter options for message filtering that will match all messages where [Message.invoiceIds] contains at least one of the provided * [invoiceIds]. * * @param invoiceIds the invoice ids to search. */ byInvoiceIds(invoiceIds: Array): BaseFilterOptions; /** * * Filter options for message filtering that will match all messages where [Message.parentId] is among the provided [parentIds]. * * @param parentIds the parent ids to search. */ byParentIds(parentIds: Array): BaseFilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner * and where the max among [Message.created], [Message.modified], and [Message.deletionDate] is greater or equal than * [startTimestamp] (if provided) and less than or equal to [endTimestamp] (if provided). * * @param dataOwnerId a data owner id. * @param startTimestamp the smallest lifecycle update that the filter will return. * @param endTimestamp the biggest lifecycle update that the filter will return. * @param descending whether to return the results sorted in ascending or descending order by last lifecycle update. */ lifecycleBetweenForDataOwner(dataOwnerId: string, startTimestamp: number | undefined, endTimestamp: number | undefined, descending: boolean): BaseFilterOptions; /** * * In-group version of [lifecycleBetweenForDataOwner]. * The data owner can be from a different group than the group of the user executing the query. */ lifecycleBetweenForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, startTimestamp: number | undefined, endTimestamp: number | undefined, descending: boolean): BaseFilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with the current data owner * and where the max among [Message.created], [Message.modified], and [Message.deletionDate] is greater or equal than * [startTimestamp] (if provided) and less than or equal to [endTimestamp] (if provided). * * @param startTimestamp the smallest lifecycle update that the filter will return. * @param endTimestamp the biggest lifecycle update that the filter will return. * @param descending whether to return the results sorted in ascending or descending order by last lifecycle update. */ lifecycleBetweenForSelf(startTimestamp: number | undefined, endTimestamp: number | undefined, descending: boolean): FilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner that have a certain code. * If you specify only the [codeType] you will get all entities that have at least a code of that type. * * These options are sortable. When sorting using these options the messages will be sorted by [codeCode]. * * @param dataOwnerId a data owner id * @param codeType a code type * @param codeCode a code for the provided code type, or null if you want the filter to accept any entity * with a code of the provided type. */ byCodeForDataOwner(dataOwnerId: string, codeType: string, options?: { codeCode?: string | undefined; }): BaseSortableFilterOptions; /** * * In group version of [byCodeForDataOwner]. */ byCodeForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, codeType: string, options?: { codeCode?: string | undefined; }): BaseSortableFilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with the current data owner that have a certain code. * If you specify only the [codeType] you will get all entities that have at least a code of that type. * * @param codeType a code type * @param codeCode a code for the provided code type, or null if you want the filter to accept any entity * with a code of the provided type. */ byCodeForSelf(codeType: string, options?: { codeCode?: string | undefined; }): FilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with a specific data owner that have a certain tag. * If you specify only the [tagType] you will get all entities that have at least a tag of that type. * * These options are sortable. When sorting using these options the messages will be sorted by [tagCode]. * * @param dataOwnerId a data owner id * @param tagType a tag type * @param tagCode a code for the provided tag type, or null if you want the filter to accept any entity * with a tag of the provided type. */ byTagForDataOwner(dataOwnerId: string, tagType: string, options?: { tagCode?: string | undefined; }): BaseSortableFilterOptions; /** * * In group version of [byTagForDataOwner]. */ byTagForDataOwnerInGroup(dataOwner: EntityReferenceInGroup, tagType: string, options?: { tagCode?: string | undefined; }): BaseSortableFilterOptions; /** * * Options for message filtering which match all messages shared directly (i.e. ignoring hierarchies) with the current data owner that have a certain tag. * If you specify only the [tagType] you will get all entities that have at least a tag of that type. * * @param tagType a tag type * @param tagCode a code for the provided tag type, or null if you want the filter to accept any entity * with a tag of the provided type. */ byTagForSelf(tagType: string, options?: { tagCode?: string | undefined; }): FilterOptions; } export declare const MessageFilters: MessageFiltersFactory; export {};