"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fieldsValidationSchema = exports.fields = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const zod_1 = require("zod");
const validation_1 = require("../../../validation");
// Note: https://docs.canvasmedical.com/reference/claim-create
exports.fields = {
    status: {
        id: 'status',
        label: 'Status',
        description: 'Accepts a value representing the status compliant with Canvas Medical.',
        type: extensions_core_1.FieldType.STRING,
        required: true,
    },
    type: {
        id: 'type',
        label: 'Type',
        description: 'Accepts a JSON object representing the type compliant with Canvas Medical.',
        type: extensions_core_1.FieldType.JSON,
        required: true,
    },
    patientId: {
        id: 'patientId',
        label: 'Patient ID',
        description: `The patient's unique resource ID (e.g. 865058f6654149bd921264d91519af9e).`,
        type: extensions_core_1.FieldType.STRING,
        required: true,
    },
    created: {
        id: 'created',
        label: 'Created',
        description: 'The field indicating when this claim resource was created.',
        type: extensions_core_1.FieldType.DATE,
        required: true,
    },
    provider: {
        id: 'provider',
        label: 'Provider',
        description: 'The field related to determining personnel resources for services in the statement accepts a JSON object in accordance with the Canvas Medical format.',
        type: extensions_core_1.FieldType.JSON,
        required: true,
    },
    supportingInfo: {
        id: 'supportingInfo',
        label: 'Supporting Info',
        description: 'Accepts a value representing the supporting info compliant with Canvas Medical.',
        type: extensions_core_1.FieldType.JSON,
        required: false,
    },
    diagnosis: {
        id: 'diagnosis',
        label: 'Diagnosis',
        description: 'The field represents the list will create the Assessments in Canvas for this claim and accepts an array of JSON objects.',
        type: extensions_core_1.FieldType.JSON,
        required: true,
    },
    insurance: {
        id: 'insurance',
        label: 'Insurance',
        description: 'The field represents the list of elements that defines what coverages are to be used when adjudicating the claim and accepts an array of JSON objects.',
        type: extensions_core_1.FieldType.JSON,
        required: true,
    },
    item: {
        id: 'item',
        label: 'Item',
        description: 'The field represents the list of service charges to be used in the claim and accepts an array of JSON objects.',
        type: extensions_core_1.FieldType.JSON,
        required: true,
    },
};
exports.fieldsValidationSchema = zod_1.z.object({
    status: zod_1.z.string(),
    type: validation_1.JsonSchema,
    patientId: zod_1.z.string(),
    created: extensions_core_1.DateOnlySchema,
    provider: validation_1.JsonSchema,
    supportingInfo: validation_1.JsonArraySchema.optional(),
    diagnosis: validation_1.JsonArraySchema,
    insurance: validation_1.JsonArraySchema,
    item: validation_1.JsonArraySchema,
});
//# sourceMappingURL=fields.js.map