Skip to content

Commit

Permalink
Merge pull request #109 from symptomatic/development
Browse files Browse the repository at this point in the history
Cerner SMART on FHIR Validation
  • Loading branch information
awatson1978 authored Jun 28, 2021
2 parents f600d6d + 35f74e2 commit e30882d
Show file tree
Hide file tree
Showing 420 changed files with 461,282 additions and 469 deletions.
162 changes: 162 additions & 0 deletions SETTINGS.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@



```
"public.title": "Foo",
"public.theme.showVideoBackground": false,
"public.theme.defaultVideo": "/VideoBackgrounds/GrayWaves.mp4",
"public.theme.backgroundImagePath": "/backgrounds/medical/Gradient.jpg",
"public.theme.palette.primaryColor": "#008080",
"public.theme.palette.primaryText": "rgba(255,255,255, 1) !important",
"public.theme.palette.secondaryColor": "#444444",
"public.theme.palette.secondaryText": "rgba(255, 255, 255, 1) !important",
"public.theme.palette.cardColor": "#ffffff !important",
"public.theme.palette.cardTextColor": "rgba(0, 0, 0, 1) !important",
"public.theme.palette.errorColor": "rgb(128,20,60) !important",
"public.theme.palette.errorText": "#ffffff !important",
"public.theme.palette.appBarColor": "#000000 !important",
"public.theme.palette.appBarTextColor": "#ffffff !important",
"public.theme.palette.paperColor": "#ffffff !important",
"public.theme.palette.paperTextColor": "rgba(0, 0, 0, 1) !important",
"public.theme.palette.bodyBackground": "#000000",
"public.theme.palette.canvasColor": "#f2f2f2",
"public.theme.palette.nivoTheme": "purple_orange",
"public.theme.referenceRanges.narrow": ["#69343b", "#415c4d", "#69343b"],
"public.theme.grayscaleFilter": "0%",
"public.loggingThreshold": "trace",
"public.capabilityStatement.resourceTypes": ["AuditEvents", "Bundle", "CrerePlan", "CareTeam", "Condition", "Consent", "Communication", "CommunicationRequest", "DocumentReference", "Endpoint", "List", "Goal", "Organization", "Patient", "Practitioner", "Questionnaire", "QuestionnaireResponse", "Task", "ValueSet"],
"public.smartOnFhir[].vendor": "Cerner",
"public.smartOnFhir[].client_id": "af4ff49c-7f0c-add4-ac7a-4723a9e2b61c",
"public.smartOnFhir[].scope": "launch online_access openid fhirUser profile patient/CarePlan.read patient/CareTeam.read patient/Condition.read patient/Consent.read patient/DocumentReference.read patient/Encounter.read patient/Goal.read patient/Immunization.read patient/Observation.read patient/Patient.read patient/Person.read patient/Procedure.read patient/Questionnaire.read patient/QuestionnaireResponse.read patient/RelatedPerson.read user/CarePlan.read user/CareTeam.read user/Condition.read user/Consent.read user/DocumentReference.read user/Encounter.read user/Goal.read user/Immunization.read user/Observation.read user/user.read user/Person.read user/Procedure.read user/Questionnaire.read user/QuestionnaireResponse.read user/RelatedPerson.read",
"public.smartOnFhir[].fhirServiceUrl": "https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d",
"public.smartOnFhir[].redirect_uri": "./patient-quickchart",
"public.smartOnFhir[].iss": "https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d",
"public.socialmedia.title": "Foo",
"public.socialmedia.type": "article",
"public.socialmedia.url": "https://foo.meteorapp.com/",
"public.socialmedia.image": "https://foo.meteorapp.com/packages/foo_core/assets/SocialMedia.jpeg",
"public.socialmedia.description": "foo.io care coordination app",
"public.socialmedia.site_name": "foo",
"public.socialmedia.app_id": "foo.meteorapp.com",
"public.defaults.route": "/continuity-of-care",
"public.defaults.landingPage": "/continuity-of-care",
"public.defaults.homePage": "/continuity-of-care",
"public.defaults.avatars": true,
"public.defaults.barcodes": true,
"public.defaults.dateFormat": "YYYY-MM-DD",
"public.defaults.tableRowSize": "normal",
"public.defaults.hexgridMenu": false,
"public.defaults.nfcOrbital": false,
"public.defaults.notificationMenu": false,
"public.defaults.searchbarVisible": true,
"public.defaults.prominantHeader": false,
"public.defaults.showPatientNameInHeader": false,
"public.defaults.displayUserNameInHeader": false,
"public.defaults.enablePatientOveride": false,
"public.defaults.viewportSafeArea": true,
"public.defaults.displayNavbars": true,
"public.defaults.disableHeader": false,
"public.defaults.disableFooter": false,
"public.defaults.disableCanvasSlide": true,
"public.defaults.drawerWidth": 320,
"public.defaults.initialScale": 0.6,
"public.defaults.iFrameEnabled": false,
"public.defaults.iFrameUrl": "",
"public.defaults.defaultPagePadding": 20,
"public.defaults.paginationLimit": 100,
"public.defaults.subscriptionLimit": 1000,
"public.defaults.unitsOfMeasure": ["F", "lbs", "mg/dL"],
"public.defaults.modals.maxWidth": "md",
"public.defaults.cards.height": "auto",
"public.defaults.cards.opacity": 0.95,
"public.defaults.noData.defaultTitle": "No Data Available",
"public.defaults.noData.defaultMessage": "Make sure that you've shared your Clinical Health Records data from the Apple Health app. If you've not downloaded your health data yet, you may need to contact your healthcare provider.",
"public.defaults.noData.marginTop": "-200px",
"public.defaults.registration.signInWith": false,
"public.defaults.registration.displayFullLegalName": true,
"public.defaults.registration.displayNickname": true,
"public.defaults.registration.displayGivenAndFamily": false,
"public.defaults.registration.displayFirstAndLast": false,
"public.defaults.registration.displayUsername": false,
"public.defaults.registration.displayEmail": true,
"public.defaults.registration.displayPassword": true,
"public.defaults.registration.displayInventationCode": true,
"public.defaults.routes.homePage": "/continuity-of-care",
"public.defaults.routes.landingPage": "/continuity-of-care",
"public.defaults.routes.adminWelcomePage": "/",
"public.defaults.routes.adminHomePage": "/",
"public.defaults.routes.adminDashboard": "/",
"public.defaults.header.menuIcon": "",
"public.defaults.header.patientId": false,
"public.defaults.sidebar.minibarVisible": false,
"public.defaults.sidebar.menuItems.HomePage": false,
"public.defaults.sidebar.menuItems.FhirResources": false,
"public.defaults.sidebar.menuItems.DynamicModules": true,
"public.defaults.sidebar.menuItems.SidebarWorkflows": true,
"public.defaults.sidebar.menuItems.Theme": false,
"public.defaults.sidebar.menuItems.About": true,
"public.defaults.sidebar.menuItems.ConstructionZone": false,
"public.defaults.sidebar.menuItems.Navbars": false,
"public.defaults.sidebar.menuItems.DataImport": true,
"public.defaults.sidebar.menuItems.DataExport": true,
"public.defaults.sidebar.menuItems.HealthRecords": false,
"public.defaults.sidebar.menuItems.Login": true,
"public.defaults.sidebar.menuItems.Login.availability": "web",
"public.defaults.sidebar.menuItems.Registration": true,
"public.defaults.sidebar.menuItems.Documentation": true,
"public.defaults.sidebar.menuItems.Marketing": false,
"public.defaults.sidebar.menuItems.TermsAndConditions": true,
"public.defaults.sidebar.menuItems.Privacy": true,
"public.defaults.sidebar.menuItems.QrScanner": true,
"public.defaults.sidebar.hidden": [],
"public.defaults.sidebar.adminHidden": [],
"public.defaults.sidebar.hiddenWorkflow": [],
"public.defaults.sidebar.links.documentation": "https://foo.io/",
"public.healthrecords.suppressEmptyChartMessage": true,
"public.google.analytics.trackingCode": "",
"public.google.analytics.debug": false,
"public.interfaces.default.status": "inactive",
"public.interfaces.default.channel.endpoint": "https://syntheticmass.mitre.org/v1/fhir",
"public.interfaces.default.auth.username": "",
"public.interfaces.default.auth.password": "",
"public.interfaces.symptomaticFhirServer.status": "active",
"public.interfaces.symptomaticFhirServer.channel.endpoint": "https://foo.meteorapp.com",
"public.interfaces.symptomaticFhirServer.auth.username": "foo",
"public.interfaces.symptomaticFhirServer.auth.password": "bar",
"public.interfaces.accountsServer.database": "meteor",
"public.interfaces.accountsServer.host": "https://foo.meteorapp.com",
"public.interfaces.accountsServer.port": 443,
"public.modules.data": true,
"public.modules.forum": false,
"public.modules.genome": false,
"public.modules.healthlog": false,
"public.modules.dermatograms": false,
"public.modules.telemedicine": false,
"public.modules.inbound": true,
"public.modules.outbound": true,
"public.modules.epic": false,
"public.modules.statisticsLogging": false,
"public.modules.app.ChecklistManifesto": false,
"public.modules.app.ContinuityOfCare": false,
"public.modules.app.Videoconferencing": false,
"public.modules.app.ZygoteAvatar": false,
"public.modules.fhir.AllergyIntolerances": true,
"public.modules.fhir.AuditEvents": true,
"public.modules.fhir.BodySites": true,
"public.modules.fhir.CarePlans": true,
"public.modules.fhir.Conditions": true,
"public.modules.fhir.Devices": true,
"public.modules.fhir.Questionnaires": true,
"public.modules.healthkit.importDestination": "client",
"private.invitationCode": "foo",
"private.fhir.disableOauth": true,
"private.fhir.schemaValidation.filter": false,
"private.fhir.schemaValidation.validate": false,
"private.fhir.fhirPath": "baseR4",
"private.fhir.rest.AuditEvent.interactions": ["read", "create"],
"private.fhir.rest.AuditEvent.search": true,
"private.fhir.rest.ValueSet.interactions": ["read", "create"],
"private.fhir.rest.ValueSet.search": true
```
4 changes: 4 additions & 0 deletions app/FhirClientContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ export const FhirClientContext = React.createContext({
client: null,
setClient: function(client) {
context.client = client;
},
patientId: null,
setPatientId: function(client) {
context.client = client;
}
});

Expand Down
27 changes: 0 additions & 27 deletions app/core/AppLoadingPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,6 @@ function AppLoadingPage(props) {
logger.verbose('client.app.layout.AppLoadingPage');
}

// let searchParams = new URLSearchParams(useLocation().search);

// if(searchParams){
// console.log("Storing state received by Loading page into Session variable.", searchParams.state);

// searchParams.forEach(function(value, key){
// console.log(key + ': ' + value);
// });

// if(searchParams.get('iss')){
// Session.set('smartOnFhir_iss', searchParams.get('iss'));
// }
// if(searchParams.get('launch')){
// Session.set('smartOnFhir_launch', searchParams.get('launch'));
// }
// if(searchParams.get('code')){
// Session.set('smartOnFhir_code', searchParams.get('code'));
// }
// if(searchParams.get('scope')){
// Session.set('smartOnFhir_scope', searchParams.get('scope'));
// }

// if(searchParams.state){
// Session.set('smartOnFhir_state', searchParams.state);
// }
// }

//--------------------------------------------------------------------------------
// Props

Expand Down
28 changes: 19 additions & 9 deletions app/core/LaunchPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,45 @@ function LaunchPage(props) {
//--------------------------------------------------------------------------------
// Query Parameters

let searchParams = new URLSearchParams(useLocation().search);
let useLocationSearch = useLocation().search
let searchParams = new URLSearchParams(useLocationSearch);


//--------------------------------------------------------------------------------
// Component Life Cycle Functions

useEffect(function(){

let smartOnFhirConfig;
if(Array.isArray(get(Meteor, 'settings.public.smartOnFhir'))){
Meteor.settings.public.smartOnFhir.forEach(function(config){
if(useLocationSearch.includes(config.vendorKeyword) && (config.launchContext === "Provider")){
smartOnFhirConfig = config;
}
})
}

let smartConfig = {
clientId: get(Meteor, 'settings.public.smartOnFhir[0].client_id'),
scope: get(Meteor, 'settings.public.smartOnFhir[0].scope'),
redirectUri: get(Meteor, 'settings.public.smartOnFhir[0].redirect_uri') // ./fhir-quer
clientId: get(smartOnFhirConfig, 'client_id'),
scope: get(smartOnFhirConfig, 'scope'),
redirectUri: get(smartOnFhirConfig, 'redirect_uri') // ./fhir-quer
}

if(searchParams.get('iss')){
// we prefer using an ?iss parameter from the URL
// this is how we typically launch from the big EHR systems
smartConfig.iss = searchParams.get('iss')
//Session.set('smartOnFhir_iss', searchParams.get('iss'))
} else if (get(Meteor, 'settings.public.smartOnFhir[0].iss')){
} else if (get(smartOnFhirConfig, 'iss')){
// if we're testing how the launcher works, we can set the iss in the settings file
// this is marginally useful in blockchain and multi-tenant hosting environments
smartConfig.iss = get(Meteor, 'settings.public.smartOnFhir[0].iss');
//Session.set('smartOnFhir_iss', get(Meteor, 'settings.public.smartOnFhir[0].iss'))
smartConfig.iss = get(smartOnFhirConfig, 'iss');
//Session.set('smartOnFhir_iss', get(smartOnFhirConfig, 'iss'))
} else {
// otherwise, we resort to using a stand-alone app without launch context
// this is mostly used for HAPI test servers, not Cerner and Epic
smartConfig.fhirServiceUrl = get(Meteor, 'settings.public.smartOnFhir[0].fhirServiceUrl');
//Session.set('smartOnFhir_iss', get(Meteor, 'settings.public.smartOnFhir[0].fhirServiceUrl'))
smartConfig.fhirServiceUrl = get(smartOnFhirConfig, 'fhirServiceUrl');
//Session.set('smartOnFhir_iss', get(smartOnFhirConfig, 'settings.public.smartOnFhir[0].fhirServiceUrl'))
}

SMART.authorize(smartConfig);
Expand Down
29 changes: 0 additions & 29 deletions app/core/QrScannerPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,6 @@ if(Meteor.isClient){
Session.setDefault('adult_icu_bed_utilization', 0);
}

//==========================================================================================
// Dynamic Theme

import { HTTP } from 'meteor/http';

Meteor.startup(function(){

if(Meteor.isClient){
if(window.navigator){
window.navigator.geolocation.getCurrentPosition(function(position){
Session.set('myLatitude', get(position, 'coords.latitude'));
Session.set('myLongitude', get(position, 'coords.longitude'));

let icuCapacityUrl = "https://healthzones.symptomatic.us/icu-capacity-at-my-location?latitude=" + get(position, 'coords.latitude') + "&longitude=" + get(position, 'coords.longitude')
console.log('icuCapacityUrl', icuCapacityUrl);

HTTP.get(icuCapacityUrl, function(error, result){
if(error) console.log('error', error)
if(result) {
let parsedResults = JSON.parse(result.content);
console.log('parsedResults', parsedResults)

Session.set('adult_icu_bed_utilization', get(parsedResults, 'adult_icu_bed_utilization'))
}
})
})
}
}
})



Expand Down
9 changes: 6 additions & 3 deletions app/layout/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import AppLoadingPage from '../core/AppLoadingPage'
import PatientChart from '../patient/PatientChart'
import PatientQuickChart from '../patient/PatientQuickChart'
import LaunchPage from '../core/LaunchPage'
import SmartLauncher from '../layout/SmartLauncher'

import QrScannerPage from '../core/QrScannerPage';
import ConstructionZone from '../core/ConstructionZone';
Expand All @@ -47,7 +48,7 @@ import useStyles from '../Styles';

import { useSwipeable } from 'react-swipeable';

//=============================================================================================================================================
//===============================================================================================================
// Analytics

let analyticsTrackingCode = get(Meteor, 'settings.public.google.analytics.trackingCode')
Expand Down Expand Up @@ -145,7 +146,7 @@ Object.keys(Package).forEach(function(packageName){
});

let defaultHomeRoute = MainPage;
let launchPage = LaunchPage;
let defaultLaunchPage = LaunchPage;

// logger.debug('Loading the following dynamic routes: ', dynamicRoutes)
// console.log('headerNavigation', headerNavigation)
Expand Down Expand Up @@ -588,9 +589,11 @@ export function App(props) {
ProjectPage

<Route name='ProjectPage' key='ProjectPage' path="/project-page" exact component={ ProjectPage } />
<Route name='SmartLauncher' key='SmartLauncher' path="/smart-launcher" exact component={ SmartLauncher } />
<Route name='patientChartRoute' key='patientChartPage' path="/patient-chart" exact component={ PatientChart } />
<Route name='patientIntakeRoute' key='patientIntakePage' path="/patient-intake" exact component={ PatientQuickChart } />
<Route name='quickChartRoute' key='quickChartPage' path="/patient-quickchart" exact component={ PatientQuickChart } />
<Route name='launchRoute' key='smartOnFhirLaunchPage' path="/launcher" exact component={ launchPage } />
<Route name='launchRoute' key='defaultLaunchPage' path="/launcher" exact component={ defaultLaunchPage } />
<Route name='landingPageRoute' key='landingPageRoute' path="/app-loading-page" component={ AppLoadingPage } />
<Route name='defaultHomeRoute' key='defaultHomeRoute' path="/" exact component={ defaultHomeRoute } />
<Route name='notFoundRoute' key='notFoundRoute' path="*" component={ NotFound } />
Expand Down
Loading

0 comments on commit e30882d

Please sign in to comment.