diff --git a/backend/src/controllers/costCentreController.js b/backend/src/controllers/costCentreController.js index 7a4291ea..59571ce2 100644 --- a/backend/src/controllers/costCentreController.js +++ b/backend/src/controllers/costCentreController.js @@ -33,6 +33,7 @@ export default class CostCentreController { const costCenterData = { cost_center_id: req.body.cost_center_id, cost_center_name: req.body.cost_center_name, + cost_center_investigator: req.body.cost_center_investigator, cost_center_contact: req.body.cost_center_contact, cost_center_email: req.body.cost_center_email, cost_center_address: req.body.cost_center_address, diff --git a/backend/src/models/costCentre.js b/backend/src/models/costCentre.js index 8c9d18d1..7260b604 100644 --- a/backend/src/models/costCentre.js +++ b/backend/src/models/costCentre.js @@ -55,10 +55,11 @@ export class CostCentre { insertCostCentre(newCostCentre, result) { con.query( - "CALL save_cost_center(?, ?, ?, ?, ?, ?)", + "CALL save_cost_center(?, ?, ?, ?, ?, ?, ?)", [ newCostCentre.cost_center_id, newCostCentre.cost_center_name, + newCostCentre.cost_center_investigator, newCostCentre.cost_center_contact, newCostCentre.cost_center_email, newCostCentre.cost_center_address, diff --git a/database/init/cost_centers.sql b/database/init/cost_centers.sql index f60cbcad..514f2868 100644 --- a/database/init/cost_centers.sql +++ b/database/init/cost_centers.sql @@ -11,6 +11,7 @@ BEGIN CREATE TABLE `cost_centers` ( cost_center_id VARCHAR(50) NOT NULL, cost_center_name VARCHAR(50), + cost_center_investigator VARCHAR(255), cost_center_contact VARCHAR(255), cost_center_email VARCHAR(255), cost_center_address VARCHAR(255), diff --git a/database/procedures/costCenterProc.sql b/database/procedures/costCenterProc.sql index 6017263b..a421893c 100644 --- a/database/procedures/costCenterProc.sql +++ b/database/procedures/costCenterProc.sql @@ -9,6 +9,7 @@ DELIMITER $$ CREATE PROCEDURE `save_cost_center` ( IN `_cost_center_id` VARCHAR(50), IN `_cost_center_name` VARCHAR(50), + IN `_cost_center_investigator` VARCHAR(255), IN `_cost_center_contact` VARCHAR(255), IN `_cost_center_email` VARCHAR(255), IN `_cost_center_address` VARCHAR(255), @@ -17,6 +18,7 @@ CREATE PROCEDURE `save_cost_center` ( INSERT INTO `cost_centers` ( `cost_center_id`, `cost_center_name`, + `cost_center_investigator`, `cost_center_contact`, `cost_center_email`, `cost_center_address`, @@ -26,6 +28,7 @@ VALUES ( `_cost_center_id`, `_cost_center_name`, + `_cost_center_investigator`, `_cost_center_contact`, `_cost_center_email`, `_cost_center_address`, @@ -33,6 +36,7 @@ VALUES ) ON DUPLICATE KEY UPDATE cost_centers.cost_center_id=_cost_center_id, cost_centers.cost_center_name=_cost_center_name, + cost_centers.cost_center_investigator=_cost_center_investigator, cost_centers.cost_center_contact=_cost_center_contact, cost_centers.cost_center_email=_cost_center_email, cost_centers.cost_center_address=_cost_center_address, diff --git a/database/procedures/formCreator/load-questions.sql b/database/procedures/formCreator/load-questions.sql index d7c80711..5a8b7bb6 100644 --- a/database/procedures/formCreator/load-questions.sql +++ b/database/procedures/formCreator/load-questions.sql @@ -92,7 +92,7 @@ END $$ CREATE PROCEDURE `load_costs` () BEGIN - SELECT question, answer, questions_cost.fk_answer_id, organization_name, cost, questions_cost.* + SELECT question, answer, questions_cost.fk_answer_id, organization_name, cost, questions_cost.*, forms.form_name FROM questions @@ -105,6 +105,9 @@ BEGIN LEFT JOIN organizations ON organizations.organization_type = questions_cost.price_category + LEFT JOIN forms + ON forms.form_id = questions.fk_form_id + WHERE cost IS NOT NULL ORDER BY position_index; diff --git a/frontend/src/components/ClinicalBox/index.css b/frontend/src/components/ClinicalBox/index.css index 2f0f8b9b..5931fd35 100644 --- a/frontend/src/components/ClinicalBox/index.css +++ b/frontend/src/components/ClinicalBox/index.css @@ -57,4 +57,17 @@ font-weight: 600; color: #DEDEDE; cursor: pointer; +} + +.clinicalXView { + flex: 0.01; + width: 50%; + text-align: left; + margin-top: 8px; +} + +.clinicalX { + width: 20px; + height: 20px; + cursor: pointer; } \ No newline at end of file diff --git a/frontend/src/components/ClinicalBox/index.js b/frontend/src/components/ClinicalBox/index.js index c7a2c7ba..571951e3 100644 --- a/frontend/src/components/ClinicalBox/index.js +++ b/frontend/src/components/ClinicalBox/index.js @@ -1,7 +1,8 @@ import { useDispatch, useSelector } from "react-redux"; import uuid from "react-uuid"; import "./index.css"; -import { ADD_CLINICAL_RESPONSE } from "../../redux/actions/formActions"; +import X from "../../assets/X.png"; +import { ADD_CLINICAL_RESPONSE, REMOVE_CLINICAL_RESPONSE } from "../../redux/actions/formActions"; function ClinicalBox({ question, option }) { const dispatch = useDispatch(); @@ -16,7 +17,7 @@ function ClinicalBox({ question, option }) {
Sample ID
-
Authorized By
+
Ordering Pathologist
{Object.values(clinicalList) .filter((value) => value.answer === option.answer_id) @@ -52,6 +53,11 @@ function ClinicalBox({ question, option }) { }} /> +
{ + dispatch({ type: REMOVE_CLINICAL_RESPONSE, payload: clinical.clinical_id }) + }}> + Delete Service +
))}
{ const columns = [ { @@ -22,7 +24,14 @@ const CostCenterTable = () => { width: "20%", }, { - title: "Principal Contact", + title: "Principal Investigator", + dataIndex: "cost_center_investigator", + key: "cost_center_investigator", + editable: true, + width: "10%", + }, + { + title: "Billing Contact", dataIndex: "cost_center_contact", key: "cost_center_contact", editable: true, @@ -40,14 +49,34 @@ const CostCenterTable = () => { dataIndex: "cost_center_email", key: "cost_center_email", editable: true, - width: "20%", + width: "10%", }, { title: "Type", dataIndex: "cost_center_type", key: "cost_center_type", - editable: true, width: "9%", + render: (_, record) => + dataSource.length >= 1 ? ( +