UNPKG

nhcx-fhir-coverage-eligibility

Version:

NHCX FHIR CoverageEligibilityRequest resource creation and validation library.

596 lines 19.4 kB
import { Identifier, Reference, CodeableConcept, Period } from "../../types/fhirDataTypes"; /** * Output type for a valid CoverageEligibilityRequest resource (NHCX profile). */ export interface CoverageEligibilityRequest extends CoverageEligibilityRequestInput { /** * Resource type (always 'CoverageEligibilityRequest') */ resourceType: 'CoverageEligibilityRequest'; /** * Logical id of this artifact (always present after creation) */ id: string; /** * Metadata about the resource (always present after creation) */ meta: { /** * Profile(s) this resource claims to conform to */ profile: string[]; /** * Version id for the resource */ versionId: string; /** * Last updated timestamp */ lastUpdated: string; [key: string]: any; }; /** * Creation date (always present after creation) */ created: string; } /** * Insurance information for CoverageEligibilityRequest (FHIR: insurance, 1..*, type: BackboneElement) */ export interface CoverageEligibilityRequestInsurance { /** * Unique id for inter-element referencing. * FHIR Path: insurance.id * Cardinality: 0..1 (optional) * Type: string * Description: A unique identifier for this element within a resource (for internal references). */ id?: string; /** * Additional content defined by implementations. * FHIR Path: insurance.extension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Additional information that is not part of the basic definition of the element. */ extension?: any[]; /** * Extensions that cannot be ignored. * FHIR Path: insurance.modifierExtension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Extensions that modify the understanding of the element. */ modifierExtension?: any[]; /** * Indicates if this coverage is to be used for adjudication. * FHIR Path: insurance.focal * Cardinality: 0..1 (optional) * Type: boolean * Description: If true, this coverage is considered the primary focus for adjudication. */ focal?: boolean; /** * Reference to the insurance coverage to be used. * FHIR Path: insurance.coverage * Cardinality: 1..1 (required) * Type: Reference (Coverage) * Description: The insurance coverage details relevant to this request. */ coverage: Reference; /** * Additional provider contract number. * FHIR Path: insurance.businessArrangement * Cardinality: 0..1 (optional) * Type: string * Description: Additional provider contract number. */ businessArrangement?: string; [key: string]: any; } /** * Supporting information for CoverageEligibilityRequest (FHIR: supportingInfo, 0..*, type: BackboneElement) */ export interface CoverageEligibilityRequestSupportingInfo { /** * Unique id for inter-element referencing. * FHIR Path: supportingInfo.id * Cardinality: 0..1 (optional) * Type: string * Description: A unique identifier for this element within a resource (for internal references). */ id?: string; /** * Additional content defined by implementations. * FHIR Path: supportingInfo.extension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Additional information that is not part of the basic definition of the element. */ extension?: any[]; /** * Extensions that cannot be ignored. * FHIR Path: supportingInfo.modifierExtension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Extensions that modify the understanding of the element. */ modifierExtension?: any[]; /** * Information instance identifier. * FHIR Path: supportingInfo.sequence * Cardinality: 1..1 (required) * Type: positiveInt * Description: A number to uniquely identify supporting information entries. */ sequence: number; /** * Data to be provided. * FHIR Path: supportingInfo.information * Cardinality: 1..1 (required) * Type: Reference (Resource) * Description: The reference to the data to be provided. */ information: Reference; /** * Applies to all items. * FHIR Path: supportingInfo.appliesToAll * Cardinality: 0..1 (optional) * Type: boolean * Description: If true, this information applies to all items. */ appliesToAll?: boolean; [key: string]: any; } /** * Diagnosis for CoverageEligibilityRequest item (FHIR: diagnosis, 0..*, type: BackboneElement) */ export interface CoverageEligibilityRequestItemDiagnosis { /** * Unique id for inter-element referencing. * FHIR Path: item.diagnosis.id * Cardinality: 0..1 (optional) * Type: string * Description: A unique identifier for this element within a resource (for internal references). */ id?: string; /** * Additional content defined by implementations. * FHIR Path: item.diagnosis.extension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Additional information that is not part of the basic definition of the element. */ extension?: any[]; /** * Extensions that cannot be ignored. * FHIR Path: item.diagnosis.modifierExtension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Extensions that modify the understanding of the element. */ modifierExtension?: any[]; /** * Nature of illness or problem (as a CodeableConcept). * FHIR Path: item.diagnosis.diagnosisCodeableConcept * Cardinality: 0..1 (optional) * Type: CodeableConcept * Description: The diagnosis as a coded concept. */ diagnosisCodeableConcept?: CodeableConcept; /** * Nature of illness or problem (as a Reference). * FHIR Path: item.diagnosis.diagnosisReference * Cardinality: 0..1 (optional) * Type: Reference (Condition) * Description: The diagnosis as a reference to a Condition resource. */ diagnosisReference?: Reference; [key: string]: any; } /** * Item to be evaluated for eligibility (FHIR: item, 0..*, type: BackboneElement) */ export interface CoverageEligibilityRequestItem { /** * Unique id for inter-element referencing. * FHIR Path: item.id * Cardinality: 0..1 (optional) * Type: string * Description: A unique identifier for this element within a resource (for internal references). */ id?: string; /** * Additional content defined by implementations. * FHIR Path: item.extension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Additional information that is not part of the basic definition of the element. */ extension?: any[]; /** * Extensions that cannot be ignored. * FHIR Path: item.modifierExtension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Extensions that modify the understanding of the element. */ modifierExtension?: any[]; /** * Applicable exception or supporting information. * FHIR Path: item.supportingInfoSequence * Cardinality: 0..* (optional, array) * Type: positiveInt[] * Description: References to supportingInfo entries that apply to this item. */ supportingInfoSequence?: number[]; /** * Benefit classification. * FHIR Path: item.category * Cardinality: 0..1 (optional) * Type: CodeableConcept * Description: Classification of benefit being requested. */ category?: CodeableConcept; /** * Billing, service, product, or drug code. * FHIR Path: item.productOrService * Cardinality: 1..1 (required) * Type: CodeableConcept * Description: The billing, service, product, or drug code for the item. */ productOrService: CodeableConcept; /** * Product or service billing modifiers. * FHIR Path: item.modifier * Cardinality: 0..* (optional, array) * Type: CodeableConcept[] * Description: Additional modifiers applicable to the product or service. */ modifier?: CodeableConcept[]; /** * Performing practitioner. * FHIR Path: item.provider * Cardinality: 0..1 (optional) * Type: Reference (Practitioner | PractitionerRole) * Description: The practitioner responsible for the item. */ provider?: Reference; /** * Count of products or services. * FHIR Path: item.quantity * Cardinality: 0..1 (optional) * Type: SimpleQuantity * Description: The number of products or services. */ quantity?: any; /** * Fee, charge or cost per item. * FHIR Path: item.unitPrice * Cardinality: 0..1 (optional) * Type: Money * Description: The fee, charge, or cost per item. */ unitPrice?: any; /** * Servicing facility. * FHIR Path: item.facility * Cardinality: 0..1 (optional) * Type: Reference (Location | Organization) * Description: The facility where the item is provided. */ facility?: Reference; /** * Applicable diagnosis. * FHIR Path: item.diagnosis * Cardinality: 0..* (optional, array) * Type: CoverageEligibilityRequestItemDiagnosis[] * Description: Diagnoses relevant to the item. */ diagnosis?: CoverageEligibilityRequestItemDiagnosis[]; /** * Product or service details. * FHIR Path: item.detail * Cardinality: 0..* (optional, array) * Type: Reference[] * Description: Additional details about the product or service. */ detail?: Reference[]; [key: string]: any; } /** * Input type for creating a CoverageEligibilityRequest resource (NHCX profile). * * FHIR Profile: https://nrces.in/ndhm/fhir/r4/StructureDefinition/CoverageEligibilityRequest * * Required fields: * - identifier: Identifier[] (1..1) * - status: string (1..1, allowed: active | cancelled | draft | entered-in-error) * - priority: CodeableConcept (1..1) * - purpose: string[] (1..*) * - patient: Reference (1..1) * - created: string (1..1, auto-set if not provided) * - enterer: Reference (1..1) * - provider: Reference (1..1) * - insurer: Reference (1..1) * - facility: Reference (1..1) * - insurance: CoverageEligibilityRequestInsurance[] (1..*) * * Optional fields: * - id, meta, implicitRules, language, text, contained, extension, modifierExtension, servicedDate, servicedPeriod, supportingInfo, item * * See field-level documentation for details and cardinality. */ export interface CoverageEligibilityRequestInput { /** * Logical id of this artifact. * FHIR Path: id * Cardinality: 0..1 (optional) * Type: string * Description: Logical id of this resource instance. */ id?: string; /** * Metadata about the resource. * FHIR Path: meta * Cardinality: 0..1 (optional) * Type: Meta * Structure: * - profile?: string[] * - versionId?: string * - lastUpdated?: string * - [key: string]: any * Description: Metadata about the resource, including profile, version, and last updated. */ meta?: { profile?: string[]; versionId?: string; lastUpdated?: string; [key: string]: any; }; /** * A set of rules under which this content was created. * FHIR Path: implicitRules * Cardinality: 0..1 (optional) * Type: uri * Description: A set of rules under which this content was created. */ implicitRules?: string; /** * Language of the resource content. * FHIR Path: language * Cardinality: 0..1 (optional) * Type: code * Description: The language in which the resource content is written. */ language?: string; /** * Text summary of the resource, for human interpretation. * FHIR Path: text * Cardinality: 0..1 (optional) * Type: Narrative * Description: Human-readable summary of the resource. */ text?: any; /** * Contained, inline Resources. * FHIR Path: contained * Cardinality: 0..* (optional, array) * Type: Resource[] * Description: Contained, inline resources. */ contained?: any[]; /** * Additional content defined by implementations. * FHIR Path: extension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Additional information that is not part of the basic definition of the resource. */ extension?: any[]; /** * Extensions that cannot be ignored. * FHIR Path: modifierExtension * Cardinality: 0..* (optional, array) * Type: Extension[] * Description: Extensions that modify the understanding of the resource. */ modifierExtension?: any[]; /** * Business Identifier for coverage eligibility request. * FHIR Path: identifier * Cardinality: 1..1 (required, array) * Type: Identifier[] * Structure: * - use?: string * - type?: CodeableConcept * - system?: string * - value?: string * - period?: Period * - assigner?: Reference * Description: Business identifier for the coverage eligibility request. */ identifier: Identifier[]; /** * Status of the resource instance. * FHIR Path: status * Cardinality: 1..1 (required) * Type: code * Allowed Values: 'active', 'cancelled', 'draft', 'entered-in-error' * Description: The current state of the resource instance. */ status: string; /** * Desired processing priority. * FHIR Path: priority * Cardinality: 1..1 (required) * Type: CodeableConcept * Structure: * - coding?: Coding[] * - text?: string * Description: The timeliness with which processing is required. */ priority: CodeableConcept; /** * Types of information being requested. * FHIR Path: purpose * Cardinality: 1..* (required, array) * Type: code[] * Allowed Values: 'auth-requirements', 'benefits', 'discovery', 'validation' * Description: The types of information being requested. */ purpose: string[]; /** * Intended recipient of products and services. * FHIR Path: patient * Cardinality: 1..1 (required) * Type: Reference (Patient) * Structure: * - reference?: string * - type?: string * - identifier?: Identifier * - display?: string * Description: The patient who is the subject of the request. */ patient: Reference; /** * Estimated date of service. * FHIR Path: servicedDate * Cardinality: 0..1 (optional) * Type: date * Description: The estimated date of service. */ servicedDate?: string; /** * Estimated period of service. * FHIR Path: servicedPeriod * Cardinality: 0..1 (optional) * Type: Period * Structure: * - start?: string * - end?: string * Description: The estimated period of service. */ servicedPeriod?: Period; /** * Creation date. * FHIR Path: created * Cardinality: 1..1 (required, auto-set if not provided) * Type: dateTime * Description: The date when the resource was created. */ created?: string; /** * Author. * FHIR Path: enterer * Cardinality: 1..1 (required) * Type: Reference (Practitioner | PractitionerRole) * Structure: * - reference?: string * - type?: string * - identifier?: Identifier * - display?: string * Description: The author of the request. */ enterer: Reference; /** * Party responsible for the request. * FHIR Path: provider * Cardinality: 1..1 (required) * Type: Reference (Practitioner | PractitionerRole | Organization) * Structure: * - reference?: string * - type?: string * - identifier?: Identifier * - display?: string * Description: The provider responsible for the request. */ provider: Reference; /** * Coverage issuer. * FHIR Path: insurer * Cardinality: 1..1 (required) * Type: Reference (Organization) * Structure: * - reference?: string * - type?: string * - identifier?: Identifier * - display?: string * Description: The organization which is the coverage issuer. */ insurer: Reference; /** * Servicing facility. * FHIR Path: facility * Cardinality: 1..1 (required) * Type: Reference (Location) * Structure: * - reference?: string * - type?: string * - identifier?: Identifier * - display?: string * Description: The facility where the service is provided. */ facility: Reference; /** * Supporting information. * FHIR Path: supportingInfo * Cardinality: 0..* (optional, array) * Type: CoverageEligibilityRequestSupportingInfo[] * Structure: * - id?: string * - extension?: any[] * - modifierExtension?: any[] * - sequence: number * - information: Reference * - appliesToAll?: boolean * Description: Additional information that may influence the adjudication of the claim. */ supportingInfo?: CoverageEligibilityRequestSupportingInfo[]; /** * Patient insurance information. * FHIR Path: insurance * Cardinality: 1..* (required, array) * Type: CoverageEligibilityRequestInsurance[] * Structure: * - id?: string * - extension?: any[] * - modifierExtension?: any[] * - focal?: boolean * - coverage: Reference * - businessArrangement?: string * Description: Patient insurance information relevant to the request. */ insurance: CoverageEligibilityRequestInsurance[]; /** * Item to be evaluated for eligibility. * FHIR Path: item * Cardinality: 0..* (optional, array) * Type: CoverageEligibilityRequestItem[] * Structure: * - id?: string * - extension?: any[] * - modifierExtension?: any[] * - supportingInfoSequence?: number[] * - category?: CodeableConcept * - productOrService: CodeableConcept * - modifier?: CodeableConcept[] * - provider?: Reference * - quantity?: any * - unitPrice?: any * - facility?: Reference * - diagnosis?: CoverageEligibilityRequestItemDiagnosis[] * - detail?: Reference[] * Description: Items to be evaluated for eligibility. */ item?: CoverageEligibilityRequestItem[]; [key: string]: any; } /** * Creates a valid NHCX FHIR CoverageEligibilityRequest resource. * @param input - The resource fields (see CoverageEligibilityRequestInput for details). * @returns The validated and defaulted FHIR resource. * @throws Error if required fields are missing or invalid. */ export declare function createCoverageEligibilityRequest(input: CoverageEligibilityRequestInput): CoverageEligibilityRequest; //# sourceMappingURL=create.d.ts.map