Skip to content

Commit

Permalink
Merge branch 'main' into fix/wp-333-ecep-search-broken
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyboar authored Nov 7, 2023
2 parents 558e097 + 15b1ddb commit bcaf2ba
Show file tree
Hide file tree
Showing 52 changed files with 1,204 additions and 398 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/netsage-cms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Netsage CMS Builds
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- 'netsage_cms/**'

jobs:
build_commit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: netsage_cms
steps:
- uses: actions/checkout@v2
- name: Get shortsha
id: vars
run: |
if [ -z "$EVENT_SHA" ]; then SHORT_SHA=${GITHUB_SHA::8}; else SHORT_SHA=${EVENT_SHA::8}; fi
echo ::set-output name=sha_short::${SHORT_SHA}
env:
EVENT_SHA: ${{ github.event.client_payload.sha }}
- name: Print shortsha
run: |
echo $SHORTSHA
env:
SHORTSHA: ${{ steps.vars.outputs.sha_short }}
- uses: docker/setup-buildx-action@v2
name: Setup Docker Builds
- uses: docker/login-action@v2
name: Log in to docker
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v3
name: Build & push commit tagged Docker image
with:
context: netsage_cms
push: true
tags: taccwma/netsage-cms:${{ steps.vars.outputs.sha_short }}
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ <h1>List Registrations</h1>
<td>
{% include "view_registration_modal.html" %}
{% include "edit_registration_modal.html" %}
{% include "create_submitter_modal.html" %}
<select id='actionsDropdown_{{r.reg_id}}' class='status-filter' onchange="openAction('{{r.reg_id}}')">
<option value="">Select Action</option>
<option value="viewRegistration">View Record</option>
<option value="editRegistration">Edit Record</option>
<option value="createSubmitter">Create Submitter</option>
</select>
</td>
</tr>
Expand Down
138 changes: 1 addition & 137 deletions apcd-cms/src/apps/admin_regis_table/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from apps.utils.apcd_database import get_registrations, get_registration_contacts, get_registration_entities, create_submitter, update_registration, update_registration_contact, update_registration_entity
from apps.utils.apcd_groups import is_apcd_admin
from apps.utils.utils import table_filter
from apps.utils.registrations_data_formatting import _set_registration
from apps.components.paginator.paginator import paginator
import logging
from dateutil import parser
Expand Down Expand Up @@ -83,143 +84,6 @@ def dispatch(self, request, *args, **kwargs):
def get_context_data(self, registrations_content, registrations_entities, registrations_contacts, *args, **kwargs):
context = super(RegistrationsTable, self).get_context_data(*args, **kwargs)

def _set_registration(reg, reg_ents, reg_conts):
org_types = {
'carrier': 'Insurance Carrier',
'tpa_aso': 'Plan Administrator¹ (TPA/ASO)',
'pbm': 'Pharmacy Benefit Manager (PBM)'
}
return {
'biz_name': reg[7],
'type': org_types[reg[6]] if (reg[6] and reg[6] in org_types.keys()) else None,
'location': '{city}, {state}'.format
(
city=reg[9],
state=reg[10]
),
'reg_status': reg[5].title(),
'reg_id': reg[0],
'view_modal_content': _set_modal_content(reg, reg_ents, reg_conts, org_types)
}
def _set_entities(reg_ent):
return {
'claim_val': reg_ent[0],
'ent_id': reg_ent[3],
'claim_and_enc_vol': reg_ent[2],
'license': reg_ent[4] if reg_ent[4] else None,
'naic': reg_ent[5] if reg_ent[5] else None,
'no_covered': reg_ent[6],
'ent_name': reg_ent[7],
'fein': reg_ent[8] if reg_ent[8] else None,
'plans_type': {
"Commercial": reg_ent[9],
"Medicare": reg_ent[10],
"Medicaid": reg_ent[11],
},
'files_type': {
"Eligibility/Enrollment": reg_ent[12],
"Provider": reg_ent[13],
"Medical": reg_ent[14],
"Pharmacy": reg_ent[15],
"Dental": reg_ent[16]
}
}
def _set_contacts(reg_cont):

def format_phone_number(num):
formatted_num_list = list(reversed(num))
last_four_digits = 3
last_seven_digits = 7
all_ten_digits = 11
placement_corrector = 1 #To add formatting chars in correct places
for curr_position in range(len(formatted_num_list) + 1):
placement_position = curr_position + placement_corrector
if curr_position == last_four_digits or curr_position == last_seven_digits:
formatted_num_list.insert(placement_position,'-')
if curr_position == all_ten_digits and len(num) > 10:
formatted_num_list.insert(placement_position,' ')
formatted_num_list.append('+')
return ''.join(reversed(formatted_num_list))

return {
'cont_id': reg_cont[0],
'notif': reg_cont[2],
'role': reg_cont[3],
'name': reg_cont[4],
'phone': format_phone_number(reg_cont[5]),
'email': reg_cont[6],
}
def _set_modal_content(reg, reg_ent, reg_cont, org_types):
return {
'biz_name': reg[7],
'type': org_types[reg[6]] if (reg[6] and reg[6] in org_types.keys()) else None,
'city': reg[9],
'state': reg[10],
'address': reg[8],
'zip': reg[11],
'for_self': reg[4],
'entities': [_set_entities(ent) for ent in reg_ent],
'contacts': [_set_contacts(cont) for cont in reg_cont],
'org_types': org_types,
'us_state_list': [
'AL - Alabama',
'AK - Alaska',
'AS - American Samoa',
'AR - Arkansas',
'AZ - Arizona',
'CA - California',
'CO - Colorado',
'CT - Connecticut',
'DE - Delaware',
'DC - District of Columbia',
'FL - Florida',
'GA - Georgia',
'GU - Guam',
'HI - Hawaii',
'ID - Idaho',
'IL - Illinois',
'IN - Indiana',
'IA - Iowa',
'KS - Kansas',
'KY - Kentucky',
'LA - Louisiana',
'ME - Maine',
'MD - Maryland',
'MA - Massachusetts',
'MI - Michigan',
'MN - Minnesota',
'MS - Mississippi',
'MO - Missouri',
'MT - Montana',
'NE - Nebraska',
'NH - New Hampshire',
'NJ - New Jersey',
'NM - New Mexico',
'NV - Nevada',
'NY - New York',
'NC - North Carolina',
'ND - North Dakota',
'MP - Northern Mariana Islands',
'OH - Ohio',
'OK - Oklahoma',
'OR - Oregon',
'PA - Pennsylvania',
'RI - Rhode Island',
'SC - South Carolina',
'SD - South Dakota',
'TN - Tennessee',
'TX - Texas',
'UT - Utah',
'VT - Vermont',
'VA - Virginia',
'VI - Virgin Islands',
'WA - Washington',
'WV - West Virginia',
'WI - Wisconsin',
'WY - Wyoming'
],
}

context['header'] = ['Business Name', 'Type', 'Location', 'Registration Status', 'Actions']
context['status_options'] = ['All', 'Received', 'Processing', 'Complete']
context['org_options'] = ['All']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ <h4>Acknowledgment of Terms</h4>
<div class="field-errors" style="display: none"></div>
<select name='business-name' required='required' class="choicefield" id='business-name'>
{% for submitter in submitters %}
<option class="dropdown-text" value={{submitter.submitter_id}}>{{submitter.org_name}} - ID: {{submitter.submitter_id}}</option>
<option class="dropdown-text" value={{submitter.submitter_id}}>
{{submitter.entity_name}} - Payor Code: {{submitter.payor_code}}
</option>
{% endfor %}
</select>

Expand Down Expand Up @@ -160,9 +162,6 @@ <h4>Acknowledgment of Terms</h4>
month = '0' + month.toString();
if(day < 10)
day = '0' + day.toString();

var minDate = dtToday.toISOString().substr(0, 10);
$('#expiration-date').attr('min', minDate);
year = year + 1;
var maxDate = year + '-' + month + '-' + day;
$('#expiration-date').attr('max', maxDate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ <h1>Threshold Exception Request</h1>
<hr/>
<h4>Requested Threshold Reduction</h4>
<div id="exception_block_1">
<div class="field-wrapper textinput required">
<label for="business-name_1">
Business Name<span class="asterisk">*</span>
</label>
<div class="field-errors" style="display: none"></div>
<select name='business-name_1' required='required' class="choicefield" id='business-name_1'>
{% for submitter in submitters %}
<option class="dropdown-text" value={{submitter.submitter_id}}>
{{submitter.entity_name}} - Payor Code: {{submitter.payor_code}}
</option>
{% endfor %}
</select>

</div>
<div class="field-wrapper select required">
<div class="field-errors" style="display: none"></div>

Expand Down Expand Up @@ -75,7 +89,7 @@ <h4>Requested Threshold Reduction</h4>
<div class="field-wrapper numberinput required">
<div class="field-errors" style="display: none"></div>

<label name="date-row" for="expiration-date_1">Expiriation Date<sup>*</sup><span class="asterisk">*</span> </label>
<label name="date-row" for="expiration-date_1">Expiration Date<sup>*</sup><span class="asterisk">*</span> </label>

<input type="date" name="expiration-date_1" class="numeric" id="expiration-date_1" inputmode="numeric"
pattern="\d{4}-\d{2}-\d{2}" required />
Expand Down Expand Up @@ -155,19 +169,6 @@ <h4>Acknowledgment of Terms</h4>
I request an exception on behalf of:
</label></div>

<div class="field-wrapper textinput required">
<label for="business-name">
Business Name<span class="asterisk">*</span>
</label>
<div class="field-errors" style="display: none"></div>
<select name='business-name' required='required' class="choicefield" id='business-name'>
{% for submitter in submitters %}
<option class="dropdown-text" value={{submitter.submitter_id}}>{{submitter.org_name}} - ID:
{{submitter.submitter_id}}</option>
{% endfor %}
</select>

</div>

<div class="field-wrapper checkbox required">
<div class="field-errors" style="display: none"></div>
Expand Down Expand Up @@ -218,24 +219,22 @@ <h4>Acknowledgment of Terms</h4>
noEmptyInputs(formTextInputs);
</script>
<!-- To require exception is not longer than a year -->
<script id="form-exception_length_less_than_year" type="module">
$(function () {
var dtToday = new Date();

var month = dtToday.getMonth() + 1;
var day = dtToday.getDate();
var year = dtToday.getFullYear();
if (month < 10)
month = '0' + month.toString();
if (day < 10)
day = '0' + day.toString();

var minDate = dtToday.toISOString().substr(0, 10);
$('#expiration-date').attr('min', minDate);
year = year + 1;
var maxDate = year + '-' + month + '-' + day;
$('#expiration-date').attr('max', maxDate);
});
<script>
function restrictExpirationDate(field, exceptions) {
var dtToday = new Date();

var month = dtToday.getMonth() + 1;
var day = dtToday.getDate();
var year = dtToday.getFullYear();
if (month < 10)
month = '0' + month.toString();
if (day < 10)
day = '0' + day.toString();

year = year + 1;
var maxDate = year + '-' + month + '-' + day;
$(`#expiration-date_${exceptions}`).attr('max', maxDate);
};
</script>
<!-- Broke out functions necessary for dynamic drop down and help text related to CDLs-->
<script>
Expand All @@ -254,6 +253,18 @@ <h4>Acknowledgment of Terms</h4>
let exceptionBlock = document.getElementById(`exception_block_${exceptions}`);
document.getElementById(`exception_header_${exceptions}`).style.display = 'block';
exceptionBlock.innerHTML = `
<div class="field-wrapper textinput required">
<label for="business-name_${exceptions}">
Business Name<span class="asterisk">*</span>
</label>
<div class="field-errors" style="display: none"></div>
<select name='business-name_${exceptions}' required='required' class="choicefield" id='business-name_${exceptions}'>
{% for submitter in submitters %}
<option class="dropdown-text" value={{submitter.submitter_id}}>{{submitter.entity_name}} - Payor Code:
{{submitter.payor_code}}</option>
{% endfor %}
</select>
</div>
<div class="field-wrapper select required">
<div class="field-errors" style="display: none"></div>
Expand Down Expand Up @@ -398,12 +409,21 @@ <h4>Acknowledgment of Terms</h4>
let exceptions = 1;
btnStatus(exceptions);

$('[id^="expiration-date"]').click(function() {
let field = $(this).attr('id');
restrictExpirationDate(field, exceptions);
});

$('#exception-add-btn').click(function() {

addException(exceptions);
// To track how many exception blocks there are for button logic
exceptions = addException(exceptions);
btnStatus(exceptions);
$('[id^="expiration-date"]').click(function() {
let field = $(this).attr('id');
restrictExpirationDate(field, exceptions);
});
// Gets help text for additional added blocks
$('[id^="field-threshold-exception"]').change(function() {
let fieldSelection = $(this).val();
Expand Down
Loading

0 comments on commit bcaf2ba

Please sign in to comment.