Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import streamlit as st
|
3 |
+
import pandas as pd
|
4 |
+
import os
|
5 |
+
|
6 |
+
# Define a mapping of state abbreviations to emojis
|
7 |
+
state_emojis = {
|
8 |
+
'MN': '๐ฒ', # Example for Minnesota, add more as needed
|
9 |
+
# Add additional state emojis here
|
10 |
+
}
|
11 |
+
|
12 |
+
# Function to load CSV files from a directory
|
13 |
+
def load_csv_files(directory):
|
14 |
+
return [f for f in os.listdir(directory) if f.endswith('.csv')]
|
15 |
+
|
16 |
+
# Load CSV files from the directory
|
17 |
+
directory = '.' # Set the directory where your CSV files are located
|
18 |
+
csv_files = load_csv_files(directory)
|
19 |
+
|
20 |
+
# Sort files alphabetically
|
21 |
+
csv_files.sort()
|
22 |
+
|
23 |
+
# Create a sidebar with buttons for each state file
|
24 |
+
st.sidebar.title('State Files')
|
25 |
+
for file in csv_files:
|
26 |
+
state_abbr = file.split('.')[0]
|
27 |
+
state_name = state_abbr # Replace this with actual state name mapping if available
|
28 |
+
emoji = state_emojis.get(state_abbr, '๐') # Default emoji if state not in dictionary
|
29 |
+
if st.sidebar.button(f'{emoji} {state_name} ({state_abbr})'):
|
30 |
+
# Load the selected CSV file into a DataFrame
|
31 |
+
df = pd.read_csv(os.path.join(directory, file))
|
32 |
+
# Display the DataFrame
|
33 |
+
st.write(f'Data for {state_name} ({state_abbr}):')
|
34 |
+
st.dataframe(df, 2000, 500) # Adjust width and height as needed
|
35 |
+
|
36 |
+
# Optionally, load MN.csv by default if present
|
37 |
+
if 'MN.csv' in csv_files:
|
38 |
+
df_default = pd.read_csv(os.path.join(directory, 'MN.csv'))
|
39 |
+
st.write('Default Data for Minnesota (MN):')
|
40 |
+
st.dataframe(df_default, 2000, 500) # Adjust width and height as needed
|
41 |
+
|
42 |
+
|
43 |
+
st.markdown('''
|
44 |
+
|
45 |
+
## NPI and Identification
|
46 |
+
|
47 |
+
- ๐ **NPI**: National Provider Identifier, a unique identification number for covered health care providers.
|
48 |
+
- ๐ง **EntityTypeCode**: Indicates whether the provider is an individual (1) or an organization (2).
|
49 |
+
- ๐ **ReplacementNPI**: NPI that replaces a previous NPI, if applicable.
|
50 |
+
- ๐ผ **EmployerIdentificationNumberEIN**: Tax identification number for the provider, if they are an organization.
|
51 |
+
|
52 |
+
## Provider Names and Credentials
|
53 |
+
|
54 |
+
- ๐ข **ProviderOrganizationNameLegalBusinessName**: Legal business name of the provider, if an organization.
|
55 |
+
- ๐จโ๐ฉโ๐ง **ProviderLastNameLegalName**: Last (family) name of the provider, if an individual.
|
56 |
+
- ๐ **ProviderFirstName**: First (given) name of the provider, if an individual.
|
57 |
+
- ๐ **ProviderMiddleName**: Middle name of the provider, if applicable.
|
58 |
+
- ๐ **ProviderNamePrefixText**: Prefix to the provider's name (e.g., Dr., Mr., Ms.).
|
59 |
+
- ๐ท๏ธ **ProviderNameSuffixText**: Suffix to the provider's name (e.g., Jr., Sr., III).
|
60 |
+
- ๐ **ProviderCredentialText**: Credentials of the provider (e.g., MD, DDS, RN).
|
61 |
+
|
62 |
+
## Other Provider Information
|
63 |
+
|
64 |
+
- ๐ฅ **ProviderOtherOrganizationName**: Other organization name used by the provider.
|
65 |
+
- ๐ **ProviderOtherOrganizationNameTypeCode**: Type code for the other organization name.
|
66 |
+
- ๐ **ProviderOtherLastName**: Other last name used by the provider.
|
67 |
+
- โก๏ธ **ProviderOtherFirstName**: Other first name used by the provider.
|
68 |
+
- ๐ **ProviderOtherMiddleName**: Other middle name used by the provider.
|
69 |
+
- ๐ผ **ProviderOtherNamePrefixText**: Other prefix to the provider's name.
|
70 |
+
- ๐ฝ **ProviderOtherNameSuffixText**: Other suffix to the provider's name.
|
71 |
+
- ๐ **ProviderOtherCredentialText**: Other credentials used by the provider.
|
72 |
+
- ๐ฏ **ProviderOtherLastNameTypeCode**: Type code for the other last name used.
|
73 |
+
|
74 |
+
## Business Mailing Address
|
75 |
+
|
76 |
+
- ๐ซ **ProviderFirstLineBusinessMailingAddress**: First line of the provider's business mailing address.
|
77 |
+
- ๐ฌ **ProviderSecondLineBusinessMailingAddress**: Second line of the provider's business mailing address.
|
78 |
+
- ๐๏ธ **ProviderBusinessMailingAddressCityName**: City name of the provider's business mailing address.
|
79 |
+
- ๐ **ProviderBusinessMailingAddressStateName**: State name of the provider's business mailing address.
|
80 |
+
- ๐ฎ **ProviderBusinessMailingAddressPostalCode**: Postal code of the provider's business mailing address.
|
81 |
+
- ๐ **ProviderBusinessMailingAddressCountryCodeIfoutsideUS**: Country code if outside the U.S.
|
82 |
+
- ๐ **ProviderBusinessMailingAddressTelephoneNumber**: Telephone number for the business mailing address.
|
83 |
+
- ๐ **ProviderBusinessMailingAddressFaxNumber**: Fax number for the business mailing address.
|
84 |
+
|
85 |
+
## Business Practice Location Address
|
86 |
+
|
87 |
+
- ๐ **ProviderFirstLineBusinessPracticeLocationAddress**: First line of the provider's business practice location address.
|
88 |
+
- ๐ก **ProviderSecondLineBusinessPracticeLocationAddress**: Second line of the provider's business practice location address.
|
89 |
+
- ๐ **ProviderBusinessPracticeLocationAddressCityName**: City name of the provider's practice location.
|
90 |
+
- ๐บ๏ธ **ProviderBusinessPracticeLocationAddressStateName**: State name of the provider's practice location.
|
91 |
+
- ๐ **ProviderBusinessPracticeLocationAddressPostalCode**: Postal code of the provider's practice location.
|
92 |
+
- ๐ **ProviderBusinessPracticeLocationAddressCountryCodeIfoutsideUS**: Country code if the practice location is outside the U.S.
|
93 |
+
- ๐ฒ **ProviderBusinessPracticeLocationAddressTelephoneNumber**: Telephone number for the practice location.
|
94 |
+
- ๐จ๏ธ **ProviderBusinessPracticeLocationAddressFaxNumber**: Fax number for the practice location.
|
95 |
+
|
96 |
+
## Dates and Status
|
97 |
+
|
98 |
+
- ๐
**ProviderEnumerationDate**: The date the provider was first added to the NPI registry.
|
99 |
+
- ๐ **LastUpdateDate**: The date of the last update to the provider's information.
|
100 |
+
- โ **NPIDeactivationReasonCode**: Reason code for NPI deactivation, if applicable.
|
101 |
+
- ๐ **NPIDeactivationDate**: Date of NPI deactivation, if applicable.
|
102 |
+
- ๐ **NPIReactivationDate**: Date of NPI reactivation, if applicable.
|
103 |
+
|
104 |
+
## Provider Details
|
105 |
+
|
106 |
+
- ๐น๐บ **ProviderGenderCode**: Gender code of the provider (if an individual).
|
107 |
+
- ๐ค **AuthorizedOfficialLastName**: Last name of the authorized official.
|
108 |
+
- ๐ค **AuthorizedOfficialFirstName**: First name of the authorized official.
|
109 |
+
- ๐ค **AuthorizedOfficialMiddleName**: Middle name of the authorized official.
|
110 |
+
- ๐ **AuthorizedOfficialTitleorPosition**: Title or position of the authorized official.
|
111 |
+
- ๐ **AuthorizedOfficialTelephoneNumber**: Telephone number of the authorized official.
|
112 |
+
|
113 |
+
## Licensing and Taxonomy
|
114 |
+
|
115 |
+
- ๐งฌ **HealthcareProviderTaxonomyCode**: Code indicating the provider's specific type or classification of health care supply.
|
116 |
+
- ๐ **ProviderLicenseNumber**: License number assigned to the provider.
|
117 |
+
- ๐บ๏ธ **ProviderLicenseNumberStateCode**: State code where the provider is licensed.
|
118 |
+
- ๐ **HealthcareProviderPrimaryTaxonomySwitch**: Indicates if the taxonomy code is the provider's primary code.
|
119 |
+
|
120 |
+
## Other Identifiers
|
121 |
+
|
122 |
+
- ๐ **OtherProviderIdentifier**: Other identifiers used to identify the provider.
|
123 |
+
- ๐ **OtherProviderIdentifierTypeCode**: Type code of the other identifier.
|
124 |
+
- ๐บ๏ธ **OtherProviderIdentifierState**: State code related to the other identifier.
|
125 |
+
- ๐ข **OtherProviderIdentifierIssuer**: Issuer of the other identifier.
|
126 |
+
|
127 |
+
## Organizational Details and Certification
|
128 |
+
|
129 |
+
- โ **IsSoleProprietor**: Indicates if the provider is a sole proprietor.
|
130 |
+
- ๐ข **IsOrganizationSubpart**: Indicates if the provider is a subpart of an organization.
|
131 |
+
- ๐ข **ParentOrganizationLBN**: Legal business name of the parent organization.
|
132 |
+
- ๐ผ **ParentOrganizationTIN**: Tax Identification Number of the parent organization.
|
133 |
+
- ๐ **AuthorizedOfficialNamePrefixText**: Prefix of the authorized official's name.
|
134 |
+
- ๐ท๏ธ **AuthorizedOfficialNameSuffixText**: Suffix of the authorized official's name.
|
135 |
+
- ๐ **AuthorizedOfficialCredentialText**: Credentials of the authorized official.
|
136 |
+
- ๐งฉ **HealthcareProviderTaxonomyGroup**: Group taxonomy codes indicating shared characteristics.
|
137 |
+
|
138 |
+
|
139 |
+
''')
|