Skip to content

Commit

Permalink
Clean up config.ts and update default.env
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellrgn committed Apr 19, 2024
1 parent f54530d commit 381c0b2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 74 deletions.
33 changes: 23 additions & 10 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,35 @@ COMPOSE_PROJECT_NAME=
# COMPOSE_FILE=docker-compose.yaml:docker-compose.traefik-ingress.yaml

# Enable to use static ingress overrides
COMPOSE_FILE=docker-compose.yaml:docker-compose.static-ingress.yaml
# COMPOSE_FILE=docker-compose.yaml:docker-compose.static-ingress.yaml

# Fully qualified domain name; used to configure ingress
# SERVER_NAME=foo.cirg.uw.edu

# Enable to use development overrides
# Enable to use docker development image
# COMPOSE_FILE=docker-compose.yaml:docker-compose.dev.yaml

VITE_EPIC_CLIENT_ID=
VITE_CERNER_CLIENT_ID=
# Fully qualified domain name; used to configure ingress
# SERVER_NAME=foo.cirg.uw.edu

# SHL Server API endpoint url
VITE_API_BASE=

# SHL Viewer url
VITE_VIEWER_BASE=
# VITE_VIEWER_BASE=

# Value of identifier.system needed to query Patients based on KC id
VITE_FHIR_R4_EXTERNAL_ID_SYSTEM=

# SOF client configuration
VITE_SOF_CLIENT_ID=
VITE_SOF_ISS=

# Url for the back button
VITE_BACK_URL=

# OIDC session management endpoints
VITE_OIDC_SERVER_BASE=
VITE_OIDC_CHECK_SESSION_IFRAME=
VITE_OIDC_LOGOUT_ENDPOINT=
VITE_POST_LOGOUT_REDIRECT_URI=

# FHIR Server endpoint url
VITE_INTERMEDIATE_FHIR_SERVER_BASE=
# VITE_INACTIVITY_TIMEOUT=04:00:00
# VITE_BACKUP_INACTIVITY_TIMEOUT=00:15:00
69 changes: 5 additions & 64 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,20 @@ import { toMilliseconds } from '$lib/util';

export const API_BASE = import.meta.env.VITE_API_BASE;

export const INTERMEDIATE_FHIR_SERVER_BASE = import.meta.env.VITE_INTERMEDIATE_FHIR_SERVER_BASE;

export const OIDC_BASE = import.meta.env.VITE_OIDC_SERVER_BASE;
export const CHECK_SESSION_IFRAME = import.meta.env.VITE_OIDC_CHECK_SESSION_IFRAME;
export const LOGOUT_URL = import.meta.env.VITE_OIDC_LOGOUT_ENDPOINT;

export const BACK_URL = import.meta.env.VITE_BACK_URL;

export const FHIR_R4_EXTERNAL_ID_SYSTEM = import.meta.env.VITE_FHIR_R4_EXTERNAL_ID_SYSTEM;

const timeout = (import.meta.env.VITE_INACTIVITY_TIMEOUT ?? "04:00:00").split(":").map((n) => Number(n));
export const INACTIVITY_TIMEOUT = toMilliseconds(timeout[0] ?? 0, timeout[1] ?? 0, timeout[2] ?? 0);

export const SOF_RESOURCES = [
'Patient',
'AllergyIntolerance',
// 'MedicationStatement', // Not in EPIC USCDI R4
'MedicationRequest',
'Medication', // can't search by patient; "Only an _ID search is allowed."
'Condition',
'Observation', // "Must have either code or category."
'Organization', // can't search by patient; "Only an _ID search is allowed."
'Immunization',
'Device',
// 'DeviceUseStatement', // Not in EPIC USCDI R4
'DiagnosticReport', // TODO change to subject
// 'ImagingStudy', // Not in EPIC USCDI R4
// 'Media', // Not in EPIC USCDI R4
'Practitioner', // can't search by patient; "Either name, family, or identifier is a required parameter."
'PractitionerRole', // can't search by patient; "An identifier, practitioner, organization, location, or specialty parameter is required."
'Procedure', // TODO change to subject
// 'Specimen', // Not in EPIC USCDI R4
];

export const SOF_PATIENT_RESOURCES = [
'Patient',
'DocumentReference',
// 'AllergyIntolerance',
// 'MedicationStatement', // Not in EPIC USCDI R4
// 'MedicationRequest',
// 'Medication', // can't search by patient; "Only an _ID search is allowed."
// 'Condition',
// 'Observation', // "Must have either code or category."
// 'Organization', // can't search by patient; "Only an _ID search is allowed."
// 'Immunization',
// 'Device',
// 'DeviceUseStatement', // Not in EPIC USCDI R4
// 'DiagnosticReport', // TODO change to subject
// 'ImagingStudy', // Not in EPIC USCDI R4
// 'Media', // Not in EPIC USCDI R4
// 'Practitioner', // can't search by patient; "Either name, family, or identifier is a required parameter."
// 'PractitionerRole', // can't search by patient; "An identifier, practitioner, organization, location, or specialty parameter is required."
// 'Procedure', // TODO change to subject
// 'Specimen', // Not in EPIC USCDI R4
'DocumentReference'
];

export const RESOURCE_SCOPE = SOF_PATIENT_RESOURCES.map(resourceType => `patient/${resourceType}.read`).join(" ");
Expand All @@ -64,20 +26,11 @@ const fullScope = `${keycloakScope} fhirUser ${RESOURCE_SCOPE}`;
const SOF_REDIRECT_URI = `${window.location.origin}/share`;

export const SOF_HOSTS = [
// {
// id: "smit",
// name: "SMART Health IT Demo",
// iss: "https://launch.smarthealthit.org/v/r4/sim/WzMsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/fhir",
// clientId: "<no client id>",
// scope: fullScope,
// redirect_uri: SOF_REDIRECT_URI,
// note: "Credentials provided"
// },
{
id: "keycloak",
name: "Let's Talk Tech Login",
iss: import.meta.env.VITE_SOF_ISS,//"https://fhir-auth.inform.dev.cirg.uw.edu/fhir",
clientId: import.meta.env.VITE_SOF_CLIENT_ID, // shl_creator
iss: import.meta.env.VITE_SOF_ISS,
clientId: import.meta.env.VITE_SOF_CLIENT_ID,
scope: keycloakScope,
redirect_uri: SOF_REDIRECT_URI,
note: "Credentials provided"
Expand All @@ -88,15 +41,3 @@ export const VIEWER_BASE = new URL(
(import.meta.env.VITE_VIEWER_BASE || `/view${dev ? '/index.html' : ''}`)+'#',
window.location.href
).toString();
export const PATIENT_IPS = {
'Dave deBronkart': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/11013/$summary'
}
export const EXAMPLE_IPS = {
'Maria SEATTLE Gravitate': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/14599/$summary',
'Peter Keith Jones': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/11013/$summary',
'Angela Roster': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/10965/$summary',
'Horace Skelly': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/11142/$summary',
'Anonymous': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/10999/$summary',
'Desiree': 'https://fhir.ips-demo.dev.cirg.uw.edu/fhir/Patient/Pat1-System2/$summary'
};
export const IPS_DEFAULT = 'Maria SEATTLE Gravitate';

0 comments on commit 381c0b2

Please sign in to comment.