diff --git a/src/components/RemsInterface/RemsInterface.css b/src/components/RemsInterface/RemsInterface.css index 05425e8e..b43160f1 100644 --- a/src/components/RemsInterface/RemsInterface.css +++ b/src/components/RemsInterface/RemsInterface.css @@ -2,8 +2,8 @@ body { margin: 0; padding: 0; font-family: sans-serif; - } + .left-form { width: 48%; float: left; @@ -21,7 +21,7 @@ body { } .resource-entry{ - clear: both; + /* clear: both; */ border-left: 4px solid #ffcccb; padding: 5px; border-bottom: 1px solid grey; @@ -45,13 +45,11 @@ body { background-color: #ededed; } - .submit-btn { float: right; margin-top: 6px; } - .submit-btn:hover{ border-width:1px 3px 1px 1px; margin-left:2px; @@ -71,6 +69,7 @@ body { cursor: pointer; margin-left: 15px; } + .refresh{ cursor: pointer; margin-left: 15px; @@ -84,6 +83,7 @@ body { overflow-y: scroll; height:500px; } + .jsonData{ line-height:16px; font-family: 'Courier New', Courier, monospace; @@ -99,6 +99,7 @@ body { .elementBody{ color:#adadad; } + .elementKey{ color:#343434 } @@ -112,7 +113,6 @@ body { } } - /* ETASU styling */ .resource-entry-hover{ display:none; @@ -121,9 +121,9 @@ body { } .etasu-container{ - padding-bottom:10px; - padding-left: 10px; - padding-right:10px; + padding-bottom:40px; + padding-left: 20px; + padding-right:20px; } .resource-entry-text{ @@ -132,12 +132,11 @@ body { width:75%; } -.etasu-container:hover > .resource-entry-hover{ +.resource-entry:hover > .resource-entry-hover{ clear: both; display: block !important; } - .resource-entry-icon{ width:25%; float:right; diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index be166c10..7a58f75a 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -56,58 +56,39 @@ export default class RemsInterface extends Component { console.log(metReq); return (
-
-
-
{metReq.requirement.name}
+
+
{metReq.requirement.name}
{metReq.completed ? "✅" : "❌"}
-
{metReq.requirement.description}
-
+
{metReq.requirement.description}
{ - metReq.childMetRequirements.map(subMetReq => -
-
-
{subMetReq.requirement.name}
-
{subMetReq.completed ? "✅" : "❌"}
-
{subMetReq.requirement.description}
-
+ metReq.childMetRequirements.map(subMetReq => +
+
{subMetReq.requirement.name}
+
{subMetReq.completed ? "✅" : "❌"}
+
{subMetReq.requirement.description}
) }
) }); - - } - // if (jsonData) { - // return Object.keys(jsonData).map(element => { - // console.log(element); - // return ( - // //
- // // {element}: {jsonData[element] === null ? "null" : typeof jsonData[element] === "object" ? this.unfurlJson(jsonData[element], level + 1) : jsonData[element]} - // //
- //
- //
- //
TEST
- //
- //
- // ) - // }); - // } - - // } + + } async sendRemsMessage() { const remsAdminResponse = await axios.post("http://localhost:8090/rems", this.props.specialtyRxBundle, this.getAxiosOptions()); this.setState({ remsAdminResponse }); console.log(remsAdminResponse) - axios.post("http://localhost:3010/api/doctorOrder/$process-message", remsAdminResponse.data, this.getAxiosOptions()).then((response) => { - this.setState({ response }); - console.log(response); - console.log(response.data); - }); - + // Will not send post request to PIS if only for prescriber enrollment + if(this.state.remsAdminResponse?.data?.case_number){ + axios.post("http://localhost:3010/api/doctorOrder/$process-message", remsAdminResponse.data, this.getAxiosOptions()).then((response) => { + this.setState({ response }); + console.log(response); + console.log(response.data); + }); + } } toggleBundle() { @@ -147,12 +128,14 @@ export default class RemsInterface extends Component { this.setState({ response: response }); }) } + refreshBundle() { this.setState({ spin: true }); axios.get(`http://localhost:8090/rems/${this.state.remsAdminResponse.data.case_number}`).then((response) => { this.setState({ remsAdminResponse: response }); }) } + render() { const status = this.state.remsAdminResponse?.data?.status; let color = "#f7f7f7" @@ -173,78 +156,117 @@ export default class RemsInterface extends Component { colorPis = "#0275d8" } + // Checking if REMS Request (pt enrollment) || Met Requirments (prescriber Form) + let hasRemsCase = this.state.remsAdminResponse?.data?.case_number ? true : false; + return (
-
-

REMS Admin Status

- -
-
- Case Number : {this.state.remsAdminResponse?.data?.case_number || "N/A"} -
-
- Status: {this.state.remsAdminResponse?.data?.status} -
-
- - - - {this.state.remsAdminResponse?.data?.case_number ? - this.setState({ spin: false })} - /> - : "" - } + {hasRemsCase ? +
+
+

REMS Admin Status

+ +
+
+ Case Number : {this.state.remsAdminResponse?.data?.case_number || "N/A"} +
+
+ Status: {this.state.remsAdminResponse?.data?.status} +
+
+ + -
+ {this.state.remsAdminResponse?.data?.case_number ? + this.setState({ spin: false })} + /> + : "" + } -
- {this.state.viewResponse ? -
- {this.unfurlJson(this.state.remsAdminResponse?.data, 0)} -
- : - ""} - {this.state.viewBundle ?
- {this.renderBundle(this.props.specialtyRxBundle)} -
: ""} +
+ + {this.state.viewResponse ? +
+

+

ETASU

+ {this.unfurlJson(this.state.remsAdminResponse?.data, 0)} +
+ : + ""} + {this.state.viewBundle ?
+

+

Bundle

+ {this.renderBundle(this.props.specialtyRxBundle)} +
: ""} +
-
+
+

Pharmacy Status

+ +
+
+ ID : {this.state.response?.data?.doctorOrder?._id || "N/A"} +
+
+ Status: {this.state.response?.data?.doctorOrder?.dispenseStatus} +
+
+ + {this.state.response?.data?.doctorOrder?._id ? + this.setState({ spinPis: false })} + /> + : "" + } +
-
-

Pharmacy Status

- -
-
- ID : {this.state.response?.data?.doctorOrder?._id || "N/A"} + + {this.state.viewPisBundle ?
+

+

Bundle

+ {this.renderBundle(this.props.specialtyRxBundle)} +
: ""}
-
- Status: {this.state.response?.data?.doctorOrder?.dispenseStatus} -
-
- - {this.state.response?.data?.doctorOrder?._id ? - this.setState({ spinPis: false })} - /> - : "" - } +
+ : +
+
+

Prescriber Document Status

+ +
+
+ Status: Documents successfully submitted +
+
+ -
+ {this.state.remsAdminResponse?.data?.case_number ? + this.setState({ spin: false })} + /> + : "" + } +
- - {this.state.viewPisBundle ?
- {this.renderBundle(this.props.specialtyRxBundle)} -
: ""} -
- {/* */} +
+ {this.state.viewBundle ?
+

+

Bundle

+ {this.renderBundle(this.props.specialtyRxBundle)} +
: ""} +
+
+ }
) }