Skip to content

Commit

Permalink
health registry updates
Browse files Browse the repository at this point in the history
  • Loading branch information
awatson1978 committed Jun 1, 2023
1 parent 63afa3b commit c5dfb97
Show file tree
Hide file tree
Showing 20 changed files with 569 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .meteor/.versions
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ [email protected]
clinical:[email protected]
clinical:[email protected]
clinical:[email protected]
clinical:hl7-fhir-data-infrastructure@6.28.2
clinical:hl7-fhir-data-infrastructure@6.33.0
clinical:[email protected]
[email protected]
[email protected]
Expand Down
11 changes: 8 additions & 3 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ littledata:synced-cron
clinical:[email protected]
clinical:[email protected]
clinical:[email protected]
clinical:hl7-fhir-data-infrastructure@6.28.2
clinical:hl7-fhir-data-infrastructure@6.33.0
clinical:json-routes
# clinical:vault-server
clinical:vault-server
clinical:uscore

# TESTING
Expand All @@ -64,5 +64,10 @@ clinical:uscore
# omega:meteor-desktop-bundler@=2.2.5

symptomatic:data-importer
mitre:flightsuit
symptomatic:data-relay
symptomatic:timelines
mitre:flightsuit
mitre:consent-engine
mitre:space-health-registry
mitre:deqm-report-generator

14 changes: 10 additions & 4 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ [email protected]
clinical:[email protected]
clinical:[email protected]
clinical:[email protected]
clinical:hl7-fhir-data-infrastructure@6.32.3
clinical:hl7-fhir-data-infrastructure@6.33.0
clinical:[email protected]
clinical:[email protected]
clinical:[email protected]
clinical:[email protected]
[email protected]
[email protected]
[email protected]
Expand Down Expand Up @@ -62,10 +63,14 @@ [email protected]
matb33:[email protected]
[email protected]
[email protected]
meteorhacks:[email protected]
[email protected]
[email protected]
[email protected]
mitre:[email protected]
mitre:[email protected]
mitre:[email protected]
mitre:[email protected]
mitre:[email protected]
[email protected]
[email protected]
[email protected]
Expand Down Expand Up @@ -99,8 +104,9 @@ [email protected]
[email protected]
[email protected]
[email protected]
symptomatic:[email protected]
symptomatic:[email protected]
symptomatic:[email protected]
symptomatic:[email protected]
symptomatic:[email protected]
[email protected]
tmeasday:[email protected]
[email protected]
Expand Down
2 changes: 2 additions & 0 deletions app/accounts/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ const Login = function({ history }){
Session.set('accountsAccessToken', get(tokens, 'accessToken'))
Session.set('accountsRefreshToken', get(tokens, 'refreshToken'))
}



}
});
Expand Down
3 changes: 3 additions & 0 deletions app/accounts/SignUp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ const Signup = function({ history }){
}

console.log('Logging in with the same information.')
if(!get(Meteor, 'settings.public.interfaces.accountsServer.host')){
alert('AccountsServer not configured. Please check settings file.')
}
await loginWithService('password', {
user: {
email: values.email
Expand Down
85 changes: 85 additions & 0 deletions app/components/NoDataWrapper.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import React, { useState } from 'react';

import { Button, Grid, CardHeader, CardContent, Typography } from '@material-ui/core';
import { StyledCard, PageCanvas } from 'fhir-starter';


import PropTypes from 'prop-types';



export function NoDataWrapper(props){

let {
children,
dataCount,
title,
subheader,
noDataImagePath,
buttonLabel,
marginTop,
redirectPath,
...otherProps
} = props;

// Meteor.absoluteUrl() + noDataImage

function handleOpenPage(){
if(redirectPath){
props.history.replace(redirectPath);
} else {
props.history.replace("/");
}
}

let dataManagementElements;
if(dataCount > 0){
dataManagementElements = children;
} else {
let noDataImageElement;
if(noDataImagePath){
noDataImageElement = <img src={noDataImagePath} style={{width: '100%', marginTop: marginTop}} />;
}
dataManagementElements = <Grid justify="center" container spacing={8} style={{marginTop: '0px', marginBottom: '80px'}}>
<Grid item md={6}>
<CardHeader title={title} subheader={subheader} />
{ noDataImageElement }
<CardContent>
<Button
fullWidth
variant="contained"
color="primary"
onClick={handleOpenPage.bind(this)}
>{buttonLabel}</Button>

</CardContent>
</Grid>
</Grid>
}

return(dataManagementElements);
}



NoDataWrapper.propTypes = {
dataCount: PropTypes.number,
title: PropTypes.string,
subheader: PropTypes.string,
buttonLabel: PropTypes.string,
noDataImagePath: PropTypes.string,
marginTop: PropTypes.string,
redirectPath: PropTypes.string
};

NoDataWrapper.defaultProps = {
dataCount: 0,
title: "No Data",
subheader: "Click the button to begin importing data.",
buttonLabel: "Import Data",
noDataImagePath: "NoData.png",
marginTop: "0px",
redirectPath: "/import-data"
}

export default NoDataWrapper
106 changes: 106 additions & 0 deletions app/components/NotSignedInWrapper.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import React, { useState } from 'react';

import { Button, Grid, CardHeader, CardContent, Typography } from '@material-ui/core';
import { StyledCard, PageCanvas } from 'fhir-starter';

import { ReactMeteorData, useTracker } from 'meteor/react-meteor-data';
import PropTypes from 'prop-types';



export function NotSignedInWrapper(props){

let {
children,
dataCount,
title,
subheader,
notSignedInImagePath,
buttonLabel,
marginTop,
redirectPath,
...otherProps
} = props;

// Meteor.absoluteUrl() + noDataImage

let currentUser = null;
currentUser = useTracker(function(){
return Session.get("currentUser");
}, []);

function handleOpenPage(){
if(redirectPath){
props.history.replace(redirectPath);
} else {
props.history.replace("/");
}
}

function toggleLoginDialog(){
// console.log('Toggle login dialog open/close.')
Session.set('mainAppDialogJson', false);
Session.set('mainAppDialogMaxWidth', "sm");

if(Session.get('currentUser')){
Session.set('mainAppDialogTitle', "Logout");
Session.set('mainAppDialogComponent', "LogoutDialog");
} else {
Session.set('mainAppDialogTitle', "Login");
Session.set('mainAppDialogComponent', "LoginDialog");
}

Session.toggle('mainAppDialogOpen');
}

let dataManagementElements;
if(currentUser){
dataManagementElements = children;
} else {
let noUserMessageElement;
if(notSignedInImagePath){
noUserMessageElement = <img src={notSignedInImagePath} style={{width: '100%', marginTop: marginTop}} />;
}
dataManagementElements = <Grid justify="center" container spacing={8} style={{marginTop: '0px', marginBottom: '80px'}}>
<Grid item md={6}>
<CardHeader title={title} subheader={subheader} />
{ noUserMessageElement }
<CardContent>
<Button
fullWidth
variant="contained"
color="primary"
onClick={toggleLoginDialog.bind(this)}
>{buttonLabel}</Button>

</CardContent>
</Grid>
</Grid>
}

return(dataManagementElements);
}



NotSignedInWrapper.propTypes = {
dataCount: PropTypes.number,
title: PropTypes.string,
subheader: PropTypes.string,
buttonLabel: PropTypes.string,
notSignedInImagePath: PropTypes.string,
marginTop: PropTypes.string,
redirectPath: PropTypes.string
};

NotSignedInWrapper.defaultProps = {
dataCount: 0,
title: "Not Signed In",
subheader: "Lets get started.",
buttonLabel: "Sign In",
notSignedInImagePath: "",
marginTop: "0px",
redirectPath: "/import-data"
}

export default NotSignedInWrapper
2 changes: 1 addition & 1 deletion app/layout/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Session } from 'meteor/session';
import { get, has } from 'lodash';
import moment from 'moment';

import { ReactMeteorData, useTracker } from 'meteor/react-meteor-data';
import { useTracker } from 'meteor/react-meteor-data';
import PatientChartWorkflowTabs from '../patient/PatientChartWorkflowTabs';

import { FhirUtilities } from 'meteor/clinical:hl7-fhir-data-infrastructure';
Expand Down
20 changes: 15 additions & 5 deletions app/patient/AutoDashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import Grid from '@material-ui/core/Grid';

import { useTracker } from 'meteor/react-meteor-data';

import { FhirUtilities, Consents, CarePlans, CareTeams, Encounters, Procedures, Conditions, Immunizations, ImmunizationsTable, Observations, Locations, Questionnaires, QuestionnaireResponses, CarePlansTable, CareTeamsTable, LocationsTable, EncountersTable, ProceduresTable, ConditionsTable, ObservationsTable, ConsentsTable, QuestionnairesTable, QuestionnaireResponsesTable } from 'meteor/clinical:hl7-fhir-data-infrastructure';
import { FhirUtilities, NoDataWrapper, Consents, CarePlans, CareTeams, Encounters, Procedures, Conditions, Immunizations, ImmunizationsTable, Observations, Locations, Questionnaires, QuestionnaireResponses, CarePlansTable, CareTeamsTable, LocationsTable, EncountersTable, ProceduresTable, ConditionsTable, ObservationsTable, ConsentsTable, QuestionnairesTable, QuestionnaireResponsesTable } from 'meteor/clinical:hl7-fhir-data-infrastructure';
import { get } from 'lodash';

import PatientCard from './PatientCard';

// import NoDataWrapper from "../components/NoDataWrapper";



Expand Down Expand Up @@ -504,9 +504,19 @@ export function AutoDashboard(props){
autoDashboardContent = patientIntakeLayout;
break;
}

return (
autoDashboardContent

let autoDashboardNoDataPath = get(Meteor, 'settings.public.smartOnFhir.autoDashboardNoDataPath', '/patients');

return (<NoDataWrapper
dataCount={data.selectedPatient ? 1 : 0}
noDataImagePath=""
history={props.history}
title="No Patient Selected"
buttonLabel="Lookup Patient"
redirectPath={autoDashboardNoDataPath}
>
{ autoDashboardContent }
</NoDataWrapper>
)
}

Expand Down
15 changes: 13 additions & 2 deletions app/patient/PatientChart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ import { useTracker } from 'meteor/react-meteor-data';

import { LayoutHelpers } from 'meteor/clinical:hl7-fhir-data-infrastructure';

export default function PatientChart() {
import NoDataWrapper from "../components/NoDataWrapper";
import NotSignedInWrapper from "../components/NotSignedInWrapper";

export default function PatientChart(props) {
let headerHeight = 64;
if(get(Meteor, 'settings.public.defaults.prominantHeader')){
headerHeight = 128;
}


let currentUser;
currentUser = useTracker(function(){
return Session.get('currentUser')
}, [])


let fhirServerEndpoint = 'http://localhost:3100/baseR4';
Expand Down Expand Up @@ -56,7 +63,11 @@ export default function PatientChart() {
let paddingWidth = LayoutHelpers.calcCanvasPaddingWidth();

let contentToRender = <PageCanvas id='patientChart' headerHeight={headerHeight} paddingLeft={20} paddingRight={20} >
<AutoDashboard fhirServerEndpoint={fhirServerEndpoint} />
<NotSignedInWrapper notSignedInImagePath="" dataCount={currentUser}>
<AutoDashboard fhirServerEndpoint={fhirServerEndpoint} history={props.history} />
</NotSignedInWrapper>
</PageCanvas>


return (contentToRender);
}
Loading

0 comments on commit c5dfb97

Please sign in to comment.