{
  "source": {
    "collectionId": "577ce118-9f1a-4104-bc8d-d16bc1a61d14",
    "version": 163
  },
  "summary": {
    "namespaceCount": 13,
    "operationCount": 41,
    "entityCount": 13
  },
  "namespaces": [
    {
      "namespace": "patient",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: PatientGetInput): Promise<ApiResponse<Patient>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one Patient by its vimEntityId.",
          "entityTypeId": "patient",
          "inputType": "PatientGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<Patient>>",
          "resultType": "Patient",
          "paginated": false
        },
        {
          "method": "lookup",
          "signature": "lookup(input: PatientLookupInput): Promise<ApiResponse<CustomOperationResponse<CustomRecord<\"patient\", never>>>>",
          "operationType": "custom",
          "customOperationName": "lookup",
          "write": false,
          "description": "Match a patient from a supplied identity. First name, last name and date of birth are required; MRN and ZIP sharpen the match.",
          "entityTypeId": "patient",
          "inputType": "PatientLookupInput",
          "inputFields": [
            {
              "name": "demographics.firstName",
              "type": "string",
              "required": true,
              "description": "First name"
            },
            {
              "name": "demographics.lastName",
              "type": "string",
              "required": true,
              "description": "Last name"
            },
            {
              "name": "demographics.dateOfBirth",
              "type": "date",
              "required": true,
              "description": "Date of birth (ISO 8601 format)",
              "format": "YYYY-MM-DD"
            },
            {
              "name": "identifiers.mrn",
              "type": "string",
              "required": false,
              "description": "Medical record number, as the practice assigns it"
            },
            {
              "name": "address.zipCode",
              "type": "string",
              "required": false,
              "description": "ZIP or postal code"
            }
          ],
          "returnType": "Promise<ApiResponse<CustomOperationResponse<CustomRecord<\"patient\", never>>>>",
          "resultType": "CustomOperationResponse<CustomRecord<\"patient\", never>>",
          "records": [
            {
              "entityTypeId": "patient"
            }
          ],
          "paginated": false
        },
        {
          "method": "getInsights",
          "signature": "getInsights(input: PatientGetInsightsInput): Promise<ApiResponse<CustomOperationResponse<CustomRecord<\"diagnosis-gap\", DiagnosisGap> | CustomRecord<\"clinical-insight\", ClinicalInsight> | CustomRecord<\"quality-gap\", QualityGap> | CustomRecord<\"sdoh-insight\", SdohInsight> | CustomRecord<\"utilization-insight\", UtilizationInsight> | CustomRecord<\"risk-insight\", RiskInsight> | CustomRecord<\"adt-insight\", AdtInsight> | CustomRecord<\"rx-insight\", RxInsight> | CustomRecord<\"ccm-insight\", CcmInsight>>>>",
          "operationType": "custom",
          "customOperationName": "getInsights",
          "write": false,
          "description": "List the insights this account holds for one Patient, by the vimEntityId lookup returned. The first call for a patient runs the account's insight resolvers when its source is an API.",
          "entityTypeId": "patient",
          "inputType": "PatientGetInsightsInput",
          "inputFields": [
            {
              "name": "vimEntityId",
              "type": "string",
              "required": true,
              "description": "The record's id, the one get, update and getInsights take."
            }
          ],
          "returnType": "Promise<ApiResponse<CustomOperationResponse<CustomRecord<\"diagnosis-gap\", DiagnosisGap> | CustomRecord<\"clinical-insight\", ClinicalInsight> | CustomRecord<\"quality-gap\", QualityGap> | CustomRecord<\"sdoh-insight\", SdohInsight> | CustomRecord<\"utilization-insight\", UtilizationInsight> | CustomRecord<\"risk-insight\", RiskInsight> | CustomRecord<\"adt-insight\", AdtInsight> | CustomRecord<\"rx-insight\", RxInsight> | CustomRecord<\"ccm-insight\", CcmInsight>>>>",
          "resultType": "CustomOperationResponse<CustomRecord<\"diagnosis-gap\", DiagnosisGap> | CustomRecord<\"clinical-insight\", ClinicalInsight> | CustomRecord<\"quality-gap\", QualityGap> | CustomRecord<\"sdoh-insight\", SdohInsight> | CustomRecord<\"utilization-insight\", UtilizationInsight> | CustomRecord<\"risk-insight\", RiskInsight> | CustomRecord<\"adt-insight\", AdtInsight> | CustomRecord<\"rx-insight\", RxInsight> | CustomRecord<\"ccm-insight\", CcmInsight>>",
          "records": [
            {
              "entityTypeId": "diagnosis-gap",
              "sectionsType": "DiagnosisGap"
            },
            {
              "entityTypeId": "clinical-insight",
              "sectionsType": "ClinicalInsight"
            },
            {
              "entityTypeId": "quality-gap",
              "sectionsType": "QualityGap"
            },
            {
              "entityTypeId": "sdoh-insight",
              "sectionsType": "SdohInsight"
            },
            {
              "entityTypeId": "utilization-insight",
              "sectionsType": "UtilizationInsight"
            },
            {
              "entityTypeId": "risk-insight",
              "sectionsType": "RiskInsight"
            },
            {
              "entityTypeId": "adt-insight",
              "sectionsType": "AdtInsight"
            },
            {
              "entityTypeId": "rx-insight",
              "sectionsType": "RxInsight"
            },
            {
              "entityTypeId": "ccm-insight",
              "sectionsType": "CcmInsight"
            }
          ],
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: PatientCreateInput): Promise<ApiResponse<Patient>>",
          "operationType": "create",
          "write": true,
          "description": "Create a Patient record.",
          "entityTypeId": "patient",
          "inputType": "PatientCreateInput",
          "inputFields": [
            {
              "name": "identifiers.sourceId",
              "type": "string",
              "required": true,
              "description": "Patient ID in the source system: the EHR patient ID for EHR-originated patients, or the datasource patient ID for resolver-created patients."
            },
            {
              "name": "identifiers.mrn",
              "type": "string",
              "required": false,
              "description": "Medical record number, as the practice assigns it"
            },
            {
              "name": "identifiers.sourcePatientId",
              "type": "string",
              "required": false,
              "description": "Patient ID in the source system. Equals ehrPatientId for EHR-originated patients, or the datasource patient ID for resolver-created patients.",
              "deprecated": true,
              "deprecationText": "Use identifiers.sourceId instead."
            },
            {
              "name": "pcp",
              "type": "Provider",
              "required": false,
              "description": "Primary care provider of record for this patient. Fetch the full provider with provider.getById(pcp.identifiers.ehrProviderId)."
            },
            {
              "name": "address",
              "type": "Address",
              "required": false,
              "description": "Physical address"
            },
            {
              "name": "problems",
              "type": "Diagnosis[]",
              "required": false,
              "description": "Active problem list — the patient's ongoing diagnoses"
            },
            {
              "name": "insurances",
              "type": "Insurance[]",
              "required": false,
              "description": "Every insurance plan on file, in the order the EHR lists them. Use isPrimary to find the primary plan."
            },
            {
              "name": "contactInfo",
              "type": "ContactInfo",
              "required": false,
              "description": "Contact information"
            },
            {
              "name": "demographics",
              "type": "Demographics",
              "required": false,
              "description": "Basic demographic information"
            }
          ],
          "returnType": "Promise<ApiResponse<Patient>>",
          "resultType": "Patient",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: PatientUpdateInput): Promise<ApiResponse<Patient>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one Patient by its vimEntityId.",
          "entityTypeId": "patient",
          "inputType": "PatientUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "pcp",
              "type": "Provider",
              "required": false,
              "description": "Primary care provider of record for this patient. Fetch the full provider with provider.getById(pcp.identifiers.ehrProviderId)."
            },
            {
              "name": "address",
              "type": "Address",
              "required": false,
              "description": "Physical address"
            },
            {
              "name": "problems",
              "type": "Diagnosis[]",
              "required": false,
              "description": "Active problem list — the patient's ongoing diagnoses"
            },
            {
              "name": "insurances",
              "type": "Insurance[]",
              "required": false,
              "description": "Every insurance plan on file, in the order the EHR lists them. Use isPrimary to find the primary plan."
            },
            {
              "name": "contactInfo",
              "type": "ContactInfo",
              "required": false,
              "description": "Contact information"
            },
            {
              "name": "identifiers",
              "type": "{ id?: string; mrn?: string; sourceId?: string; ehrPatientId?: string; sourcePatientId?: string }",
              "required": false,
              "description": "Unique patient identifier"
            },
            {
              "name": "demographics",
              "type": "Demographics",
              "required": false,
              "description": "Basic demographic information"
            }
          ],
          "returnType": "Promise<ApiResponse<Patient>>",
          "resultType": "Patient",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "patientMatch",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: PatientMatchGetInput): Promise<ApiResponse<PatientMatch>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one Patient Match by its vimEntityId.",
          "entityTypeId": "patient-match",
          "inputType": "PatientMatchGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<PatientMatch>>",
          "resultType": "PatientMatch",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input?: PatientMatchCreateInput): Promise<ApiResponse<PatientMatch>>",
          "operationType": "create",
          "write": true,
          "description": "Create a Patient Match record.",
          "entityTypeId": "patient-match",
          "inputType": "PatientMatchCreateInput",
          "inputFields": [
            {
              "name": "matchedAt",
              "type": "date",
              "required": false,
              "description": "When the match was established",
              "format": "YYYY-MM-DD"
            },
            {
              "name": "statusDetails",
              "type": "MatchStatusDetails",
              "required": false,
              "description": "Outcome details — matchStrategy on success"
            },
            {
              "name": "insightsSynced",
              "type": "boolean",
              "required": false,
              "description": "True once all insights from the datasource have been fully copied to this account. Written after the last upsert — if absent/false, the next GET insights call re-fetches."
            },
            {
              "name": "insightsSyncedAt",
              "type": "date",
              "required": false,
              "description": "ISO timestamp of when insightsSynced was last set to true",
              "format": "ISO8601"
            },
            {
              "name": "requestAccountId",
              "type": "string",
              "required": false,
              "description": "Account ID of the requesting (practice) side"
            },
            {
              "name": "resolveAccountId",
              "type": "string",
              "required": false,
              "description": "The data-source account this match was resolved against (request side)"
            },
            {
              "name": "lookupVimEntityId",
              "type": "string",
              "required": false,
              "description": "Back-reference to the patient-lookup record that initiated this match"
            },
            {
              "name": "requestPatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "The requesting patient that triggered the lookup"
            },
            {
              "name": "resolvedPatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "The matched data-source patient entity"
            },
            {
              "name": "copyRequestPatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "Lean copy of the requesting patient written to the data-source store"
            },
            {
              "name": "copyResolvePatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "Lean copy of the resolved patient written to the requesting account"
            }
          ],
          "returnType": "Promise<ApiResponse<PatientMatch>>",
          "resultType": "PatientMatch",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: PatientMatchUpdateInput): Promise<ApiResponse<PatientMatch>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one Patient Match by its vimEntityId.",
          "entityTypeId": "patient-match",
          "inputType": "PatientMatchUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "matchedAt",
              "type": "date",
              "required": false,
              "description": "When the match was established",
              "format": "YYYY-MM-DD"
            },
            {
              "name": "statusDetails",
              "type": "MatchStatusDetails",
              "required": false,
              "description": "Outcome details — matchStrategy on success"
            },
            {
              "name": "insightsSynced",
              "type": "boolean",
              "required": false,
              "description": "True once all insights from the datasource have been fully copied to this account. Written after the last upsert — if absent/false, the next GET insights call re-fetches."
            },
            {
              "name": "insightsSyncedAt",
              "type": "date",
              "required": false,
              "description": "ISO timestamp of when insightsSynced was last set to true",
              "format": "ISO8601"
            },
            {
              "name": "requestAccountId",
              "type": "string",
              "required": false,
              "description": "Account ID of the requesting (practice) side"
            },
            {
              "name": "resolveAccountId",
              "type": "string",
              "required": false,
              "description": "The data-source account this match was resolved against (request side)"
            },
            {
              "name": "lookupVimEntityId",
              "type": "string",
              "required": false,
              "description": "Back-reference to the patient-lookup record that initiated this match"
            },
            {
              "name": "requestPatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "The requesting patient that triggered the lookup"
            },
            {
              "name": "resolvedPatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "The matched data-source patient entity"
            },
            {
              "name": "copyRequestPatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "Lean copy of the requesting patient written to the data-source store"
            },
            {
              "name": "copyResolvePatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "Lean copy of the resolved patient written to the requesting account"
            }
          ],
          "returnType": "Promise<ApiResponse<PatientMatch>>",
          "resultType": "PatientMatch",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "diagnosisGap",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: DiagnosisGapGetInput): Promise<ApiResponse<DiagnosisGap>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one DiagnosisGap by its vimEntityId.",
          "entityTypeId": "diagnosis-gap",
          "inputType": "DiagnosisGapGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<DiagnosisGap>>",
          "resultType": "DiagnosisGap",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: DiagnosisGapCreateInput): Promise<ApiResponse<DiagnosisGap>>",
          "operationType": "create",
          "write": true,
          "description": "Create a DiagnosisGap record.",
          "entityTypeId": "diagnosis-gap",
          "inputType": "DiagnosisGapCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "hcc",
              "type": "HccGap",
              "required": false,
              "description": "Risk context (HCC). 0..1. A gap has an hcc OR >=1 icd."
            },
            {
              "name": "icds",
              "type": "IcdGap[]",
              "required": false,
              "description": "The ICD codes a provider can act on for this gap. Zero or more."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "modelVersion",
              "type": "'CMS_HCC_V24' | 'CMS_HCC_V28' | 'CMS_ESRD_HCC_V24' | 'RX_HCC_V08' | 'HHS_HCC' | 'CDPS_RX' | 'EDC_ICD'",
              "required": false,
              "description": "The risk model this gap was scored against. Values the resolver does not recognise pass through unchanged."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<DiagnosisGap>>",
          "resultType": "DiagnosisGap",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: DiagnosisGapUpdateInput): Promise<ApiResponse<DiagnosisGap>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one DiagnosisGap by its vimEntityId.",
          "entityTypeId": "diagnosis-gap",
          "inputType": "DiagnosisGapUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "hcc",
              "type": "HccGap",
              "required": false,
              "description": "Risk context (HCC). 0..1. A gap has an hcc OR >=1 icd."
            },
            {
              "name": "icds",
              "type": "IcdGap[]",
              "required": false,
              "description": "The ICD codes a provider can act on for this gap. Zero or more."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "modelVersion",
              "type": "'CMS_HCC_V24' | 'CMS_HCC_V28' | 'CMS_ESRD_HCC_V24' | 'RX_HCC_V08' | 'HHS_HCC' | 'CDPS_RX' | 'EDC_ICD'",
              "required": false,
              "description": "The risk model this gap was scored against. Values the resolver does not recognise pass through unchanged."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<DiagnosisGap>>",
          "resultType": "DiagnosisGap",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "clinicalInsight",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: ClinicalInsightGetInput): Promise<ApiResponse<ClinicalInsight>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one ClinicalInsight by its vimEntityId.",
          "entityTypeId": "clinical-insight",
          "inputType": "ClinicalInsightGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<ClinicalInsight>>",
          "resultType": "ClinicalInsight",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: ClinicalInsightCreateInput): Promise<ApiResponse<ClinicalInsight>>",
          "operationType": "create",
          "write": true,
          "description": "Create a ClinicalInsight record.",
          "entityTypeId": "clinical-insight",
          "inputType": "ClinicalInsightCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<ClinicalInsight>>",
          "resultType": "ClinicalInsight",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: ClinicalInsightUpdateInput): Promise<ApiResponse<ClinicalInsight>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one ClinicalInsight by its vimEntityId.",
          "entityTypeId": "clinical-insight",
          "inputType": "ClinicalInsightUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<ClinicalInsight>>",
          "resultType": "ClinicalInsight",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "qualityGap",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: QualityGapGetInput): Promise<ApiResponse<QualityGap>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one QualityGap by its vimEntityId.",
          "entityTypeId": "quality-gap",
          "inputType": "QualityGapGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<QualityGap>>",
          "resultType": "QualityGap",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: QualityGapCreateInput): Promise<ApiResponse<QualityGap>>",
          "operationType": "create",
          "write": true,
          "description": "Create a QualityGap record.",
          "entityTypeId": "quality-gap",
          "inputType": "QualityGapCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "program",
              "type": "string",
              "required": false,
              "description": "Quality program — the only difference from ClinicalInsight."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<QualityGap>>",
          "resultType": "QualityGap",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: QualityGapUpdateInput): Promise<ApiResponse<QualityGap>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one QualityGap by its vimEntityId.",
          "entityTypeId": "quality-gap",
          "inputType": "QualityGapUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "program",
              "type": "string",
              "required": false,
              "description": "Quality program — the only difference from ClinicalInsight."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<QualityGap>>",
          "resultType": "QualityGap",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "rxRecommendation",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: RxRecommendationGetInput): Promise<ApiResponse<RxRecommendation>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one RxRecommendation by its vimEntityId.",
          "entityTypeId": "rx-recommendation",
          "inputType": "RxRecommendationGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<RxRecommendation>>",
          "resultType": "RxRecommendation",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: RxRecommendationCreateInput): Promise<ApiResponse<RxRecommendation>>",
          "operationType": "create",
          "write": true,
          "description": "Create a RxRecommendation record.",
          "entityTypeId": "rx-recommendation",
          "inputType": "RxRecommendationCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            }
          ],
          "returnType": "Promise<ApiResponse<RxRecommendation>>",
          "resultType": "RxRecommendation",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: RxRecommendationUpdateInput): Promise<ApiResponse<RxRecommendation>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one RxRecommendation by its vimEntityId.",
          "entityTypeId": "rx-recommendation",
          "inputType": "RxRecommendationUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            }
          ],
          "returnType": "Promise<ApiResponse<RxRecommendation>>",
          "resultType": "RxRecommendation",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "sdohInsight",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: SdohInsightGetInput): Promise<ApiResponse<SdohInsight>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one SdohInsight by its vimEntityId.",
          "entityTypeId": "sdoh-insight",
          "inputType": "SdohInsightGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<SdohInsight>>",
          "resultType": "SdohInsight",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: SdohInsightCreateInput): Promise<ApiResponse<SdohInsight>>",
          "operationType": "create",
          "write": true,
          "description": "Create a SdohInsight record.",
          "entityTypeId": "sdoh-insight",
          "inputType": "SdohInsightCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<SdohInsight>>",
          "resultType": "SdohInsight",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: SdohInsightUpdateInput): Promise<ApiResponse<SdohInsight>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one SdohInsight by its vimEntityId.",
          "entityTypeId": "sdoh-insight",
          "inputType": "SdohInsightUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<SdohInsight>>",
          "resultType": "SdohInsight",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "utilizationInsight",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: UtilizationInsightGetInput): Promise<ApiResponse<UtilizationInsight>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one UtilizationInsight by its vimEntityId.",
          "entityTypeId": "utilization-insight",
          "inputType": "UtilizationInsightGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<UtilizationInsight>>",
          "resultType": "UtilizationInsight",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: UtilizationInsightCreateInput): Promise<ApiResponse<UtilizationInsight>>",
          "operationType": "create",
          "write": true,
          "description": "Create a UtilizationInsight record.",
          "entityTypeId": "utilization-insight",
          "inputType": "UtilizationInsightCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<UtilizationInsight>>",
          "resultType": "UtilizationInsight",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: UtilizationInsightUpdateInput): Promise<ApiResponse<UtilizationInsight>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one UtilizationInsight by its vimEntityId.",
          "entityTypeId": "utilization-insight",
          "inputType": "UtilizationInsightUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<UtilizationInsight>>",
          "resultType": "UtilizationInsight",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "riskInsight",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: RiskInsightGetInput): Promise<ApiResponse<RiskInsight>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one RiskInsight by its vimEntityId.",
          "entityTypeId": "risk-insight",
          "inputType": "RiskInsightGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<RiskInsight>>",
          "resultType": "RiskInsight",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: RiskInsightCreateInput): Promise<ApiResponse<RiskInsight>>",
          "operationType": "create",
          "write": true,
          "description": "Create a RiskInsight record.",
          "entityTypeId": "risk-insight",
          "inputType": "RiskInsightCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<RiskInsight>>",
          "resultType": "RiskInsight",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: RiskInsightUpdateInput): Promise<ApiResponse<RiskInsight>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one RiskInsight by its vimEntityId.",
          "entityTypeId": "risk-insight",
          "inputType": "RiskInsightUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<RiskInsight>>",
          "resultType": "RiskInsight",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "adtInsight",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: AdtInsightGetInput): Promise<ApiResponse<AdtInsight>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one AdtInsight by its vimEntityId.",
          "entityTypeId": "adt-insight",
          "inputType": "AdtInsightGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<AdtInsight>>",
          "resultType": "AdtInsight",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: AdtInsightCreateInput): Promise<ApiResponse<AdtInsight>>",
          "operationType": "create",
          "write": true,
          "description": "Create a AdtInsight record.",
          "entityTypeId": "adt-insight",
          "inputType": "AdtInsightCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<AdtInsight>>",
          "resultType": "AdtInsight",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: AdtInsightUpdateInput): Promise<ApiResponse<AdtInsight>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one AdtInsight by its vimEntityId.",
          "entityTypeId": "adt-insight",
          "inputType": "AdtInsightUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<AdtInsight>>",
          "resultType": "AdtInsight",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "rxInsight",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: RxInsightGetInput): Promise<ApiResponse<RxInsight>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one RxInsight by its vimEntityId.",
          "entityTypeId": "rx-insight",
          "inputType": "RxInsightGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<RxInsight>>",
          "resultType": "RxInsight",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: RxInsightCreateInput): Promise<ApiResponse<RxInsight>>",
          "operationType": "create",
          "write": true,
          "description": "Create a RxInsight record.",
          "entityTypeId": "rx-insight",
          "inputType": "RxInsightCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<RxInsight>>",
          "resultType": "RxInsight",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: RxInsightUpdateInput): Promise<ApiResponse<RxInsight>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one RxInsight by its vimEntityId.",
          "entityTypeId": "rx-insight",
          "inputType": "RxInsightUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<RxInsight>>",
          "resultType": "RxInsight",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "ccmInsight",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: CcmInsightGetInput): Promise<ApiResponse<CcmInsight>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one CcmInsight by its vimEntityId.",
          "entityTypeId": "ccm-insight",
          "inputType": "CcmInsightGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<CcmInsight>>",
          "resultType": "CcmInsight",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input: CcmInsightCreateInput): Promise<ApiResponse<CcmInsight>>",
          "operationType": "create",
          "write": true,
          "description": "Create a CcmInsight record.",
          "entityTypeId": "ccm-insight",
          "inputType": "CcmInsightCreateInput",
          "inputFields": [
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": true,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<CcmInsight>>",
          "resultType": "CcmInsight",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: CcmInsightUpdateInput): Promise<ApiResponse<CcmInsight>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one CcmInsight by its vimEntityId.",
          "entityTypeId": "ccm-insight",
          "inputType": "CcmInsightUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "code",
              "type": "string",
              "required": false,
              "description": "The source's own code for this insight."
            },
            {
              "name": "notes",
              "type": "string",
              "required": false,
              "description": "Free-text notes from the source."
            },
            {
              "name": "title",
              "type": "string",
              "required": false,
              "description": "Short label for the insight, as the source names it."
            },
            {
              "name": "gapSource",
              "type": "string",
              "required": false,
              "description": "Where the insight came from — the payer, programme or analytics source that raised it."
            },
            {
              "name": "gapStatus",
              "type": "'OPEN' | 'CLOSED'",
              "required": false,
              "description": "OPEN while the insight still needs attention, CLOSED once it does not."
            },
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "What the insight says, in full."
            },
            {
              "name": "customFields",
              "type": "CustomField[]",
              "required": false,
              "description": "Extra fields the source attached, beyond the standard shape."
            },
            {
              "name": "lastRecorded",
              "type": "LastRecorded",
              "required": false,
              "description": "When this was last recorded in the chart, and by whom."
            },
            {
              "name": "medicalCodes",
              "type": "MedicalCode[]",
              "required": false,
              "description": "Coded concepts the insight refers to."
            },
            {
              "name": "requiredAction",
              "type": "string",
              "required": false,
              "description": "What the provider is expected to do about it."
            },
            {
              "name": "sourceInsightId",
              "type": "string",
              "required": false,
              "description": "The source's own insight id (encrypted). Identifier of this insight."
            },
            {
              "name": "vimPatientId",
              "type": "string",
              "required": false,
              "description": "The Vim patient this insight is about."
            },
            {
              "name": "supportingDocument",
              "type": "SupportingDocument",
              "required": false,
              "description": "Document backing the insight, with the coordinates to highlight."
            }
          ],
          "returnType": "Promise<ApiResponse<CcmInsight>>",
          "resultType": "CcmInsight",
          "paginated": false
        }
      ]
    },
    {
      "namespace": "patientLookup",
      "methods": [
        {
          "method": "get",
          "signature": "get(input: PatientLookupGetInput): Promise<ApiResponse<PatientLookup>>",
          "operationType": "getById",
          "write": false,
          "description": "Read one Patient Lookup by its vimEntityId.",
          "entityTypeId": "patient-lookup",
          "inputType": "PatientLookupGetInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            }
          ],
          "returnType": "Promise<ApiResponse<PatientLookup>>",
          "resultType": "PatientLookup",
          "paginated": false
        },
        {
          "method": "create",
          "signature": "create(input?: PatientLookupCreateInput): Promise<ApiResponse<PatientLookup>>",
          "operationType": "create",
          "write": true,
          "description": "Create a Patient Lookup record.",
          "entityTypeId": "patient-lookup",
          "inputType": "PatientLookupCreateInput",
          "inputFields": [
            {
              "name": "status",
              "type": "'pending' | 'success' | 'failure'",
              "required": false,
              "description": "Lookup status"
            },
            {
              "name": "lookupPayload",
              "type": "LookupPayload",
              "required": false,
              "description": "PHI vault token refs used for the lookup"
            },
            {
              "name": "statusDetails",
              "type": "LookupStatusDetails",
              "required": false,
              "description": "Details about the lookup outcome (reason for failure, or reused flag on success)"
            },
            {
              "name": "requestAccountId",
              "type": "string",
              "required": false,
              "description": "Requesting account (on the resolve side)"
            },
            {
              "name": "resolvedAccountIds",
              "type": "string[]",
              "required": false,
              "description": "Data-source accounts that successfully matched (set on success)"
            },
            {
              "name": "patientMatchVimEntityId",
              "type": "string",
              "required": false,
              "description": "vimEntityId of the patient-match record created for this lookup (set on success)"
            },
            {
              "name": "requestPatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "Patient in the requesting account that triggered the lookup"
            },
            {
              "name": "candidateResolvedAccountIds",
              "type": "string[]",
              "required": false,
              "description": "Data-source accounts queried in this lookup"
            }
          ],
          "returnType": "Promise<ApiResponse<PatientLookup>>",
          "resultType": "PatientLookup",
          "paginated": false
        },
        {
          "method": "update",
          "signature": "update(input: PatientLookupUpdateInput): Promise<ApiResponse<PatientLookup>>",
          "operationType": "updateById",
          "write": true,
          "description": "Update one Patient Lookup by its vimEntityId.",
          "entityTypeId": "patient-lookup",
          "inputType": "PatientLookupUpdateInput",
          "inputFields": [
            {
              "name": "id",
              "type": "string",
              "required": true,
              "description": "The record's vimEntityId."
            },
            {
              "name": "status",
              "type": "'pending' | 'success' | 'failure'",
              "required": false,
              "description": "Lookup status"
            },
            {
              "name": "lookupPayload",
              "type": "LookupPayload",
              "required": false,
              "description": "PHI vault token refs used for the lookup"
            },
            {
              "name": "statusDetails",
              "type": "LookupStatusDetails",
              "required": false,
              "description": "Details about the lookup outcome (reason for failure, or reused flag on success)"
            },
            {
              "name": "requestAccountId",
              "type": "string",
              "required": false,
              "description": "Requesting account (on the resolve side)"
            },
            {
              "name": "resolvedAccountIds",
              "type": "string[]",
              "required": false,
              "description": "Data-source accounts that successfully matched (set on success)"
            },
            {
              "name": "patientMatchVimEntityId",
              "type": "string",
              "required": false,
              "description": "vimEntityId of the patient-match record created for this lookup (set on success)"
            },
            {
              "name": "requestPatientVimEntityId",
              "type": "string",
              "required": false,
              "description": "Patient in the requesting account that triggered the lookup"
            },
            {
              "name": "candidateResolvedAccountIds",
              "type": "string[]",
              "required": false,
              "description": "Data-source accounts queried in this lookup"
            }
          ],
          "returnType": "Promise<ApiResponse<PatientLookup>>",
          "resultType": "PatientLookup",
          "paginated": false
        }
      ]
    }
  ],
  "entities": [
    {
      "id": "patient",
      "pascalName": "Patient",
      "description": "Personal, administrative, and clinical data for individuals receiving care.",
      "fields": [
        {
          "name": "identifiers",
          "type": "{ id?: string; mrn?: string; sourceId?: string; ehrPatientId?: string; sourcePatientId?: string }",
          "required": false,
          "description": "Unique patient identifier",
          "fields": [
            {
              "name": "mrn",
              "type": "string",
              "required": false,
              "description": "Medical record number, as the practice assigns it"
            },
            {
              "name": "ehrPatientId",
              "type": "string",
              "required": false,
              "description": "EHR patient identifier",
              "deprecated": true,
              "deprecationText": "Use identifiers.sourceId instead."
            },
            {
              "name": "id",
              "type": "string",
              "required": false,
              "description": "Legacy patient identifier",
              "deprecated": true,
              "deprecationText": "Use identifiers.sourceId instead."
            },
            {
              "name": "sourceId",
              "type": "string",
              "required": false,
              "description": "Patient ID in the source system: the EHR patient ID for EHR-originated patients, or the datasource patient ID for resolver-created patients."
            },
            {
              "name": "sourcePatientId",
              "type": "string",
              "required": false,
              "description": "Patient ID in the source system. Equals ehrPatientId for EHR-originated patients, or the datasource patient ID for resolver-created patients.",
              "deprecated": true,
              "deprecationText": "Use identifiers.sourceId instead."
            }
          ]
        },
        {
          "name": "demographics",
          "type": "Demographics",
          "required": false,
          "description": "Basic demographic information"
        },
        {
          "name": "address",
          "type": "Address",
          "required": false,
          "description": "Physical address"
        },
        {
          "name": "contactInfo",
          "type": "ContactInfo",
          "required": false,
          "description": "Contact information"
        },
        {
          "name": "pcp",
          "type": "Provider",
          "required": false,
          "description": "Primary care provider of record for this patient. Fetch the full provider with provider.getById(pcp.identifiers.ehrProviderId)."
        },
        {
          "name": "problems",
          "type": "Diagnosis[]",
          "required": false,
          "description": "Active problem list — the patient's ongoing diagnoses"
        },
        {
          "name": "insurances",
          "type": "Insurance[]",
          "required": false,
          "description": "Every insurance plan on file, in the order the EHR lists them. Use isPrimary to find the primary plan."
        },
        {
          "name": "allergies",
          "type": "Allergy[]",
          "required": false,
          "description": "Patient allergies"
        },
        {
          "name": "labResults",
          "type": "LabResult[]",
          "required": false,
          "description": "Patient lab results"
        },
        {
          "name": "vitals",
          "type": "Vital[]",
          "required": false,
          "description": "Patient vitals"
        },
        {
          "name": "medications",
          "type": "Medication[]",
          "required": false,
          "description": "Patient medications"
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "user",
        "authored": true
      }
    },
    {
      "id": "patient-lookup",
      "pascalName": "PatientLookup",
      "description": "Audit record of a cross-account patient lookup request.",
      "fields": [
        {
          "name": "status",
          "type": "'pending' | 'success' | 'failure'",
          "required": false,
          "description": "Lookup status"
        },
        {
          "name": "lookupPayload",
          "type": "LookupPayload",
          "required": false,
          "description": "PHI vault token refs used for the lookup"
        },
        {
          "name": "statusDetails",
          "type": "LookupStatusDetails",
          "required": false,
          "description": "Details about the lookup outcome (reason for failure, or reused flag on success)"
        },
        {
          "name": "requestAccountId",
          "type": "string",
          "required": false,
          "description": "Requesting account (on the resolve side)"
        },
        {
          "name": "resolvedAccountIds",
          "type": "string[]",
          "required": false,
          "description": "Data-source accounts that successfully matched (set on success)"
        },
        {
          "name": "patientMatchVimEntityId",
          "type": "string",
          "required": false,
          "description": "vimEntityId of the patient-match record created for this lookup (set on success)"
        },
        {
          "name": "requestPatientVimEntityId",
          "type": "string",
          "required": false,
          "description": "Patient in the requesting account that triggered the lookup"
        },
        {
          "name": "candidateResolvedAccountIds",
          "type": "string[]",
          "required": false,
          "description": "Data-source accounts queried in this lookup"
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "search",
        "authored": false
      }
    },
    {
      "id": "patient-match",
      "pascalName": "PatientMatch",
      "description": "Cross-account patient match established by a lookup.",
      "fields": [
        {
          "name": "matchedAt",
          "type": "date",
          "required": false,
          "description": "When the match was established",
          "format": "YYYY-MM-DD"
        },
        {
          "name": "statusDetails",
          "type": "MatchStatusDetails",
          "required": false,
          "description": "Outcome details — matchStrategy on success"
        },
        {
          "name": "insightsSynced",
          "type": "boolean",
          "required": false,
          "description": "True once all insights from the datasource have been fully copied to this account. Written after the last upsert — if absent/false, the next GET insights call re-fetches."
        },
        {
          "name": "insightsSyncedAt",
          "type": "date",
          "required": false,
          "description": "ISO timestamp of when insightsSynced was last set to true",
          "format": "ISO8601"
        },
        {
          "name": "requestAccountId",
          "type": "string",
          "required": false,
          "description": "Account ID of the requesting (practice) side"
        },
        {
          "name": "resolveAccountId",
          "type": "string",
          "required": false,
          "description": "The data-source account this match was resolved against (request side)"
        },
        {
          "name": "lookupVimEntityId",
          "type": "string",
          "required": false,
          "description": "Back-reference to the patient-lookup record that initiated this match"
        },
        {
          "name": "requestPatientVimEntityId",
          "type": "string",
          "required": false,
          "description": "The requesting patient that triggered the lookup"
        },
        {
          "name": "resolvedPatientVimEntityId",
          "type": "string",
          "required": false,
          "description": "The matched data-source patient entity"
        },
        {
          "name": "copyRequestPatientVimEntityId",
          "type": "string",
          "required": false,
          "description": "Lean copy of the requesting patient written to the data-source store"
        },
        {
          "name": "copyResolvePatientVimEntityId",
          "type": "string",
          "required": false,
          "description": "Lean copy of the resolved patient written to the requesting account"
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "git-compare",
        "authored": false
      }
    },
    {
      "id": "diagnosis-gap",
      "pascalName": "DiagnosisGap",
      "description": "A diagnosis a patient may be missing — the risk context (HCC) and the ICD codes a provider can act on.",
      "fields": [
        {
          "name": "hcc",
          "type": "HccGap",
          "required": false,
          "description": "Risk context (HCC). 0..1. A gap has an hcc OR >=1 icd."
        },
        {
          "name": "icds",
          "type": "IcdGap[]",
          "required": false,
          "description": "The ICD codes a provider can act on for this gap. Zero or more."
        },
        {
          "name": "modelVersion",
          "type": "'CMS_HCC_V24' | 'CMS_HCC_V28' | 'CMS_ESRD_HCC_V24' | 'RX_HCC_V08' | 'HHS_HCC' | 'CDPS_RX' | 'EDC_ICD'",
          "required": false,
          "description": "The risk model this gap was scored against. Values the resolver does not recognise pass through unchanged."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "activity",
        "authored": false
      }
    },
    {
      "id": "quality-gap",
      "pascalName": "QualityGap",
      "description": "A quality measure a patient is not yet meeting, with the quality programme it belongs to.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Short label for the insight, as the source names it."
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The source's own code for this insight."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the insight says, in full."
        },
        {
          "name": "program",
          "type": "string",
          "required": false,
          "description": "Quality program — the only difference from ClinicalInsight."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "medicalCodes",
          "type": "MedicalCode[]",
          "required": false,
          "description": "Coded concepts the insight refers to."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the insight still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the insight came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "target",
        "authored": false
      }
    },
    {
      "id": "rx-recommendation",
      "pascalName": "RxRecommendation",
      "description": "A medication recommendation for a patient. Carries the patient and source identifiers; the clinical fields are not published yet.",
      "fields": [
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "pill-bottle",
        "authored": false
      }
    },
    {
      "id": "clinical-insight",
      "pascalName": "ClinicalInsight",
      "description": "A clinical insight about a patient — the general shape the category-specific insights share.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Short label for the insight, as the source names it."
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The source's own code for this insight."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the insight says, in full."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "medicalCodes",
          "type": "MedicalCode[]",
          "required": false,
          "description": "Coded concepts the insight refers to."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the insight still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the insight came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "lightbulb",
        "authored": false
      }
    },
    {
      "id": "risk-insight",
      "pascalName": "RiskInsight",
      "description": "Risk insight for a patient.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Short label for the insight, as the source names it."
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The source's own code for this insight."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the insight says, in full."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "medicalCodes",
          "type": "MedicalCode[]",
          "required": false,
          "description": "Coded concepts the insight refers to."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the insight still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the insight came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "triangle-alert",
        "authored": false
      }
    },
    {
      "id": "rx-insight",
      "pascalName": "RxInsight",
      "description": "Medication insight for a patient.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Short label for the insight, as the source names it."
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The source's own code for this insight."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the insight says, in full."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "medicalCodes",
          "type": "MedicalCode[]",
          "required": false,
          "description": "Coded concepts the insight refers to."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the insight still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the insight came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "pill",
        "authored": false
      }
    },
    {
      "id": "adt-insight",
      "pascalName": "AdtInsight",
      "description": "Admission, discharge and transfer insight for a patient.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Short label for the insight, as the source names it."
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The source's own code for this insight."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the insight says, in full."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "medicalCodes",
          "type": "MedicalCode[]",
          "required": false,
          "description": "Coded concepts the insight refers to."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the insight still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the insight came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "bed",
        "authored": false
      }
    },
    {
      "id": "ccm-insight",
      "pascalName": "CcmInsight",
      "description": "Chronic care management insight for a patient.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Short label for the insight, as the source names it."
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The source's own code for this insight."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the insight says, in full."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "medicalCodes",
          "type": "MedicalCode[]",
          "required": false,
          "description": "Coded concepts the insight refers to."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the insight still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the insight came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "heart-pulse",
        "authored": false
      }
    },
    {
      "id": "sdoh-insight",
      "pascalName": "SdohInsight",
      "description": "Social determinants of health insight for a patient.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Short label for the insight, as the source names it."
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The source's own code for this insight."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the insight says, in full."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "medicalCodes",
          "type": "MedicalCode[]",
          "required": false,
          "description": "Coded concepts the insight refers to."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the insight still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the insight came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "house",
        "authored": false
      }
    },
    {
      "id": "utilization-insight",
      "pascalName": "UtilizationInsight",
      "description": "Care utilisation insight for a patient.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Short label for the insight, as the source names it."
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The source's own code for this insight."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the insight says, in full."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "medicalCodes",
          "type": "MedicalCode[]",
          "required": false,
          "description": "Coded concepts the insight refers to."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the insight still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the insight came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        },
        {
          "name": "supportingDocument",
          "type": "SupportingDocument",
          "required": false,
          "description": "Document backing the insight, with the coordinates to highlight."
        },
        {
          "name": "customFields",
          "type": "CustomField[]",
          "required": false,
          "description": "Extra fields the source attached, beyond the standard shape."
        },
        {
          "name": "vimPatientId",
          "type": "string",
          "required": false,
          "description": "The Vim patient this insight is about."
        },
        {
          "name": "sourceInsightId",
          "type": "string",
          "required": false,
          "description": "The source's own insight id (encrypted). Identifier of this insight."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's id, the one get, update and getInsights take."
        }
      ],
      "icon": {
        "kind": "named",
        "name": "chart-column",
        "authored": false
      }
    }
  ],
  "typeDefinitions": [
    {
      "id": "demographics",
      "pascalName": "Demographics",
      "description": "Basic demographic information",
      "fields": [
        {
          "name": "firstName",
          "type": "string",
          "required": false,
          "description": "First name"
        },
        {
          "name": "lastName",
          "type": "string",
          "required": false,
          "description": "Last name"
        },
        {
          "name": "middleName",
          "type": "string",
          "required": false,
          "description": "Middle name"
        },
        {
          "name": "dateOfBirth",
          "type": "date",
          "required": false,
          "description": "Date of birth (ISO 8601 format)",
          "format": "YYYY-MM-DD"
        },
        {
          "name": "gender",
          "type": "'male' | 'female' | 'unknown'",
          "required": false,
          "description": "Gender"
        }
      ]
    },
    {
      "id": "address",
      "pascalName": "Address",
      "description": "Physical address",
      "fields": [
        {
          "name": "address1",
          "type": "string",
          "required": false,
          "description": "Street address line 1"
        },
        {
          "name": "address2",
          "type": "string",
          "required": false,
          "description": "Street address line 2"
        },
        {
          "name": "city",
          "type": "string",
          "required": false,
          "description": "City"
        },
        {
          "name": "state",
          "type": "string",
          "required": false,
          "description": "State or province",
          "format": "abbreviation"
        },
        {
          "name": "zipCode",
          "type": "string",
          "required": false,
          "description": "ZIP or postal code"
        }
      ]
    },
    {
      "id": "contact-info",
      "pascalName": "ContactInfo",
      "description": "Contact information including phone numbers and email",
      "fields": [
        {
          "name": "email",
          "type": "string",
          "required": false,
          "description": "Email address"
        },
        {
          "name": "homePhoneNumber",
          "type": "string",
          "required": false,
          "description": "Home phone number",
          "format": "digits-only"
        },
        {
          "name": "mobilePhoneNumber",
          "type": "string",
          "required": false,
          "description": "Mobile phone number",
          "format": "digits-only"
        },
        {
          "name": "faxNumber",
          "type": "string",
          "required": false,
          "description": "Fax number",
          "format": "digits-only"
        }
      ]
    },
    {
      "id": "provider",
      "pascalName": "Provider",
      "description": "Healthcare provider information",
      "fields": [
        {
          "name": "identifiers",
          "type": "{ npi?: string; ehrProviderId?: string }",
          "required": false,
          "description": "The provider's identifiers in the EHR and the NPI registry.",
          "fields": [
            {
              "name": "ehrProviderId",
              "type": "string",
              "required": false,
              "description": "EHR provider id. Fetch the full provider with provider.getById."
            },
            {
              "name": "npi",
              "type": "string",
              "required": false,
              "description": "National Provider Identifier"
            }
          ]
        },
        {
          "name": "demographics",
          "type": "ProviderDemographics",
          "required": false,
          "description": "The provider's name"
        },
        {
          "name": "firstName",
          "type": "string",
          "required": false,
          "description": "Provider first name",
          "deprecated": true,
          "deprecationText": "Use demographics.firstName instead."
        },
        {
          "name": "lastName",
          "type": "string",
          "required": false,
          "description": "Provider last name",
          "deprecated": true,
          "deprecationText": "Use demographics.lastName instead."
        },
        {
          "name": "middleName",
          "type": "string",
          "required": false,
          "description": "Provider middle name",
          "deprecated": true,
          "deprecationText": "Use demographics.middleName instead."
        },
        {
          "name": "specialty",
          "type": "string",
          "required": false,
          "description": "Provider specialty",
          "deprecated": true,
          "deprecationText": "Use specialties instead."
        },
        {
          "name": "specialties",
          "type": "{ taxonomies?: string[]; description?: string }[]",
          "required": false,
          "description": "The provider's specialties as the EHR lists them. A provider can have more than one.",
          "fields": [
            {
              "name": "description",
              "type": "string",
              "required": false,
              "description": "Specialty name as the EHR shows it."
            },
            {
              "name": "taxonomies",
              "type": "string[]",
              "required": false,
              "description": "NUCC taxonomy codes for this specialty."
            }
          ]
        },
        {
          "name": "npi",
          "type": "string",
          "required": false,
          "description": "National Provider Identifier",
          "deprecated": true,
          "deprecationText": "Use identifiers.npi instead."
        },
        {
          "name": "ehrProviderId",
          "type": "string",
          "required": false,
          "description": "EHR system provider identifier",
          "deprecated": true,
          "deprecationText": "Use identifiers.ehrProviderId instead."
        }
      ]
    },
    {
      "id": "provider-demographics",
      "pascalName": "ProviderDemographics",
      "description": "A provider's name. Not PHI.",
      "fields": [
        {
          "name": "firstName",
          "type": "string",
          "required": false,
          "description": "First name"
        },
        {
          "name": "lastName",
          "type": "string",
          "required": false,
          "description": "Last name"
        },
        {
          "name": "middleName",
          "type": "string",
          "required": false,
          "description": "Middle name"
        },
        {
          "name": "degree",
          "type": "string",
          "required": false,
          "description": "Professional degree or credential as the EHR shows it, e.g. MD, DO, NP."
        },
        {
          "name": "dateOfBirth",
          "type": "date",
          "required": false,
          "description": "Not populated for providers.",
          "deprecated": true,
          "deprecationText": "Not part of a provider record; never populated.",
          "format": "YYYY-MM-DD"
        },
        {
          "name": "gender",
          "type": "'male' | 'female' | 'unknown'",
          "required": false,
          "description": "Not populated for providers.",
          "deprecated": true,
          "deprecationText": "Not part of a provider record; never populated."
        }
      ]
    },
    {
      "id": "diagnosis",
      "pascalName": "Diagnosis",
      "description": "Clinical diagnosis with standard code",
      "fields": [
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "Human-readable description"
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "Diagnosis code"
        },
        {
          "name": "system",
          "type": "string",
          "required": false,
          "description": "Coding system (ICD-10, ICD-9, SNOMED-CT)"
        },
        {
          "name": "status",
          "type": "string",
          "required": false,
          "description": "Whether the diagnosis is active or resolved"
        },
        {
          "name": "onSetDate",
          "type": "date",
          "required": false,
          "description": "Date the condition began (ISO 8601)",
          "format": "YYYY-MM-DD"
        }
      ]
    },
    {
      "id": "insurance",
      "pascalName": "Insurance",
      "description": "A patient's insurance coverage — payer, member and group identifiers.",
      "fields": [
        {
          "name": "payerName",
          "type": "string",
          "required": false,
          "description": "Name of the insurance payer"
        },
        {
          "name": "payerId",
          "type": "string",
          "required": false,
          "description": "Payer identifier used for claims"
        },
        {
          "name": "groupId",
          "type": "string",
          "required": false,
          "description": "Group number on the patient's plan"
        },
        {
          "name": "memberId",
          "type": "string",
          "required": false,
          "description": "Member number identifying the patient to the payer"
        },
        {
          "name": "isPrimary",
          "type": "boolean",
          "required": false,
          "description": "Whether this is the patient's primary coverage"
        }
      ]
    },
    {
      "id": "allergy",
      "pascalName": "Allergy",
      "description": "Patient allergy information",
      "fields": [
        {
          "name": "allergyDetails",
          "type": "{ name?: string; criticality?: string }",
          "required": false,
          "description": "Details about the allergen",
          "fields": [
            {
              "name": "name",
              "type": "string",
              "required": false,
              "description": "Allergen name"
            },
            {
              "name": "criticality",
              "type": "string",
              "required": false,
              "description": "Clinical criticality of the allergy (e.g. High, Low)"
            }
          ]
        },
        {
          "name": "allergyReactionDetails",
          "type": "{ name?: string; severity?: string }",
          "required": false,
          "description": "Details about the allergic reaction",
          "fields": [
            {
              "name": "name",
              "type": "string",
              "required": false,
              "description": "Reaction description"
            },
            {
              "name": "severity",
              "type": "string",
              "required": false,
              "description": "Reaction severity (e.g. Mild, Moderate)"
            }
          ]
        },
        {
          "name": "basicInformation",
          "type": "{ status?: string; onsetDate?: date }",
          "required": false,
          "description": "Basic allergy information",
          "fields": [
            {
              "name": "status",
              "type": "string",
              "required": false,
              "description": "Allergy status (e.g. Active, Inactive)"
            },
            {
              "name": "onsetDate",
              "type": "date",
              "required": false,
              "description": "Date the allergy was first observed (ISO-8601)",
              "format": "YYYY-MM-DD"
            }
          ]
        }
      ]
    },
    {
      "id": "labResult",
      "pascalName": "LabResult",
      "description": "A patient lab result panel and its analyte values",
      "fields": [
        {
          "name": "basicInformation",
          "type": "{ cpt?: Procedure; name?: string; resultDate?: date; resultStatus?: string }",
          "required": false,
          "description": "Panel-level information",
          "fields": [
            {
              "name": "name",
              "type": "string",
              "required": false,
              "description": "Lab or panel name"
            },
            {
              "name": "cpt",
              "type": "Procedure",
              "required": false,
              "description": "CPT code of the ordered lab/panel (shared procedure type: code + description)"
            },
            {
              "name": "resultDate",
              "type": "date",
              "required": false,
              "description": "Date the panel was resulted (ISO-8601 YYYY-MM-DD). Date-only: eCW stores a naive practice-local date with no offset, so a datetime could not be made unambiguous.",
              "format": "YYYY-MM-DD"
            },
            {
              "name": "resultStatus",
              "type": "string",
              "required": false,
              "description": "Overall result status: Normal | Abnormal | Critical. Derived from the analyte flags; 'Critical' is direction-neutral because the source flag carries no high/low direction."
            }
          ]
        },
        {
          "name": "results",
          "type": "{ date?: date; name?: string; unit?: string; loinc?: string; range?: string; value?: string }[]",
          "required": false,
          "description": "Individual analyte results within the panel",
          "fields": [
            {
              "name": "name",
              "type": "string",
              "required": false,
              "description": "Analyte name"
            },
            {
              "name": "value",
              "type": "string",
              "required": false,
              "description": "Measured value"
            },
            {
              "name": "unit",
              "type": "string",
              "required": false,
              "description": "Unit of measure"
            },
            {
              "name": "range",
              "type": "string",
              "required": false,
              "description": "Reference range"
            },
            {
              "name": "date",
              "type": "date",
              "required": false,
              "description": "Result date for this analyte (ISO-8601 YYYY-MM-DD). Date-only for the same reason as basicInformation.resultDate.",
              "format": "YYYY-MM-DD"
            },
            {
              "name": "loinc",
              "type": "string",
              "required": false,
              "description": "LOINC code for the analyte"
            }
          ]
        }
      ]
    },
    {
      "id": "procedure",
      "pascalName": "Procedure",
      "description": "Billable procedure with a standard code (CPT)",
      "fields": [
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "Human-readable description of the procedure"
        },
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "Procedure code (CPT)"
        }
      ]
    },
    {
      "id": "vital",
      "pascalName": "Vital",
      "description": "A vital-sign type and its measurement history.",
      "fields": [
        {
          "name": "basicInformation",
          "type": "{ name?: 'Blood Pressure' | 'Heart Rate' | 'Respiratory Rate' | 'Body Temperature' | 'Oxygen Saturation' | 'Body Height' | 'Body Weight' | 'Body Mass Index' | 'Pain Score' | 'Body Surface Area'; unit?: 'mm[Hg]' | '/min' | '[degF]' | 'Cel' | '%' | 'cm' | '[in_i]' | 'kg' | '[lb_av]' | 'kg/m2' | '1' | 'm2'; loinc?: string }",
          "required": false,
          "description": "Vital-sign type metadata",
          "fields": [
            {
              "name": "name",
              "type": "'Blood Pressure' | 'Heart Rate' | 'Respiratory Rate' | 'Body Temperature' | 'Oxygen Saturation' | 'Body Height' | 'Body Weight' | 'Body Mass Index' | 'Pain Score' | 'Body Surface Area'",
              "required": false,
              "description": "Vital-sign name"
            },
            {
              "name": "unit",
              "type": "'mm[Hg]' | '/min' | '[degF]' | 'Cel' | '%' | 'cm' | '[in_i]' | 'kg' | '[lb_av]' | 'kg/m2' | '1' | 'm2'",
              "required": false,
              "description": "Unit of measure (UCUM code)"
            },
            {
              "name": "loinc",
              "type": "string",
              "required": false,
              "description": "LOINC code"
            }
          ]
        },
        {
          "name": "values",
          "type": "{ value?: string; measurementDate?: date; dataAbsentReason?: 'unknown' | 'asked-unknown' | 'temp-unknown' | 'not-asked' | 'asked-declined' | 'masked' | 'not-applicable' | 'unsupported' | 'as-text' | 'error' | 'not-a-number' | 'negative-infinity' | 'positive-infinity' | 'not-performed' | 'not-permitted' }[]",
          "required": false,
          "description": "Measurement history for this vital type, newest first",
          "fields": [
            {
              "name": "value",
              "type": "string",
              "required": false,
              "description": "Measured value. Absent when the EHR recorded no reading; dataAbsentReason then says why."
            },
            {
              "name": "measurementDate",
              "type": "date",
              "required": false,
              "description": "Date of measurement (ISO-8601 YYYY-MM-DD). Date-only by necessity, not choice: the source encounter date carries no time, and an EHR time without a zone offset is not a legal FHIR dateTime. Two readings on the same day therefore share this value — a blood pressure and its retake, for instance.",
              "format": "YYYY-MM-DD"
            },
            {
              "name": "dataAbsentReason",
              "type": "'unknown' | 'asked-unknown' | 'temp-unknown' | 'not-asked' | 'asked-declined' | 'masked' | 'not-applicable' | 'unsupported' | 'as-text' | 'error' | 'not-a-number' | 'negative-infinity' | 'positive-infinity' | 'not-performed' | 'not-permitted'",
              "required": false,
              "description": "Why this entry has no value, as a FHIR Observation.dataAbsentReason code. Present only on an entry whose value is absent; an entry with a value never carries it."
            }
          ]
        }
      ]
    },
    {
      "id": "medication",
      "pascalName": "Medication",
      "description": "Medication information",
      "fields": [
        {
          "name": "basicInformation",
          "type": "MedicationBasicInformation",
          "required": false,
          "description": "Identity, coding and timeline of the medication record"
        },
        {
          "name": "medicationName",
          "type": "string",
          "required": false,
          "description": "Medication name",
          "deprecated": true,
          "deprecationText": "Use basicInformation.medicationName instead. Still returned for now; it will be removed in a future version."
        },
        {
          "name": "strength",
          "type": "string",
          "required": false,
          "description": "Medication strength"
        },
        {
          "name": "form",
          "type": "string",
          "required": false,
          "description": "Medication form (tablet, capsule, liquid, injection)"
        },
        {
          "name": "frequency",
          "type": "string",
          "required": false,
          "description": "Dosing frequency"
        },
        {
          "name": "quantity",
          "type": "Quantity",
          "required": false,
          "description": "Quantity prescribed"
        },
        {
          "name": "ndcCode",
          "type": "string",
          "required": false,
          "description": "National Drug Code",
          "deprecated": true,
          "deprecationText": "Use basicInformation.ndcCode instead. Still returned for now; it will be removed in a future version."
        },
        {
          "name": "status",
          "type": "'active' | 'inactive' | 'discontinued'",
          "required": false,
          "description": "Medication status",
          "deprecated": true,
          "deprecationText": "Use basicInformation.status instead. Still returned for now; it will be removed in a future version."
        },
        {
          "name": "endDate",
          "type": "date",
          "required": false,
          "description": "Date the medication was stopped/discontinued",
          "deprecated": true,
          "deprecationText": "Use basicInformation.endDate instead. Still returned for now; it will be removed in a future version.",
          "format": "YYYY-MM-DD"
        },
        {
          "name": "onSetDate",
          "type": "date",
          "required": false,
          "description": "Date the medication was started",
          "deprecated": true,
          "deprecationText": "Use basicInformation.onSetDate instead. Still returned for now; it will be removed in a future version.",
          "format": "YYYY-MM-DD"
        },
        {
          "name": "recordedDate",
          "type": "date",
          "required": false,
          "description": "Date the medication record was created in the EHR",
          "deprecated": true,
          "deprecationText": "Use basicInformation.recordedDate instead. Still returned for now; it will be removed in a future version."
        }
      ]
    },
    {
      "id": "medicationBasicInformation",
      "pascalName": "MedicationBasicInformation",
      "description": "Identity, coding and timeline of a medication record.",
      "fields": [
        {
          "name": "medicationName",
          "type": "string",
          "required": false,
          "description": "Medication name"
        },
        {
          "name": "ndcCode",
          "type": "string",
          "required": false,
          "description": "National Drug Code"
        },
        {
          "name": "status",
          "type": "'active' | 'inactive' | 'discontinued'",
          "required": false,
          "description": "Medication status"
        },
        {
          "name": "onSetDate",
          "type": "date",
          "required": false,
          "description": "Date the medication was started",
          "format": "YYYY-MM-DD"
        },
        {
          "name": "recordedDate",
          "type": "date",
          "required": false,
          "description": "Date the medication record was created in the EHR"
        },
        {
          "name": "endDate",
          "type": "date",
          "required": false,
          "description": "Date the medication was stopped/discontinued",
          "format": "YYYY-MM-DD"
        }
      ]
    },
    {
      "id": "quantity",
      "pascalName": "Quantity",
      "description": "An amount with its unit.",
      "fields": [
        {
          "name": "unit",
          "type": "string",
          "required": false,
          "description": "Unit the amount is counted in (tablet, mL, …)"
        },
        {
          "name": "value",
          "type": "number",
          "required": false,
          "description": "Amount dispensed"
        }
      ]
    },
    {
      "id": "lookup-payload",
      "pascalName": "LookupPayload",
      "description": "The patient details a lookup was performed with, as vault token references.",
      "fields": [
        {
          "name": "demographics",
          "type": "Demographics",
          "required": false,
          "description": "Identity the caller supplied, as vault token references"
        },
        {
          "name": "address",
          "type": "Address",
          "required": false,
          "description": "Address the caller supplied, as vault token references"
        },
        {
          "name": "identifiers",
          "type": "LookupIdentifiers",
          "required": false,
          "description": "Source identifiers the caller supplied, as vault token references"
        }
      ]
    },
    {
      "id": "lookup-identifiers",
      "pascalName": "LookupIdentifiers",
      "description": "Vault token references identifying the patient in a lookup request.",
      "fields": [
        {
          "name": "mrn",
          "type": "string",
          "required": false,
          "description": "Medical record number, as a vault token reference (vtk_…@mrn)"
        }
      ]
    },
    {
      "id": "lookup-status-details",
      "pascalName": "LookupStatusDetails",
      "description": "Why a lookup ended as it did — the failure reason, or the reused flag on success.",
      "fields": [
        {
          "name": "reason",
          "type": "string",
          "required": false,
          "description": "Failure reason"
        },
        {
          "name": "error",
          "type": "string",
          "required": false,
          "description": "Error class, set on failure"
        },
        {
          "name": "reused",
          "type": "boolean",
          "required": false,
          "description": "True when an existing match was reused rather than performed again"
        },
        {
          "name": "matchStrategy",
          "type": "string",
          "required": false,
          "description": "How the match was performed — FLDE, FLDM or FLDZ when matched by scoring; 'external' when matched by an external identity API. Not an enum: the value set lives in the matching code, not here."
        }
      ]
    },
    {
      "id": "match-status-details",
      "pascalName": "MatchStatusDetails",
      "description": "How a match was established.",
      "fields": [
        {
          "name": "matchStrategy",
          "type": "string",
          "required": false,
          "description": "Which identity strategy produced the match — FLDE, FLDM or FLDZ when matched by scoring; 'external' when matched by an external identity API. Not an enum: the value set lives in the matching code, not here."
        }
      ]
    },
    {
      "id": "hcc-gap",
      "pascalName": "HccGap",
      "description": "Risk-context (HCC) portion of a DiagnosisGap. 0..1 per gap.",
      "fields": [
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The HCC code."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the HCC gap says, in full."
        },
        {
          "name": "gap_type",
          "type": "'SUSPECTED' | 'RECAPTURED' | 'INSUFFICIENT'",
          "required": false,
          "description": "How confident the source is in this diagnosis. Values the resolver does not recognise pass through unchanged."
        },
        {
          "name": "rafValue",
          "type": "number",
          "required": false,
          "description": "Risk-adjustment factor value carried by this HCC."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the gap still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the gap came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        }
      ]
    },
    {
      "id": "last-recorded",
      "pascalName": "LastRecorded",
      "description": "When/by whom a gap or code was last recorded.",
      "fields": [
        {
          "name": "date",
          "type": "date",
          "required": false,
          "description": "When it was last recorded."
        },
        {
          "name": "npi",
          "type": "string",
          "required": false,
          "description": "NPI of the provider who last recorded it."
        },
        {
          "name": "npiName",
          "type": "string",
          "required": false,
          "description": "Name of that provider."
        }
      ]
    },
    {
      "id": "icd-gap",
      "pascalName": "IcdGap",
      "description": "Provider-action (ICD) portion of a DiagnosisGap. 0..* per gap.",
      "fields": [
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The ICD code."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the ICD gap says, in full."
        },
        {
          "name": "gap_type",
          "type": "'SUSPECTED' | 'RECAPTURED' | 'INSUFFICIENT'",
          "required": false,
          "description": "How confident the source is in this diagnosis. Values the resolver does not recognise pass through unchanged."
        },
        {
          "name": "requiredAction",
          "type": "string",
          "required": false,
          "description": "What the provider is expected to do about it."
        },
        {
          "name": "gapStatus",
          "type": "'OPEN' | 'CLOSED'",
          "required": false,
          "description": "OPEN while the gap still needs attention, CLOSED once it does not."
        },
        {
          "name": "gapSource",
          "type": "string",
          "required": false,
          "description": "Where the gap came from — the payer, programme or analytics source that raised it."
        },
        {
          "name": "lastRecorded",
          "type": "LastRecorded",
          "required": false,
          "description": "When this was last recorded in the chart, and by whom."
        },
        {
          "name": "notes",
          "type": "string",
          "required": false,
          "description": "Free-text notes from the source."
        }
      ]
    },
    {
      "id": "supporting-document",
      "pascalName": "SupportingDocument",
      "description": "A supporting document with a URL and highlight coordinates.",
      "fields": [
        {
          "name": "url",
          "type": "string",
          "required": false,
          "description": "Where the document can be fetched."
        },
        {
          "name": "coordinates",
          "type": "number[]",
          "required": false,
          "description": "[ pageIndex, pageWidth, pageHeight, topLeft.x, topLeft.y, topRight.x, topRight.y, bottomRight.x, bottomRight.y, bottomLeft.x, bottomLeft.y ]"
        }
      ]
    },
    {
      "id": "custom-field",
      "pascalName": "CustomField",
      "description": "App-defined custom field. `value` carries the CustomFieldValue scalar (stringified); `type` names how to interpret it.",
      "fields": [
        {
          "name": "title",
          "type": "string",
          "required": false,
          "description": "Label for the custom field."
        },
        {
          "name": "value",
          "type": "string",
          "required": false,
          "description": "CustomFieldValue scalar (stringified)"
        },
        {
          "name": "type",
          "type": "'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'CURRENCY' | 'URL'",
          "required": false,
          "description": "How to read `value` — STRING, NUMBER, BOOLEAN, DATE, CURRENCY or URL."
        }
      ]
    },
    {
      "id": "medical-code",
      "pascalName": "MedicalCode",
      "description": "A coded medical concept (system + code).",
      "fields": [
        {
          "name": "code",
          "type": "string",
          "required": false,
          "description": "The code itself."
        },
        {
          "name": "system",
          "type": "string",
          "required": false,
          "description": "The coding system the code belongs to."
        },
        {
          "name": "description",
          "type": "string",
          "required": false,
          "description": "What the code means."
        }
      ]
    }
  ],
  "envelopeTypes": [
    {
      "id": "custom-operation-response",
      "pascalName": "CustomOperationResponse",
      "description": "What every custom operation answers with: records of the entity types it declares.",
      "fields": [
        {
          "name": "records",
          "type": "CustomRecord[]",
          "required": true,
          "description": "Empty when nothing matched or nothing is held."
        }
      ]
    },
    {
      "id": "custom-record",
      "pascalName": "CustomRecord",
      "description": "One record a custom operation answers with.",
      "fields": [
        {
          "name": "entityTypeId",
          "type": "string",
          "required": true,
          "description": "The record's entity type."
        },
        {
          "name": "vimEntityId",
          "type": "string",
          "required": true,
          "description": "The record's own id in this account."
        },
        {
          "name": "sections",
          "type": "object",
          "required": false,
          "description": "The record, present only when the operation returns it."
        }
      ]
    }
  ],
  "phi": {
    "patient": {
      "identifierField": "identifiers.sourceId",
      "fields": [
        "address.zipCode",
        "insurances.memberId",
        "contactInfo.email",
        "contactInfo.faxNumber",
        "contactInfo.homePhoneNumber",
        "contactInfo.mobilePhoneNumber",
        "identifiers.mrn",
        "identifiers.sourceId",
        "demographics.lastName",
        "demographics.firstName",
        "demographics.dateOfBirth"
      ]
    },
    "patient-lookup": {
      "fields": [
        "lookupPayload.address.zipCode",
        "lookupPayload.identifiers.mrn",
        "lookupPayload.demographics.lastName",
        "lookupPayload.demographics.firstName",
        "lookupPayload.demographics.dateOfBirth"
      ]
    }
  }
}
