awacke1 commited on
Commit
0fab8df
·
1 Parent(s): 0060db5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -0
app.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from fhir.resources.patient import Patient
3
+ from fhir.resources.bundle import Bundle
4
+ from fhir.resources.identifier import Identifier
5
+ from fhir.resources.humanname import HumanName
6
+ from fhir.resources.contactpoint import ContactPoint
7
+
8
+ # Define Streamlit app and set title
9
+ app = st.beta_container()
10
+
11
+ with app:
12
+ st.set_page_config(page_title="FHIR Streamlit App")
13
+ st.title("FHIR Streamlit App")
14
+
15
+ # Create a new Patient resource
16
+ patient = Patient()
17
+ patient.id = "example-patient"
18
+ patient.identifier = [Identifier(value="12345")]
19
+ patient.name = [HumanName(family="Smith", given=["John"])]
20
+ patient.telecom = [ContactPoint(system="phone", value="555-555-5555")]
21
+
22
+ # Display the Patient resource
23
+ st.write("Patient resource:")
24
+ st.write(patient.json())
25
+
26
+ # Create a Bundle resource
27
+ bundle = Bundle()
28
+ bundle.type = "searchset"
29
+ bundle.entry = [{"resource": patient}]
30
+
31
+ # Display the Bundle resource
32
+ st.write("Bundle resource:")
33
+ st.write(bundle.json())