Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Testing from "./components/ConsoleBox/Testing";
import UserMessage from "./components/UserMessage/UserMessage";
import TaskPopup from "./components/Popup/TaskPopup";
import PatientSelect from "./components/PatientSelect/PatientSelect";
import RemsInterface from "./components/RemsInterface/RemsInterface";

// uncomment for testing UserMessage
// let sampleError = {
Expand Down Expand Up @@ -600,8 +601,8 @@ export default class App extends Component {
>

</div>
{this.state.priorAuthClaim ? (
<PriorAuth claimBundle={this.state.priorAuthClaim} />
{this.state.specialtyRxBundle ? (
<RemsInterface specialtyRxBundle={this.state.specialtyRxBundle} />
) : (
<QuestionnaireForm
qform={this.state.questionnaire}
Expand Down
6 changes: 6 additions & 0 deletions src/components/QuestionnaireForm/QuestionnaireForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,12 @@ export default class QuestionnaireForm extends Component {
parameters: {
reference: "Parameters/param0111"
}
},
source: {
// TODO: url should be dynamically created
// also if DTR expects to recieve a response it
// will need an endpoint to recieve it at
endpoint: "http://localhost:3005"
}

}
Expand Down
51 changes: 51 additions & 0 deletions src/components/RemsInterface/RemsInterface.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
body {
margin: 0;
padding: 0;
font-family: sans-serif;

}
.left-form {
width: 50%;
float: left;
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{
border-left: 4px solid #ff6663;
background-color: #fdfdfd;
}

.resource-entry.active{
border-left: 4px solid #ff6663;
background-color: #f5f5f5;
}

.details{
margin-left: 60px;
background-color: #ededed;
width: 750px;
}


.submit-btn {
float: right;
margin-top: 6px;
}


.submit-btn:hover{
border-width:1px 3px 1px 1px;
margin-left:2px;
margin-top:8px;
}
59 changes: 59 additions & 0 deletions src/components/RemsInterface/RemsInterface.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React, { Component } from "react";
import ResourceEntry from './ResourceEntry';
import "./RemsInterface.css";

import axios from "axios";
import { SystemUpdateTwoTone } from "@material-ui/icons";


export default class RemsInterface extends Component {
constructor(props) {
super(props);
this.state = {
claimResponseBundle: null,
};

this.getAxiosOptions = this.getAxiosOptions.bind(this);
this.sendMessage = this.sendMessage.bind(this);
this.renderBundle= this.renderBundle.bind(this);
}
getAxiosOptions() {
const options = {
headers: {
Accept: "application/json",
"Content-Type": "application/json"
}
};
return options;
}

sendMessage(destination) {
console.log(this.props.specialtyRxBundle);
axios.post(destination, this.props.specialtyRxBundle, this.getAxiosOptions());
}

renderBundle() {
return this.props.specialtyRxBundle.entry.map((entry) => {
const resource = entry.resource;
console.log(resource);
return(
<div>
<ResourceEntry resource={resource}></ResourceEntry>
</div>
)
})
}
render() {
return (
<div>
<div className="container left-form">
{this.renderBundle()}
<button className="submit-btn" onClick={()=>{this.sendMessage("http://localhost:3010/api/doctorOder/FHIR")}}>Submit</button>

</div>
<div className="right-form">
</div>
</div>
)
}
}
33 changes: 33 additions & 0 deletions src/components/RemsInterface/ResourceEntry.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, {Component} from 'react'
import "./RemsInterface.css";

export default class ResourceEntry extends Component {
constructor(props) {
super(props);
this.state = {
viewDetails: null,
};
this.openDetails = this.openDetails.bind(this);

}


openDetails() {

this.setState((prevState) => {
return { viewDetails: !prevState.viewDetails };
})


}
render() {
return (
<div>
<div className={"resource-entry " + [this.state.viewDetails ? "active" : ""]} onClick={this.openDetails}>
<div>{this.props.resource["resourceType"]}</div>
</div>
{this.state.viewDetails ? <div className="details"><pre>{JSON.stringify(this.props.resource,null,'\t')}</pre></div> : null}
</div>
)
}
}