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 })
+ }}>
+
+
))}
{
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 ? (
+
diff --git a/frontend/src/redux/actions/formActions.js b/frontend/src/redux/actions/formActions.js
index b4431ac8..a7019fe1 100644
--- a/frontend/src/redux/actions/formActions.js
+++ b/frontend/src/redux/actions/formActions.js
@@ -30,6 +30,7 @@ export const ADD_OTHER_RESPONSE = "ADD_OTHER_RESPONSE";
export const REMOVE_OTHER_RESPONSE = "REMOVE_OTHER_RESPONSE";
export const ADD_CLINICAL_RESPONSE = "ADD_CLINICAL_RESPONSE";
+export const REMOVE_CLINICAL_RESPONSE = "REMOVE_CLINICAL_RESPONSE";
export const SUBMIT_FORM = "SUBMIT_FORM";
diff --git a/frontend/src/redux/api/costcenterApi.js b/frontend/src/redux/api/costcenterApi.js
index 43945659..cacac84f 100644
--- a/frontend/src/redux/api/costcenterApi.js
+++ b/frontend/src/redux/api/costcenterApi.js
@@ -83,6 +83,7 @@ export const postCostCenterApi = async (payload) => {
var data = JSON.stringify({
cost_center_id: payload.cost_center_id,
cost_center_name: payload.cost_center_name,
+ cost_center_investigator: payload.cost_center_investigator,
cost_center_contact: payload.cost_center_contact,
cost_center_email: payload.cost_center_email,
cost_center_address: payload.cost_center_address,
diff --git a/frontend/src/redux/reducers/costReducer.js b/frontend/src/redux/reducers/costReducer.js
index 90ae45bc..14db5628 100644
--- a/frontend/src/redux/reducers/costReducer.js
+++ b/frontend/src/redux/reducers/costReducer.js
@@ -69,6 +69,7 @@ const costTableServices = (state = defaultCostDataSourceData, action) => {
} else {
pricingMap.set(item.fk_answer_id, {
key: item.fk_answer_id,
+ form_name: item.form_name,
service: item.answer,
description: item.question,
idMap: {
diff --git a/frontend/src/redux/reducers/formReducer.js b/frontend/src/redux/reducers/formReducer.js
index 1b2f8621..f70d656a 100644
--- a/frontend/src/redux/reducers/formReducer.js
+++ b/frontend/src/redux/reducers/formReducer.js
@@ -32,6 +32,7 @@ import {
REMOVE_ALL_RESPONSE,
SET_DRAFTS,
SET_ALL_DRAFTS,
+ REMOVE_CLINICAL_RESPONSE,
} from "../actions/formActions";
const defaultQuestionlist = {
@@ -342,6 +343,10 @@ const clinicalResponses = (state = defaultClinicalResponses, action) => {
state[action.payload.clinical_id] = action.payload;
return { ...state };
}
+ case REMOVE_CLINICAL_RESPONSE: {
+ delete state[action.payload];
+ return { ...state };
+ }
default: {
return state;
}