diff --git a/docs/users/erpnext-openmrs.md b/docs/users/erpnext-openmrs.md index dc13954..0f0b060 100644 --- a/docs/users/erpnext-openmrs.md +++ b/docs/users/erpnext-openmrs.md @@ -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"] -``` \ No newline at end of file +``` diff --git a/docs/users/odoo-openmrs.md b/docs/users/odoo-openmrs.md index ffea8ce..807d632 100644 --- a/docs/users/odoo-openmrs.md +++ b/docs/users/odoo-openmrs.md @@ -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?" @@ -48,20 +50,35 @@ flowchart LR _option 1_   An OpenMRS patient is always synchronised as an Odoo customer. -### **2**   OpenMRS Billable Items ⭆ Odoo Quotation +### **2**   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**   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**   OpenMRS Billable Item → Odoo Quotation Item +### **4**   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"] -``` \ No newline at end of file +```