{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-npdb-report-update-request-schema.json",
  "title": "NPDB Report",
  "description": "NPDB report data for PUT operations that replace the entire NPDB reports array",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-credentialingworkflow-api-openapi.yml#/components/schemas/NpdbReportUpdateRequest",
  "type": "object",
  "required": [
    "reportDate",
    "processDate",
    "typeOfAction",
    "source",
    "reportType"
  ],
  "properties": {
    "createdAt": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "The date the record was created"
    },
    "createdBy": {
      "type": "string",
      "description": "The user who created the record"
    },
    "updatedAt": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "The date the record was last updated"
    },
    "updatedBy": {
      "type": "string",
      "description": "The user who last updated the record"
    },
    "attachments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CredentialingWorkflowAttachment"
      },
      "description": "Array of attachment metadata for this record"
    },
    "verifiedBy": {
      "type": "string",
      "description": "Person who verified this record"
    },
    "verifiedDate": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Date when this record was verified"
    },
    "reportDate": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Date of the report"
    },
    "processDate": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Date when report was processed"
    },
    "data": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional data associated with the report"
    },
    "typeOfAction": {
      "type": "string",
      "pattern": "\\S",
      "description": "Type of action in the report"
    },
    "createdDate": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Date when record was created"
    },
    "deceased": {
      "type": "string",
      "description": "Deceased status"
    },
    "paymentAmount": {
      "type": "string",
      "description": "Payment amount"
    },
    "paymentDate": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Date of payment"
    },
    "patientAge": {
      "type": "string",
      "description": "Age of the patient"
    },
    "patientGender": {
      "type": "string",
      "description": "Gender of the patient"
    },
    "patientType": {
      "type": "string",
      "description": "Type of patient"
    },
    "medicalConditionDescription": {
      "type": "string",
      "description": "Description of medical condition"
    },
    "procedureDescription": {
      "type": "string",
      "description": "Description of procedure"
    },
    "allegationsDescription": {
      "type": "string",
      "description": "Description of allegations"
    },
    "allegationNature": {
      "type": "string",
      "description": "Nature of allegation"
    },
    "specificAllegation": {
      "type": "string",
      "description": "Specific allegation details"
    },
    "specificAllegationDate": {
      "$ref": "#/$defs/Date",
      "type": "string",
      "description": "Date of specific allegation"
    },
    "outcome": {
      "type": "string",
      "description": "Outcome of the report"
    },
    "source": {
      "type": "string",
      "pattern": "\\S",
      "description": "Source of the report"
    },
    "reportType": {
      "type": "string",
      "pattern": "\\S",
      "description": "Type of report"
    },
    "firstName": {
      "type": "string",
      "description": "First name"
    },
    "lastName": {
      "type": "string",
      "description": "Last name"
    },
    "middleName": {
      "type": "string",
      "description": "Middle name"
    },
    "gender": {
      "type": "string",
      "description": "Gender"
    },
    "npi": {
      "type": "string",
      "description": "National Provider Identifier"
    },
    "homeAddress": {
      "type": "string",
      "description": "Home address"
    },
    "homeCity": {
      "type": "string",
      "description": "Home city"
    },
    "homeState": {
      "type": "string",
      "description": "Home state"
    },
    "homeZip": {
      "type": "string",
      "description": "Home zip code"
    },
    "dcn": {
      "type": "string",
      "description": "Document Control Number"
    },
    "databankSubjectId": {
      "type": "string",
      "description": "Databank subject ID"
    },
    "enrollmentStatus": {
      "$ref": "#/$defs/NpdbEnrollmentStatus",
      "type": "object",
      "description": "Enrollment status information for this NPDB report"
    }
  },
  "$defs": {
    "CredentialingWorkflowAttachment": {
      "type": "object",
      "required": [
        "fileType",
        "fileUrl",
        "originalFileName"
      ],
      "description": "Attachment metadata for credentialing workflow row",
      "properties": {
        "createdAt": {
          "type": "string",
          "description": "Creation timestamp"
        },
        "fileType": {
          "type": "string",
          "description": "Document file type"
        },
        "fileUrl": {
          "type": "string",
          "description": "GCS file URL for file retrieval"
        },
        "originalFileName": {
          "type": "string",
          "description": "Original file name"
        },
        "expirationDate": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "Expiration date",
          "default": "9999-12-31"
        },
        "createdBy": {
          "type": "string",
          "description": "User who created the record"
        },
        "artifactLinkId": {
          "type": "string",
          "description": "Shared identifier linking this attachment to its corresponding supportingDocuments entry"
        }
      }
    },
    "Date": {
      "type": "string",
      "format": "date"
    },
    "NpdbEnrollmentStatus": {
      "type": "object",
      "description": "Enrollment status information for NPDB reports",
      "properties": {
        "dataBank": {
          "type": "string",
          "description": "The databank associated with the enrollment status"
        },
        "status": {
          "type": "string",
          "description": "The enrollment status"
        },
        "statusCode": {
          "type": "string",
          "description": "The code for the enrollment status"
        },
        "section1128e": {
          "type": "boolean",
          "description": "Enrollment status related to Section 1128E of the Social Security Act"
        },
        "section1921": {
          "type": "boolean",
          "description": "Enrollment status related to Section 1921 of the Social Security Act"
        },
        "titleIV": {
          "type": "boolean",
          "description": "Enrollment status related to Title IV of the Social Security Act"
        },
        "startDate": {
          "$ref": "#/$defs/Date",
          "type": "string",
          "description": "Start date of the enrollment status"
        },
        "endDate": {
          "$ref": "#/$defs/Date",
          "type": "string",
          "description": "End date of the enrollment status"
        }
      }
    }
  }
}