diff --git a/src/components/RemsInterface/RemsInterface.css b/src/components/RemsInterface/RemsInterface.css index 3dd2c161..230aaba6 100644 --- a/src/components/RemsInterface/RemsInterface.css +++ b/src/components/RemsInterface/RemsInterface.css @@ -5,20 +5,26 @@ body { } .left-form { - width: 50%; + width: 48%; float: left; margin-top: 25px; margin-left: 25px; padding: 5px; } + .right-form { + width: 48%; + float: right; + margin-top: 25px; + margin-left: 25px; + padding: 5px; + } + .resource-entry{ border-left: 4px solid #ffcccb; padding: 5px; - margin-left: 10px; border-bottom: 1px solid grey; background-color: #ededed; - width: 800px; } .resource-entry:hover{ @@ -32,9 +38,8 @@ body { } .details{ - margin-left: 60px; + margin-left: 30px; background-color: #ededed; - width: 750px; } @@ -48,4 +53,35 @@ body { border-width:1px 3px 1px 1px; margin-left:2px; margin-top:8px; +} + +.status-icon{ + width: 100%; + height:5px; +} + +.bundle-entry{ + margin: 5px; +} + +.renew-icon{ + cursor: pointer; + margin-left: 15px; +} +.refresh{ + cursor: pointer; + margin-left: 15px; + animation-name: spin; + animation-duration: 500ms; + animation-iteration-count: 2; + animation-timing-function: ease-in-out; +} + +@keyframes spin { + from { + transform:rotate(0deg); + } + to { + transform:rotate(360deg); + } } \ No newline at end of file diff --git a/src/components/RemsInterface/RemsInterface.jsx b/src/components/RemsInterface/RemsInterface.jsx index 5de5a0ba..cbfd24c8 100644 --- a/src/components/RemsInterface/RemsInterface.jsx +++ b/src/components/RemsInterface/RemsInterface.jsx @@ -1,21 +1,41 @@ import React, { Component } from "react"; import ResourceEntry from './ResourceEntry'; import "./RemsInterface.css"; - import axios from "axios"; import { SystemUpdateTwoTone } from "@material-ui/icons"; - - +import Paper from "@material-ui/core/Paper"; +import FiberManualRecordIcon from '@material-ui/icons/FiberManualRecord'; +import Button from '@material-ui/core/Button'; +import AutorenewIcon from '@material-ui/icons/Autorenew'; +const colorPicker = { + "Pending": "#f0ad4e", + "Approved": "#5cb85c", +} export default class RemsInterface extends Component { + constructor(props) { super(props); this.state = { claimResponseBundle: null, + remsAdminResponse: null, + response: null, + spin: false, + spinPis: false, + viewBundle: false, + viewPisBundle: false, }; this.getAxiosOptions = this.getAxiosOptions.bind(this); this.sendRemsMessage = this.sendRemsMessage.bind(this); - this.renderBundle= this.renderBundle.bind(this); + this.renderBundle = this.renderBundle.bind(this); + this.refreshBundle = this.refreshBundle.bind(this); + this.refreshPisBundle = this.refreshPisBundle.bind(this); + this.toggleBundle = this.toggleBundle.bind(this); + this.togglePisBundle = this.togglePisBundle.bind(this); + } + + componentDidMount() { + this.sendRemsMessage(); } getAxiosOptions() { const options = { @@ -29,31 +49,137 @@ export default class RemsInterface extends Component { async sendRemsMessage() { const remsAdminResponse = await axios.post("http://localhost:8090/api/rems", this.props.specialtyRxBundle, this.getAxiosOptions()); - axios.post("http://localhost:3010/api/doctorOrder/fhir/rems", remsAdminResponse.data, this.getAxiosOptions()); + this.setState({ remsAdminResponse }); + console.log(remsAdminResponse) + axios.post("http://localhost:3010/api/doctorOrder/fhir/rems", remsAdminResponse.data, this.getAxiosOptions()).then((response) => { + this.setState({ response }); + console.log(response); + console.log(response.data); + }); + + } - renderBundle() { - return this.props.specialtyRxBundle.entry.map((entry) => { - const resource = entry.resource; - console.log(resource); - return( -