import { type DeviceAppType } from 'gdc-common-utils-ts/constants/device'; import { type ClinicalSectionUpdateCommunicationInput, type SubjectSectionUpdateCommunicationInput, type ClinicalUpdateCommunicationInput, type ClinicalSummaryReadResult, type ClinicalSummaryRequestInput, type PermissionRequestCommunicationInput } from 'gdc-sdk-core-ts'; import type { LicenseOfferSearchState, LicenseOrderSearchState } from 'gdc-common-utils-ts/utils/license-commercial-search'; import type { LicenseListSearchState } from 'gdc-common-utils-ts/utils/license-list-search'; import type { BundleSearchQuery, CommMsgExtendedCommunicationOutboxJob, CommunicationOutboxJob, CommunicationInput, DateRange, EmployeeSearchValue, IndividualOrganizationLifecycleInput, TransportProfile, SubmitPayload } from 'gdc-sdk-core-ts'; import type { BundleEntry, BundleJsonApi } from 'gdc-common-utils-ts/models/bundle'; import type { SubmitAndPollResult } from './orchestration/client-port.js'; import type { RouteContext } from './individual-onboarding.js'; export type { ClinicalSummaryReadResult, ClinicalSummaryRequestInput, } from 'gdc-sdk-core-ts'; export type OrganizationEmployeeCreationInput = { /** * Canonical employee/person claims sent to CORE GW. * * Use `org.schema.Person.*` claim keys, not invented `Employee.*` keys. * Typical examples are: * - `@context = org.schema` * - `org.schema.Person.identifier` * - `org.schema.Person.email` * - `org.schema.Person.hasOccupation.identifier.value` * - optionally `org.schema.Person.memberOf` * - canonically `org.schema.Person.memberOf.taxID` for employee membership under an organization * * Current CORE GW examples and ICA representative/employee materials are based * on `org.schema.Person.memberOf.taxID`. In shared constants this can be * referenced as `ClaimsPersonSchemaorg.memberOfOrgTaxId`. Do not invent * `Employee.*` claims. */ employeeClaims: Record; dataType?: string; }; /** Input for reserving an existing employee seat and issuing its activation credential. */ export type OrganizationEmployeeLicenseInvitationInput = { email: string; role: string; subjectDid: string; /** Technical employee resource id returned by Employee creation. */ subjectId?: string; type?: DeviceAppType; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** * Current GW CORE employee lifecycle locator payload. * * Current backend behavior: * - disable is still `Employee/_batch` with entry `request.method = DELETE` * - purge is `Employee/_purge` with entry `request.method = POST` * * This SDK intentionally models the deployed GW CORE contract. It does not * synthesize the future normalized `_batch + PATCH` contract ahead of the backend. */ export type OrganizationEmployeeLifecycleInput = { /** * Canonical employee/person claims carried as the exportable employee identity. * * These claims should still include the business/external identifier * (`org.schema.Person.identifier`) when available, but runtime lifecycle * operations must prefer `resourceId` as the concrete GW profile locator. * Treat `resource.id` as the current technical record anchor and * `identifier` as the interoperable/exported identity value. */ employeeClaims: Record; /** * Preferred current GW employee profile id returned by create/search. * * Pass this for disable/purge whenever the caller already knows the active * profile row. The SDK forwards it as `Bundle.entry.resource.id`, which GW * now treats as the primary operational locator for lifecycle actions. */ resourceId: string; dataType?: string; }; export type OrganizationEmployeeSearchInput = { /** * Canonical employee/person claims used as search filters against GW CORE. * * Typical examples: * - `org.schema.Person.email` * - `org.schema.Person.hasOccupation.identifier.value` * - `org.schema.Person.memberOf.taxID` */ employeeClaims?: Record; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** * Runtime search/list input for license seats exposed through actor facades. * * The semantic filter set comes from the shared license controller facade. */ export type LicenseListRuntimeSearchInput = { licenseQuery?: Partial; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** * Reserves one individual-organization seat for an existing RelatedPerson. * * Only FHIR v3 RoleCode members belong here. ISCO professionals receive * Consent/Communication access but keep using the license paid by their * professional organization. */ export type IndividualMemberLicenseInvitationInput = { ownerOrganizationId: string; /** Exact card/subject DID granted after the invitation is accepted. */ subjectDid: string; relatedPersonId: string; invitationId: string; role: string; email?: string; telephone?: string; type?: DeviceAppType; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** Adds zero-cost member seats to one individual organization. */ export type IndividualMemberLicenseAddInput = { ownerOrganizationId: string; quantity: number; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** Requests a host-authored Offer for additional professional employee seats. */ export type OrganizationEmployeeLicenseOfferInput = { /** Exact DCR-registered controller DID that signs the protected request. */ issuerDid: string; quantity: number; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** @deprecated Use `OrganizationEmployeeLicenseOfferInput`. */ export type OrganizationEmployeeLicenseAddInput = OrganizationEmployeeLicenseOfferInput; /** Input shared by invitation acceptance, deactivation and release. */ export type IndividualMemberLicenseTransitionInput = { /** Required for controller deactivation/release; acceptance resolves by code. */ ownerOrganizationId?: string; activationCode: string; subjectId?: string; verifiedActorIdentifier?: string; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** * Runtime search/list input for commercial offer read-models exposed through * actor facades. */ export type LicenseOfferRuntimeSearchInput = { offerQuery?: Partial; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** * Runtime search/list input for commercial order/payment read-models exposed * through actor facades. */ export type LicenseOrderRuntimeSearchInput = { orderQuery?: Partial; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** * Current GW CORE individual/family lifecycle locator payload. * * Current backend behavior: * - disable is `individual/org.schema/Organization/_disable` * - purge is `individual/org.schema/Organization/_purge` */ /** * Current locator payload for individual-member / caregiver lifecycle * operations backed by `RelatedPerson`. * * Current runtime behavior: * - disable uses `RelatedPerson/_batch` with identifier-first lifecycle * resource semantics * - purge uses explicit `RelatedPerson/_purge` */ export type IndividualMemberLifecycleInput = { /** * Canonical claims used to locate the member/caregiver relationship. */ memberClaims: Record; resourceId?: string; dataType?: string; }; /** * Input retained for the direct Composition compatibility adapter. * * @deprecated Use `ClinicalSummaryUpdateInput` with * `updateClinicalSummary(...)`, or `SubjectSectionUpdateInput` with * `updateSubjectSection(...)`; both use the Communication ingestion flow. */ export type IpsOrFhirImportInput = { /** * Server-built IPS/FHIR payload whose original Composition author is * preserved as provenance. Importing an external `urn:*` author never makes * the authenticated controller that author and does not grant local update * or delete authority. Repeating the same author URN is not proof that a * correction came from the same source; unsigned/demo imports therefore * remain locally immutable under the strict audit contract. */ compositionPayload: { thid?: string; } & Record; format?: 'api' | 'r4'; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; export type RelatedPersonUpsertInput = { /** * Canonical RelatedPerson bundle. Keep kinship/legal relationship in * `RelatedPerson.relationship`; the optional GDC `RelatedPerson.role` * extension may carry comma-separated functions such as * `CAREGIVER,ECON,DEPEN,BILL`. * Access decisions such as PERMITTED do not belong in either claim. */ relatedPersonPayload: { thid?: string; } & Record; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; export type CommunicationIngestionInput = { /** * Preferred claims-first job created by * `createCommunicationOutboxJobFromCommMsgExtendedDraft(...)`. Legacy * `createOutboxJobFromDraft(...)` jobs remain accepted temporarily. */ communicationJob?: CommunicationOutboxJob | CommMsgExtendedCommunicationOutboxJob; /** * Compatibility input for callers that already own one GW envelope. * New application code should pass `communicationJob` instead. */ communicationPayload?: CommunicationInput & Record; /** Overrides the client default only for this clinical submission. */ transportProfile?: TransportProfile; /** Clinical representation rendered from canonical claims: built-in `api`/`r4` or an extension format. */ clinicalFormat?: string; /** @deprecated Use `clinicalFormat`. This value selects representation and route, not transport. */ pathFormatSegment?: 'org.hl7.fhir.api' | 'org.hl7.fhir.r4' | 'api' | 'r4' | 'fhir.r4'; autoConvertClaimsToFhirR4?: boolean; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** * Canonical professional-to-subject permission request. * * This operation records one `Communication` carrying a normal * `Consent.status = draft`; it never creates an active grant and does not * require a SMART token. HTTP authentication and optional secure DIDComm * transport remain concerns of the configured runtime client. */ export type ProfessionalAccessRequestInput = Omit & Readonly<{ missing: Readonly<{ sections: string[]; resourceTypes: string[]; pairs?: PermissionRequestCommunicationInput['missing']['pairs']; }>; transportProfile?: TransportProfile; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }>; /** Result of persisting one canonical permission-request Communication. */ export type ProfessionalAccessRequestResult = Readonly<{ thid: string; communicationIdentifier: string; consentIdentifier: string; communication: CommunicationInput; delivery: SubmitAndPollResult; }>; type ClinicalUpdateRuntimeOptions = Readonly<{ transportProfile?: TransportProfile; clinicalFormat?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }>; /** * Updates exactly one clinical section through a scoped batch/collection. * A `Bundle.type = batch` may mix typed create, update, and delete entries. * A delete targets `ResourceType/id`, carries no resource body, and may use * `ifMatch` for optimistic concurrency. GW authorizes it against the stored * attester assignment plus the caller's registered clinical creator binding; * contact identifiers are never written into the clinical resource. * An externally authored `urn:*` may be preserved on first import, but a local * local actor cannot subsequently update or delete that source-authored fact * unless an explicit successor policy applies. */ export type ClinicalSectionUpdateInput = ClinicalSectionUpdateCommunicationInput & ClinicalUpdateRuntimeOptions; /** * Preferred generic section mutation for data owned by a human, animal, or * other governed subject. It keeps the current Composition-compatible flat * author and attester claims used by confidential indexing. */ export type SubjectSectionUpdateInput = SubjectSectionUpdateCommunicationInput & ClinicalUpdateRuntimeOptions; /** * Updates one complete multi-section clinical summary document. * * For the direct call, `sender` is the authenticated profile's operational * `actorDid`, and `recipient` is the real provider-tenant DID inside the host * that accommodates it. Neither value is a portal alias. An editable demo * clone obtains its stable FHIR author/attester from the protected * `clinicalCreator` export, never from that `actorDid`. */ export type ClinicalSummaryUpdateInput = ClinicalUpdateCommunicationInput & ClinicalUpdateRuntimeOptions; export declare function buildClinicalSectionUpdateIngestion(input: ClinicalSectionUpdateInput): CommunicationIngestionInput; /** Builds the generic subject-section ingestion job. */ export declare function buildSubjectSectionUpdateIngestion(input: SubjectSectionUpdateInput): CommunicationIngestionInput; export declare function buildClinicalSummaryUpdateIngestion(input: ClinicalSummaryUpdateInput): CommunicationIngestionInput; export type BlockchainArtifactRegistrationInput = { subject: string; resource?: Record; contentDataBase64?: string; contentType?: string; identifier?: string; title?: string; description?: string; date?: string; location?: string; language?: string; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; export type BlockchainArtifactSearchSelectionInput = Readonly<{ subject: string; searchResponse: unknown; selectedResourceIds?: readonly string[]; }>; export type BlockchainArtifactSearchSelectionResult = Readonly<{ availableResourceIds: readonly string[]; anchoredResourceIds: readonly string[]; unanchoredResourceIds: readonly string[]; selectedResourceIds: readonly string[]; missingResourceIds: readonly string[]; returnedCount: number; totalCount: number; bundle: BundleJsonApi; }>; export type VitalSignBatchCommunicationFromSearchResponseInput = Readonly<{ subject: string; searchResponse: unknown; selectedResourceIds?: readonly string[]; sender?: string; recipient?: string | string[]; sent?: string; status?: string; noteText?: string; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }>; /** * Runtime participant query for `Communication/_search`. * * Search semantics: * - `subject` scopes which individual communication sections to inspect * - `userActorId` and `targetActorId` both match sender OR any recipient * - `senderActorId` and `recipientActorId` constrain one side explicitly * - `actorId` is the generic sender-or-recipient filter * - `*` means "all" for the corresponding operand * * Canonical prefixes are normalized by shared `gdc-common-utils-ts` helpers: * - `did:` * - `email:` / `mailto:` * - `tel:` / `phone:` */ export type CommunicationParticipantRuntimeSearchInput = { searchParams?: Record | undefined>; subject?: string | string[]; actorId?: string | string[]; senderActorId?: string | string[]; recipientActorId?: string | string[]; userActorId?: string | string[]; targetActorId?: string | string[]; periodStart?: string; periodEnd?: string; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; page?: number; count?: number; }; /** Subject/requester filters for canonical permission-request Communications. */ export type ProfessionalAccessRequestSearchInput = CommunicationParticipantRuntimeSearchInput; /** * Restricts a Communication participant search to standard notifications. * A permission request is identified by its attached draft Consent contract; * it is not an invented fifth FHIR category. See * https://www.hl7.org/fhir/valueset-communication-category.html */ export declare function buildProfessionalAccessRequestSearchInput(input: ProfessionalAccessRequestSearchInput): CommunicationParticipantRuntimeSearchInput; export type ClinicalDateRange = DateRange; export type ClinicalBundleSearchInput = Omit & { section?: string | string[]; extraSearchParams?: BundleSearchQuery['searchParams']; requestThid?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; /** Overrides the client default for this subject-scoped clinical read. */ transportProfile?: TransportProfile; }; export type ConsentActorTargetInput = string | string[] | { identifier?: string; url?: string; didWeb?: string; organizationUrl?: string; organizationTaxId?: string; email?: string; phone?: string; }; export type GrantProfessionalAccessInput = { subjectDid?: string; /** * Compatibility/extension field. * * CORE canonical consent examples identify the subject with `subjectDid`. * Phone-based subject targeting should be treated as an extension concern. */ subjectPhone?: string; /** * Compatibility/extension field used by phone/notification-heavy UX layers. * * CORE canonical consent examples do not require a display name side-field. */ subjectGivenName?: string; /** * Canonical flat actor identifier for the actor receiving the permission. * * Canonical professional grant input: * - the exact `did:web:...:employee::` actor DID reused by * the employee profile, VP credential subject and SMART request * * Compatibility input forms: * - `user@example.org` * - `tel:+34600111222` * - `ES` * - comma-separated lists or string arrays of those tokens * * Email/phone targets and legacy structured objects remain accepted for * compatibility, but they do not automatically authorize a later SMART * request made with a different derived professional DID. */ actorId?: ConsentActorTargetInput; /** * @deprecated Use `actorId`. */ actor?: ConsentActorTargetInput; actorRole: string; purpose: string; actions: string[]; consentIdentifier?: string; consentDate?: string; /** * ISO 8601 instant after which this grant must no longer authorize access. * It is persisted and signed as the canonical `Consent.period-end` claim. */ periodEnd?: string; decision?: 'permit' | 'deny'; /** Permission-request Communication identifier or thread being answered. */ eventBasedOn?: string; /** Canonical permission-request Communication reference. */ sourceReference?: string; attachmentContentType?: string; attachmentBase64?: string; dataType?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; export type GrantProfessionalAccessResult = { thid: string; consent: SubmitAndPollResult; subjectIdentifier: string; actorIdentifier: string; consentClaims: Record; claimsCid?: string; }; /** Subject decision that remains correlated to the originating request. */ export type ProfessionalAccessRequestDecisionInput = Omit & Readonly<{ requestThid: string; requestCommunicationIdentifier?: string; }>; /** Converts one request decision into the canonical correlated Consent grant. */ export declare function buildProfessionalAccessRequestDecisionGrant(input: ProfessionalAccessRequestDecisionInput): GrantProfessionalAccessInput; export type RevokeProfessionalAccessInput = { consentClaims: Record; periodEnd?: string; dataType?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; export type RevokeProfessionalAccessResult = { thid: string; consent: SubmitAndPollResult; consentClaims: Record; }; export type DigitalTwinGenerationInput = { compositionPayload: { thid?: string; } & Record; format?: 'api' | 'r4'; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** Subject decision controlling publication into the pseudonymous research index. */ export type DigitalTwinSecondaryUseConsentInput = { subjectDid: string; /** Organization/tenant that provides and stores the subject's index. */ indexProviderOrganizationDid: string; decision: 'permit' | 'deny'; /** * Stable URL or URI identifying the portal, software or research study whose * permission is being changed. GW uses it as `Consent.source-reference` to * find or create the rule; callers never manage `Consent.identifier`. */ researchUseReference: string; consentDate?: string; dataType?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** Result of enabling or disabling one subject's digital-twin publication. */ export type DigitalTwinSecondaryUseConsentResult = GrantProfessionalAccessResult; /** Provider-offboarding command that destroys only the private subject/twin binding. */ export type DigitalTwinSubjectLinkPurgeInput = { subjectDid: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }; /** Async GW result for a subject/twin binding purge. */ export type DigitalTwinSubjectLinkPurgeResult = SubmitAndPollResult; /** Input for reading the subject-owned Consent records through its individual aggregate. */ export type SubjectConsentSearchInput = Readonly<{ subject: string; actorIdentifier?: string; purpose?: string; action?: string; sourceReference?: string; pollOptions?: { timeoutMs?: number; intervalMs?: number; }; }>; export declare function createOrganizationEmployeeWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeCreationInput, options: { timeoutMs?: number; intervalMs?: number; } | undefined, deps: { employeeBatchPath: (ctx: RouteContext) => string; employeePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Issues the activation credential for an employee already created under the * tenant. The credential belongs to that employee seat and can authorize its * configured number of concurrent installations (two by default in GW CORE). */ export declare function issueOrganizationEmployeeLicenseWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeLicenseInvitationInput, deps: { identityLicenseIssuePath: (ctx: RouteContext) => string; identityLicenseIssuePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function disableOrganizationEmployeeWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeLifecycleInput, options: { timeoutMs?: number; intervalMs?: number; } | undefined, deps: { employeeBatchPath: (ctx: RouteContext) => string; employeePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function purgeOrganizationEmployeeWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeLifecycleInput, options: { timeoutMs?: number; intervalMs?: number; } | undefined, deps: { employeePurgePath: (ctx: RouteContext) => string; employeePurgePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function searchOrganizationEmployeesWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeSearchInput, deps: { employeeSearchPath: (ctx: RouteContext) => string; employeeSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Searches license seats for one organization/tenant through `License/_search`. */ export declare function searchOrganizationLicensesWithDeps(routeCtx: RouteContext, input: LicenseListRuntimeSearchInput, deps: { organizationLicenseSearchPath: (ctx: RouteContext) => string; organizationLicenseSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Lists license seats using the same canonical `License/_search` route with no * mandatory filters. */ export declare function listOrganizationLicensesWithDeps(routeCtx: RouteContext, input: LicenseListRuntimeSearchInput | undefined, deps: Parameters[2]): Promise; /** * Searches commercial license offers for one organization/tenant through * `Offer/_search`. */ export declare function searchOrganizationLicenseOffersWithDeps(routeCtx: RouteContext, input: LicenseOfferRuntimeSearchInput, deps: { organizationLicenseOfferSearchPath: (ctx: RouteContext) => string; organizationLicenseOfferSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function listOrganizationLicenseOffersWithDeps(routeCtx: RouteContext, input: LicenseOfferRuntimeSearchInput | undefined, deps: Parameters[2]): Promise; /** * Searches commercial license orders/payment projections for one * organization/tenant through `Order/_search`. */ export declare function searchOrganizationLicenseOrdersWithDeps(routeCtx: RouteContext, input: LicenseOrderRuntimeSearchInput, deps: { organizationLicenseOrderSearchPath: (ctx: RouteContext) => string; organizationLicenseOrderSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function listOrganizationLicenseOrdersWithDeps(routeCtx: RouteContext, input: LicenseOrderRuntimeSearchInput | undefined, deps: Parameters[2]): Promise; export declare function disableIndividualOrganizationWithDeps(routeCtx: RouteContext, input: IndividualOrganizationLifecycleInput, options: { timeoutMs?: number; intervalMs?: number; } | undefined, deps: { individualOrganizationDisablePath: (ctx: RouteContext) => string; individualOrganizationDisablePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function purgeIndividualOrganizationWithDeps(routeCtx: RouteContext, input: IndividualOrganizationLifecycleInput, options: { timeoutMs?: number; intervalMs?: number; } | undefined, deps: { individualOrganizationPurgePath: (ctx: RouteContext) => string; individualOrganizationPurgePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Searches license seats for one individual/family controller context through * the shared `License/_search` route. */ export declare function searchIndividualLicensesWithDeps(routeCtx: RouteContext, input: LicenseListRuntimeSearchInput, deps: { individualLicenseSearchPath: (ctx: RouteContext) => string; individualLicenseSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Lists license seats for the individual/family side using the same canonical * search route without mandatory filters. */ export declare function listIndividualLicensesWithDeps(routeCtx: RouteContext, input: LicenseListRuntimeSearchInput | undefined, deps: Parameters[2]): Promise; type IndividualLicenseMutationDeps = { individualLicenseActionPath: (ctx: RouteContext, action: string) => string; individualLicenseActionPollPath: (ctx: RouteContext, action: string) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }; type OrganizationLicenseMutationDeps = { organizationLicenseOfferCreatePath: (ctx: RouteContext) => string; organizationLicenseOfferCreatePollPath: (ctx: RouteContext) => string; submitAndPoll: IndividualLicenseMutationDeps['submitAndPoll']; }; /** * Requests a professional-seat Offer without creating or assigning seats. * The returned Offer must be accepted through the existing paid Order flow. */ export declare function requestOrganizationEmployeeLicenseOfferWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeLicenseOfferInput, deps: OrganizationLicenseMutationDeps): Promise; /** @deprecated Use `requestOrganizationEmployeeLicenseOfferWithDeps`. */ export declare function addFreeOrganizationEmployeeLicensesWithDeps(routeCtx: RouteContext, input: OrganizationEmployeeLicenseAddInput, deps: OrganizationLicenseMutationDeps): Promise; /** * Reserves one available household/member seat for a selected contact. * * Ordered application flow: * 1. Create/select RelatedPerson. * 2. Author Consent rules. * 3. Call this operation only for a FHIR v3 RoleCode member. * 4. Put the returned activation code in the invitation Communication. */ export declare function issueIndividualMemberLicenseWithDeps(routeCtx: RouteContext, input: IndividualMemberLicenseInvitationInput, deps: IndividualLicenseMutationDeps): Promise; /** * Adds free seats without creating contacts, permissions or invitations. * Price zero is explicit so GW never routes this MVP operation through a * payment-proof branch. */ export declare function addFreeIndividualMemberLicensesWithDeps(routeCtx: RouteContext, input: IndividualMemberLicenseAddInput, deps: IndividualLicenseMutationDeps): Promise; /** * Accepts, deactivates or releases one member seat. * * `_accept` needs the Firebase/BFF verified recipient plus the authenticated * subject id. `_release` remains backend-guarded and cannot free an active * member directly. */ export declare function transitionIndividualMemberLicenseWithDeps(routeCtx: RouteContext, action: '_accept' | '_deactivate' | '_release', input: IndividualMemberLicenseTransitionInput, deps: IndividualLicenseMutationDeps): Promise; export declare function searchIndividualLicenseOffersWithDeps(routeCtx: RouteContext, input: LicenseOfferRuntimeSearchInput, deps: { individualLicenseOfferSearchPath: (ctx: RouteContext) => string; individualLicenseOfferSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function listIndividualLicenseOffersWithDeps(routeCtx: RouteContext, input: LicenseOfferRuntimeSearchInput | undefined, deps: Parameters[2]): Promise; export declare function searchIndividualLicenseOrdersWithDeps(routeCtx: RouteContext, input: LicenseOrderRuntimeSearchInput, deps: { individualLicenseOrderSearchPath: (ctx: RouteContext) => string; individualLicenseOrderSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function listIndividualLicenseOrdersWithDeps(routeCtx: RouteContext, input: LicenseOrderRuntimeSearchInput | undefined, deps: Parameters[2]): Promise; /** * Direct Composition compatibility adapter retained without behavior changes. * * @deprecated Build the appropriate Communication input with * `buildClinicalSummaryUpdateIngestion(...)` or * `buildSubjectSectionUpdateIngestion(...)`, then submit it through * `ingestCommunicationAndUpdateIndexWithDeps(...)`. */ export declare function importIpsOrFhirAndUpdateIndexWithDeps(routeCtx: RouteContext, input: IpsOrFhirImportInput, deps: { individualCompositionR4BatchPath: (ctx: RouteContext) => string; individualCompositionR4PollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function disableIndividualMemberWithDeps(routeCtx: RouteContext, input: IndividualMemberLifecycleInput, options: { timeoutMs?: number; intervalMs?: number; } | undefined, deps: { individualRelatedPersonBatchPath: (ctx: RouteContext) => string; individualRelatedPersonPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function purgeIndividualMemberWithDeps(routeCtx: RouteContext, input: IndividualMemberLifecycleInput, options: { timeoutMs?: number; intervalMs?: number; } | undefined, deps: { individualRelatedPersonPurgePath: (ctx: RouteContext) => string; individualRelatedPersonPurgePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function upsertRelatedPersonAndPollWithDeps(routeCtx: RouteContext, input: RelatedPersonUpsertInput, deps: { individualRelatedPersonBatchPath: (ctx: RouteContext) => string; individualRelatedPersonPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function ingestCommunicationAndUpdateIndexWithDeps(routeCtx: RouteContext, input: CommunicationIngestionInput, deps: { individualCommunicationBatchPath: (ctx: RouteContext, pathFormatSegment: string) => string; individualCommunicationPollPath: (ctx: RouteContext, pathFormatSegment: string) => string; transformPayloadForFhirR4?: (payload: Record, enabled: boolean) => Record; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Builds and persists one professional access request against the subject's * provider route. The request is deliberately independent from SMART because * no active subject consent exists yet. The auditable Communication carries a * draft Consent Bundle; the draft itself never authorizes data access. */ export declare function requestProfessionalAccessWithDeps(routeCtx: RouteContext, input: ProfessionalAccessRequestInput, deps: { individualCommunicationBatchPath: (ctx: RouteContext, pathFormatSegment: string) => string; individualCommunicationPollPath: (ctx: RouteContext, pathFormatSegment: string) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function searchCommunicationParticipantsWithDeps(routeCtx: RouteContext, input: CommunicationParticipantRuntimeSearchInput, deps: { communicationSearchPath: (ctx: RouteContext) => string; communicationSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Requests the subject's available clinical document through the canonical * auditable read lifecycle: * * `Communication -> Subject/$summary -> FHIR Parameters -> Bundle document`. * * The dependency name intentionally says `submit`, not `ingest`: GW receives a * Communication transport record, but the business operation is a read and * must not be exposed to applications as index ingestion. `Subject/$summary` * is the internal operation reference inside that Communication, not a route * for application/BFF code to invoke directly. */ export declare function requestClinicalSummaryWithDeps(routeCtx: RouteContext, input: ClinicalSummaryRequestInput, deps: { submitSummaryCommunication: (ctx: RouteContext, input: CommunicationIngestionInput) => Promise; }): Promise; export declare function searchClinicalBundleWithDeps(routeCtx: RouteContext, input: ClinicalBundleSearchInput, deps: { bundleSearchPath: (ctx: RouteContext) => string; bundleSearchPollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Builds one Communication-ready ingestion payload from a paginated search * response that already selected the day batches to be anchored. * * The search response is normalized into a `Bundle.type=batch` attachment, * and the resulting `Communication` is ready for `ingestCommunication...`. */ export declare function buildVitalSignBatchCommunicationFromSearchResponse(input: VitalSignBatchCommunicationFromSearchResponseInput): CommunicationIngestionInput; /** * Builds one blockchain-ready batch bundle from a paginated search response. * * The helper keeps the original search result as the source of truth and only * projects the selected `resource.id` values into a `Bundle.type=batch` * payload for subsequent communication/registration. */ export declare function buildBlockchainArtifactBundleFromSearchResponse(input: BlockchainArtifactSearchSelectionInput): BlockchainArtifactSearchSelectionResult; export declare function searchLatestIpsWithDeps(routeCtx: RouteContext, input: Omit & { section?: string | string[]; }, deps: { searchClinicalBundle: (routeCtx: RouteContext, input: ClinicalBundleSearchInput) => Promise; }): Promise; export declare function registerBlockchainArtifactAndUpdateIndexWithDeps(routeCtx: RouteContext, input: BlockchainArtifactRegistrationInput, deps: { individualDocumentReferenceBatchPath: (ctx: RouteContext) => string; individualDocumentReferencePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function grantProfessionalAccessWithDeps(routeCtx: RouteContext, input: GrantProfessionalAccessInput, deps: { buildConsentClaimsWithCid: (input: GrantProfessionalAccessInput, options?: { consentIdentifierFactory: () => string; }) => { actorIdentifier: string; subjectIdentifier: string; consentClaims: Record; claimsCid?: string; }; individualConsentR4BatchPath: (ctx: RouteContext) => string; individualConsentR4PollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Enables or disables secondary research use for one subject. * * `permit` asks GW to build or rebuild the current pseudonymous projection; * `deny` pauses later synchronization while preserving the published twin and * tenant-private subject alias. */ export declare function setDigitalTwinSecondaryUseConsentWithDeps(routeCtx: RouteContext, input: DigitalTwinSecondaryUseConsentInput, deps: { buildConsentClaimsWithCid: (input: GrantProfessionalAccessInput, options?: { consentIdentifierFactory: () => string; }) => { actorIdentifier: string; subjectIdentifier: string; consentClaims: Record; claimsCid?: string; }; individualConsentR4BatchPath: (ctx: RouteContext) => string; individualConsentR4PollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Removes the index provider's private individual-to-twin correspondence. * The anonymous twin is intentionally not deleted. A later enrollment gets a * new UUID and cannot reconnect the detached twin to the individual. */ export declare function purgeDigitalTwinSubjectLinkWithDeps(routeCtx: RouteContext, input: DigitalTwinSubjectLinkPurgeInput, deps: { individualResearchSubjectPurgePath: (ctx: RouteContext) => string; individualResearchSubjectPurgePollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; /** * Reads Consent through the individual `Subject/_search` aggregate carried by * an auditable Communication. `Subject` is the individual aggregate; it is * intentionally separate from the public digital-twin `ResearchSubject` * aggregate, whose canonical index document is a Composition. */ export declare function searchSubjectConsentsWithDeps(routeCtx: RouteContext, input: SubjectConsentSearchInput, deps: { individualCommunicationBatchPath: (ctx: RouteContext, pathFormatSegment: string) => string; individualCommunicationPollPath: (ctx: RouteContext, pathFormatSegment: string) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function revokeProfessionalAccessWithDeps(routeCtx: RouteContext, input: RevokeProfessionalAccessInput, deps: { individualConsentR4BatchPath: (ctx: RouteContext) => string; individualConsentR4PollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function generateDigitalTwinFromSubjectDataWithDeps(routeCtx: RouteContext, input: DigitalTwinGenerationInput, deps: { digitalTwinCompositionApiBatchPath: (ctx: RouteContext) => string; digitalTwinCompositionApiPollPath: (ctx: RouteContext) => string; digitalTwinCompositionR4BatchPath: (ctx: RouteContext) => string; digitalTwinCompositionR4PollPath: (ctx: RouteContext) => string; submitAndPoll: (submitPath: string, pollPath: string, payload: { thid?: string; } & Record, pollOptions?: { timeoutMs?: number; intervalMs?: number; }) => Promise; }): Promise; export declare function normalizeCommunicationPathFormatSegment(raw?: string): string; /** * Selects only the outer employee wire representation. * * The BundleEditor-authored entries remain identical across transports: * JSON-API `data[]` stays inside DIDComm, while the legacy FHIR profile maps * those entries to standard `Bundle.entry[]`. Authorization and encryption * remain runtime concerns rather than browser-authored payload fields. */ export declare function prepareEmployeeLifecycleMessageForTransport(message: SubmitPayload, profile: TransportProfile): SubmitPayload;