av6-core 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1183,10 +1183,9 @@ function calculateBillingFromChildren(inputs, masterExtra, options = {}) {
1183
1183
  }
1184
1184
  copayAmount2 = applyRound(copayAmount2, lineFmt, precision);
1185
1185
  const copay = clamp(Math.max(0, copayAmount2), 0, grossAmount2);
1186
- const patientRaw = grossAmount2 - copay;
1186
+ const patientRaw = applyRound(grossAmount2 - copay, "TO_FIXED", 2);
1187
1187
  const patientRounded = applyRound(patientRaw, lineFmt, precision);
1188
1188
  const lineRoundOff = patientRounded - patientRaw;
1189
- const normalizedLineRoundOff = Object.is(lineRoundOff, -0) ? 0 : lineRoundOff;
1190
1189
  return {
1191
1190
  baseRate: applyRound(baseRate, lineFmt, precision),
1192
1191
  subtotalAmount: applyRound(subtotal + other - inxInclusiveDiff, lineFmt, precision),
@@ -1201,7 +1200,7 @@ function calculateBillingFromChildren(inputs, masterExtra, options = {}) {
1201
1200
  grossAmount: applyRound(grossAmount2, lineFmt, precision),
1202
1201
  netAmount: patientRounded,
1203
1202
  // patient payable at line
1204
- roundOffAmount: applyRound(normalizedLineRoundOff, "TO_FIXED", 2),
1203
+ roundOffAmount: applyRound(lineRoundOff, "TO_FIXED", 2),
1205
1204
  // rounded - raw
1206
1205
  copayAmount: copay
1207
1206
  // insurer covered at line
@@ -1222,10 +1221,9 @@ function calculateBillingFromChildren(inputs, masterExtra, options = {}) {
1222
1221
  }
1223
1222
  masterExtraApplied = maybeStep(masterExtraApplied, stepwise, headFmt, precision);
1224
1223
  const discountTotalAmount = maybeStep(itemDiscountSum + masterExtraApplied, stepwise, headFmt, precision);
1225
- const patientAfterExtra = Math.max(0, patientRawTotal - masterExtraApplied);
1224
+ const patientAfterExtra = applyRound(Math.max(0, patientRawTotal - masterExtraApplied), "TO_FIXED", 2);
1226
1225
  const netAmount = applyRound(patientAfterExtra, headFmt, precision);
1227
1226
  const roundOffAmount = netAmount - patientAfterExtra;
1228
- const normalizedRoundOffAmount = Object.is(roundOffAmount, -0) ? 0 : roundOffAmount;
1229
1227
  const master = {
1230
1228
  additionalDiscountMode: masterExtra.mode,
1231
1229
  additionalDiscountValue: masterExtra.value,
@@ -1237,7 +1235,7 @@ function calculateBillingFromChildren(inputs, masterExtra, options = {}) {
1237
1235
  grossAmount: applyRound(grossAmount, headFmt, precision),
1238
1236
  netAmount,
1239
1237
  // patient payable after master extra + rounding
1240
- roundOffAmount: applyRound(normalizedRoundOffAmount, "TO_FIXED", 2),
1238
+ roundOffAmount: applyRound(roundOffAmount, "TO_FIXED", 2),
1241
1239
  // rounded - raw
1242
1240
  copayAmount: applyRound(copayAmount, headFmt, precision)
1243
1241
  // Σ line copay (insurer covered)
package/dist/index.mjs CHANGED
@@ -1135,10 +1135,9 @@ function calculateBillingFromChildren(inputs, masterExtra, options = {}) {
1135
1135
  }
1136
1136
  copayAmount2 = applyRound(copayAmount2, lineFmt, precision);
1137
1137
  const copay = clamp(Math.max(0, copayAmount2), 0, grossAmount2);
1138
- const patientRaw = grossAmount2 - copay;
1138
+ const patientRaw = applyRound(grossAmount2 - copay, "TO_FIXED", 2);
1139
1139
  const patientRounded = applyRound(patientRaw, lineFmt, precision);
1140
1140
  const lineRoundOff = patientRounded - patientRaw;
1141
- const normalizedLineRoundOff = Object.is(lineRoundOff, -0) ? 0 : lineRoundOff;
1142
1141
  return {
1143
1142
  baseRate: applyRound(baseRate, lineFmt, precision),
1144
1143
  subtotalAmount: applyRound(subtotal + other - inxInclusiveDiff, lineFmt, precision),
@@ -1153,7 +1152,7 @@ function calculateBillingFromChildren(inputs, masterExtra, options = {}) {
1153
1152
  grossAmount: applyRound(grossAmount2, lineFmt, precision),
1154
1153
  netAmount: patientRounded,
1155
1154
  // patient payable at line
1156
- roundOffAmount: applyRound(normalizedLineRoundOff, "TO_FIXED", 2),
1155
+ roundOffAmount: applyRound(lineRoundOff, "TO_FIXED", 2),
1157
1156
  // rounded - raw
1158
1157
  copayAmount: copay
1159
1158
  // insurer covered at line
@@ -1174,10 +1173,9 @@ function calculateBillingFromChildren(inputs, masterExtra, options = {}) {
1174
1173
  }
1175
1174
  masterExtraApplied = maybeStep(masterExtraApplied, stepwise, headFmt, precision);
1176
1175
  const discountTotalAmount = maybeStep(itemDiscountSum + masterExtraApplied, stepwise, headFmt, precision);
1177
- const patientAfterExtra = Math.max(0, patientRawTotal - masterExtraApplied);
1176
+ const patientAfterExtra = applyRound(Math.max(0, patientRawTotal - masterExtraApplied), "TO_FIXED", 2);
1178
1177
  const netAmount = applyRound(patientAfterExtra, headFmt, precision);
1179
1178
  const roundOffAmount = netAmount - patientAfterExtra;
1180
- const normalizedRoundOffAmount = Object.is(roundOffAmount, -0) ? 0 : roundOffAmount;
1181
1179
  const master = {
1182
1180
  additionalDiscountMode: masterExtra.mode,
1183
1181
  additionalDiscountValue: masterExtra.value,
@@ -1189,7 +1187,7 @@ function calculateBillingFromChildren(inputs, masterExtra, options = {}) {
1189
1187
  grossAmount: applyRound(grossAmount, headFmt, precision),
1190
1188
  netAmount,
1191
1189
  // patient payable after master extra + rounding
1192
- roundOffAmount: applyRound(normalizedRoundOffAmount, "TO_FIXED", 2),
1190
+ roundOffAmount: applyRound(roundOffAmount, "TO_FIXED", 2),
1193
1191
  // rounded - raw
1194
1192
  copayAmount: applyRound(copayAmount, headFmt, precision)
1195
1193
  // Σ line copay (insurer covered)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "av6-core",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",