Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) added billing modules #88

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/esm-billing-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# ESM Billing App

This is a frontend module that provides billing functionality.
151 changes: 151 additions & 0 deletions packages/esm-billing-app/__mocks__/visit.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
export const mockCurrentVisit = {
uuid: 'ee527f74-7373-4494-98bc-002c979971d1',
encounters: [],
patient: { uuid: '0b25b92a-add3-4d52-8491-778bec556e02' },
visitType: { uuid: '3371a4d4-f66f-4454-a86d-92c7b3da990c', name: 'Outpatient', display: 'Outpatient' },
attributes: [
{
uuid: 'e1522ecb-d027-4c30-aa25-38698ba18020',
display: 'Source form: 13',
attributeType: {
name: 'Source form',
datatypeClassname: 'org.openmrs.module.kenyaemr.datatype.FormDatatype',
uuid: '8bfab185-6947-4958-b7ab-dfafae1a3e3d',
},
value: {
uuid: '23b4ebbd-29ad-455e-be0e-04aa6bc30798',
display: 'MOH 257 Visit Summary',
name: 'MOH 257 Visit Summary',
description: null,
encounterType: {
uuid: 'a0034eee-1940-4e35-847f-97537a35d05e',
display: 'HIV Consultation',
},
version: '1',
build: null,
published: true,
formFields: [],
retired: false,
resourceVersion: '1.9',
},
},
{
uuid: '5dbb093d-b377-4684-9583-05074ae7187a',
display: 'Payment Method: 28989582-e8c3-46b0-96d0-c249cb06d5c6',
attributeType: {
name: 'Payment Method',
datatypeClassname: 'org.openmrs.customdatatype.datatype.FreeTextDatatype',
uuid: 'e6cb0c3b-04b0-4117-9bc6-ce24adbda802',
},
value: '28989582-e8c3-46b0-96d0-c249cb06d5c6',
},
{
uuid: '85abc096-8524-4c2e-863c-b44c99c144f7',
display: 'Patient Type: false',
attributeType: {
name: 'Patient Type',
datatypeClassname: 'org.openmrs.customdatatype.datatype.FreeTextDatatype',
uuid: '3b9dfac8-9e4d-11ee-8c90-0242ac120002',
},
value: 'false',
},
{
uuid: '7eb402bb-2bf8-43b7-91aa-ee3f5c753de1',
display: 'Visit queue number: CLI-090',
attributeType: {
name: 'Visit queue number',
datatypeClassname: 'org.openmrs.customdatatype.datatype.FreeTextDatatype',
uuid: 'c61ce16f-272a-41e7-9924-4c555d0932c5',
},
value: 'CLI-090',
},
],
location: {
uuid: '233de33e-2778-4f9a-a398-fa09da9daa14',
name: 'Wamagana Health Centre',
display: 'Wamagana Health Centre',
},
startDatetime: '2024-05-29T15:19:00.000+0300',
stopDatetime: '',
};

export const mockBills = [
{
id: 1888,
uuid: '3b784fa7-c124-4710-9152-cad3dbaa19e8',
patientName: ' Test Unit patient',
identifier: 'MGTKYE ',
patientUuid: '0b25b92a-add3-4d52-8491-778bec556e02',
status: 'PENDING',
receiptNumber: '1916-6',
cashier: {
uuid: '693acc9b-734f-488d-b6d2-60368d02cec0',
display: '23797304 - Test Patient',
},
cashPointUuid: '54065383-b4d4-42d2-af4d-d250a1fd2590',
cashPointName: 'OPD Cash Point',
cashPointLocation: 'Moi Teaching Refferal Hospital',
dateCreated: '29 — May — 2024',
lineItems: [
{
uuid: '528c3411-b3b8-41dc-bf88-174b4adc1b5b',
display: 'BillLineItem',
voided: false,
voidReason: null,
item: '',
billableService: '3f5d0684-a280-477e-a67b-2a956a1f6dca:Registration Revist',
quantity: 1,
price: 50,
priceName: 'Default',
priceUuid: '',
lineItemOrder: 0,
paymentStatus: 'PENDING',
order: null,
resourceVersion: '1.8',
},
],
billingService: '3f5d0684-a280-477e-a67b-2a956a1f6dca:Registration Revist',
payments: [],
display: '1916-6',
totalAmount: 50,
},
{
id: 1213,
uuid: '5b633220-9a99-4517-bcdf-c06a7d38dd23',
patientName: ' peter ndungu mairo',
identifier: 'MGTKYE ',
patientUuid: '0b25b92a-add3-4d52-8491-778bec556e02',
status: 'PENDING',
receiptNumber: '1228-6',
cashier: {
uuid: '48b55692-e061-4ffa-b1f2-fd4aaf506224',
display: 'admin - Super User',
},
cashPointUuid: '54065383-b4d4-42d2-af4d-d250a1fd2590',
cashPointName: 'OPD Cash Point',
cashPointLocation: 'Moi Teaching Refferal Hospital',
dateCreated: '15 — May — 2024',
lineItems: [
{
uuid: '16cc8b90-f2d4-4907-a3d5-0f57486e5dcf',
display: 'BillLineItem',
voided: false,
voidReason: null,
item: '',
billableService: '3f5d0684-a280-477e-a67b-2a956a1f6dca:Registration Revist',
quantity: 1,
price: 50,
priceName: 'Default',
priceUuid: '',
lineItemOrder: 0,
paymentStatus: 'PENDING',
order: null,
resourceVersion: '1.8',
},
],
billingService: '3f5d0684-a280-477e-a67b-2a956a1f6dca:Registration Revist',
payments: [],
display: '1228-6',
totalAmount: 50,
},
];
8 changes: 8 additions & 0 deletions packages/esm-billing-app/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const rootConfig = require('../../jest.config.js');

const packageConfig = {
...rootConfig,
collectCoverage: false,
};

module.exports = packageConfig;
54 changes: 54 additions & 0 deletions packages/esm-billing-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "@ampath/esm-billing-app",
"version": "5.1.1",
"description": "Billing app for AMRS",
"browser": "dist/ampath-esm-billing-app.js",
"main": "src/index.ts",
"source": true,
"license": "MPL-2.0",
"homepage": "https://github.com/AMPATH/ampath-esm-3.x#readme",
"scripts": {
"start": "openmrs develop",
"serve": "webpack serve --mode=development",
"debug": "npm run serve",
"build": "webpack --mode production",
"analyze": "webpack --mode=production --env.analyze=true",
"lint": "eslint src --ext ts,tsx",
"typescript": "tsc",
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js",
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests",
"test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js",
"coverage": "yarn test --coverage"
},
"browserslist": [
"extends browserslist-config-openmrs"
],
"keywords": [
"openmrs"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/AMPATH/ampath-esm-3.x.git"
},
"bugs": {
"url": "git+https://github.com/AMPATH/ampath-esm-3.x.git"
},
"dependencies": {
"@carbon/react": "^1.42.1",
"lodash-es": "^4.17.15",
"react-to-print": "^2.14.13"
},
"peerDependencies": {
"@openmrs/esm-framework": "5.x",
"react": "^18.1.0",
"react-i18next": "11.x",
"react-router-dom": "6.x",
"swr": "2.x"
},
"devDependencies": {
"webpack": "^5.74.0"
}
}
Loading
Loading