Skip to main content
Glama
v10.ts51.1 kB
// SPDX-FileCopyrightText: Copyright Orangebot, Inc. and Medplum contributors // SPDX-License-Identifier: Apache-2.0 import type { PoolClient } from 'pg'; import { prepareCustomMigrationJobData, runCustomMigration } from '../../workers/post-deploy-migration'; import * as fns from '../migrate-functions'; import type { MigrationActionResult } from '../types'; import type { CustomPostDeployMigration } from './types'; export const migration: CustomPostDeployMigration = { type: 'custom', prepareJobData: (asyncJob) => prepareCustomMigrationJobData(asyncJob), run: async (repo, job, jobData) => runCustomMigration(repo, job, jobData, callback), }; // prettier-ignore async function callback(client: PoolClient, results: MigrationActionResult[]): Promise<void> { await fns.idempotentCreateIndex(client, results, 'Account_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Account_projectId_lastUpdated_idx" ON "Account" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ActivityDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ActivityDefinition_projectId_lastUpdated_idx" ON "ActivityDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ActivityDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ActivityDefinition_projectId_date_idx" ON "ActivityDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'AdverseEvent_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AdverseEvent_projectId_lastUpdated_idx" ON "AdverseEvent" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'AdverseEvent_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AdverseEvent_projectId_date_idx" ON "AdverseEvent" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'AllergyIntolerance_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AllergyIntolerance_projectId_lastUpdated_idx" ON "AllergyIntolerance" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'AllergyIntolerance_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AllergyIntolerance_projectId_date_idx" ON "AllergyIntolerance" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Appointment_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Appointment_projectId_lastUpdated_idx" ON "Appointment" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Appointment_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Appointment_projectId_date_idx" ON "Appointment" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'AppointmentResponse_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AppointmentResponse_projectId_lastUpdated_idx" ON "AppointmentResponse" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'AuditEvent_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AuditEvent_projectId_lastUpdated_idx" ON "AuditEvent" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'AuditEvent_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AuditEvent_projectId_date_idx" ON "AuditEvent" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Basic_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Basic_projectId_lastUpdated_idx" ON "Basic" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Binary_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Binary_projectId_lastUpdated_idx" ON "Binary" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'BiologicallyDerivedProduct_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "BiologicallyDerivedProduct_projectId_lastUpdated_idx" ON "BiologicallyDerivedProduct" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'BodyStructure_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "BodyStructure_projectId_lastUpdated_idx" ON "BodyStructure" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Bundle_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Bundle_projectId_lastUpdated_idx" ON "Bundle" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CapabilityStatement_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CapabilityStatement_projectId_lastUpdated_idx" ON "CapabilityStatement" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CapabilityStatement_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CapabilityStatement_projectId_date_idx" ON "CapabilityStatement" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'CarePlan_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CarePlan_projectId_lastUpdated_idx" ON "CarePlan" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CarePlan_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CarePlan_projectId_date_idx" ON "CarePlan" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'CareTeam_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CareTeam_projectId_lastUpdated_idx" ON "CareTeam" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CareTeam_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CareTeam_projectId_date_idx" ON "CareTeam" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'CatalogEntry_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CatalogEntry_projectId_lastUpdated_idx" ON "CatalogEntry" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ChargeItem_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ChargeItem_projectId_lastUpdated_idx" ON "ChargeItem" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ChargeItemDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ChargeItemDefinition_projectId_lastUpdated_idx" ON "ChargeItemDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ChargeItemDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ChargeItemDefinition_projectId_date_idx" ON "ChargeItemDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Claim_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Claim_projectId_lastUpdated_idx" ON "Claim" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ClaimResponse_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ClaimResponse_projectId_lastUpdated_idx" ON "ClaimResponse" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ClinicalImpression_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ClinicalImpression_projectId_lastUpdated_idx" ON "ClinicalImpression" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ClinicalImpression_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ClinicalImpression_projectId_date_idx" ON "ClinicalImpression" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'CodeSystem_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CodeSystem_projectId_lastUpdated_idx" ON "CodeSystem" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CodeSystem_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CodeSystem_projectId_date_idx" ON "CodeSystem" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Communication_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Communication_projectId_lastUpdated_idx" ON "Communication" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Communication_projectId_sent_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Communication_projectId_sent_idx" ON "Communication" ("projectId", "sent")`); await fns.idempotentCreateIndex(client, results, 'CommunicationRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CommunicationRequest_projectId_lastUpdated_idx" ON "CommunicationRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CompartmentDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CompartmentDefinition_projectId_lastUpdated_idx" ON "CompartmentDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CompartmentDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CompartmentDefinition_projectId_date_idx" ON "CompartmentDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Composition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Composition_projectId_lastUpdated_idx" ON "Composition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Composition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Composition_projectId_date_idx" ON "Composition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ConceptMap_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ConceptMap_projectId_lastUpdated_idx" ON "ConceptMap" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ConceptMap_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ConceptMap_projectId_date_idx" ON "ConceptMap" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Condition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Condition_projectId_lastUpdated_idx" ON "Condition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Consent_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Consent_projectId_lastUpdated_idx" ON "Consent" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Consent_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Consent_projectId_date_idx" ON "Consent" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Contract_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Contract_projectId_lastUpdated_idx" ON "Contract" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Coverage_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Coverage_projectId_lastUpdated_idx" ON "Coverage" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CoverageEligibilityRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CoverageEligibilityRequest_projectId_lastUpdated_idx" ON "CoverageEligibilityRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'CoverageEligibilityResponse_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "CoverageEligibilityResponse_projectId_lastUpdated_idx" ON "CoverageEligibilityResponse" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DetectedIssue_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DetectedIssue_projectId_lastUpdated_idx" ON "DetectedIssue" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Device_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Device_projectId_lastUpdated_idx" ON "Device" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DeviceDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DeviceDefinition_projectId_lastUpdated_idx" ON "DeviceDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DeviceMetric_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DeviceMetric_projectId_lastUpdated_idx" ON "DeviceMetric" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DeviceRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DeviceRequest_projectId_lastUpdated_idx" ON "DeviceRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DeviceUseStatement_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DeviceUseStatement_projectId_lastUpdated_idx" ON "DeviceUseStatement" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DiagnosticReport_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DiagnosticReport_projectId_lastUpdated_idx" ON "DiagnosticReport" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DiagnosticReport_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DiagnosticReport_projectId_date_idx" ON "DiagnosticReport" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'DocumentManifest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DocumentManifest_projectId_lastUpdated_idx" ON "DocumentManifest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DocumentReference_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DocumentReference_projectId_lastUpdated_idx" ON "DocumentReference" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DocumentReference_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DocumentReference_projectId_date_idx" ON "DocumentReference" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'EffectEvidenceSynthesis_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EffectEvidenceSynthesis_projectId_lastUpdated_idx" ON "EffectEvidenceSynthesis" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'EffectEvidenceSynthesis_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EffectEvidenceSynthesis_projectId_date_idx" ON "EffectEvidenceSynthesis" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Encounter_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Encounter_projectId_lastUpdated_idx" ON "Encounter" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Encounter_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Encounter_projectId_date_idx" ON "Encounter" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Endpoint_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Endpoint_projectId_lastUpdated_idx" ON "Endpoint" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'EnrollmentRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EnrollmentRequest_projectId_lastUpdated_idx" ON "EnrollmentRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'EnrollmentResponse_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EnrollmentResponse_projectId_lastUpdated_idx" ON "EnrollmentResponse" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'EpisodeOfCare_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EpisodeOfCare_projectId_lastUpdated_idx" ON "EpisodeOfCare" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'EpisodeOfCare_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EpisodeOfCare_projectId_date_idx" ON "EpisodeOfCare" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'EventDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EventDefinition_projectId_lastUpdated_idx" ON "EventDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'EventDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EventDefinition_projectId_date_idx" ON "EventDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Evidence_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Evidence_projectId_lastUpdated_idx" ON "Evidence" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Evidence_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Evidence_projectId_date_idx" ON "Evidence" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'EvidenceVariable_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EvidenceVariable_projectId_lastUpdated_idx" ON "EvidenceVariable" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'EvidenceVariable_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "EvidenceVariable_projectId_date_idx" ON "EvidenceVariable" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ExampleScenario_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ExampleScenario_projectId_lastUpdated_idx" ON "ExampleScenario" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ExampleScenario_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ExampleScenario_projectId_date_idx" ON "ExampleScenario" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ExplanationOfBenefit_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ExplanationOfBenefit_projectId_lastUpdated_idx" ON "ExplanationOfBenefit" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'FamilyMemberHistory_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "FamilyMemberHistory_projectId_lastUpdated_idx" ON "FamilyMemberHistory" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'FamilyMemberHistory_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "FamilyMemberHistory_projectId_date_idx" ON "FamilyMemberHistory" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Flag_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Flag_projectId_lastUpdated_idx" ON "Flag" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Flag_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Flag_projectId_date_idx" ON "Flag" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Goal_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Goal_projectId_lastUpdated_idx" ON "Goal" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'GraphDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "GraphDefinition_projectId_lastUpdated_idx" ON "GraphDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'GraphDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "GraphDefinition_projectId_date_idx" ON "GraphDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Group_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Group_projectId_lastUpdated_idx" ON "Group" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'GuidanceResponse_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "GuidanceResponse_projectId_lastUpdated_idx" ON "GuidanceResponse" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'HealthcareService_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "HealthcareService_projectId_lastUpdated_idx" ON "HealthcareService" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ImagingStudy_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ImagingStudy_projectId_lastUpdated_idx" ON "ImagingStudy" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Immunization_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Immunization_projectId_lastUpdated_idx" ON "Immunization" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Immunization_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Immunization_projectId_date_idx" ON "Immunization" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ImmunizationEvaluation_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ImmunizationEvaluation_projectId_lastUpdated_idx" ON "ImmunizationEvaluation" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ImmunizationEvaluation_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ImmunizationEvaluation_projectId_date_idx" ON "ImmunizationEvaluation" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ImmunizationRecommendation_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ImmunizationRecommendation_projectId_lastUpdated_idx" ON "ImmunizationRecommendation" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ImmunizationRecommendation_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ImmunizationRecommendation_projectId_date_idx" ON "ImmunizationRecommendation" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ImplementationGuide_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ImplementationGuide_projectId_lastUpdated_idx" ON "ImplementationGuide" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ImplementationGuide_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ImplementationGuide_projectId_date_idx" ON "ImplementationGuide" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'InsurancePlan_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "InsurancePlan_projectId_lastUpdated_idx" ON "InsurancePlan" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Invoice_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Invoice_projectId_lastUpdated_idx" ON "Invoice" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Invoice_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Invoice_projectId_date_idx" ON "Invoice" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Library_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Library_projectId_lastUpdated_idx" ON "Library" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Library_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Library_projectId_date_idx" ON "Library" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Linkage_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Linkage_projectId_lastUpdated_idx" ON "Linkage" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'List_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "List_projectId_lastUpdated_idx" ON "List" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'List_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "List_projectId_date_idx" ON "List" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Location_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Location_projectId_lastUpdated_idx" ON "Location" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Measure_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Measure_projectId_lastUpdated_idx" ON "Measure" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Measure_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Measure_projectId_date_idx" ON "Measure" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'MeasureReport_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MeasureReport_projectId_lastUpdated_idx" ON "MeasureReport" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MeasureReport_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MeasureReport_projectId_date_idx" ON "MeasureReport" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Media_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Media_projectId_lastUpdated_idx" ON "Media" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Medication_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Medication_projectId_lastUpdated_idx" ON "Medication" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicationAdministration_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicationAdministration_projectId_lastUpdated_idx" ON "MedicationAdministration" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicationDispense_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicationDispense_projectId_lastUpdated_idx" ON "MedicationDispense" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicationKnowledge_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicationKnowledge_projectId_lastUpdated_idx" ON "MedicationKnowledge" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicationRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicationRequest_projectId_lastUpdated_idx" ON "MedicationRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicationStatement_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicationStatement_projectId_lastUpdated_idx" ON "MedicationStatement" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicinalProduct_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicinalProduct_projectId_lastUpdated_idx" ON "MedicinalProduct" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MPA_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MPA_projectId_lastUpdated_idx" ON "MedicinalProductAuthorization" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MPC_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MPC_projectId_lastUpdated_idx" ON "MedicinalProductContraindication" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicinalProductIndication_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicinalProductIndication_projectId_lastUpdated_idx" ON "MedicinalProductIndication" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicinalProductIngredient_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicinalProductIngredient_projectId_lastUpdated_idx" ON "MedicinalProductIngredient" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicinalProductInteraction_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicinalProductInteraction_projectId_lastUpdated_idx" ON "MedicinalProductInteraction" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicinalProductManufactured_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicinalProductManufactured_projectId_lastUpdated_idx" ON "MedicinalProductManufactured" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MedicinalProductPackaged_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MedicinalProductPackaged_projectId_lastUpdated_idx" ON "MedicinalProductPackaged" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MPP_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MPP_projectId_lastUpdated_idx" ON "MedicinalProductPharmaceutical" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MPUE_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MPUE_projectId_lastUpdated_idx" ON "MedicinalProductUndesirableEffect" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MessageDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MessageDefinition_projectId_lastUpdated_idx" ON "MessageDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MessageDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MessageDefinition_projectId_date_idx" ON "MessageDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'MessageHeader_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MessageHeader_projectId_lastUpdated_idx" ON "MessageHeader" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'MolecularSequence_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "MolecularSequence_projectId_lastUpdated_idx" ON "MolecularSequence" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'NamingSystem_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "NamingSystem_projectId_lastUpdated_idx" ON "NamingSystem" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'NamingSystem_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "NamingSystem_projectId_date_idx" ON "NamingSystem" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'NutritionOrder_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "NutritionOrder_projectId_lastUpdated_idx" ON "NutritionOrder" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Observation_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Observation_projectId_lastUpdated_idx" ON "Observation" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Observation_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Observation_projectId_date_idx" ON "Observation" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ObservationDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ObservationDefinition_projectId_lastUpdated_idx" ON "ObservationDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'OperationDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "OperationDefinition_projectId_lastUpdated_idx" ON "OperationDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'OperationDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "OperationDefinition_projectId_date_idx" ON "OperationDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'OperationOutcome_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "OperationOutcome_projectId_lastUpdated_idx" ON "OperationOutcome" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Organization_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Organization_projectId_lastUpdated_idx" ON "Organization" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'OrganizationAffiliation_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "OrganizationAffiliation_projectId_lastUpdated_idx" ON "OrganizationAffiliation" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'OrganizationAffiliation_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "OrganizationAffiliation_projectId_date_idx" ON "OrganizationAffiliation" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Parameters_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Parameters_projectId_lastUpdated_idx" ON "Parameters" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Patient_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Patient_projectId_lastUpdated_idx" ON "Patient" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'PaymentNotice_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "PaymentNotice_projectId_lastUpdated_idx" ON "PaymentNotice" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'PaymentReconciliation_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "PaymentReconciliation_projectId_lastUpdated_idx" ON "PaymentReconciliation" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Person_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Person_projectId_lastUpdated_idx" ON "Person" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'PlanDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "PlanDefinition_projectId_lastUpdated_idx" ON "PlanDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'PlanDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "PlanDefinition_projectId_date_idx" ON "PlanDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Practitioner_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Practitioner_projectId_lastUpdated_idx" ON "Practitioner" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'PractitionerRole_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "PractitionerRole_projectId_lastUpdated_idx" ON "PractitionerRole" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'PractitionerRole_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "PractitionerRole_projectId_date_idx" ON "PractitionerRole" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Procedure_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Procedure_projectId_lastUpdated_idx" ON "Procedure" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Procedure_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Procedure_projectId_date_idx" ON "Procedure" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Provenance_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Provenance_projectId_lastUpdated_idx" ON "Provenance" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Questionnaire_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Questionnaire_projectId_lastUpdated_idx" ON "Questionnaire" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Questionnaire_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Questionnaire_projectId_date_idx" ON "Questionnaire" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'QuestionnaireResponse_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "QuestionnaireResponse_projectId_lastUpdated_idx" ON "QuestionnaireResponse" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'RelatedPerson_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "RelatedPerson_projectId_lastUpdated_idx" ON "RelatedPerson" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'RequestGroup_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "RequestGroup_projectId_lastUpdated_idx" ON "RequestGroup" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ResearchDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ResearchDefinition_projectId_lastUpdated_idx" ON "ResearchDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ResearchDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ResearchDefinition_projectId_date_idx" ON "ResearchDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ResearchElementDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ResearchElementDefinition_projectId_lastUpdated_idx" ON "ResearchElementDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ResearchElementDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ResearchElementDefinition_projectId_date_idx" ON "ResearchElementDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ResearchStudy_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ResearchStudy_projectId_lastUpdated_idx" ON "ResearchStudy" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ResearchStudy_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ResearchStudy_projectId_date_idx" ON "ResearchStudy" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ResearchSubject_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ResearchSubject_projectId_lastUpdated_idx" ON "ResearchSubject" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ResearchSubject_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ResearchSubject_projectId_date_idx" ON "ResearchSubject" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'RiskAssessment_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "RiskAssessment_projectId_lastUpdated_idx" ON "RiskAssessment" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'RiskAssessment_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "RiskAssessment_projectId_date_idx" ON "RiskAssessment" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'RiskEvidenceSynthesis_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "RiskEvidenceSynthesis_projectId_lastUpdated_idx" ON "RiskEvidenceSynthesis" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'RiskEvidenceSynthesis_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "RiskEvidenceSynthesis_projectId_date_idx" ON "RiskEvidenceSynthesis" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Schedule_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Schedule_projectId_lastUpdated_idx" ON "Schedule" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Schedule_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Schedule_projectId_date_idx" ON "Schedule" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'SearchParameter_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SearchParameter_projectId_lastUpdated_idx" ON "SearchParameter" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SearchParameter_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SearchParameter_projectId_date_idx" ON "SearchParameter" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ServiceRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ServiceRequest_projectId_lastUpdated_idx" ON "ServiceRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Slot_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Slot_projectId_lastUpdated_idx" ON "Slot" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Specimen_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Specimen_projectId_lastUpdated_idx" ON "Specimen" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SpecimenDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SpecimenDefinition_projectId_lastUpdated_idx" ON "SpecimenDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'StructureDefinition_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "StructureDefinition_projectId_lastUpdated_idx" ON "StructureDefinition" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'StructureDefinition_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "StructureDefinition_projectId_date_idx" ON "StructureDefinition" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'StructureMap_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "StructureMap_projectId_lastUpdated_idx" ON "StructureMap" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'StructureMap_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "StructureMap_projectId_date_idx" ON "StructureMap" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Subscription_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Subscription_projectId_lastUpdated_idx" ON "Subscription" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SubscriptionStatus_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SubscriptionStatus_projectId_lastUpdated_idx" ON "SubscriptionStatus" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Substance_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Substance_projectId_lastUpdated_idx" ON "Substance" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SubstanceNucleicAcid_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SubstanceNucleicAcid_projectId_lastUpdated_idx" ON "SubstanceNucleicAcid" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SubstancePolymer_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SubstancePolymer_projectId_lastUpdated_idx" ON "SubstancePolymer" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SubstanceProtein_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SubstanceProtein_projectId_lastUpdated_idx" ON "SubstanceProtein" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SubstanceReferenceInformation_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SubstanceReferenceInformation_projectId_lastUpdated_idx" ON "SubstanceReferenceInformation" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SubstanceSourceMaterial_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SubstanceSourceMaterial_projectId_lastUpdated_idx" ON "SubstanceSourceMaterial" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SubstanceSpecification_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SubstanceSpecification_projectId_lastUpdated_idx" ON "SubstanceSpecification" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SupplyDelivery_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SupplyDelivery_projectId_lastUpdated_idx" ON "SupplyDelivery" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SupplyRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SupplyRequest_projectId_lastUpdated_idx" ON "SupplyRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SupplyRequest_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SupplyRequest_projectId_date_idx" ON "SupplyRequest" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'Task_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Task_projectId_lastUpdated_idx" ON "Task" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'TerminologyCapabilities_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "TerminologyCapabilities_projectId_lastUpdated_idx" ON "TerminologyCapabilities" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'TerminologyCapabilities_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "TerminologyCapabilities_projectId_date_idx" ON "TerminologyCapabilities" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'TestReport_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "TestReport_projectId_lastUpdated_idx" ON "TestReport" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'TestScript_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "TestScript_projectId_lastUpdated_idx" ON "TestScript" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'TestScript_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "TestScript_projectId_date_idx" ON "TestScript" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'ValueSet_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ValueSet_projectId_lastUpdated_idx" ON "ValueSet" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ValueSet_projectId_date_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ValueSet_projectId_date_idx" ON "ValueSet" ("projectId", "date")`); await fns.idempotentCreateIndex(client, results, 'VerificationResult_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "VerificationResult_projectId_lastUpdated_idx" ON "VerificationResult" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'VisionPrescription_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "VisionPrescription_projectId_lastUpdated_idx" ON "VisionPrescription" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Project_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Project_projectId_lastUpdated_idx" ON "Project" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ClientApplication_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ClientApplication_projectId_lastUpdated_idx" ON "ClientApplication" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'User_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "User_projectId_lastUpdated_idx" ON "User" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'ProjectMembership_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectMembership_projectId_lastUpdated_idx" ON "ProjectMembership" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Bot_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Bot_projectId_lastUpdated_idx" ON "Bot" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Login_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Login_projectId_lastUpdated_idx" ON "Login" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'PasswordChangeRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "PasswordChangeRequest_projectId_lastUpdated_idx" ON "PasswordChangeRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'UserSecurityRequest_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "UserSecurityRequest_projectId_lastUpdated_idx" ON "UserSecurityRequest" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'JsonWebKey_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "JsonWebKey_projectId_lastUpdated_idx" ON "JsonWebKey" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'AccessPolicy_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AccessPolicy_projectId_lastUpdated_idx" ON "AccessPolicy" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'UserConfiguration_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "UserConfiguration_projectId_lastUpdated_idx" ON "UserConfiguration" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'BulkDataExport_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "BulkDataExport_projectId_lastUpdated_idx" ON "BulkDataExport" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'SmartAppLaunch_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "SmartAppLaunch_projectId_lastUpdated_idx" ON "SmartAppLaunch" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'DomainConfiguration_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "DomainConfiguration_projectId_lastUpdated_idx" ON "DomainConfiguration" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'AsyncJob_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "AsyncJob_projectId_lastUpdated_idx" ON "AsyncJob" ("projectId", "lastUpdated")`); await fns.idempotentCreateIndex(client, results, 'Agent_projectId_lastUpdated_idx', `CREATE INDEX CONCURRENTLY IF NOT EXISTS "Agent_projectId_lastUpdated_idx" ON "Agent" ("projectId", "lastUpdated")`); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/medplum/medplum'

If you have feedback or need assistance with the MCP directory API, please join our Discord server