-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathApp.tsx
More file actions
73 lines (64 loc) · 2.59 KB
/
App.tsx
File metadata and controls
73 lines (64 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import React, { useState } from "react";
import { Router } from "./react-router";
import Routes from "./navigation/Routes";
import { AppLoading } from "expo";
import * as Font from "expo-font";
import { Ionicons } from "@expo/vector-icons";
import * as Linking from "expo-linking";
import { FhirProvider, FhirProviderProps } from "./smartmarkers-router";
import { serverUrl } from "./urls";
import { Provider } from "react-redux";
import { store } from "./store";
const App: React.FC = () => {
const [isReady, setIsReady] = useState(false);
React.useEffect(() => {
const loadAssets = async () => {
await Font.loadAsync({
Roboto: require("native-base/Fonts/Roboto.ttf"),
Roboto_medium: require("native-base/Fonts/Roboto_medium.ttf"),
...Ionicons.font,
});
setIsReady(true);
};
loadAssets();
}, []);
if (!isReady) {
return <AppLoading />;
}
const redirectUri = Linking.makeUrl("auth-callback");
// Practitioner
// const iss =
// "https://launch.smarthealthit.org/v/r4/sim/eyJoIjoiMSIsImIiOiIzMjZiNDY3NS0wYmM4LTRkYmQtYjQwNi1hNTU2NGMyODI0MDEsMTU1ZDNkODAtZjNmMC00YjM5LTkyMDctMGQxMjJjZjk0YTExIiwiZSI6IjM3ODgxMDg2LTdiMDUtNGIxOC1hMjc5LTA4ZTMzMWY1MGU5YiJ9/fhir";
// Patient
// const iss =
// "https://launch.smarthealthit.org/v/r4/sim/eyJrIjoiMSIsImoiOiIxIiwiYiI6Ijg3YTMzOWQwLThjYWUtNDE4ZS04OWM3LTg2NTFlNmFhYjNjNiJ9/fhir";
// const iss =
// 'https://launch.smarthealthit.org/v/r4/sim/eyJoIjoiMSIsImIiOiIzMjZiNDY3NS0wYmM4LTRkYmQtYjQwNi1hNTU2NGMyODI0MDEiLCJpIjoiMSIsImoiOiIxIiwiZSI6ImVmYjVkNGNlLWRmZmMtNDdkZi1hYTZkLTA1ZDM3MmZkYjQwNyJ9/fhir'
// const iss = "https://launch.smarthealthit.org/v/r4/sim/eyJrIjoiMSIsImoiOiIxIiwiYiI6IjMyNmI0Njc1LTBiYzgtNGRiZC1iNDA2LWE1NTY0YzI4MjQwMSJ9/fhir";
// const iss =
// 'https://launch.smarthealthit.org/v/r4/sim/eyJoIjoiMSIsImIiOiIxNTVkM2Q4MC1mM2YwLTRiMzktOTIwNy0wZDEyMmNmOTRhMTEiLCJpIjoiMSIsImoiOiIxIiwiZSI6ImVmYjVkNGNlLWRmZmMtNDdkZi1hYTZkLTA1ZDM3MmZkYjQwNyJ9/fhir'
const iss = serverUrl;
const scope =
"openid fhirUser offline_access user/*.* patient/*.* launch/encounter launch/patient profile";
const settings: FhirProviderProps = {
client_id: "my_web_app",
scope,
iss,
redirectUri,
promisSettings: {
url: "https://mss.fsm.northwestern.edu/AC_API/2018-10/",
identifier: "2F984419-5008-4E42-8210-68592B418233",
token: "21A673E8-9498-4DC2-AAB6-07395029A778",
},
};
return (
<FhirProvider {...settings}>
<Provider store={store}>
<Router>
<Routes />
</Router>
</Provider>
</FhirProvider>
);
};
export default App;