Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
markdown_text = '''
|
4 |
+
# Top 10 Python Libraries for HL7 v2, v3, and v4 π
|
5 |
+
|
6 |
+
1. **hl7apy** π
|
7 |
+
- A Python library for HL7 v2.x messages
|
8 |
+
- [GitHub](https://github.com/crs4/hl7apy)
|
9 |
+
- Example:
|
10 |
+
```python
|
11 |
+
from hl7apy.parser import parse_message
|
12 |
+
message = "MSH|^~\\&|ADT1|MCM|LABADT|MCM|198808181126|SECURITY|ADT^A01|MSG00001|P|2.4"
|
13 |
+
parsed_message = parse_message(message)
|
14 |
+
print(parsed_message)
|
15 |
+
```
|
16 |
+
|
17 |
+
2. **python-hl7** π
|
18 |
+
- A simple HL7 v2.x parsing library
|
19 |
+
- [GitHub](https://github.com/johnpaulett/python-hl7)
|
20 |
+
- Example:
|
21 |
+
```python
|
22 |
+
import hl7
|
23 |
+
message = "MSH|^~\\&|ADT1|MCM|LABADT|MCM|198808181126|SECURITY|ADT^A01|MSG00001|P|2.4"
|
24 |
+
parsed_message = hl7.parse(message)
|
25 |
+
print(parsed_message)
|
26 |
+
```
|
27 |
+
|
28 |
+
3. **hl7v3** π
|
29 |
+
- A Python library for HL7 v3 messages
|
30 |
+
- [GitHub](https://github.com/medrecord/hl7v3)
|
31 |
+
- Example:
|
32 |
+
```python
|
33 |
+
from hl7v3 import HL7v3Message
|
34 |
+
message = "<xml>...</xml>" # Replace with a valid HL7 v3 XML message
|
35 |
+
parsed_message = HL7v3Message(message)
|
36 |
+
print(parsed_message)
|
37 |
+
```
|
38 |
+
|
39 |
+
4. **fhirclient** π₯
|
40 |
+
- A Python client for FHIR (HL7 v4)
|
41 |
+
- [GitHub](https://github.com/smart-on-fhir/client-py)
|
42 |
+
- Example:
|
43 |
+
```python
|
44 |
+
from fhirclient import client
|
45 |
+
settings = {
|
46 |
+
'app_id': 'my_app',
|
47 |
+
'api_base': 'https://fhir.example.com/baseDstu2'
|
48 |
+
}
|
49 |
+
smart = client.FHIRClient(settings=settings)
|
50 |
+
```
|
51 |
+
|
52 |
+
5. **fhir.resources** π
|
53 |
+
- A Python library for FHIR (HL7 v4) resources
|
54 |
+
- [GitHub](https://github.com/nazrulworld/fhir.resources)
|
55 |
+
- Example:
|
56 |
+
```python
|
57 |
+
from fhir.resources.patient import Patient
|
58 |
+
patient = Patient()
|
59 |
+
patient.id = "example"
|
60 |
+
print(patient)
|
61 |
+
```
|
62 |
+
|
63 |
+
6. **fhir-parser** π
|
64 |
+
- A Python library for parsing FHIR (HL7 v4) resources
|
65 |
+
- [GitHub](https://github.com/nazrulworld/fhir-parser)
|
66 |
+
- Example:
|
67 |
+
```python
|
68 |
+
from fhir_parser import FHIR
|
69 |
+
fhir = FHIR()
|
70 |
+
patient = fhir.parse_resource('{"resourceType": "Patient", "id": "example"}')
|
71 |
+
print(patient)
|
72 |
+
```
|
73 |
+
|
74 |
+
7. **fhirpy** π
|
75 |
+
- A Python library for working with FHIR (HL7 v4) servers
|
76 |
+
- [GitHub](https://github.com/beda-software/fhirpy)
|
77 |
+
- Example:
|
78 |
+
```python
|
79 |
+
import fhirpy
|
80 |
+
connection = fhirpy.FHIRClient(url='https://fhir.example.com/baseDstu2', authorization='Bearer TOKEN')
|
81 |
+
patient = connection.resource('Patient')
|
82 |
+
patient.id = "example"
|
83 |
+
print(patient)
|
84 |
+
```
|
85 |
+
|
86 |
+
8. **hl7-fasthealthcareinteroperabilityresources-client** π
|
87 |
+
- A Python client for FHIR (HL7 v4) servers
|
88 |
+
- [GitHub](https://github.com/Asymmetrik/hl7-fasthealthcareinteroperabilityresources-client)
|
89 |
+
- Example:
|
90 |
+
```python
|
91 |
+
from fhirclient import client
|
92 |
+
settings = {
|
93 |
+
'app_id': 'my_app',
|
94 |
+
'api_base': 'https://fhir.example.com/baseDstu2'
|
95 |
+
}
|
96 |
+
smart = client.FHIRClient(settings=settings)
|
97 |
+
```
|
98 |
+
|
99 |
+
9. **ccda** π
|
100 |
+
- A Python library for parsing CCDA (HL7 v3) documents
|
101 |
+
- [GitHub](https://github.com/amida-tech/python-ccda)
|
102 |
+
- Example:
|
103 |
+
```python
|
104 |
+
from ccda import CCDA
|
105 |
+
ccda = CCDA("<xml>...</xml>") # Replace with a valid CCDA XML document
|
106 |
+
print(ccda)
|
107 |
+
```
|
108 |
+
|
109 |
+
10. **hl7.fhir** π
|
110 |
+
- A Python library for FHIR (HL7 v4) resources
|
111 |
+
- [GitHub](https://github.com/HL7/fhir-svn)
|
112 |
+
- Example:
|
113 |
+
```python
|
114 |
+
from hl7.fhir.r4.model import Patient
|
115 |
+
patient = Patient()
|
116 |
+
patient.id = "example"
|
117 |
+
print(patient)
|
118 |
+
```
|
119 |
+
'''
|
120 |
+
|
121 |
+
st.markdown(markdown_text)
|