-
-
{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]}
- // //
- //
- // )
- // });
- // }
-
- // }
+
+ }
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)}
+ : ""}
+
+
+ }
)
}