added interface 0

This commit is contained in:
Mayank Aamseek
2024-03-27 18:59:29 +05:30
parent 4eb43aae6d
commit 94b66c2d2a
4 changed files with 172 additions and 16 deletions
+5 -5
View File
@@ -59,7 +59,7 @@ NETWORK"
NETWORK"
"If the Tertiary Reimbursement methodology is based on Status Indicator codes, then list the applicable codes or code ranges",Applicable Status Indicator Codes - Tertiary,TERTIARY_REIMBURSEMENT_STATUS_INDICATOR_CODES,VARCHAR,B,ACTIVE,Yes,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Reimbursement Methodology,Required Only If Available ,"PAYMENT ACCURACY
NETWORK"
"If this agreement is not the base contract, then what is the effective date of the associated base contract? This date is earlier than today's date and is a long date format.",Associated Base Contract Effective Date,CONTRACT_BASE_EFFECTIVE_DT,DATE,C,ACTIVE,No,Preamble ,Contract ,Required Only If Agreement Is NOT the Base Contract ,
"If this agreement is not the base contract, then what is the effective date of the associated base contract? This date is earlier than today's date and is a long date format. Only return this date. If there is no date, return nothing. Do not explain or elaborate, only return the date converted to YYYY-MM-DD format or nothing.",Associated Base Contract Effective Date,CONTRACT_BASE_EFFECTIVE_DT,DATE,C,ACTIVE,No,Preamble ,Contract ,Required Only If Agreement Is NOT the Base Contract ,
"If this agreement is not the base contract, then what is the title of the associated base contract? This field will be present if there is an amendment or if the amendment is numbered. It is text that likely contains some of the following keywords: agreement, participating provider, participating hospital, provider agreement, or hospital agreement. Only say the title. Do not provide any context or explanation for it. Do not introduce what it is either, simply state the title. ",Associated Base Contract Title,CONTRACT_BASE_TITLE,VARCHAR,C,ACTIVE,No,Preamble ,Contract ,Required Only If Agreement Is NOT the Base Contract ,
"What are the names of other providers associated with this agreement? The names can be found across multiple pages after the signature page. These names can be found in a roster and can be a list of provider names or TINs. Do not provide any context or explanation, simply state the names.",Associated Provider Full Names,PROV_DOING_BUSINESS_AS,VARCHAR,A,ACTIVE,Yes,"Preamble, contract signatory section, and/or Exhibit, Attachment, or Schedule to contract",Provider ,Required Only If Available ,"UNIQUE KEY
PDM"
@@ -363,7 +363,7 @@ INTELLIGENT EDITS "
INTELLIGENT EDITS "
"If the contract includes a carve out for Neonatal Services, describe how these codes are reimbursed",Neonatal Reimbursement Methodology,NEONATAL_CARVEOUT_REIMBURSEMENT_METHODOLOGY,VARCHAR,G,ACTIVE,No,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Carve Outs,Required Only If Available ,"PAYMENT ACCURACY
INTELLIGENT EDITS "
"If the contract is based on network type, then list them for each impacted line of business for each specifically listed network.",Network,CONTRACT_NETWORK,VARCHAR,A,ACTIVE,Yes,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",LOB/Provider Type Specific,Required Only If Available ,UNIQUE KEY
"If the contract is based on network type, list each payer network relevant to each line of business as outlined in the contract.",Network,CONTRACT_NETWORK,VARCHAR,A,ACTIVE,Yes,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",LOB/Provider Type Specific,Required Only If Available ,UNIQUE KEY
Does the contract include a carve out for never events (Yes/No)?,Never Event Carve Out (Y/N)?,NEVER_EVENT_CAREVEOUT_IND,VARCHAR,F,ACTIVE,No,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Carve Outs,Required Only If Available ,"PAYMENT ACCURACY
INTELLIGENT EDITS "
"If the contract includes a carve out for never events, list the applicable codes or code ranges ",Never Event Codes or Code Range,NEVER_EVENT_CAREVOUT_CODES,VARCHAR,F,ACTIVE,No,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Carve Outs,Required Only If Available ,"PAYMENT ACCURACY
@@ -410,7 +410,7 @@ NETWORK"
What triggers computation of penalties and interest?,Penalties & Interest Trigger,PENALTIES_INTEREST_TRIGGER,VARCHAR,B,ACTIVE,No,"From Base Contract or from LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider","Discounts, Premiums, Sequestration, Penalties, Interest",Required Only If Available ,"PAYMENT ACCURACY
NETWORK"
"If the contract is for Marketplace line of business, then list all metal levels , such as platinum, bronze, silver, and gold.",Plan - Metal Level,CONTRACT_MARKETPLACE_METAL_LEVEL,VARCHAR,A,ACTIVE,Yes,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",LOB/Provider Type Specific,Required Only If Available ,UNIQUE KEY
"If the contract is based on service areas, then list each specifically listed area, county, ZIP, etc. for each impacted line of business.",Plan- Service Area,CONTRACT_SERVICE_AREA,VARCHAR,A,ACTIVE,Yes,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",LOB/Provider Type Specific,Required Only If Available ,UNIQUE KEY
"If the contract is based on service areas, then list each specifically listed geographic area for each line of business. This could be a state, county, ZIP code, etc. Return either a comma separated list of these service areas, or do not return anything if the contract is not based on geography. Do not elaborate or add context.",Plan- Service Area,CONTRACT_SERVICE_AREA,VARCHAR,A,ACTIVE,Yes,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",LOB/Provider Type Specific,Required Only If Available ,UNIQUE KEY
Does the contract include a carve out for post-discharge procedures (Yes/No)?,Post-Discharge Procedures Carve Out (Y/N)?,POSTDISCHARGE_PROC_CAREVEOUT_IND,VARCHAR,F,ACTIVE,No,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Carve Outs,Required Only If Available ,"PAYMENT ACCURACY
INTELLIGENT EDITS "
"If the contract includes a carve out for post-discharge procedures, list the applicable codes or code ranges",Post-Discharge Services Codes or Code Range,POSTDISCHARGE_PROC_CAREVOUT_CODES,VARCHAR,F,ACTIVE,No,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Carve Outs,Required Only If Available ,"PAYMENT ACCURACY
@@ -530,7 +530,7 @@ INTELLIGENT EDITS "
INTELLIGENT EDITS "
"If the contract includes a carve out for Technical Component, describe how these codes are reimbursed",Technical Component Reimbursement Methodology ,TECHNICAL_COMPONENT_CARVEOUT_REIMBURSEMENT_METHODOLOGY,VARCHAR,G,ACTIVE,No,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Carve Outs,Required Only If Available ,"PAYMENT ACCURACY
INTELLIGENT EDITS "
Identify the specific date upon which the compensation specific to each line of business terminates.,Termination Date of Pricing Terms,LOB_PRICING_TERMS_TERMINATION_DT,D,A,ACTIVE,No (but please use GDP date format throughout),"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",LOB/Provider Type Specific,Always Required ,"GREEN LIGHT - IF DATE IS LESS THAN TODAY'S DATE THEN STOP, DO NOT REVIEW CONTRACT CONFIGURATION UNLESS THERE IS AN EFFECTIVE AMENDMENT UNIQUE KEY"
"For each line of business, identify the specific date upon which the compensation terminates, in the following format ONLY: MM/DD/YYYY.",Termination Date of Pricing Terms,LOB_PRICING_TERMS_TERMINATION_DT,D,A,ACTIVE,No (but please use GDP date format throughout),"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",LOB/Provider Type Specific,Always Required ,"GREEN LIGHT - IF DATE IS LESS THAN TODAY'S DATE THEN STOP, DO NOT REVIEW CONTRACT CONFIGURATION UNLESS THERE IS AN EFFECTIVE AMENDMENT UNIQUE KEY"
What is timeline for payer to audit claims per Medicaid agreement (INSERT NUMBER)?,Timeline Medicaid Payer Claim Audit ,R156,,,INACTIVE,No,Medicaid Agreement ,Key Dates,Required Only If Available ,PAYMENT ACCURACY
What is timeline for payer to identify overpayments in paid claims per Medicaid agreement (INSERT NUMBER)?,Timeline Medicaid Payer Overpayment Identification,R164,,,INACTIVE,No,Medicaid Agreement ,Key Dates,Required Only If Available ,PAYMENT ACCURACY
What is timeline for payer to give notice of policy changes to provider per Medicaid agreement (INSERT NUMBER)?,Timeline Medicaid Payer Policy Change Notice ,R146,,,INACTIVE,No,Medicaid Agreement ,Key Dates,Required Only If Available ,"PAYMENT ACCURACY
@@ -610,7 +610,7 @@ INTELLIGENT EDITS "
INTELLIGENT EDITS "
"If the contract includes a carve out for Trauma, describe how these codes are reimbursed",Trauma Reimbursement Methodology,TRAUMA_CARVEOUT_REIMBURSEMENT_METHODOLOGY,VARCHAR,G,ACTIVE,No,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Carve Outs,Required Only If Available ,"PAYMENT ACCURACY
INTELLIGENT EDITS "
"Is the contract related to a Professional, Institutional or Ancillary provider?",Type of Contract,CONTRACT_TYPE,VARCHAR,A,ACTIVE,Yes,AArete Derived from Title or Preamble ,LOB/Provider Type Specific,Always Required ,UNIQUE KEY
"Is the contract related to a Professional, Institutional or Ancillary provider? Only respond with ""Professional,"" ""Institutional,"", or ""Ancillary.""",Type of Contract,CONTRACT_TYPE,VARCHAR,A,ACTIVE,Yes,AArete Derived from Title or Preamble ,LOB/Provider Type Specific,Always Required ,UNIQUE KEY
"If the contract is based on type of provider, identify each provider type for each line of business. Often the provider type will be found next to the word ""services.""",Type of Provider,PROV_TYPE,VARCHAR,A,ACTIVE,Yes,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",LOB/Provider Type Specific,Always Required ,UNIQUE KEY
"If the contract includes a carve out for Unlisted codes, describe how these codes are reimbursed",Unlisted Code Reimbursement Methodology ,UNLISTED_CARVEOUT_REIMBURSEMENT_METHODOLOGY,VARCHAR,G,ACTIVE,No,"From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider",Carve Outs,Required Only If Available ,"PAYMENT ACCURACY
INTELLIGENT EDITS "
1 Interrogation Question? Field Name SF_DB_COL_NAME DATA_TYPE PRIORITY FLAG Related Generic Data Pipeline Field Name? Source of Data Theme Required Field? Use of Field Beyond Contract Config?
59 If the contract includes Vaccine for Children client-specific carve outs, describe how these codes are reimbursed Client-Specific Carve Out #1 Reimbursement Methodology VACCINE_CHILDREN_CARVEOUT_REIMBURSEMENT_METHODOLOGY VARCHAR G ACTIVE TBD From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider Carve Outs Required Only If Available PAYMENT ACCURACY INTELLIGENT EDITS
60 Does the contract include other Vaccine for Children carve outs (Yes/No)? Client-Specific Carve Out #1 (Y/N) VACCINE_CHILDREN_CAREVEOUT_IND VARCHAR F ACTIVE TBD From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider Carve Outs Required Only If Available PAYMENT ACCURACY INTELLIGENT EDITS
61 Does the contract include Surgical Assist/Assistant carve outs (Yes/No)? Client-Specific Carve Out #2 (Y/N) SURGICAL_ASSIST_CAREVEOUT_IND VARCHAR F ACTIVE TBD From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider Carve Outs Required Only If Available PAYMENT ACCURACY INTELLIGENT EDITS
62 If the contract includes Surgical Assist/Assistant carve outs, list the applicable codes or code ranges Client-Specific Carve Out #2 Codes or Code Range SURGICAL_ASSIST_CAREVOUT_CODES VARCHAR F ACTIVE TBD From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider Carve Outs Required Only If Available PAYMENT ACCURACY INTELLIGENT EDITS
63 If the contract includes other client-specific carve outs, describe how these codes are reimbursed Client-Specific Carve Out #2 Reimbursement Methodology VARCHAR INACTIVE TBD From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider Carve Outs Required Only If Available PAYMENT ACCURACY INTELLIGENT EDITS
64 Does the contract include Physicians/Clinical Psychologists (MD, DO, PhD, DPN) carve outs (Yes/No)? Client-Specific Carve Out #3 (Y/N) PHY_CLINICAL_PSYCHOLOGIST_CAREVEOUT_IND VARCHAR F ACTIVE TBD From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider Carve Outs Required Only If Available PAYMENT ACCURACY INTELLIGENT EDITS
65 If the contract includes physicians/Clinical Psychologists (MD, DO, PhD, DPN) carve outs, list the applicable codes or code ranges Client-Specific Carve Out #3 Codes or Code Range PHY_CLINICAL_PSYCHOLOGIST_CAREVOUT_CODES VARCHAR F ACTIVE TBD From LOB Specific Exhibit, Attachment, Schedule or Amendment, Addendum, Rider Carve Outs Required Only If Available PAYMENT ACCURACY INTELLIGENT EDITS
363 Does the contract automatically renew (Yes/No)? (Page#) CONTRACT_AUTO_RENEWAL_IND_PG NUMERIC ACTIVE
364 If contract automatically renews, then what is the length of the renewal term? (Page#) CONTRACT_AUTO_RENEWAL_TERM_LENGTH_PG NUMERIC A ACTIVE
365 If contract automatically renews, then then what is the adjusted contract termination date? (Page#) R101 INACTIVE
366 What is timeline for payer to give notice of policy changes to provider per base agreement? (INSERT UNIT OF MEASURE) R103 INACTIVE
367 Concat - What is timeline for payer to give notice of policy changes to provider per base agreement? (INSERT NUMBER) PAYER_POLICY_CHANGE_NOTICE_TIMELINE VARCHAR E ACTIVE
368 What is timeline for payer to give notice of policy changes to provider per base agreement? (INSERT TRIGGER "FROM" or "BEFORE") PAYER_POLICY_CHANGE_NOTICE_INFO VARCHAR E ACTIVE
369 What is timeline for payer to give notice of policy changes to provider per base agreement? (Page#) PAYER_POLICY_CHANGE_NOTICE_INFO_PG NUMERIC E ACTIVE
410 What is timeline for payer to give notice of policy changes to provider per Medicare agreement (INSERT UNIT OF MEASURE)? R125 INACTIVE
411 Concat - What is timeline for payer to give notice of policy changes to provider per Medicare agreement (INSERT NUMBER)? PAYER_NOTICE_POLICY_CHANGE_MEDICARE_TIMELINE VARCHAR INACTIVE
412 What is timeline for payer to give notice of policy changes to provider per Medicare agreement (INSERT TRIGGER "FROM" OR "BEFORE")? PAYER_NOTICE_POLICY_CHANGE_MEDICARE_INFO VARCHAR INACTIVE
413 What is timeline for payer to give notice of policy changes to provider per Medicare agreement (Page#)? PAYER_NOTICE_POLICY_CHANGE_MEDICARE_PG NUMERIC INACTIVE
414 What is timeline for provider timely filing of claims submitted to the payer per Medicare agreement (INSERT UNIT OF MEASURE)? R127 INACTIVE
415 Concat - What is timeline for provider timely filing of claims submitted to the payer per Medicare agreement (INSERT NUMBER)? PROV_CLAIM_TIMELY_FILING_MEDICARE_TIMELINE VARCHAR INACTIVE
416 What is timeline for provider timely filing of claims submitted to the payer per Medicare agreement (INSERT TRIGGER "FROM" OR "BEFORE")? PROV_CLAIM_TIMELY_FILING_MEDICARE_INFO VARCHAR INACTIVE
530 What is timeline for provider to submit a payment dispute to the payer per State Marketplace agreement (INSERT TRIGGER "FROM" OR "BEFORE") ? PROV_PAYMENT_DISPUTE_MARKETPLACE_INFO VARCHAR INACTIVE
531 What is timeline for provider to submit a payment dispute to the payer per State Marketplace agreement ? (Page#) PROV_PAYMENT_DISPUTE_MARKETPLACE_PG NUMERIC INACTIVE
532 What is timeline for provider to submit a payment reconsideration request to the payer per State Marketplace agreement (INSERT UNIT OF MEASURE)? R185 INACTIVE
533 Concat - What is timeline for provider to submit a payment reconsideration request to the payer per State Marketplace agreement (INSERT NUMBER)? PROV_PAYMENT_RECONSIDERATION_MARKETPLACE_TIMELINE VARCHAR INACTIVE
534 What is timeline for provider to submit a payment reconsideration request to the payer per State Marketplace agreement (INSERT TRIGGER "FROM" OR "BEFORE")? PROV_PAYMENT_RECONSIDERATION_MARKETPLACE_INFO VARCHAR INACTIVE
535 What is timeline for provider to submit a payment reconsideration request to the payer per State Marketplace agreement? (Page#) PROV_PAYMENT_RECONSIDERATION_MARKETPLACE_PG NUMERIC INACTIVE
536 What is timeline for payer to identify overpayments in paid claims per State Marketplace agreement (INSERT UNIT OF MEASURE)? R187 INACTIVE
610 If the Secondary reimbursement methodology is based on a fee for service, flat rate, all-inclusive rate, episode of care rate, case rate, per diem rate, or other dollar rate, what is the reimbursed dollar amount? (Page#) SECONDARY_REIMBURSEMENT_FLAT_FEE_PG NUMERIC B ACTIVE
611 If the Secondary reimbursement is based on codes listed on the CMS fee schedule, what is the comparable Medicare fee schedule rate? (Page#) SECONDARY_REIMBURSEMENT_CMS_MEDICARE_RATE_PG NUMERIC B ACTIVE
612 If the Secondary reimbursement is based on codes listed on the the State Medicaid fee schedule, what is the comparable Medicaid fee schedule rate? (Page#) SECONDARY_REIMBURSEMENT_MEDICAID_RATE_PG NUMERIC B ACTIVE
613 If the Secondary reimbursement methodology is based on a grouper rate, what is the applicable grouper methodology? (Page#) SECONDARY_REIMBURSEMENT_GROUPER_PG NUMERIC B ACTIVE
614 Are there any exceptions to the Secondary reimbursement methodology? (Page#) SECONDARY_REIMBURSEMENT_EXCEPTION_IND_PG NUMERIC B ACTIVE
615 If the contract includes lesser of or greater of language, what is the tertiary Reimbursement methodology (if any)? (Page#) TERTIARY_REIMBURSEMENT_METHODOLOGY_PG NUMERIC B ACTIVE
616 If the Tertiary Reimbursement methodology is based on Procedure Codes, then list the applicable codes or code ranges (Page#) TERTIARY_REIMBURSEMENT_PROC_CODES_PG NUMERIC B ACTIVE
+155
View File
@@ -0,0 +1,155 @@
import streamlit as st
from streamlit_extras.add_vertical_space import add_vertical_space
import os
import streamlit as st
import pandas as pd
from io import StringIO
from datetime import datetime
import boto3
import util
import requests
doczy_pipeline = 'https://8ir4vi1ri4.execute-api.us-east-2.amazonaws.com/dev/'
REDIRECT_URI = 'https://doczy.aarete.com:8500'
user_list = ['maamseek@aarete.com', 'smahdavian@aarete.com', 'ahinge@aarete.com', 'akadam@aarete.com', 'pkatariya@aarete.com'
, 'piragavarapu@aarete.com', 'umistry@aarete.com', 'ahutchison@aarete.com', 'bgrunst@aarete.com', 'ddimeglio@aarete.com'
, 'vnair@aarete.com']
st.set_page_config(layout = "wide")
# # Sidebar contents
# with st.sidebar:
# st.title("Doczy.AI ™")
# st.markdown(
# """
# ## About
# This app extracts data from contracts
# """
# )
# add_vertical_space(15)
# # st.write("Doczy")
try:
# util.setup_page(REDIRECT_URI)
_,c1= st.columns([5,1])
c1.write(f"User: **{st.session_state.user_info['displayName']}**")
user_mail = st.session_state.user_info['mail']
except:
user_mail = 'maamseek@aarete.com'
if user_mail in user_list:
s3_client = boto3.client('s3',
region_name="us-east-1",
)
objects = s3_client.list_objects_v2(Bucket='doczy-dev-infra-textract'
, Prefix="batches/batch_1/", Delimiter='/')
folder_list = []
for prefix in objects['CommonPrefixes']:
folder_list.append(prefix['Prefix'][:-1].split('/')[-1])
# # to be deleted later
# folder_list = ['Delaware First Health, Inc.', 'Community Health Choice, Inc','CareSource Network Partners LLC',
# 'HealthNet of Cali', 'Oklahoma Complete Health, Inc', 'HealthFirst', 'Molina Healthcare of TX', 'AvMed', 'Arizona Care1st',
# 'WellCare New Jersey']
client_row = st.columns([0.1, 0.8])
with client_row[0]:
st.write("**Client Name**")
with client_row[1]:
client = st.selectbox('Client Name',(folder_list), label_visibility = "collapsed")
# # to be deleted later
# client = 'textract-receiver-processed-file'
folder_objects = s3_client.list_objects_v2(Bucket='doczy-dev-infra-textract'
, Prefix="batches/batch_1/"+client+"/", Delimiter='/')
folder_list_2 = []
for prefix in folder_objects['CommonPrefixes']:
folder_list_2.append(prefix['Prefix'][:-1].split('/')[-1])
path_row = st.columns([0.1, 0.8])
with path_row[0]:
st.write("**Path to folder**")
with path_row[1]:
Directory = st.selectbox('**Path to folder**', folder_list_2, label_visibility = "collapsed")
add_vertical_space(1)
df = pd.DataFrame(columns=['Contract Name','Unique Key','Pricing Before Carveouts'
, 'Contract Related', 'Provider', 'Timeline', 'Carveout Indicator', 'Carveout Methodology'])
file_list = []
file_objects = s3_client.list_objects_v2(Bucket='doczy-dev-infra-textract'
, Prefix="batches/batch_1/"+client+"/"+Directory+"/", Delimiter='/')
if st.button("Create Batch"):
for obj in file_objects.get('Contents',[]):
if not obj['Key'].endswith('/'):
file_list.append(obj['Key'].split('/')[-1])
df['Contract Name'] = file_list
add_vertical_space(1)
@st.cache_data
def convert_df(df):
return df.to_csv(index=False).encode('utf-8')
csv = convert_df(df)
df = df.reset_index() # make sure indexes pair with number of rows
# contract_list = []
# for index, row in df.iterrows():
# group_list = []
# if row['Unique Key']:
# group_list.append('Unique Key')
# if row['Pricing Before Carveouts']:
# group_list.append('Pricing Before Carveouts')
# if row['Contract Related']:
# group_list.append('Contract Related')
# if row['Provider']:
# group_list.append('Provider')
# if row['Timeline']:
# group_list.append('Timeline')
# if row['Carveout Indicator']:
# group_list.append('Carveout Indicator')
# if row['Carveout Methodology']:
# group_list.append('Carveout Methodology')
# entry_dict = {
# "contract_name": row['Contract Name'],
# "groups": group_list,
# "contract_source_path": "batches/batch_1/"+client+"/"+row['Contract Name']
# }
# contract_list.append(entry_dict)
contract_list = list(df['Contract Name'])
myobj = {
"s3_bucket": 'doczy-dev-infra-textract',
"batch_id": "1",
"client_name": client,
"username": user_mail,
"contract_list": contract_list
}
buttons = st.columns([0.8, 0.2])
with buttons[0]:
st.download_button("Download Table", csv, "file.csv", "text/csv", key='download-csv')
with buttons[1]:
if st.button("Upload to DB"):
response = requests.post(doczy_pipeline, json = myobj)
if response.status_code >= 200 and response.status_code < 300:
st.write("Success")
else:
st.write("Failed")
# st.write(response.text)
else:
st.write("Access Denied")
+3 -3
View File
@@ -29,7 +29,7 @@ st.set_page_config(layout = "wide")
# # st.write("Doczy")
try:
util.setup_page(REDIRECT_URI)
# util.setup_page(REDIRECT_URI)
_,c1= st.columns([5,1])
c1.write(f"User: **{st.session_state.user_info['displayName']}**")
user_mail = st.session_state.user_info['mail']
@@ -95,7 +95,7 @@ if user_mail in user_list:
add_vertical_space(1)
df = pd.DataFrame(columns=['Request ID','Contract Name','Unique Key','Pricing Before Carveouts'
df = pd.DataFrame(columns=['Contract Name','Unique Key','Pricing Before Carveouts'
, 'Contract Related', 'Provider', 'Timeline', 'Carveout Indicator', 'Carveout Methodology'])
file_list = []
file_objects = s3_client.list_objects_v2(Bucket='doczy-dev-infra-textract'
@@ -107,7 +107,7 @@ if user_mail in user_list:
file_list.append(obj['Key'].split('/')[-1])
df['Contract Name'] = file_list
df['Request ID'] = range(len(file_list))
# df['Request ID'] = range(len(file_list))
# df['Contract ID'] = file_list
df['Unique Key'] = a
df['Pricing Before Carveouts'] = b
+9 -8
View File
@@ -44,7 +44,7 @@ with st.sidebar:
# st.write("Doczy")
try:
util.setup_page(REDIRECT_URI)
# util.setup_page(REDIRECT_URI)
_,c1= st.columns([4,1])
c1.write(f"User: **{st.session_state.user_info['displayName']}**")
user_mail = st.session_state.user_info['mail']
@@ -245,9 +245,9 @@ if user_mail in user_list:
sequence_input = ''
if st.button("Back to default"):
prompt = sequence_input
st.button("Save Prompt")
# st.button("Save Prompt")
with prompt_row[0]:
prompt = st.text_area("**Prompt**", sequence_input, height = 150, label_visibility = "collapsed")
prompt = st.text_area("**Prompt**", sequence_input, height = 100, label_visibility = "collapsed")
# column_name = fields.loc[fields['Field Name'] == field, 'SF_DB_COL_NAME'].iloc[0]
@@ -503,7 +503,7 @@ if user_mail in user_list:
df = df[~df['Contract ID'].isnull()]
if 'Original Page Number' not in df.columns:
df['Original Page Number'] = ' '
df = df[['Contract Name','Contract ID', 'Field Name', 'Actual Value Stored','New Extracted value','Confidence Level'
df = df[['Contract Name','Contract ID', 'SF_DB_COL_NAME', 'Actual Value Stored','New Extracted value','Confidence Level'
,'Snippet','Original Page Number', 'New Page Number', 'Revised Prompt', 'Result']]
try:
@@ -524,25 +524,26 @@ if user_mail in user_list:
if st.button("Test Configuration"):
df, history, attempt, raw_response_text = run_llm(attempt, bucket, contract_list, llm_selected, field, field_values, history)
df = df[['Contract Name','Contract ID', 'Actual Value Stored','New Extracted value','Confidence Level'
df_1 = df[['Contract Name','Contract ID', 'Actual Value Stored','New Extracted value','Confidence Level'
,'Snippet','Original Page Number', 'New Page Number', 'Revised Prompt', 'Result']]
# df.to_csv('results.csv', index=False)
# history.to_csv('history.csv', index=False)
# s3_client.upload_file('results.csv', bucket, key)
csv_buf = StringIO()
df.to_csv(csv_buf, header=True, index=False)
df_1.to_csv(csv_buf, header=True, index=False)
csv_buf.seek(0)
s3_client.put_object(Bucket='doczy-dev-infra-raw-data-ingestion', Body=csv_buf.getvalue(), Key='training_interface/results.csv')
csv_buf = StringIO()
history.to_csv(csv_buf, header=True, index=False)
csv_buf.seek(0)
s3_client.put_object(Bucket='doczy-dev-infra-raw-data-ingestion', Body=csv_buf.getvalue(), Key='training_interface/history.csv')
df = df[['Contract Name','Contract ID', 'SF_DB_COL_NAME', 'Actual Value Stored','New Extracted value','Confidence Level'
,'Snippet', 'New Page Number', 'Revised Prompt', 'Result']]
# df = pd.read_csv('results.csv')
# df['Result'] = df['Result'].astype('str')
# history = pd.read_csv('history.csv')
df = df[['Contract Name','Contract ID', 'Actual Value Stored','New Extracted value','Confidence Level'
,'Snippet', 'New Page Number', 'Revised Prompt', 'Result']]
st.dataframe(df)
st.dataframe(history)