UNPKG

gcp-nrces-fhir

Version:

Google cloud healthcare api NRCES FHIR implimenataion

194 lines 5.93 kB
/** * FHIR Invoice resource class implementing the NRCES Invoice profile * https://nrces.in/ndhm/fhir/r4/StructureDefinition/Invoice */ export declare const INVOICE_TYPE_CODES: { readonly CONSULTATION: { readonly code: "00"; readonly display: "Consultation"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-billing-codes"; }; readonly PHARMACY: { readonly code: "01"; readonly display: "Pharmacy"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-billing-codes"; }; readonly IPD: { readonly code: "02"; readonly display: "IPD"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-billing-codes"; }; readonly OPD: { readonly code: "03"; readonly display: "OPD"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-billing-codes"; }; readonly OTHERS: { readonly code: "99"; readonly display: "Others"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-billing-codes"; }; }; export declare const PRICE_COMPONENT_CODES: { readonly MRP: { readonly code: "00"; readonly display: "MRP"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-price-components"; }; readonly RATE: { readonly code: "01"; readonly display: "Rate"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-price-components"; }; readonly DISCOUNT: { readonly code: "02"; readonly display: "Discount"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-price-components"; }; readonly CGST: { readonly code: "03"; readonly display: "CGST"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-price-components"; }; readonly SGST: { readonly code: "04"; readonly display: "SGST"; readonly system: "https://nrces.in/ndhm/fhir/r4/CodeSystem/ndhm-price-components"; }; }; export interface INVOICE_IDENTIFIER { value: string; system?: string; type?: { text: string; }; } export interface PRICE_COMPONENT { type: "base" | "surcharge" | "deduction" | "discount" | "tax" | "informational"; code: { coding: Array<{ system: string; code: string; display: string; }>; }; amount: { value: number; currency: string; }; factor?: number; } export interface INVOICE_LINE_ITEM { sequence?: number; chargeItemReference: string; chargeItemDisplay?: string; priceComponent: PRICE_COMPONENT[]; } export interface INVOICE_OPTIONS { id?: string; identifier: INVOICE_IDENTIFIER; status: "draft" | "issued" | "balanced" | "cancelled" | "entered-in-error"; type: { coding: Array<{ system: string; code: string; display: string; }>; text?: string; }; subject: { reference: string; display?: string; }; date: string; lineItem: INVOICE_LINE_ITEM[]; totalNet: { value: number; currency: string; }; totalGross: { value: number; currency: string; }; recipient?: { reference: string; display?: string; }; issuer?: { reference: string; display?: string; }; participant?: Array<{ role?: { coding: Array<{ system: string; code: string; display: string; }>; }; actor: { reference: string; display?: string; }; }>; account?: { reference: string; display?: string; }; paymentTerms?: string; note?: Array<{ text: string; time?: string; }>; cancelledReason?: string; } export declare class Invoice { /** * Map internal voucher type to ABDM Invoice type coding */ static mapVoucherTypeToInvoiceType(voucherType: string): { coding: Array<{ system: string; code: string; display: string; }>; text: string; }; /** * Build a price component for a line item */ static buildPriceComponent(type: PRICE_COMPONENT["type"], code: { code: string; display: string; system: string; }, amount: number, currency?: string): PRICE_COMPONENT; /** * Build price components array for a single line item from GST item data */ static buildLineItemPriceComponents(quantity: number, salePrice: number, discountPercent?: number, cgst?: number, sgst?: number): PRICE_COMPONENT[]; /** * Calculate net total from line items (base - discounts; taxes are added separately in totalGross) */ static calculateNetTotal(lineItems: INVOICE_LINE_ITEM[]): number; /** * Calculate gross total from line items (base - discounts + taxes) */ static calculateGrossTotal(lineItems: INVOICE_LINE_ITEM[]): number; /** * Generate the FHIR Invoice resource JSON */ static toFhir(options: INVOICE_OPTIONS): any; /** * Store an Invoice resource in GCP FHIR store */ static create(options: INVOICE_OPTIONS, creds?: any, dbPath?: any): Promise<any>; /** * Update an existing Invoice resource */ static update(id: string, options: INVOICE_OPTIONS, creds?: any, dbPath?: any): Promise<any>; /** * Get Invoice resource from GCP FHIR store */ static get(id: string, creds?: any, dbPath?: any): Promise<any>; } //# sourceMappingURL=Invoice.d.ts.map