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

WIP: Invoicing #195

Merged
merged 24 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
96307cd
WIP: Add an ability to setup price for health care services
projkov Oct 6, 2023
b29b586
WIP: Add ChargeItemDefinition resources as demo data
projkov Oct 6, 2023
fef19a3
WIP: Add invoices list
projkov Oct 9, 2023
85f5ae0
WIP: Add an ability to cancel and pay invoice
projkov Oct 9, 2023
68c6020
WIP: Add line items to Invoice
projkov Oct 10, 2023
c5a4a73
WIP: Update invoices list
projkov Oct 10, 2023
270525d
WIP: Add filters for invoice list
projkov Oct 10, 2023
d258794
WIP: Add placeholder for select
projkov Oct 10, 2023
2278299
Update icons for InvoiceList
projkov Oct 11, 2023
01c91c3
Merge branch 'master' into invoicing
projkov Oct 11, 2023
2fa1aaf
Reduce functionality for the patient role in InvoiceList
projkov Oct 11, 2023
3f4bdf1
WIP: Add invoice details page
projkov Oct 11, 2023
da525bc
Change width for patientsActions columns
projkov Oct 11, 2023
838327f
Update InvoiceDetails view
projkov Oct 12, 2023
e9378f0
Add humanized output of Invoice status
projkov Oct 12, 2023
74b06fa
Add spinner when loading InvoiceList, InvoiceDetails
projkov Oct 12, 2023
0ba583f
Add method to extract id and type from FHIRReference
projkov Oct 12, 2023
97fabe3
Remove unused types
projkov Oct 12, 2023
c7630ab
Fix practitioner select options
projkov Oct 12, 2023
4d1ec20
Add type for useParams
projkov Oct 12, 2023
2440b43
Remove non-null assertion operator
projkov Oct 12, 2023
b33a776
Remove inline styles from the table footer
projkov Oct 12, 2023
e260b2a
Fixes related to the translate and storing types
projkov Oct 12, 2023
7b04cbb
Add invoice demo data
projkov Oct 12, 2023
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
20 changes: 20 additions & 0 deletions resources/seeds/ChargeItemDefinition/consultation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
url: https://emr.beda.software/charge-item/consultation
meta:
profile:
- https://beda.software/beda-emr-charge-item-definition
status: active
propertyGroup:
- priceComponent:
- type: base
amount:
value: 50
currency: USD
- type: tax
amount:
value: 10
currency: USD
healthcareService:
id: consultation
resourceType: HealthcareService
id: consultation
resourceType: ChargeItemDefinition
20 changes: 20 additions & 0 deletions resources/seeds/ChargeItemDefinition/follow-up.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
url: https://emr.beda.software/charge-item/follow-up
meta:
profile:
- https://beda.software/beda-emr-charge-item-definition
status: active
propertyGroup:
- priceComponent:
- type: base
amount:
value: 25
currency: USD
- type: tax
amount:
value: 2
currency: USD
healthcareService:
id: follow-up
resourceType: HealthcareService
id: follow-up
resourceType: ChargeItemDefinition
14 changes: 14 additions & 0 deletions resources/seeds/Mapping/cancel-invoice-extract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resourceType: Mapping
id: cancel-invoice-extract
body:
$let:
currentInvoiceId: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='current-invoice-id').answer.valueString").0
$body:
resourceType: Bundle
type: transaction
entry:
- request:
url: $ "/Invoice/" + currentInvoiceId
method: PATCH
resource:
status: cancelled
80 changes: 80 additions & 0 deletions resources/seeds/Mapping/complete-encounter-extract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
resourceType: Mapping
id: complete-encounter-extract
body:
$let:
currentEncounterId: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='current-encounter-id').answer.valueString").0
startDateTime: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='start-dateTime').answer.valueDateTime").0
endDateTime: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='end-dateTime').answer.valueDateTime").0
chargeItemDefinitionUrl: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='charge-item-definition-url').answer.valueString").0
priceBase: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='price-base').answer.valueDecimal").0
priceTax: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='price-tax').answer.valueDecimal").0
serviceName: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='healthcare-service-name').answer.valueString").0
serviceCode: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='healthcare-service-code').answer.valueString").0
$body:
$let:
selectedSubjectReference:
$call: splitStr
$args:
- $ CurrentEncounter.subject.reference
- "/"
selectedPractitionerRoleReferenceSplit:
$call: splitStr
$args:
- $ CurrentEncounter.participant.0.individual.reference
- "/"
$body:
resourceType: Bundle
type: transaction
entry:
- request:
url: $ "/Encounter/" + currentEncounterId
method: PATCH
resource:
status: finished
period:
start: $ startDateTime
end: $ endDateTime
- request:
url: $ "/ChargeItem/"
method: POST
fullUrl: urn:uuid:charge-item-id
resource:
subject:
resourceType: $ selectedSubjectReference.0
id: $ selectedSubjectReference.1
display: $ CurrentEncounter.subject.display
status: planned
code:
text: $ serviceName
coding:
- code: $ serviceCode
system: http://beda.software/custom-healthcare-service-list
display: $ serviceName
definitionCanonical:
- $ chargeItemDefinitionUrl
- request:
url: "/Invoice/"
method: POST
resource:
lineItem:
- chargeItem:
Reference:
uri: urn:uuid:charge-item-id
priceComponent:
- type: base
amount:
value: $ priceBase
- type: tax
amount:
value: $ priceTax
date: $ endDateTime
status: issued
subject:
resourceType: $ selectedSubjectReference.0
id: $ selectedSubjectReference.1
display: $ CurrentEncounter.subject.display
participant:
- actor:
resourceType: $ selectedPractitionerRoleReferenceSplit.0
id: $ selectedPractitionerRoleReferenceSplit.1
display: $ CurrentEncounter.participant.0.individual.display
49 changes: 49 additions & 0 deletions resources/seeds/Mapping/healthcare-service-create-extract.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ body:
visitTypeCode: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='visit-type-code').answer.valueString").0
visitTypeName: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='visit-type-name').answer.valueString").0
comment: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='comment').answer.valueString").0
priceBase: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='price-base').answer.valueDecimal").0
priceTax: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='price-tax').answer.valueDecimal").0
$body:
type: transaction
entry:
- request:
url: /HealthcareService
method: POST
fullUrl: urn:uuid:healthcare-service-id
resource:
name: $ visitTypeName
duration: $ duration
Expand All @@ -26,6 +29,52 @@ body:
meta:
profile:
- https://beda.software/beda-emr-healthcare-service
- request:
url: /ChargeItemDefinition
method: POST
fullUrl: urn:uuid:charge-item-definition-id
resource:
url: $ 'https://emr.beda.software/charge-item/' + visitTypeCode
status: active
title: $ visitTypeName
propertyGroup:
- priceComponent:
- type: base
amount:
value: $ priceBase
currency: USD
- type: tax
amount:
value: $ priceTax
currency: USD
healthcareService:
uri: urn:uuid:healthcare-service-id
resourceType: HealthcareService
meta:
profile:
- https://beda.software/beda-emr-charge-item-definition
# - request:
# url: /ChargeItem
# method: POST
# resource:
# status: planned
# definitionCanonical:
# - urn:uuid:charge-item-definition-id
# resourceType: ChargeItem
# subject:
# resourceType: Group
# id: patients-group
# quantity:
# value: 1
# unit: "procedure"
# system: "http://unitsofmeasure.org"
# code: "proc"
# code:
# text: $ visitTypeName
# coding:
# - code: $ visitTypeCode
# display: $ visitTypeName
# system: http://beda.software/custom-healthcare-service-list
resourceType: Bundle
id: healthcare-service-create-extract
resourceType: Mapping
17 changes: 17 additions & 0 deletions resources/seeds/Mapping/healthcare-service-edit-extract.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
body:
$let:
healthcareServiceId: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='healthcareServiceId').answer.valueString").0
chargeItemDefinitionId: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='charge-item-definition-id').answer.valueString").0
duration: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='duration').answer.valueInteger").0
visitTypeCode: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='visit-type-code').answer.valueString").0
visitTypeName: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='visit-type-name').answer.valueString").0
comment: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='comment').answer.valueString").0
priceBase: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='price-base').answer.valueDecimal").0
priceTax: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='price-tax').answer.valueDecimal").0
$body:
type: transaction
entry:
Expand All @@ -20,6 +23,20 @@ body:
- code: $ visitTypeCode
display: $ visitTypeName
system: http://beda.software/custom-healthcare-service-list
- request:
url: $ "/ChargeItemDefinition/" + chargeItemDefinitionId
method: PATCH
resource:
propertyGroup:
- priceComponent:
- type: base
amount:
value: $ priceBase
currency: USD
- type: tax
amount:
value: $ priceTax
currency: USD
resourceType: Bundle
id: healthcare-service-edit-extract
resourceType: Mapping
14 changes: 14 additions & 0 deletions resources/seeds/Mapping/pay-invoice-extract.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resourceType: Mapping
id: pay-invoice-extract
body:
$let:
currentInvoiceId: $ fhirpath("QuestionnaireResponse.repeat(item).where(linkId='current-invoice-id').answer.valueString").0
$body:
resourceType: Bundle
type: transaction
entry:
- request:
url: $ "/Invoice/" + currentInvoiceId
method: PATCH
resource:
status: balanced
31 changes: 31 additions & 0 deletions resources/seeds/Questionnaire/cancel-invoice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
resourceType: Questionnaire
id: cancel-invoice
status: active
title: Change invoice status
mapping:
- id: cancel-invoice-extract
resourceType: Mapping
launchContext:
- name:
code: Invoice
type:
- Invoice
description: The invoice to change status
item:
- type: group
linkId: root-group
item:
- text: Current Invoice ID
type: string
linkId: current-invoice-id
hidden: true
initialExpression:
language: text/fhirpath
expression: "%Invoice.id"
- text: Are you sure to cancel this invoice?
linkId: are-you-sure
type: display
url: https://aidbox.emr.beda.software/ui/console#/entities/Questionnaire/change-invoice-status
meta:
profile:
- https://beda.software/beda-emr-questionnaire
Loading
Loading