From dc9977ce9ff33b698e32f34d3444a83cc7a34e5a Mon Sep 17 00:00:00 2001 From: Zach Robin Date: Tue, 20 Sep 2022 00:18:48 -0700 Subject: [PATCH 1/6] Added separation between both bundles --- src/components/RemsInterface/RemsInterface.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index be166c10..dc795f13 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -203,11 +203,13 @@ export default class RemsInterface extends Component { {this.state.viewResponse ?
+

ETASU

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

Bundle

{this.renderBundle(this.props.specialtyRxBundle)}
: ""} From f90e55e9d12e97f09047edd6ea773a567b9c3915 Mon Sep 17 00:00:00 2001 From: Zach Robin Date: Tue, 20 Sep 2022 01:59:48 -0700 Subject: [PATCH 2/6] added in break lines and updated hover to be on parent div --- src/components/RemsInterface/RemsInterface.css | 12 ++++++------ src/components/RemsInterface/RemsInterface.jsx | 10 ++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/components/RemsInterface/RemsInterface.css b/src/components/RemsInterface/RemsInterface.css index 05425e8e..6d4c78fb 100644 --- a/src/components/RemsInterface/RemsInterface.css +++ b/src/components/RemsInterface/RemsInterface.css @@ -21,13 +21,14 @@ body { } .resource-entry{ - clear: both; + /* clear: both; */ border-left: 4px solid #ffcccb; padding: 5px; border-bottom: 1px solid grey; background-color: #ededed; padding-top: 20px; padding-bottom:20px; + } .resource-entry:hover { @@ -121,9 +122,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 +133,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 dc795f13..72796dbc 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -56,21 +56,17 @@ export default class RemsInterface extends Component { console.log(metReq); return (
-
-
+
{metReq.requirement.name}
{metReq.completed ? "✅" : "❌"}
{metReq.requirement.description}
-
{ metReq.childMetRequirements.map(subMetReq => -
-
+
{subMetReq.requirement.name}
{subMetReq.completed ? "✅" : "❌"}
{subMetReq.requirement.description}
-
) } @@ -203,12 +199,14 @@ export default class RemsInterface extends Component { {this.state.viewResponse ?
+

ETASU

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

Bundle

{this.renderBundle(this.props.specialtyRxBundle)}
: ""} From c61fd3e5e21c73893c21eba96ae472d2cb74ac3c Mon Sep 17 00:00:00 2001 From: Zach Robin Date: Tue, 20 Sep 2022 02:29:29 -0700 Subject: [PATCH 3/6] added break lines to pharmacy bundle to match UI --- src/components/RemsInterface/RemsInterface.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index 72796dbc..d04ee7a5 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -240,6 +240,8 @@ export default class RemsInterface extends Component { {this.state.viewPisBundle ?
+

+

Bundle

{this.renderBundle(this.props.specialtyRxBundle)}
: ""}
From bf1487fee9056f5ea69105c580086b23ece8da91 Mon Sep 17 00:00:00 2001 From: Zach Robin Date: Tue, 20 Sep 2022 08:29:07 -0700 Subject: [PATCH 4/6] Added UI view for Prescriber Forms --- .../RemsInterface/RemsInterface.jsx | 214 ++++++++++-------- 1 file changed, 125 insertions(+), 89 deletions(-) diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index d04ee7a5..b30eab11 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -57,39 +57,39 @@ export default class RemsInterface extends Component { return (
-
{metReq.requirement.name}
+
{metReq.requirement.name}
{metReq.completed ? "✅" : "❌"}
-
{metReq.requirement.description}
+
{metReq.requirement.description}
{ - metReq.childMetRequirements.map(subMetReq => + metReq.childMetRequirements.map(subMetReq =>
-
{subMetReq.requirement.name}
-
{subMetReq.completed ? "✅" : "❌"}
-
{subMetReq.requirement.description}
+
{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
- //
- //
- // ) - // }); - // } + + } + // 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
+ //
+ //
+ // ) + // }); + // } // } @@ -169,84 +169,120 @@ 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 ? -
-

-

ETASU

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

-

Bundle

- {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"} -
-
- Status: {this.state.response?.data?.doctorOrder?.dispenseStatus} -
-
- - {this.state.response?.data?.doctorOrder?._id ? - this.setState({ spinPis: false })} - /> - : "" - } +
+
+ {this.state.viewPisBundle ?
+

+

Bundle

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

Prescriber Document Status

+ +
+
+ Status: Documents successfully submitted +
+
+ - - {this.state.viewPisBundle ?
-

-

Bundle

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

+

Bundle

+ {this.renderBundle(this.props.specialtyRxBundle)} +
: ""} + +
+
+ }
) } From 918f5ea71ff9a2d89220830c1bba9a335712e69c Mon Sep 17 00:00:00 2001 From: Zach Robin Date: Tue, 20 Sep 2022 12:56:52 -0700 Subject: [PATCH 5/6] Cleaned up/ removed test code --- .../RemsInterface/RemsInterface.css | 9 ++++--- .../RemsInterface/RemsInterface.jsx | 24 ++----------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/src/components/RemsInterface/RemsInterface.css b/src/components/RemsInterface/RemsInterface.css index 6d4c78fb..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; @@ -28,7 +28,6 @@ body { background-color: #ededed; padding-top: 20px; padding-bottom:20px; - } .resource-entry:hover { @@ -46,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; @@ -72,6 +69,7 @@ body { cursor: pointer; margin-left: 15px; } + .refresh{ cursor: pointer; margin-left: 15px; @@ -85,6 +83,7 @@ body { overflow-y: scroll; height:500px; } + .jsonData{ line-height:16px; font-family: 'Courier New', Courier, monospace; @@ -100,6 +99,7 @@ body { .elementBody{ color:#adadad; } + .elementKey{ color:#343434 } @@ -113,7 +113,6 @@ body { } } - /* ETASU styling */ .resource-entry-hover{ display:none; diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index b30eab11..e7d70eb2 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -75,23 +75,6 @@ export default class RemsInterface extends Component { }); } - // 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()); @@ -102,8 +85,6 @@ export default class RemsInterface extends Component { console.log(response); console.log(response.data); }); - - } toggleBundle() { @@ -143,12 +124,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" @@ -238,7 +221,6 @@ export default class RemsInterface extends Component { /> : "" } -
@@ -248,7 +230,6 @@ export default class RemsInterface extends Component { {this.renderBundle(this.props.specialtyRxBundle)}
: ""}
- {/* */} :
@@ -270,7 +251,6 @@ export default class RemsInterface extends Component { /> : "" } -
From 1d24cd3a0dd32e6caf75c592afbcdc23b4ca4e27 Mon Sep 17 00:00:00 2001 From: Zach Robin Date: Tue, 20 Sep 2022 13:26:14 -0700 Subject: [PATCH 6/6] added in if statement to prevent PIS from receiving unnecessary POST request if prescriber document --- src/components/RemsInterface/RemsInterface.jsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index e7d70eb2..7a58f75a 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -80,11 +80,15 @@ export default class RemsInterface extends Component { 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() {