@@ -446,56 +602,57 @@ export default class PatientBox extends Component {
- Gender: {patient.gender}
+ Full Name: {fullName}
- Age: {getAge(patient.birthDate)}
+ Gender: {patient.gender.charAt(0).toUpperCase() + patient.gender.slice(1)}
+
+
+ DoB/Age: {formatBirthdate} ({getAge(patient.birthDate)} years old)
-
- Request:
- {!options.length && returned ? (
- No requests
- ) : (
- this.makeDropdown(
- options,
- 'Select a medication request',
- this.state.request,
- this.handleRequestChange
- )
- )}
-
-
-
- In Progress Form:
-
-
-
+
+ { this.state.showMedications ?
+ } onClick={() => this.setState({ showMedications: false })}>Close Medications
+ :
+
+ } disabled={options.length === 0} onClick={() => {
+ this.updatePatient(patient);
+ this.setState({ showMedications: true, showQuestionnaires: false });
+ }}>Request New Medication
- {!responseOptions.length && returned ? (
- No in progress forms
- ) : (
- this.makeDropdown(
- responseOptions,
- 'Choose an in-progress form',
- this.state.response,
- this.handleResponseChange
- )
- )}
-
+ }
+ { this.state.showQuestionnaires ?
+ } onClick={() => this.setState({ showQuestionnaires: false })}>Close In Progress Forms
+ :
+
+
+ } disabled={this.state.numInProgressForms === 0} onClick={() => {
+ this.updatePatient(patient);
+ this.setState({ showQuestionnaires: true, showMedications: false });
+ }}>{this.state.numInProgressForms} Form(s) In Progress
+
+
+ }
+
+ { this.state.showMedications ?
+
+ { this.makeResponseTable(medicationColumns, options, 'medication', patient) }
+
+ :
}
+ { this.state.showQuestionnaires ?
+
+ { this.makeQuestionnaireTable(questionnaireColumns, responseOptions, 'questionnaire', patient) }
+
+ :
}
);
}
diff --git a/src/components/SMARTBox/smart.css b/src/components/SMARTBox/smart.css
index 243de77e..f95cd6dd 100644
--- a/src/components/SMARTBox/smart.css
+++ b/src/components/SMARTBox/smart.css
@@ -11,9 +11,28 @@ html{
padding:10px 10px 15px 10px;
flex:1;
background-color: #ddd;
- display: grid;
- grid-template-columns: 15% 35% 35% 10%;
- column-gap: 5px;
+ display: flex;
+ justify-content: space-between;
+}
+.button-options {
+ display: flex;
+ column-gap: 12px;
+}
+
+.patient-table-info {
+ /* display: flex; */
+ margin-bottom: 10px;
+}
+tr:nth-child(odd) {
+ background-color: #ddd !important;
+}
+.hover-row:hover {
+ background-color: #E7F1FF !important;
+}
+
+.big-button {
+ display: flex !important;
+ flex-direction: column !important;
}
.patient-box{
@@ -63,12 +82,9 @@ html{
float:right;
}
-.patient-info {
- display:inline-block;
-}
-
.request-info {
- display: inherit;
+ display: flex;
+ flex-direction: column;
}
@@ -84,9 +100,7 @@ html{
}
.select-btn {
- height: 40px;
- align-self: center;
- margin-top: 25px !important;
+ height: 52px;
}
.emptyForm {
diff --git a/src/containers/RequestBuilder.js b/src/containers/RequestBuilder.js
index eba3a64c..a75d266c 100644
--- a/src/containers/RequestBuilder.js
+++ b/src/containers/RequestBuilder.js
@@ -28,7 +28,7 @@ export default class RequestBuilder extends Component {
patient: {},
expanded: false,
patientList: [],
- response: null,
+ response: {},
code: null,
codeSystem: null,
display: null,
@@ -298,6 +298,8 @@ export default class RequestBuilder extends Component {
getPatients = {this.getPatients}
searchablePatients={this.state.patientList}
client={this.props.client}
+ request={this.state.request}
+ launchUrl={this.state.launchUrl}
callback={this.updateStateElement}
callbackList={this.updateStateList}
callbackMap={this.updateStateMap}