Skip to content

Commit

Permalink
OZ-592: Updated Odoo-OpenMRS flows functional documentation. (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishSiddharth authored Jun 5, 2024
1 parent 2b47681 commit 7db750a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
6 changes: 5 additions & 1 deletion docs/users/erpnext-openmrs.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ flowchart LR

Each billable item ordered in OpenMRS during a patient's visit is synchronized in ERPNext as a quotation item in the corresponding customer's draft quotation that is linked with the OpenMRS patient's visit.

When a drug or lab test order is discontinued for a patient in OpenMRS, the corresponding quotation item is removed from the related ERPNext quotation.

If all quotation items are removed from a quotation, the quotation is marked as cancelled.

``` mermaid
flowchart LR
a["OpenMRS billable item"]-- 1-to-1 -->b["ERPNext quotation item"]
```
```
39 changes: 28 additions & 11 deletions docs/users/odoo-openmrs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@
participant Odoo
OpenMRS->>Ozone: Patients
Ozone->>Odoo: Customers
OpenMRS->>Ozone: Visits
OpenMRS->>Ozone: Drug orders
OpenMRS->>Ozone: Lab test orders
Ozone->>Odoo: Quotations
Ozone->>Odoo: Order lines
Ozone->>Odoo: Order Lines
```

## Flows List

|Source|Element| |Target|Element|
|:---:|:---:|:---:|:---:|:---:|
|OpenMRS|Patient||Odoo|Customer|
|OpenMRS|Billable item||Odoo|Quotation|
|OpenMRS|Billable item||Odoo|Order line|
|Source| Element | |Target| Element |
|:---:|:-------------:|:---:|:---:|:---------------:|
|OpenMRS| Patient ||Odoo| Customer |
|OpenMRS| Visit ||Odoo| Quotation |
|OpenMRS| Billable item ||Odoo| Quotation |
|OpenMRS| Billable item ||Odoo| Order line |


!!! question "What are the OpenMRS billable items?"
Expand All @@ -48,20 +50,35 @@ flowchart LR

<small>_option 1_</small> &nbsp; An OpenMRS patient is always synchronised as an Odoo customer.

### **2** &nbsp; OpenMRS Billable Items ⭆ Odoo Quotation
### **2** &nbsp; OpenMRS Visit → Odoo Quotation

As soon as the first billable item is ordered for a patient in OpenMRS a draft quotation is created in Odoo for the Odoo customer corresponding to that patient.
A new Odoo quotation is linked with an OpenMRS patient's visit as soon as the first billable item is ordered during that visit.

``` mermaid
flowchart LR
a["OpenMRS visit"]-- 1-to-1 -->b["Odoo quotation"]
```

### **3** &nbsp; OpenMRS Billable Items ⭆ Odoo Quotation

As soon as the first billable item is ordered for a patient in OpenMRS, a quotation is created in Odoo for the Odoo customer corresponding to that patient. Furthermore the quotation is linked with the OpenMRS patient's visit.

All billable items ordered for a patient within the same OpenMRS visit are added to the Odoo quotation linked with this OpenMRS visit.

``` mermaid
flowchart LR
a["OpenMRS billable items"]-- many-to-1 -->b["Odoo quotation"]
```

### **3** &nbsp; OpenMRS Billable Item → Odoo Quotation Item
### **4** &nbsp; OpenMRS Billable Item → Odoo Order Line

Each billable item ordered in OpenMRS during a patient's visit is synchronized in Odoo as an order line in the corresponding customer's quotation that is linked with the OpenMRS patient's visit.

Each billable item ordered for an OpenMRS patient is synchronized in Odoo as an order line in the corresponding customer's quotation.
When a drug or lab test order is discontinued for a patient in OpenMRS, the corresponding order line is removed from the related Odoo quotation.

If all order lines are removed from a quotation, the quotation is marked as cancelled.

``` mermaid
flowchart LR
a["OpenMRS billable item"]-- 1-to-1 -->b["Odoo order line"]
```
```

0 comments on commit 7db750a

Please sign in to comment.