tmp - hmislk/hmis GitHub Wiki

in Admin Function Page - https://qa.carecode.org/qa1/faces/dataAdmin/admin_functions.xhtml

Under Pharmacy Section I want a new button to correct the negatove / positive sign of Bill Values, BillFinanceDetail values, BillItem Values, BillItemFinanceDetails Value and Pharmaceutical Bill Item Values depending on the Bill Type

First get all Bills related entities and list of bill items and its related ones through billService.reload Itemrate all bills fixing the sign

BillItem \ BillTypeAtomic Pharmacy Transfer Request Pharmacy Transfer Request Pre Pharmacy Transfer Request Cancelled Pharmacy Transfer Issue Pharmacy Transfer Issue Cancelled Pharmacy Transfer Issue Return Pharmacy Direct Issue Pharmacy Direct Issue Cancelled Pharmacy Disposal Issue Pharmacy Disposal Issue Cancelled Pharmacy Disposal Issue Return Pharmacy Receive Pharmacy Receive Pre Pharmacy Receive Cancelled
netRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
grossValue
netValue
Field Pharmacy Transfer Request Pharmacy Transfer Request Pre Pharmacy Transfer Request Cancelled Pharmacy Transfer Issue Pharmacy Transfer Issue Cancelled Pharmacy Transfer Issue Return Pharmacy Direct Issue Pharmacy Direct Issue Cancelled Pharmacy Disposal Issue Pharmacy Disposal Issue Cancelled Pharmacy Disposal Issue Return Pharmacy Receive Pharmacy Receive Pre Pharmacy Receive Cancelled
lineGrossRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
billGrossRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
grossRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
lineNetRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
billNetRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
netRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
lineDiscountRate
billDiscountRate
totalDiscountRate
lineExpenseRate
billExpenseRate
totalExpenseRate
billTaxRate
lineTaxRate
totalTaxRate
billCostRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
lineCostRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
totalCostRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
lineGrossTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
billGrossTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
grossTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
lineNetTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
billNetTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
netTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
lineDiscount
billDiscount
totalDiscount
retailSaleRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
wholesaleRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
costRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
purchaseRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
retailSaleRatePerUnit Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
wholesaleRatePerUnit Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
costRatePerUnit Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
purchaseRatePerUnit Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
valueAtRetailRate Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
valueAtPurchaseRate Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
valueAtCostRate Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
valueAtWholesaleRate Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
billTax
lineTax
totalTax
billExpense
lineExpense
totalExpense
billCost Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
lineCost Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalCost Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
freeQuantity
quantity Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalQuantity Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
freeQuantityByUnits
quantityByUnits Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalQuantityByUnits Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
returnQuantity Positive Positive
returnFreeQuantity Positive Positive
totalReturnQuantity Positive Positive
returnGrossTotal Positive Positive
returnNetTotal Positive Positive
profitMargin Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
PharmaceuticalBillItem \ BillTypeAtomic Pharmacy Transfer Request Pharmacy Transfer Request Pre Pharmacy Transfer Request Cancelled Pharmacy Transfer Issue Pharmacy Transfer Issue Cancelled Pharmacy Transfer Issue Return Pharmacy Direct Issue Pharmacy Direct Issue Cancelled Pharmacy Disposal Issue Pharmacy Disposal Issue Cancelled Pharmacy Disposal Issue Return Pharmacy Receive Pharmacy Receive Pre Pharmacy Receive Cancelled
qty Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
qtyPacks Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
freeQty
freeQtyPacks
remainingFreeQty Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
remainingFreeQtyPack Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
remainingQty Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
remainingQtyPack Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
purchaseRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
purchaseRatePack Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
retailRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
retailRatePack Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
completedQty Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
completedFreeQty
wholesaleRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
wholesaleRatePack Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
costRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
costRatePack Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
purchaseValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
retailValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
costValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
lastPurchaseRate Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
lastPurchaseRatePack Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
Bill \ BillTypeAtomic Pharmacy Transfer Request Pharmacy Transfer Request Pre Pharmacy Transfer Request Cancelled Pharmacy Transfer Issue Pharmacy Transfer Issue Cancelled Pharmacy Transfer Issue Return Pharmacy Direct Issue Pharmacy Direct Issue Cancelled Pharmacy Disposal Issue Pharmacy Disposal Issue Cancelled Pharmacy Disposal Issue Return Pharmacy Receive Pharmacy Receive Pre Pharmacy Receive Cancelled
margin Positive Positive Positive Positive Positive Positive Positive Positive Positive Positive
total Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
netTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
discount
vat
vatPlusNetTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
discountPercent
billTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
paidAmount
settledAmountByPatient
settledAmountBySponsor
refundAmount Positive Positive
balance
serviceCharge
tax
cashPaid
cashBalance
saleValuef Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
freeValuef
performInstitutionFee
staffFee
billerFee
grantTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
expenseTotal
expensesTotalConsideredForCosting
expensesTotalNotConsideredForCosting
grnNetTotal Positive
hospitalFee
collctingCentreFee
professionalFee
BillFinanceDetails \ BillTypeAtomic Pharmacy Transfer Request Pharmacy Transfer Request Pre Pharmacy Transfer Request Cancelled Pharmacy Transfer Issue Pharmacy Transfer Issue Cancelled Pharmacy Transfer Issue Return Pharmacy Direct Issue Pharmacy Direct Issue Cancelled Pharmacy Disposal Issue Pharmacy Disposal Issue Cancelled Pharmacy Disposal Issue Return Pharmacy Receive Pharmacy Receive Pre Pharmacy Receive Cancelled
billDiscount
lineDiscount
totalDiscount
billExpense
lineExpense
totalExpense
billExpensesConsideredForCosting
billExpensesNotConsideredForCosting
billCostValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
lineCostValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalCostValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalCostValueFree
totalCostValueNonFree Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
billTaxValue
itemTaxValue
totalTaxValue
totalPurchaseValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalPurchaseValueFree
totalPurchaseValueNonFree Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalOfFreeItemValues
totalOfFreeItemValuesFree
totalOfFreeItemValuesNonFree
totalRetailSaleValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalRetailSaleValueFree
totalRetailSaleValueNonFree Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalWholesaleValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalWholesaleValueFree
totalWholesaleValueNonFree Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalBeforeAdjustmentValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalAfterAdjustmentValue Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalQuantity Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalFreeQuantity
totalQuantityInAtomicUnitOfMeasurement Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
totalFreeQuantityInAtomicUnitOfMeasurement
lineGrossTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
billGrossTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
grossTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
lineNetTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
billNetTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative
netTotal Negative Positive Positive Negative Positive Negative Positive Positive Positive Negative

I have to have few tables, each table for One Entity Class Rows will correspond to attributes Columns will represent BillTypeAtomic Follwing the data given, please draft a table, one at a time. I will correct them if any error.

BillTypeAtomic - use as Columns PHARMACY_TRANSFER_REQUEST("Pharmacy Transfer Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.CREDIT_SPEND, BillType.PharmacyTransferRequest), PHARMACY_TRANSFER_REQUEST_PRE("Pharmacy Transfer Request Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.CREDIT_SPEND, BillType.PharmacyTransferRequest), PHARMACY_TRANSFER_REQUEST_CANCELLED("Pharmacy Transfer Request Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.CREDIT_SPEND, BillType.PharmacyTransferRequest), PHARMACY_ISSUE("Pharmacy Transfer Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.NO_PAYMENT, BillType.PharmacyIssue), PHARMACY_ISSUE_CANCELLED("Pharmacy Transfer Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.NO_PAYMENT, BillType.PharmacyIssue), PHARMACY_ISSUE_RETURN("Pharmacy Transfer Issue returned", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.NO_PAYMENT, BillType.PharmacyIssue), PHARMACY_DIRECT_ISSUE("Pharmacy Direct Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.CREDIT_SPEND, BillType.PharmacyIssue), PHARMACY_DIRECT_ISSUE_CANCELLED("Pharmacy Direct Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.CREDIT_SPEND, BillType.PharmacyIssue), PHARMACY_DISPOSAL_ISSUE("Pharmacy Disposal Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.NO_PAYMENT, BillType.PharmacyDisposalIssue), PHARMACY_DISPOSAL_ISSUE_CANCELLED("Pharmacy Disposal Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.NO_PAYMENT, BillType.PharmacyDisposalIssue), PHARMACY_DISPOSAL_ISSUE_RETURN("Pharmacy Disposal Issue returned", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.NO_PAYMENT, BillType.PharmacyDisposalIssue), PHARMACY_RECEIVE("Pharmacy Receive", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.CREDIT_SPEND, BillType.PharmacyTransferReceive), PHARMACY_RECEIVE_PRE("Pharmacy Receive Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.CREDIT_SPEND, BillType.PharmacyTransferReceive), PHARMACY_RECEIVE_CANCELLED("Pharmacy Receive Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY, PaymentCategory.CREDIT_SPEND, BillType.PharmacyTransferReceive),

Reules: Usually when money in, stocks out. When stocks in, money out. There are some without stock or finance movements like requests

Rates are positives in both stock in stock out, money in, money out bills

If stocks in, quantities are positives If stocks goes out, quantities are negatives Quentities are valued at cost rate, purchase rate, retail rate , etc When quantities are positive, all the values of stocks are positive When quantities are negative, all the values of stocks are negative

netValue, value, gorssValue, etc are positive when money comes, these are negative when money goes out

can I have a table with following sttributes under each Entity? The columns should have bill type

THere are several spelling mistakes, but we can not correct them because of backword compatibility

Entity: BillItem qty Rate discountRate marginRate netRate

grossValue discount vat netValue

Entity: BillItemFinanceDetails

lineGrossRate billGrossRate grossRate

lineNetRate billNetRate netRate

lineDiscountRate billDiscountRate totalDiscountRate

lineExpenseRate billExpenseRate totalExpenseRate

billTaxRate lineTaxRate totalTaxRate

billCostRate lineCostRate totalCostRate

lineGrossTotal billGrossTotal grossTotal

lineNetTotal billNetTotal netTotal

lineDiscount billDiscount totalDiscount

retailSaleRate wholesaleRate costRate purchaseRate

retailSaleRatePerUnit wholesaleRatePerUnit costRatePerUnit purchaseRatePerUnit

valueAtRetailRate valueAtPurchaseRate valueAtCostRate valueAtWholesaleRate

billTax lineTax totalTax

billExpense lineExpense totalExpense

billCost lineCost totalCost

freeQuantity quantity totalQuantity

freeQuantityByUnits quantityByUnits totalQuantityByUnits

returnQuantity returnFreeQuantity totalReturnQuantity

returnGrossTotal returnNetTotal

profitMargin

Entity: PharmaceuticalBillItem qty qtyPacks

freeQty freeQtyPacks

remainingFreeQty remainingFreeQtyPack

remainingQty remainingQtyPack

purchaseRate purchaseRatePack

retailRate retailRatePack

completedQty completedFreeQty

wholesaleRate wholesaleRatePack

costRate costRatePack

purchaseValue retailValue costValue

lastPurchaseRate lastPurchaseRatePack

Entity : Bill margin

total netTotal discount vat vatPlusNetTotal

discountPercent

billTotal paidAmount settledAmountByPatient settledAmountBySponsor refundAmount balance serviceCharge tax cashPaid cashBalance saleValuef freeValuef performInstitutionFee staffFee billerFee grantTotal expenseTotal expensesTotalConsideredForCosting expensesTotalNotConsideredForCosting grnNetTotal

hospitalFee collctingCentreFee professionalFee

Entity :BillFinanceDetails

billDiscount

lineDiscount totalDiscount billExpense

lineExpense

totalExpense

billExpensesConsideredForCosting

billExpensesNotConsideredForCosting

billCostValue lineCostValue

totalCostValue

totalCostValueFree

totalCostValueNonFree billTaxValue itemTaxValue totalTaxValue

totalPurchaseValue

totalPurchaseValueFree

totalPurchaseValueNonFree totalOfFreeItemValues totalOfFreeItemValuesFree

totalOfFreeItemValuesNonFree totalRetailSaleValue totalRetailSaleValueFree

totalRetailSaleValueNonFree totalWholesaleValue totalWholesaleValueFree totalWholesaleValueNonFree

totalBeforeAdjustmentValue totalAfterAdjustmentValue totalQuantity

totalFreeQuantity totalQuantityInAtomicUnitOfMeasurement totalFreeQuantityInAtomicUnitOfMeasurement

lineGrossTotal billGrossTotal grossTotal

lineNetTotal billNetTotal netTotal