Commit 01c1a395 authored by Sandeep Sagar Panjala's avatar Sandeep Sagar Panjala

initial commit

parent 94ea8e58
export * from "./insurance-admission.entity";
\ No newline at end of file
export class InsuranceAdmission {
insuranceForAdmissionId: number;
insuranceApprovalId: number;
patientInsuranceId: number;
insuranceCompanyId: number;
admissionId: number;
expectedAmount: number;
createdBy: number;
modifiedBy?: number;
expectedSettlementDate?: Date;
createdDate: Date;
modifiedDate?: Date;
insuranceCompanyName: string;
admissionNo: string;
patientName: string;
insuranceTypeName: string;
gender: string;
umrNo: string;
thumbnailUrl: string;
createdByName: string;
createdByRole: string;
modifiedByName: string;
modifiedByRole: string;
age: number;
admissionDate: Date;
totalItems: number;
comment: string;
attachments: string;
files: Array<any>;
}
\ No newline at end of file
export * from "./inventory-raw-product.entity";
export * from "./inventory-raw-purchase.entity";
export * from "./inventory-warehouse-store.entity";
\ No newline at end of file
export class InventoryRawProduct {
productName: string;
company: string;
category: string;
rack: string;
purchaseQuantity: string;
purchaseUnit: string;
saleQuantity: string;
saleUnit: string;
gst: string;
minQuantity: string;
maxQuantity: string;
reorderQuantity: string;
batchNumberRequired: string;
productExpire: string;
billNumber: string;
}
\ No newline at end of file
export class InventoryRawPurchase {
productName: string;
supplierName: string;
billNumber: string;
purchaseRate: string;
quantity: string;
batchNumber: string;
expiryDate: string;
}
\ No newline at end of file
export class InventoryWareHouse {
inventoryWareHouseId: number;
name: string;
createdByName: string;
createdByRole: string;
modifiedByName: string;
modifiedByRole: string;
createdBy: number;
modifiedBy?: number
createdDate: Date;
modifiedDate?: Date;
allowedAccountId: string;
users: Array<AllowedAccounts>;
active: boolean;
locationId?: number;
constructor() {
this.users = new Array<AllowedAccounts>();
}
}
export class AllowedAccounts {
moduleDepartmentUserId: number;
accountId: number;
inventoryWareHouseId: number;
fullName: string;
roleName: string;
}
import { BookingLabDetail } from "./booking-lab-detail.entity";
export class BookingLabHeader {
labBookingHeaderId: number;
patientType: string;
billNumber: string;
patientId?: number;
patientName: string;
mobile: string;
doctorName: string;
netAmount: number;
paidVia: string;
createdBy: number;
createdDate: Date;
bookingDate: Date;
createdByName: string;
isShow: boolean;
overallDiscount: number;
labDetail: Array<BookingLabDetail>;
noOfTest: number;
totalItems: number;
umrNo: string;
gender: string;
age: number;
totalAmount: number;
limit?: number;
totalElements?: number;
isLabPackage: boolean;
isLabService: boolean;
thumbnailUrl: string;
admissionId?: number;
appointmentId?: number;
otBookingDetailId?: number;
appointmentNo: string;
admissionNo: string;
locationName: string;
isSelected: boolean;
collectedFlag = true;
barcodeGeneratedName: string;
barcodeGeneratedDate: Date;
constructor() {
this.labDetail = new Array<BookingLabDetail>();
}
}
\ No newline at end of file
import { LabInPackageBooking } from "./lab-in-package-booking.entity";
export class BookingLabDetail {
labBookingDetailId: number;
labBookingHeaderId: number;
labHeaderId?: number;
labPackageId?: number;
discountAmount: number;
amount: number;
status: string;
labName: string;
packageName: string;
isReportGenerated?: boolean;
reportDate?: Date;
netAmount: number;
discountPercentage?: number;
labsInPackage: Array<LabInPackageBooking>;
isSampleCollected?: boolean;
sampleDate?: Date;
typedByName: string;
verifiedByName: string;
billNumber: string;
createdByName: string;
isSendingSMS: boolean;
isDeleteEligible: boolean;
patientId:number;
patientName: string;
doctorName: string;
totalItems: number;
umrNo: string;
barcode: string;
departmentName: string;
isSelected: boolean;
collectedSampleReceivedBy: string;
sampleReceivedDate: Date;
verifiedByDoctorName: string
constructor() {
this.labsInPackage = new Array<LabInPackageBooking>();
}
}
\ No newline at end of file
export * from "./lab-header.entity";
export * from "./lab-detail.entity";
export * from "./boking-lab-header.entity";
export * from "./booking-lab-detail.entity";
export * from "./lab-report-main.entity";
export * from "./lab-report-parameter.entity";
export * from "./lab-report-daily.entity";
export * from "./lab-package.entity";
export * from "./lab-in-package-booking.entity";
export * from "./lab-location-charges.entity";
export * from "./lab-department.entity";
\ No newline at end of file
export class LabDepartment {
labDepartmentId: number;
departmentName: string;
description: string;
active: boolean;
createdBy: number;
createdDate: Date;
modifiedBy?: number;
modifiedDate?: Date;
createdByName: string;
createdByRole: string;
modifiedByName: string;
modifiedByRole: string;
totalItems: number;
}
\ No newline at end of file
export class LabDetail {
labHeaderId: number;
labDetailId: number;
testParameter: string;
referenceRange: string;
refrenceRangeUnit: number
active: boolean;
name: string;
}
\ No newline at end of file
export class LabHeaders {
labHeaderId: number;
labCode: string;
signature: string;
labName: string;
charge: number;
active: boolean;
createdBy: number;
createdDate: Date;
noOfParameter: number;
createdByName: string;
totalItems: number
inPatientCharge: number;
modifiedBy?: number;
modifiedDate?: Date;
modifiedByName: string;
isSelected: boolean;
discountPercentage?: number;
discountAmount?: number;
netAmount: number;
//Modified
labPackageDetailId: number;
labPackageId: number;
testParameter: string;
labData: Array<string>;
status: boolean;
deleting: boolean;
unit: number;
departmentName: string;
locationName: string;
labDepartmentId: number;
patientLabDetailId?: number;
}
\ No newline at end of file
import { LabReportParameter } from "./lab-report-parameter.entity";
export class LabInPackageBooking {
labBookingDetailId: number;
labBookingHeaderId: number;
labBookingPackageDetailId: number;
labHeaderId: number;
status: string;
labName: string;
labCode: string;
isReportGenerated?: boolean;
reportDate?: Date;
typedBy?: number;
verifiedBy?: number;
isSampleCollected?: boolean;
sampleDate?: Date;
typedDate?: Date;
typedByName: string;
verifiedByName: string;
labsParameters: Array<LabReportParameter>;
barcode: string;
isSelected = false;
collectedSampleReceivedBy: string;
verifiedByDoctorName: string;
sampleReceivedDate: Date;
constructor() {
this.labsParameters = new Array<LabReportParameter>();
}
}
\ No newline at end of file
export class LabLocationCharges {
locationLabHeaderMapId: number;
locationId: number;
locationName: string;
testCharge: number;
inPatientCharge: number;
active: boolean;
labHeaderId: number;
charge: number;
createdBy: number;
createdDate: string;
modifiedBy: number;
modifiedDate: number;
}
\ No newline at end of file
export class LabPackage {
labPackageId: number;
name: string; //
amount: number;
createdBy: number;
noOfLabs: number;
createdDate: Date;
modifiedBy?: number;
modifiedDate?: Date;
active: boolean;
createdByName: string;
createdByRole: string;
modifiedByName: string;
modifiedByRole: string;
totalItems: number;
isEditing: boolean;
isDeleting: boolean;
isSelected: boolean;
accountId: number;
}
\ No newline at end of file
export class LabReportDaily {
labName: string;
patientName: string;
umrNo: string;
mobile: string;
amount: number;
grandTotal: number;
doctorName: string;
labBookingHeaderId: number;
patientId: number;
createdBy: number;
billNumber: string;
createdByName: string;
createdDate: Date | string;
bookingDate: Date;
discountPercentage?: number;
netAmount: number;
discountAmount?: number;
overallDiscountAmount?: number;
overallNetAmount: number;
labPackageId?: number | string;
age?: number | string;
gender?: string;
paidVia: string;
accountId: number;
payTypeName: string;
paymentNumber: string;
providerId: number;
requisitionNumber: string;
overallTotalAmount: number;
totalAmount: number;
}
\ No newline at end of file
export class LabReportMain {
labBookingDetailId: number;
labBookingHeaderId: number;
labHeaderId: number;
patientId: number;
amount: number;
status: string;
isReportGenerated?: boolean;
reportDate?: Date;
labCode: string;
signature: string;
labName: string;
patientType: string;
billNumber: string;
patientName: string;
mobile: string;
doctorName: string;
paidVia: string;
createdBy: number;
createdByName: string;
netAmount: number;
createdDate: Date;
umrNo: string;
age: number;
gender: string;
isSampleCollected?: boolean;
sampleDate?: Date;
}
\ No newline at end of file
export class LabReportParameter {
labPatientParameterId: number;
labHeaderId: number;
labDetailId: number;
refrenceRangeUnit: number;
testParameter: string;
referenceRange: string;
refrenceRangeUnitName: string;
testParamResult: string;
typedBy?: number;
typedDate?: Date;
typedByName: string;
verifiedByName: string;
labBookingPackageDetailId?: number;
verifiedByDoctorId?: number;
verifiedByDoctorName: string;
verifiedByDoctorSignature: string;
}
\ No newline at end of file
export class LabVacutainer {
labVacutainerId: number;
labVacutainerName?: string = null;
active: boolean = null;
createdBy: number;
createdDate: Date;
modifiedBy?: number;
modifiedDate?: Date;
createdByName: string;
modifiedByName: string;
totalItems: number;
}
\ No newline at end of file
export class Machine {
machineId: number;
machineCode: string;
machineName: string;
createdBy: number;
createdDate: Date;
modifiedBy?: number;
modifiedDate?: Date;
active: boolean;
modifiedByRole: string;
createdByRole: string;
locationId: number;
createdByName: string;
modifiedByName: string;
}
\ No newline at end of file
export * from "./notification.entity";
\ No newline at end of file
export class Notification {
webNotificationId: number;
webNotificationPriorityId: number;
webNotificationLogTypeId: number;
patientId?: number;
referenceId?: number;
patientAge?: number;
message: string;
redirectionLink: string;
allowedRoles: string;
allowedAccounts: string;
priority: string;
logType: string;
patientName: string;
patientGender: string;
umrNo: string;
patientThumbnailUrl: string;
encryptedReferenceId: string;
encryptedPatientId: string;
patientMobile: string;
createdDate: Date;
isRead: boolean;
webNotificationTypeId: number;
moduleType: string;
totalItems: number;
total: number;
Amount: number;
modifiedBy: number;
appointmentId: number;
paymentNumber: string;
appointmentTimeString: string;
appointmentDate: Date;
appointmentTime: object;
tokenNumber?: number;
specializationName: string;
departmentId: string;
departmentName: string;
providerId: number;
providerName: string;
specializationId: number;
appointmentNo: string;
patientPaymentStatus?: boolean;
practiceName: string;
providerLocation: string;
nextAppointment: string;
lastConsultedDate: Date;
lastConsultedTime: string;
lastConsultedDoctor: string;
lastPaidAmount: number;
paymentStatus?: boolean;
active?: boolean;
hide: boolean;
}
\ No newline at end of file
export class NurseShiftMap {
nurseShiftMapId: number;
date: Date;
shiftId: number;
createdBy: number;
createdDate: Date;
modifiedBy: number;
modifiedDate: Date;
nurseAccountId: number;
nurseShiftStatusTypeId: number;
}
\ No newline at end of file
export class Nurses {
nurseName: string;
nurseShiftMapId: number;
dates: Array<Dates>
}
export class Dates {
date: string;
shifts: Array<Shifts>;
}
export class Shifts {
shiftName: string;
beds: Array<Beds>;
}
export class Beds {
bedId: number;
gender: string;
bedNumber: string;
patientId: number;
admissionId: number;
admissionNo: string;
patientName: string;
providerName: string;
bedStatusName: string;
expectedDichargeDate: string;
}
\ No newline at end of file
export * from "./pediatric-age-wise.entity";
export * from "./pediatric-age-wise-z-score.entity";
export * from "./pediatric-authority.entity";
export * from "./pediatric-chart-type.entity";
export * from "./pediatric-patient-measurement.entity";
\ No newline at end of file
export class PediatricAgeWiseZScoreDataModel {
pediatricAgeWiseDataId: number;
pediatricChartAuthorityId: number | null;
pediatricChartTypeId: number | null;
gender: string;
ageInMonth: number;
createdBy: number;
createdDate: Date;
modifiedBy: number | null;
modifiedDate: Date | null;
active: boolean | null;
authorityName: string;
typeName: string;
l: number | null;
m: number | null;
sd: number | null;
s: number | null;
minus3SD: number | null;
minus2SD: number | null;
minus1SD: number | null;
median: number | null;
oneSD: number | null;
twoSD: number | null;
threeSD: number | null;
}
\ No newline at end of file
export class PediatricAgeWiseDataModel {
pediatricAgeWiseDataId: number;
pediatricChartAuthorityId: number;
pediatricChartTypeId: number;
gender: string;
authorityName: string;
typeName: string;
ageInMonth: number;
sd?: number;
p1: number;
p3: number;
p5: number;
p15: number;
p25: number;
p50: number;
p75: number;
p85: number;
p95: number;
p97: number;
p99: number;
createdBy: number;
createdDate: Date;
modifiedBy?: number;
modifiedDate?: Date;
active?: boolean;
l?: number;
m?: number;
p999?: number;
p01?: number;
p10?: number;
p90?: number;
}
\ No newline at end of file
export class PediatricChartAuthorityModel {
pediatricChartAuthorityId: number;
authorityName: string;
createdBy: number;
createdDate: Date;
modifiedBy: number | null;
modifiedDate: Date | null;
active: boolean | null;
createdByName: string;
modifiedByName: string;
}
\ No newline at end of file
export class PediatricChartTypeModel {
pediatricChartTypeId: number;
typeName: string;
active: boolean;
}
\ No newline at end of file
export class PediatricPatientMeasurementHistoryModel {
createdDate: Date;
createdBy: number;
measurements: string;
createdByName: string;
realData: any;
monthAtMeasurement: number;
}
export class DepartmentalStock {
pharmacyDepartmentId: number;
pharmacyDepartmentalStockId: number;
inventoryDepartmentId: number;
inventoryDepartmentalStockId: number;
pharmacyProductId: number;
inventoryProductId: number;
taxId: number;
quantityIn: number;
quantityOut: number;
purchaseRate: number;
mrp: number;
roq: number;
rol: number;
availableQuantity: number;
taxPercentage: number;
totalItems: number;
pharmacyStockId?: number;
pharmacyRetailStockId?: number;
pharmacyProductDetailId?: number;
inventoryProductDetailId?: number;
barcode: string;
batchNumber: string;
productName: string;
categoryName: string;
genericName: string;
rackName: string;
departmentName: string;
createdByName: string;
createdByRole: string;
modifiedByName: string;
modifiedByRole: string;
createdBy: number;
modifiedBy?: number
createdDate: Date;
modifiedDate?: Date;
expiryDate?: Date;
}
export * from "./pharmacy-raw-product.entity";
export * from "./pharmacy-raw-purchase.entity";
export * from "./retail-store.entity";
export * from "./pharmacy-retail.entity";
export * from "./warehouse-store.entity";
export * from "./pharma-purchase-bill.entity";
export * from "./module-department.entity";
export * from "./departmental-stock.entity";
export * from "./issue-stock.entity";
export * from "./pharmacy-rack.entity";
export * from "./pharmacy-product-type.entity";
export * from "./pharmacy-product-sub-type.entity";
export * from "./purchase-order-header.entity";
export * from "./purchase-order-detail.entity";
export * from "./pharmacy-in-patient-return.entity";
\ No newline at end of file
export class IssueStockHeader {
totalItems: number;
pharmacyIssuedStockHeaderId: number;
inventoryIssuedStockHeaderId: number;
issuedBy: number;
handOverTo?: number;
retailWareHouseLinkId?: number;
pharmacyDepartmentId?: number;
receivedBy?: number;
issueHeaderId: number;
issuedDate: Date;
indentCreatedDate: Date;
receivedDate?: Date;
comment: string;
issueNumber: string;
indentRaisedByName: string;
handOverName: string;
raisedFromLocation: string;
raisedForRetail: string;
approvedFromWareHouse: string;
reasonForRequirement: string;
raisedForDepartment: string;
receivedByName: string;
issuedByName: string;
products: Array<IssueStockDetail>;
constructor() {
this.products = new Array<IssueStockDetail>();
}
}
export class IssueStockDetail {
pharmacyIssuedStockDetailId: number;
pharmacyIssuedStockHeaderId: number;
inventoryIssuedStockDetailId: number;
inventoryIssuedStockHeaderId: number;
pharmacyProductId: number;
inventoryProductId: number;
taxId: number;
quantityIn: number;
pharmacyStockId: number;
inventoryStockId: number;
barcode: string;
batchNumber: string;
productName: string;
genericName: string;
category: string;
taxPercentage: string;
expiryDate?: Date;
purchaseRate: number;
mrp: number;
}
import { AllowedAccount } from "./warehouse-store.entity";
export class ModuleDepartment {
pharmacyDepartmentId: number;
inventoryDepartmentId: number;
name: string;
createdByName: string;
createdByRole: string;
modifiedByName: string;
modifiedByRole: string;
createdBy: number;
modifiedBy?: number
createdDate: Date;
modifiedDate?: Date;
users: Array<AllowedAccount>;
active: boolean;
locationId: number;
isUploaded: boolean;
locationName: string;
constructor() {
this.users = new Array<AllowedAccount>();
}
}
export class PharmaPurchaseBill {
pharmacyProductId: number;
billNumber: string;
billType: string;
productName: string;
genericName: string;
batchNumber: string;
barcode: string;
createdDate: Date;
billDate: Date;
categoryName: string;
companyName: string;
supplierId: number;
supplierName: string;
quantity: number;
free: number;
mrp: number;
purchaseRate: number;
total: number;
taxAmount: number;
discountAmount: number;
netAmount: number;
billTotal: number;
billTaxes: number;
billDiscount: number;
billNetAmount: number;
returnQuantity: number;
returnDate: number;
returnTotal: number;
returnNetAmount: number;
overallBillAmount: number;
overallTaxes: number;
overallDiscount: number;
overallNetamount: number;
}
\ No newline at end of file
export class PharmacyInPatientReturnModel {
pharmacyInPatientReturnId: number;
pharmacyIssueDetailId: number;
returnQuantity: number;
createdBy: number;
createdDate: Date;
acceptedBy: number | null;
acceptedDate: Date | null;
createdByName: string;
acceptedByName: string;
pharmacyProductId: number | null;
retailStockId: number | null;
productName: string;
genericName: string;
patientName: string;
mobile: string;
umrNo: string;
}

export class PharmacyProductSubType {
pharmacyProductSubTypeId: number;
subTypeName: string;
pharmacyProductTypeId: number;
typeName: string;
active: boolean;
isGeneralItem: boolean;
createdBy: number;
createdByName: string;
createdDate: Date;
modifiedBy: number | null;
modifiedByName: string;
modifiedDate: Date | null;
}
\ No newline at end of file

export class PharmacyProductType {
pharmacyProductTypeId: number;
typeName: string;
active: boolean;
isGeneralItem: boolean;
createdBy: number;
createdByName: string;
createdDate: Date;
modifiedBy: number | null;
modifiedByName: string;
modifiedDate: Date | null;
}
\ No newline at end of file
export class PharmacyRack {
pharmacyProductRackId: number;
inventoryProductRackId: number;
createdBy: number;
retailPharmacyId: number;
pharmacyDepartmentId: number;
inventoryDepartmentId: number;
inventoryWareHouseId: number;
rackName: string;
}
export class PharmacyRawProduct{
productName: string;
genericName: string;
company: string;
category: string;
rack: string;
purchaseQuantity: string;
purchaseUnit: string;
saleQuantity: string;
saleUnit: string;
gst: string;
hsnCode: string;
minQuantity: string;
maxQuantity: string;
reorderQuantity: string;
barCode: string;
productExpire: string;
billNumber: string;
batchNumberRequired: string;
rolQuantity: string;
purchaseQty: string;
categoryName: string;
}
\ No newline at end of file
export class PharmacyRawPurchase {
productName: string;
barcode: string;
supplierName: string;
billNumber: string;
purchaseRate: string;
mrp: string;
quantity: string;
free: string;
batchNumber: string;
expiryDate: string;
sgst: string;
igst: string;
}
\ No newline at end of file
export class PharmacyStore {
pharmacyStoreId: number;
createdBy: number;
name: string;
hospitalName: string;
location: string;
pinCode: string;
gstNumber: string;
createdByName: string;
createdDate: Date;
}
\ No newline at end of file
export class PurchaseOrderDetail {
purchaseOrderDetailId: number;
purchaseOrderHeaderId: number;
pharmacyProductApprovalId: number;
pharmacyProductId: number;
quantity: number;
amount: number;
taxAmount: number;
netAmount: number;
mrp: number;
purchaseRate: number;
productName: string;
genericName: string;
isGeneralItem: boolean;
companyId: number;
categoryId: number;
taxId: number;
tax: number;
categoryName: string;
companyName: string;
typeName: string;
subTypeName: string;
purchaseUnitQty: number;
saleUnitQty: number;
purchaseUnitName: string;
saleUnitName: string;
status: string;
isExpiry: boolean;
feededQuantity: number | null;
feedTotal: number | null;
free: number | null;
feedPurchaseRate: number | null;
feedMrp: number | null;
taxPerItem: number | null;
feedTaxAmount: number | null;
discountPerItem: number | null;
discountAmount: number | null;
feedNetAmount: number | null;
batchNumber: string;
expiryDate: Date | null;
pharmacyPurchaseDetailId: number | null;
pharmacyPurchaseHeaderId: number | null;
barcode: string;
purchaseFree?: number;
}
\ No newline at end of file
import { PurchaseOrderDetail } from "./purchase-order-detail.entity";
export class PurchaseOrderHeader {
purchaseOrderHeaderId: number;
poNumber: string;
poRaiseDate: string;
estimatedDeliveryDate: Date | null;
createdBy: number;
createdDate: Date;
tenderStatusId: number;
totalAmount: number;
totalTax: number;
totalNetAmount: number;
supplierId: number;
pharmacyWareHouseId: number;
dueDays: number | null;
locationId: number | null;
centralWarehouseLocationId: number | null;
supplierName: string;
wareHouseName: string;
locationName: string;
createdByName: string;
status: string;
billNumber: string;
billType: string;
billDate: Date | null;
dueDate: Date | null;
billAmount: number | null;
discount: number | null;
taxes: number | null;
netamount: number | null;
pharmacyPurchaseHeaderId: number | null;
supplier: any;
poDetail: Array<PurchaseOrderDetail>;
constructor() { this.poDetail = new Array<PurchaseOrderDetail>(); }
}
\ No newline at end of file
export class RetailStore {
retailPharmacyId: number;
retailName: string;
allowedUser: string;
userNames: string;
createdBy: number;
createdDate: Date;
modifiedBy?: number;
modifiedDate?: Date;
createdByName: string;
modifiedByName: string;
allowedAccountId: string;
active: boolean;
wareHouseNames: string;
pharmacyWareHouseIds: string;
pharmacyWareHouse: string;
retailWareHouseLinkIdIds: string;
fullName: string;
wareHouseName: string;
locationName: string;
}
\ No newline at end of file
import { RetailStore } from "./retail-store.entity";
export class WareHouseStore {
pharmacyWareHouseId: number;
wareHouseName: string;
createdByName: string;
createdByRole: string;
modifiedByName: string;
modifiedByRole: string;
createdBy: number;
modifiedBy?: number
createdDate: Date;
modifiedDate?: Date;
allowedAccountId: string;
allowedUsers: Array<AllowedAccount>;
active: boolean;
retailStoreCount: number;
locationId?: number;
centralWarehouseLocationId?: number;
centralWarehouseLocation: string;
retailStore: Array<RetailStore>;
inventoryWareHouseId: number;
name: string;
locationName: string;
isUploaded: boolean;
constructor() {
this.allowedUsers = new Array<AllowedAccount>();
this.retailStore = new Array<RetailStore>();
}
}
export class AllowedAccount {
moduleDepartmentUserId: number;
accountId: number;
pharmacyWareHouseId: number;
fullName: string;
roleName: string;
pharmacyDepartmentUserId: number;
pharmacyDepartmentId: number;
}
export * from "./provider-medication-group.entity";
export * from "./provider-medication-master.entity";
export * from "./provider-medication-map.entity";
\ No newline at end of file
export class ProviderMedicationGroup {
providerMedicationGroupId: number;
specializationId?: number;
createdBy: number;
modifiedBy?: number;
createdDate: Date;
modifiedDate?: Date;
tagName: string;
}
export class ProviderMedicationMap {
providerMedicationMapId: number;
providerId: number;
createdBy: number;
modifiedBy?: number;
createdDate: Date;
modifiedDate?: Date;
active: boolean;
}
\ No newline at end of file
export class ProviderMedicationMaster {
providerMedicationMasterId: number;
providerMedicationGroupId: number;
pharmacyProductId: number;
duration: number;
dosage: number;
categoryId: number;
companyId: number;
durationType: string;
morningDosage: string;
afternoonDosage: string;
nightDosage: string;
instruction: string;
productName: string;
genericName: string;
companyName: string;
categoryName: string;
isMorning: boolean;
isAfternoon: boolean;
isNight: boolean;
tagName: string;
specializationName: string;
specializationId?: number;
providers: Array<ProviderList>;
isAdded: boolean;
isSaved: boolean;
constructor() {
this.providers = new Array<ProviderList>();
}
}
export class ProviderList {
providerId: number;
fullName: string;
}
export class DoctorDetailReport {
providerId: number;
providerName: string;
departmentName: string;
opCount: number;
ipcount: number;
totalCount: number;
opRevenue: number;
iprevenue: number;
totalRevenue: number;
labs_investigations: number;
radiology: number;
}
\ No newline at end of file
export * from "./doctor-detail-report.entity";
\ No newline at end of file
export class Relations {
relationsId: number;
relationName: string;
ro: string;
locationId: number;
active: boolean;
createdBy: number;
createdDate: Date;
modifiedBy?: number;
modifiedDate?: Date;
createdByName: string;
createdByRole: string;
modifiedByName: string;
modifiedByRole: string;
totalItems: number;
}
\ No newline at end of file
export enum ActiveStatus {
Active = 1,
InActive = 2
}
\ No newline at end of file
export enum BehavioralHealthType {
ProblemHistory,
MedicalHistory,
CurrentSupport,
CurrentLiving,
EducationalHistory,
ClientStrengths,
OutComeMeasures,
SubstanceHistory,
WorkHistory,
AbuseHistory,
ReligionSpirituality,
MentalStatus,
FamilyRelationships,
RelapsePredictors,
PatientQuestionnaire,
GeneralizedAnxietyDisorder,
BurnsDepression,
Aims,
Genogram,
Notes,
Vitals,
ReferralProvider,
FollowUp,
Medications,
TreatmentPlan,
MedicationComments,
GeneralAdvice
}
\ No newline at end of file
export enum ChargeType {
Special = 1,
Covid = 2
}
\ No newline at end of file
export enum CommunicationType {
Call = 1,
Notify = 2,
Reject = 3,
CloseAll = 4,
Join = 5,
Close = 6,
AppointmentRefresh = 7,
AppointmentAddRefresh = 8,
MessageRefresh = 9,
Cancel = 10,
Initiate = 11
}
export enum ControlType {
Text = 1,
Date = 2,
Number = 3,
Boolean = 4
}
\ No newline at end of file
export enum DentalEncounterType {
ChiefComplaints=1,
MedicalHistory,
DentalHistory,
FamilyHistory,
PersonalHabits,
OralHygiene,
ClinicalFindings,
Diagnosis,
Medications,
MedicationComments,
GeneralAdvice
}
\ No newline at end of file
export enum DeviceType {
Web = 1,
A = 2,
// ReSharper disable once InconsistentNaming
IOS = 3
}
\ No newline at end of file
export enum DietEncounterType {
dietPlanPrescribed = 1,
opNutritionScreeningForm,
opNutritionalAssessmentForm,
ipNutritionalScreeningForm,
pediatricCDCScreeningForm,
dietGuideLines,
syndromesFormP,
ordersPrescription,
referralForm,
speacialFeature
}
\ No newline at end of file
export enum EmergencyType {
EmergencyTriage = 1,
NursingERForm
}
\ No newline at end of file
export enum ExportType { XLS, XLSX, CSV, TSV}
\ No newline at end of file
export enum GYNType {
Abdomen = 1,
AdditionalLabs,
BirthControl,
Breast,
BreastScreening,
CancerHistory,
Cardiovascular,
GynHistory,
GynLabs,
GynUltraSound,
Heent,
LastBreastUltraSound,
LastDexaScan,
LastMammogram,
LastPelvicUltraSound,
Lymphatic,
MenopausalHistory,
MensutralHistory,
Musculoskeletal,
PatientDeferred,
Pelvic,
PhysicalExam,
Respiratory,
Skin,
Vitals,
GyneacCard,
GynaecOrders,
GynIUI,
GynaecVisit,
Procedure,
GyneacPartner,
ProformaForOasi,
familyHistory,
ProblemList,
surgeries, birthHistory,
Allergies,
OrderPrescription,
GyneacAdmissionSheet,
GyneacSurgery,
GyneacDiscargeSummary,
Colposcopic,
Ectopic,
SpeacialFeature,
ReferralForm,
Measure,
RefferalOrder,
MeasureCommonData,
ScanAppointmentDetails
}
\ No newline at end of file
export enum HomeopathyType {
Confidential = 1,
CCAndOC,
AdditionalComplaints,
PastIllness,
FamilyIllness,
SpouseAndChildren,
PersonalHistory,
PersonalHabits,
AppetiteAndThirst,
BowelMovements,
Urination,
SweatFeverChill,
ChestHeartColdCough,
SexualSphere,
GeneralComplaints,
AffectedFactors,
EmotionalNature,
SleepAndDreams,
Children,
ChiefComplaints,
Medications,
MedicationComments,
FollowUp,
GeneralAdvice
}
\ No newline at end of file
export * from "./modal-type.enum";
export * from "./device-type.enum";
export * from "./sinch-status-type.enum";
export * from "./lookup-type.enum";
export * from "./record-status.enum";
export * from "./role.enum";
export * from "./internal-medicine-type.enum";
export * from "./communication-type.enum";
export * from "./homeopathy-type.enum";
export * from "./dental-encounter-type.enum";
export * from "./behavioral-health-type.enum";
export * from "./menu-type.enum";
export * from "./charge-type.enum";
export * from "./export-type.enum";
export * from "./control-type.enum";
export * from "./receipt-type.enum";
export * from "./widget-type.enum";
export * from "./gyn-type.enum";
export * from "./ob-encounter.enum";
export * from "./active-status.enum";
export * from "./payment-module.enum";
export * from "./diet-encounter.enum";
export * from "./emergency-type.enum";
\ No newline at end of file
export enum InternalMedicineType {
ProblemList = 1,
CheifComplaints,
FollowUp,
Medications,
Notes,
Vitals,
SocialHistory,
FamilyMedicalHistory,
Diagnosis,
GeneralAdvice,
Heent,
Skin,
Abdomen,
Musculoskeletal,
Neurology,
Extremities,
Respiratory,
Ekg,
CardioVascular,
Allergies,
Hospitalization,
PreventiveCare,
Immunizations,
MedicationProblems,
CurrentMedications,
ReviewOfSystems,
MedicationComments,
dietGuidlines
}
\ No newline at end of file
export enum IvfEncounterType {
EmbryoFreezing = 1,
MarriedLifeHistory,
BirthControl,
ContraceptionHistory,
MenstrualHistoryPresent,
AddIUIData,
DualTriggerInjection,
GynHistory,
IUISummary,
Laproscopy,
Hysteroscopy,
Fertilization,
EmbryoQuality,
StimulationChart,
OtherInvestigationHistory,
PersonalHistory,
FamilyHistory,
MensutralHistory,
PhysicalGyecologicalHistory,
IvfSummary,
CoitalHistory,
PreviousObstetricHistory,
PreviousInfertilityTreatmentHistory,
MedicalAndSurgicalHistory,
IvfData,
SingleTriggerInjection,
IvfDualTriggerInjection,
GynIUI,
Fet,
IvfSimulationScan,
EmbryoThawing,
Aspiration,
CryoPreservation,
OocytCryoPreservation,
EmbyologyDetail,
ObservationInfertility,
InfertilityHistory,
IUIStimulationScan,
ordersPrescription,
}
export enum LookupType {
ProblemList = 24,
PlStatus = 43,
Ppd = 52,
Relation = 44,
Health = 34,
Allergies = 9,
Reactions = 46,
Hospitalization = 10,
PCare = 41,
Initial = 51,
Site = 5,
Vaccine = 22,
gynLabs=33
}
\ No newline at end of file
export enum MenuType {
MainMenu = 1,
SubMenu = 2,
NestedMenu = 3,
HiddenMenu = 4,
InPageMenu = 5,
CategoryMenu = 6
}
export enum AllowType
{
Allowed = 1,
NotAllowed = 2,
BreakIt = 3,
Redirect = 4
}
\ No newline at end of file
export enum ModalType {
Add,
Edit,
View,
Url,
Reject,
Export
}
\ No newline at end of file
export enum OBEncounterType {
ProblemList = 1,
Vitals,
BriefRos,
GeneticScreening,
InfectionHistory,
ANCCaredClosure,
BreastExamination,
AncCardGeneration,
Complaints,
OrderPrescription,
ObstetricExamination,
VaginalExamination,
PlanOfManagement,
DrugHistory,
MenstrualHistory,
OtherDetail,
vteRisk,
birthHistory,
procedureForm,
sgaScanning,
surgeries,
antinantalRisk,
vaccine,
PostnanatalVisit,
Measure,
GeneralExamination,
Breech,
AncCards,
Covid,
AnaesthesiaRecord,
PrePregnancyCounseling,
Allergies,
familyHistory,
outPatientManagement,
PrePregnancyPlan,
SpeacialFeature,
ReferralForm,
RefferalOrder,
AdmissionSlip,
MotherWithEpilepsy,
ExternalCephalicVersion,
DischargeSummary,
Syndromes,
OPManagement,
NurseAssessment,
OutSideTests,
MeasureCommonData,
AncCardCloseCommonData,
NeonatalAssessmentForm,
ScanAppointmentDetails
}
export enum PaymentModule {
Patient = 1,
Appointment,
Pharmacy,
Labs,
ScanAppointment,
Admission,
ViewMachine,
Services
}
\ No newline at end of file
export enum PayType {
Cash = 1,
Card = 2,
Cheque = 3,
DD = 4,
UPI = 5
}
\ No newline at end of file
export enum PediatricEncounterType {
Measurements = 1,
NeonatalRisk,
PediatricRisk,
Syndrome,
ClinicalExamination,
DownSyndromeFollowUp,
HighRiskIntial,
PediatricGuide,
OrderPrescription,
Allergies,
RefferalOrder,
VaccineDetail,
MChat,
FamilyHistory,
BirthHistory,
specialFeature,
DiagnosisOrder,
NextVisitOrder
}
\ No newline at end of file
export enum ReceiptType {
Cash = 1,
Refund = 2
}
\ No newline at end of file
export enum RecordStatus {
Add,
Edit,
Delete
}
\ No newline at end of file
export enum Role {
SuperAdmin = 1,
Administrator,
Provider,
Patient,
Admin,
Support,
Nurse,
Receptionist,
Accountant,
SymptomCreator,
SymptomManager
}
export enum SinchStatusType {
IsInCall = 1,
OutOfCall = 2,
Fetching = 3,
Initiating = 4,
Ringing = 5,
Answered = 6,
Hangup = 7
}
\ No newline at end of file
export enum WidgetType {
Count = 1,
Chart = 2,
TotalRevenue = 3,
PharmacyDashboard =4,
TableView = 5
}
\ No newline at end of file
import { Injectable } from "@angular/core";
import { NgbDateParserFormatter, NgbDateStruct, NgbDateAdapter } from "@ng-bootstrap/ng-bootstrap";
import { isNumber, padNumber, toInteger, DateHelper } from "@shared/helpers/date.helper";
@Injectable()
export class DateParserFormatter extends NgbDateParserFormatter {
parse(value: string): NgbDateStruct {
if (value) {
const dateParts = value.trim().split("/");
if (dateParts.length === 1 && isNumber(dateParts[0])) {
return { year: toInteger(dateParts[0]), month: null, day: null };
} else if (dateParts.length === 2 && isNumber(dateParts[0]) && isNumber(dateParts[1])) {
return { year: toInteger(dateParts[1]), month: toInteger(dateParts[0]), day: null };
} else if (dateParts.length === 3 && isNumber(dateParts[0]) && isNumber(dateParts[1]) && isNumber(dateParts[2])) {
return { year: toInteger(dateParts[2]), month: toInteger(dateParts[1]), day: toInteger(dateParts[0]) };
}
}
return null;
}
format(date: NgbDateStruct): string {
let stringDate = "";
if (date) {
stringDate += isNumber(date.month) ? padNumber(date.month) + "/" : "";
stringDate += isNumber(date.day) ? padNumber(date.day) + "/" : "";
stringDate += date.year;
}
return stringDate;
}
}
@Injectable()
export class NgbUTCStringAdapter extends NgbDateAdapter<string> {
fromModel(date: string): NgbDateStruct {
return DateHelper.toNgbDateStruct(date);
}
toModel(date: NgbDateStruct): string {
return DateHelper.toString(date);
}
}
\ No newline at end of file
export * from "./date-parser-formatter";
\ No newline at end of file
import { Injectable } from "@angular/core";
import { CanActivate, Router } from "@angular/router";
import { Observable, of } from "rxjs";
import { catchError, map } from "rxjs/operators";
import { IdentityService, MenuService } from "@shared/services";
@Injectable()
export class AccessGuard implements CanActivate {
constructor(
private readonly router: Router,
private readonly identityService: IdentityService,
private readonly menuService: MenuService
) { }
canActivate(): Observable<boolean> | boolean {
const userAccountReq = this.identityService.status();
return userAccountReq
.pipe(
map((roleId: number) => {
if (roleId) {
this.router.navigate([this.menuService.getDefaultRoute]);
return false;
} else {
return true;
}
}),
catchError(() => {
return of(true);
})
);
}
canActivateChild(): Observable<boolean> | Promise<boolean> | boolean {
return this.canActivate();
}
}
\ No newline at end of file
import { Injectable } from "@angular/core";
import { CanActivate, CanActivateChild, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from "@angular/router";
import { Observable } from "rxjs";
import { MenuService } from "../services";
import { AllowType } from "../enums";
@Injectable()
export class AuthGuard implements CanActivate, CanActivateChild {
constructor(
private readonly menuService: MenuService,
private readonly router: Router
) {
}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot):
Observable<boolean> | Promise<boolean> | boolean {
return this.activateHelper(route, state);
}
activateHelper = (_route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => {
const allowType = this.menuService.isAllowed(state.url, true);
if (typeof allowType === 'string') {
this.router.navigateByUrl(allowType);
return false;
} else {
switch (allowType as AllowType) {
case AllowType.Allowed:
return true;
case AllowType.NotAllowed:
return false;
case AllowType.BreakIt:
this.router.navigateByUrl("login");
return false;
default:
return false;
}
}
}
canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot):
Observable<boolean> | Promise<boolean> | boolean {
return this.activateHelper(route, state);
}
}
////import { Injectable } from "@angular/core";
////import { CanActivate, CanActivateChild, Router } from "@angular/router";
////import { Observable, of } from "rxjs";
////import { catchError, map } from "rxjs/operators";
////import { IdentityService, appUrls } from "@shared/services";
////@Injectable()
////export class AuthGuard implements CanActivate, CanActivateChild {
//// constructor(
//// private readonly identityService: IdentityService,
//// private readonly router: Router
//// ) {
//// }
//// canActivate(): Observable<boolean> | Promise<boolean> | boolean {
//// const userAccountReq = this.identityService.status();
//// return userAccountReq
//// .pipe(
//// map((roleId: number) => {
//// if (roleId) {
//// return true;
//// }
//// this.router.navigateByUrl(appUrls.login);
//// return false;
//// }),
//// catchError(() => {
//// return of(false);
//// })
//// );
//// }
//// canActivateChild(): Observable<boolean> | Promise<boolean> | boolean {
//// return this.canActivate();
//// }
////}
\ No newline at end of file
import { Injectable } from '@angular/core';
import { CanDeactivate, UrlTree } from "@angular/router";
import { Observable } from 'rxjs';
export interface ICanComponentDeactivate {
canDeactivate: () => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
}
@Injectable()
export class DeactivateGuard implements CanDeactivate<ICanComponentDeactivate> {
canDeactivate(component: ICanComponentDeactivate): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
return component.canDeactivate();
}
}
\ No newline at end of file
export * from "./access.guard";
export * from "./auth.guard";
export * from "./role.guard";
export * from "./deactivate.guard";
export * from "./telemedicine.guard";
\ No newline at end of file
import { Injectable } from "@angular/core";
import { ActivatedRouteSnapshot, CanActivate, Router } from "@angular/router";
import { Observable, of } from "rxjs";
import { catchError, map } from "rxjs/operators";
import { IUserAccount } from "@shared/models";
import { PermissionHelper } from "@shared/helpers/permission.helper";
import { AppData, IdentityService, appUrls } from "@shared/services";
class RouteData {
title?: string;
filters?: boolean;
roles?: Array<number>;
}
@Injectable()
export class RoleGuard implements CanActivate {
routeData: RouteData;
permissions: PermissionHelper;
constructor(
private readonly appData: AppData,
private readonly router: Router,
private readonly identityService: IdentityService,
) {
this.routeData = new RouteData();
}
canActivate(route: ActivatedRouteSnapshot): Observable<boolean> | Promise<boolean> | boolean {
this.routeData = route.data;
return this.appData.userAccount.pipe(
map((account: IUserAccount) => {
this.permissions = new PermissionHelper(account.roleId);
const exists = this.routeData.roles.find((o: number) => o === account.roleId);
if (exists !== undefined) {
return true;
} else {
this.identityService.signOut().subscribe(() => {
this.router.navigateByUrl(appUrls.login);
this.appData.setAccount(null);
delete localStorage["ProviderVideoCallingSession"];
});
}
}),
catchError(() => {
return of(false);
})
);
}
}
\ No newline at end of file
import { Injectable } from '@angular/core';
import { CanActivateChild, CanDeactivate, UrlTree } from "@angular/router";
import {JitsiService} from "../services";
import { Observable } from 'rxjs';
export interface CanComponentDeactivate {
canDeactivate: () => Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
}
@Injectable()
export class TelemedicineGuard implements CanActivateChild, CanDeactivate<CanComponentDeactivate> {
constructor(
private readonly jitsiService: JitsiService
) {
}
canActivateChild() {
return true;
}
canDeactivate(_component: CanComponentDeactivate): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
if (this.jitsiService.isRoomActive) {
this.jitsiService.closeCall(true);
return false;
} else {
return true;
}
}
}
\ No newline at end of file
This diff is collapsed.
import { NgbDateStruct } from "@ng-bootstrap/ng-bootstrap";
import * as moment from "moment";
export function padNumber(value: number) {
if (isNumber(value)) {
return (`0${value}`).slice(-2);
} else {
return "";
}
}
export function isNumber(value: any): boolean {
return !isNaN(toInteger(value));
}
export function toInteger(value: any): number {
return parseInt(value, 10);
}
export class DateHelper {
static get today() {
return moment().format("dddd, Do MMMM YYYY, h:mm:ss a");
}
static get todayInFormat() {
return moment().format("YYYY-MM-DD");
}
static get ngbToday() {
return { year: new Date().getFullYear(), month: new Date().getMonth() + 1, day: new Date().getDate() };
}
static get minDate() {
return { year: new Date().getFullYear() - 160, month: new Date().getMonth() + 1, day: new Date().getDate() };
}
static get minAge() {
return { year: new Date().getFullYear() - 18, month: new Date().getMonth() + 1, day: new Date().getDate() };
}
static get currentTimeZone() {
const split = new Date().toString().split(" ");
const timeZone = split[split.length - 3].substring(1) + " " + split[split.length - 2] + " " + split[split.length - 1];
return timeZone.substring(0, timeZone.length - 1);
}
static get currentTimeOffset() {
const split = new Date().toString().split(" ");
const offset = split[5].split("GMT")[1];
return offset.slice(0, 3) + ":" + offset.slice(3);
}
static toNgbDateStruct(date: string) {
let dateString: NgbDateStruct = null;
if ((date &&
Number(date.substring(0, 4)) &&
Number(date.substring(5, 7) + 1) &&
Number(date.substring(8, 10)))) {
dateString = {
year: Number(date.substring(0, 4)),
month: Number(date.substring(5, 7)),
day: Number(date.substring(8, 10))
};
}
return dateString;
}
static getAge(value: string) {
const dateOfBirth = this.toNgbDateStruct(value);
const timeDiff = Math.abs(new Date().getTime() - new Date(dateOfBirth.year, dateOfBirth.month, dateOfBirth.day).getTime());
return Math.round(timeDiff / (1000 * 3600 * 24) / 365.25);
}
static toString(date: NgbDateStruct) {
return date ? date.year.toString() + "-" + String(`00${date.month}`).slice(-2) + "-" + String(`00${date.day}`).slice(-2) : null;
}
static isExpired(date: Date, ticks: number) {
const hours = Math.round((ticks / (60 * 60 * 10000000)) % 24);
const mins = Math.round((ticks / (60 * 10000000)) % 60);
const timestamp = moment(moment(date).format("YYYY-MM-DD") + "T" + padNumber(hours) + ":" + padNumber(mins) + ":00");
return timestamp.diff(moment(), "m") <= 0;
}
static getTimeFromTicks(ticks: number) {
const hours = Math.round((ticks / (60 * 60 * 10000000)) % 24);
const mins = Math.round((ticks / (60 * 10000000)) % 60);
const time = "T" + padNumber(hours) + ":" + padNumber(mins) + ":00";
return time;
}
static getDays(date: Date) {
return moment.duration(moment(Date.now()).diff(moment(new Date(date)))).asDays();
}
}
\ No newline at end of file
export class CalculateDiscounttHelper {
static convertRupeesToPercentage(originalAmount: number, discountAmount: number) {
const discountPercentage = (discountAmount / originalAmount) * 100;
const discountDecimal = discountAmount / originalAmount;
const discountedAmount = originalAmount - discountAmount;
const percentageDecimal = discountPercentage / 100;
return { discountPercentage, discountedAmount, discountDecimal, percentageDecimal };
}
static convertPercentageToRupees(originalAmount: number, discountPercentage: number) {
const discountDecimal = discountPercentage / 100;
const discountAmount = originalAmount * discountDecimal;
const discountedAmount = originalAmount - discountAmount;
return { discountDecimal, discountAmount, discountedAmount };
}
static applyPercentageDiscount(amount: number, discountPercentage: number): number {
const discountAmount = (amount * discountPercentage) / 100;
//const discountedAmount = amount - discountAmount;
return discountAmount;
}
static applyRupeesDiscount(amount: number, discountInRupees: number): number {
const discountedAmount = amount - discountInRupees;
return discountedAmount;
}
}
\ No newline at end of file
export * from "./api.helper";
export * from "./key-codes.helper";
export * from "./regex.helper";
export * from "./util.helper";
export * from "./date.helper";
export * from "./permission.helper";
export * from "./linq.helper";
export * from "./money.helper";
export * from "./local-storage.helper";
export * from "./init-payment.helper";
\ No newline at end of file
import { InitPaymentModel } from "../models/init-payment.model";
const INIT_PAYMENT_KEY = "initPayment";
export class InitPaymentHelper {
static Get(): InitPaymentModel | null | undefined {
return JSON.parse(localStorage.getItem(INIT_PAYMENT_KEY)) as InitPaymentModel | null | undefined;
}
static Set(value: InitPaymentModel) {
localStorage.setItem(INIT_PAYMENT_KEY, JSON.stringify(value));
}
static UpdateMultiPayments(value: boolean) {
const data = this.Get();
if(data) {
data.isMultiPayments = value;
this.Set(data)
}
}
static UpdateModel(value: object) {
const data = this.Get();
if (data) {
data.data.finalModel = value;
this.Set(data)
}
}
}
\ No newline at end of file
export class KeyCodesHelper {
static default: Array<number> = [8, 9, 13, 17, 20, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46];
static defaultNames: Array<string> = ["backspace", "tab", "enter", "caps lock", "page up", "page down", "end", "home", "left arrow", "up arrow", "right arrow", "down arrow", "insert", "delete"];
static specialChars: Array<number> = [188, 189, 190, 222, 32];
static numbers: Array<number> = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105];
static alphabets: Array<number> = [32, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90];
static dots: Array<number> = [110, 190];
static specialCharacters: Array<string> = ["!", "\"", "#", "$", "@", "%", "^", "&", "*", "(", ")", "_", "+", "=", "-", "~", "`", ",", ".", "/", "?", "<", ">", ":", ";", "'", "{", "}", "[", "]", "|", "\\"];
}
\ No newline at end of file
import * as cloneDeep from "lodash.clonedeep";
import { FormGroup } from "@angular/forms";
export class LinqHelper {
static groupBy = (list, keyGetter) => {
const map = new Map();
list.forEach((item) => {
const key = keyGetter(item);
const collection = map.get(key);
if (!collection) {
map.set(key, [item]);
} else {
collection.push(item);
}
});
return map;
}
static sort = (records: Array<any>, key: string) => {
records.sort((a: any, b: any) => {
return a[key] < b[key]
? -1
: a[key] > b[key]
? 1
: 0;
});
}
static cloneDeepArray = <T>(data: Array<T>): Array<T> => {
const newData = data.map(x => ({ ...x }));
return newData as Array<T>;
}
static cloneDeep = <T>(data: T): T => {
return cloneDeep(data) as T;
}
static uniqueOnlyBy = (value, index, self) => {
return index === self.findIndex((t) => (
t.name === value.name
));
}
static uniqueOnlyByAlt = (value, index, self, name) => {
return index === self.findIndex((t) => (
t[name] === value[name]
));
}
static uniqueOnly = (value, index, self) => {
return self.indexOf(value) === index;
}
static compare = (a, b, key: string) => {
if (a[key] < b[key]) {
return -1;
}
if (a[key] > b[key]) {
return 1;
}
return 0;
}
static toNormalCase = (text: string): string => {
const result = text.replace(/([A-Z])/g, " $1");
const finalResult = result.charAt(0).toUpperCase() + result.slice(1);
return finalResult;
}
static stuffIn = (originalText: string, stuffInText: string) => {
return originalText.indexOf(stuffInText) !== -1
? originalText.replace(new RegExp(`(${stuffInText})`, 'gi'), ` ${stuffInText} `).replace(/\s+/g, " ")
: originalText.trim() + " " + stuffInText;
}
static trimFormValues = (form: FormGroup) => {
const setValue = (control: any) => {
control.setValue(control.value.toString().trim().split(" ").filter(x => !!x).join(" "));
}
const patchHelper = (controls: any) => {
const keys = Object.keys(controls);
keys.forEach(key => {
const subControls = controls[key]["controls"];
!subControls && typeof controls[key].value === "string" && setValue(controls[key]);
subControls && patchHelper(subControls);
})
}
patchHelper(form["controls"]);
}
}
\ No newline at end of file
export class LocalStorageHelper {
static GetValue (key: string) {
return localStorage.getItem(key);
}
static SetValue(key: string, value: string) {
localStorage.setItem(key, value);
}
static DeleteAll() {
localStorage.clear()
}
static Delete(key: string) {
localStorage.removeItem(key);
}
}
\ No newline at end of file
export class MoneyHelper {
static table_0_19 = ["", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"];
static table_20_90 = ["", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"];
static table_Scale = ["", "Thousand", "Lakh", "Crore", "Arab", "Kharab", "Neel", "Padma", "Shankh", "Samudra", "Antya", "Madhyam", "Paraardh", "***", "***"];
static integerToWordsInd = (givenNumber = 0, official = 0) => {
if (givenNumber === 0) return "Zero";
if (official) return MoneyHelper.siptlets(givenNumber); // Return Official Numbering System text
let numWords = "";
const num = ("0".repeat(6 * ((givenNumber).toString().length) % 7) + givenNumber).match(/.{7}/g); // Create Siptlets Array
return num.forEach((siptlet, scalePos) => { // Return Commmon-Use Numbering System text
const [scale, sWords] = [(MoneyHelper.table_Scale[3] + " ").repeat(num.length - scalePos - 1).trimRight(), MoneyHelper.siptlets(siptlet)];
numWords += (numWords && sWords ? ", " : "") + sWords + (scale ? " " : "") + scale;
}), numWords;
}
static siptlets = (Num, NumWords = "") => {
(Num += "").length - 3 & 1 && (Num = "0" + Num);
Num = Num > 999 ? [...Num.slice(0, -3).match(/.{2}/g).map(e => "0" + e), (Num.slice(-3))] : [("00" + Num).substr(-3)];
return Num.forEach((Duplet, ScalePos) => {
if (+Duplet) {
const [Hyphen, Hundreds, Tens, Scale] = [+Duplet[2] ? "-" : "", +Duplet[0], +Duplet.substr(1), MoneyHelper.table_Scale[Num.length - ScalePos - 1]];
NumWords += (NumWords ? " " : "") + (Hundreds ? MoneyHelper.table_0_19[Hundreds] + " Hundred" : "") +
(Hundreds && Tens ? " " : "") + (Tens < 20 ? MoneyHelper.table_0_19[Tens] :
MoneyHelper.table_20_90[+(Duplet[1])] + Hyphen + MoneyHelper.table_0_19[+Duplet[2]]);
NumWords += (NumWords && Scale ? " " : "") + Scale;
}
}), NumWords;
}
static numberCurrencyIn = (Num = 0, Official = 0) => {
const n = (Num + "").split(0.1.toLocaleString().substr(1, 1)); // Number and Fraction parts
n.length !== 2 && (n[1] = ""); // No fraction
Num = +n[0];
let Nw = "", Fw = "", Frc = (n[1] + "00").substring(0, 2); // Limit to 2 Decimal Places
Num && (Nw = MoneyHelper.integerToWordsInd(Num, Official)); // Convert the Whole Number
Frc && (Fw = MoneyHelper.integerToWordsInd(+Frc, Official)); // Convert the Fractional Part
const final = (Nw ? Nw : "") + (Nw ? " Rupees" : "") + (Nw && Fw && Fw !== "Zero" ? " and " : "") + (Fw && Fw !== "Zero" ? Fw + " Paisa" : "");
return Nw ? final : "Zero Paisa"; // Join together
}
}
\ No newline at end of file
import { Role } from "@shared/enums";
export class PermissionHelper {
constructor(private readonly roleId: number) { }
get superAdmin() {
return [Role.SuperAdmin].indexOf(this.roleId) > -1;
}
get admin() {
return [Role.Administrator].indexOf(this.roleId) > -1;
}
get support() {
return [Role.Support].indexOf(this.roleId) > -1;
}
get accountant() {
return [Role.Accountant].indexOf(this.roleId) > -1;
}
get symptomCreator() {
return [Role.SymptomCreator].indexOf(this.roleId) > -1;
}
get symptomManager() {
return [Role.SymptomManager].indexOf(this.roleId) > -1;
}
get all() {
return [Role.Administrator, Role.Support].indexOf(this.roleId) > -1;
}
}
\ No newline at end of file
export class RegExHelper {
static email = /^[\w-]+(?:\.[\w-]+)*@(?:[\w-]+\.)+[a-zA-Z]{2,10}$/;
static emailFormat = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/;
static length10 = /^[A-Za-z\d$@$!%*?&]{10,}/;
static mobile = /^\b\d{10}?\b$/;
static npi = /^\b\d{10}?\b$/;
static oneUpperCase = /^(?=.*[A-Z])/;
static oneLowerCase = /^(?=.*[a-z])/;
static oneNumber = /^(?=.*\d)/;
static oneSpecialChar = /^(?=.*[$@$!%*?&])/;
static numbersOnly = /^[0-9]+$/;
static textOnly = /^[a-zA-Z ]+$/;
static titleOnly = /^[a-zA-Z .,'-/]+$/;
static alphaNumeric = /^[a-zA-Z0-9 ]+$/;
static decimalsOnly = /^(100|([0-9][0-9]?(\.\d?\d)?))$/;
static twoDecimalsOnly = /^[0-9]{0,3}(\.{0,1})([0-9]{1,2})?$/;
static whiteSpace = /^[\s]{1,}|[\s]{2,}|[\s]{1,}$/;
static sp = /^[a-zA-z"]{1,}\((([a-zA-z"]{1,} (bigint|int8|boolean|bool|varchar|integer|int|int4|smallint|int2|float8|float4|text|date){1,}){0,}(,){0,}( ){0,}([a-zA-z"]{1,} (bigint|int8|boolean|bool|varchar|integer|int|int4|smallint|int2|float8|float4|text|date){1,})){0,}\)$/;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment