finished workflow for sandata - even though they cancelled the launch! Worked on Anthology's group based course extractions.

This commit is contained in:
Norm Rasmussen
2024-04-19 16:53:56 -04:00
parent 59e9a4ae2b
commit 88000a824d
13 changed files with 175 additions and 46 deletions

View File

@ -32,7 +32,7 @@
<i class="np-card-training-sessions-icon far fa-calendar-star"></i>
<span class="np-card-training-sessions-label">
{% if training_event.sessions.size > 1 %}
Multiple Sessions
Additional Sessions
{% else %}
{% t .sessions, count: training_event.sessions.size %}
{% endif %}

Binary file not shown.

View File

@ -1,6 +1,6 @@
<div class="np-dashboard-resources-container">
<div class="np-zero-state-text">
{{ message }}
New Courses Coming Soon!
</div>
<img class="np-zero-state-courses" alt="{{ message }}" />
</div>

View File

@ -1,3 +1,8 @@
{% styles default %}
{% styles colors %}
{% styles custom %}
<script
src="https://code.jquery.com/jquery-3.6.3.min.js"
integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU="
crossorigin="anonymous"></script>

View File

@ -1,3 +1,27 @@
{% if current_person.signed_in? %}
{% unless current_person.email contains "+preview" %}
{% assign groups_count = 0 %}
{% for group in current_person.groups %}
{% assign groups_count = groups_count | plus: 1 %}
{% endfor %}
<script>
const groupsCount = {{groups_count}}
if (groupsCount == 0) {
if (!window.location.href.includes("/invite")) {
console.log("not /invite page")
if (localStorage.getItem('completed-second-registration') != null) {
console.log("Local Storage Item found from Secondary registration")
} else {
window.location.replace('/app/sign-up-follow-up')
}
}
}
</script>
{% endunless %}
{% endif %}
<header class="np-header np-header-color">
<div class="np-header-content">
<div class="np-hidden-desktop np-header-mobile-menu-nav">
@ -189,4 +213,4 @@
align-items: baseline;
}
}
</style>
</style>

View File

@ -37,18 +37,21 @@
{% comment %} <input class="sign-up-follow-up-input" id="oh-input" placeholder="OH Identifier" style="display: none;"/> {% endcomment %}
<div id="oh-input" placeholder="OH Identifier" style="display: none;">
<div class='oh-button' type="radio" value="EVV"
onclick="validateForm()">Ohio EVV</div>
<div class='oh-button' type="radio" value="ALT EVV"
onclick="validateForm()">Ohio Alt EVV</div>
<div class='oh-button' type="radio" value="ST - OH EVV ODM Agency Provider"
onclick="validateForm()">Agency EVV</div>
<div class='oh-button' type="radio" value="ST - OH EVV Non-Agency"
onclick="validateForm()">Non-Agency EVV</div>
<div class='oh-button' type="radio" value="ST - OH ODM AGENCY PROVIDER ALT EVV"
onclick="validateForm()">Alternative EVV</div>
</div>
<div id="ca-input" placeholder="CA Identifier" style="display: none;">
{% comment %} <div class='ca-button' type="radio" value="ST - CA CHHS BOTH (PCS & HHCS)" {% endcomment %}
<div class='ca-button' type="radio" value="EVV"
onclick="validateForm()">Sandata EVV</div>
onclick="validateForm()">Agency EVV</div>
{% comment %} <div class='ca-button' type="radio" value="ST - CA CHHS JE & ST - CA CHHS STATE" {% endcomment %}
<div class='ca-button' type="radio" value="ALT EVV"
onclick="validateForm()">Sandata Alt EVV Aggregator</div>
onclick="validateForm()">Alternative EVV</div>
</div>
<span class="sign-up-follow-up-error-label" id="oh-label">Please select your affiliation</span>
@ -389,7 +392,7 @@
if(Object.keys(revisedPropsObj).length > 0){
let validationFlag = true;
let allRequiredFields = ['agency_name', 'medicaid_id', 'provider_id', 'learner_state', 'learner_role', 'ca_group_name', 'oh_group_name'];
let allRequiredFields = ['agency_name', 'medicaid_id', 'provider_id', 'learner_state', 'learner_role', 'oh_group_name', 'ca_group_name']
for(let i = 0; i < allRequiredFields.length; i++){
if(Object.keys(revisedPropsObj).indexOf(allRequiredFields[i]) == -1){
@ -404,6 +407,7 @@
} else {
document.querySelector('#calEVV-input').style.border = '1px solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133))';
document.querySelector('#calEVV-label').style.display = 'none';
revisedPropsObj['oh_group_name'] = undefined;
}
} else if(allRequiredFields[i] == 'learner_state' && revisedPropsObj[allRequiredFields[i]] == 'Ohio'){
if(Object.keys(revisedPropsObj).indexOf('oh_group_name') == -1){
@ -411,6 +415,9 @@
document.querySelector('#oh-label').style.display = 'block';
} else {
document.querySelector('#oh-label').style.display = 'none';
revisedPropsObj['ca_group_name'] = undefined;
revisedPropsObj['cal_evv_id'] = undefined;
}
}
}
@ -446,11 +453,12 @@
console.log(userID);
if(revisedPropsObj['learner_state'] != 'Ohio'){
revisedPropsObj['oh_group_name'] = null;
revisedPropsObj['oh_group_name'] = "None";
}
if(revisedPropsObj['learner_state'] != 'California'){
revisedPropsObj['cal_evv_id'] = null;
revisedPropsObj['cal_evv_id'] = "None";
revisedPropsObj['ca_group_name'] = "None";
}
console.log(revisedPropsObj);
@ -459,8 +467,7 @@
function webhookCaller(){
return new Promise(function(res, rej) {
let xhr = new XMLHttpRequest();
url = "https://webhook.site/8fc3650a-7c4b-413a-a6fd-6e3787bc3771"
//url = "https://webhooks.workato.com/webhooks/rest/0a1d61c1-421c-4160-a1ab-d29e79aee50e/secondary-registration-submitted";
url = "https://webhooks.workato.com/webhooks/rest/0a1d61c1-421c-4160-a1ab-d29e79aee50e/secondary-registration-submitted";
xhr.addEventListener("load", e => {
localStorage.setItem('completed-second-registration', true);

View File

@ -434,7 +434,6 @@ Two items from KC:
KC Question: When the categories are established in the filters, can we programatically re-assign categories to all 800 courses? Or does it need to be done manually?
KS1:
Anthology Academic Economics: Essential, Anthology Academic Economics: Enhanced, Anthology Accreditation: Essential, Anthology Accreditation: Enhanced, Anthology 101: Essential, Anthology Baseline: Essential, Anthology Baseline: Enhanced, Anthology Beacon: Essential, Anthology Course Evaluations: Essential, Anthology Course Evaluations: Enhanced, Anthology Digital Assistant: Essential, Anthology Digital Assistant: Enhanced, Anthology Encompass: Essential, Anthology Encompass: Enhanced, Anthology Encompass: Enhanced+, Anthology Engage: Essential, Anthology Engage: Enhanced, Anthology Engage: Enhanced+, Anthology Evaluate: Essential, Anthology Evaluate: Enhanced, Anthology Finance & HCM: Essential, Anthology Finance & HCM: Enhanced, Anthology Finance & HCM: Enhanced+, Anthology Insight: Essential, Anthology Insight: Enhanced, Blackboard Learn: Essential, Anthology Milestone: Essential, Anthology Milestone: Enhanced, Outcomes: Essential, Outcomes: Enhanced, Anthology Payroll: Essential, Anthology Payroll: Enhanced, Anthology Planning: Essential, Anthology Planning: Enhanced, Anthology Portfolio: Essential, Anthology Portfolio: Enhanced, Power BI: Essential, Power BI: Enhanced, Anthology Program Review: Essential, Anthology Program Review: Enhanced, Anthology Raise: Essential, Anthology Raise: Enhanced, Anthology Raise: Enhanced+, Anthology Reach: Essential, Anthology Reach: Enhanced, Anthology Reach: Enhanced+, Anthology Student: Essential, Anthology Student: Enhanced,
Anthology Student: Enhanced+,

View File

@ -9,7 +9,21 @@ HEADERS = {
"accept": "application/json",
"X-Api-Key": APIKEY,
}
GROUPS = [
"Accreditation",
"Anthology 101",
"Baseline",
"Course Evaluations",
"Engage",
"Evaluate",
"Finance & HCM",
"Learn",
"Portfolio",
"Power BI",
"Raise",
"Reach",
"Student",
]
def get_courses():
"""

View File

@ -0,0 +1,77 @@
import Apikeys
import requests
import pprint
import csv
pp= pprint.PrettyPrinter(indent=4)
APIKEY = Apikeys.ANTHOLOGY
HEADERS = {
"accept": "application/json",
"X-Api-Key": APIKEY,
}
BASEURL = "https://api.northpass.com/v2/"
GROUPS = [
"Accreditation",
"Anthology 101",
"Baseline",
"Course Evaluations",
"Engage",
"Evaluate",
"Finance & HCM",
"Learn",
"Portfolio",
"Power BI",
"Raise",
"Reach",
"Student",
]
def group_ids():
"""
Get the group Ids from a list of named groups.
"""
url = "groups"
for group in GROUPS:
filter = f"?filter[name][cont]={group} - ("
urlreq = f"{BASEURL}{url}{filter}"
response = requests.get(urlreq, headers=HEADERS)
response = response.json()
for data in response['data']:
print(data['attributes']['name'])
id = data['id']
get_courses_in_groups(id)
def get_courses_in_groups(id):
"""
From the IDs received above, list out all of the courses.
"""
count = 0
courses = []
while True:
# count += 1
url = f"groups/{id}/courses?limit=100"
courseurl = f"{BASEURL}{url}"
coursereq = requests.get(courseurl, headers=HEADERS)
coursedata = coursereq.json()
# nextlink = coursedata['links']
print(id)
# print(coursedata)
for data in coursedata['included']:
if data['attributes']['status'] == 'live':
name = data['attributes']['name']
id = data['attributes']['share_course_link'].split("/")[5]
enrollments = data['attributes']['enrollments_count']
created = data['attributes']['created_at']
updated = data['attributes']['updated_at']
coursedict = {
"name": name, "id": id, "enrollments": enrollments,
"created at": created, "updated at": updated
}
courses.append(coursedict)
print(courses)
if __name__ == "__main__":
group_ids()

View File

@ -15,8 +15,8 @@ REF = [
("Nevada", "ST - Nevada (DHCFP)", "9fcf4e98-1dfd-441f-8ee4-0131c968867c"),
("North Carolina", "ST - North Carolina (DHHS)", "67a01f25-57ca-49a8-8fed-b7181b020842"),
("North Daktoa", "ST - North Dakota (DHHS)", "62dc0f55-a51d-4acf-90ce-dc10788385af"),
("Ohio", "ST - OH NON-Agencies", "5d50b3ed-671b-4e97-9d5e-87f8b755dfe2"),
("Ohio", "ST - OH ODM Agency Provider", "0c8efefc-364b-4971-b376-030493611b0d"),
("Ohio", "ST - OH EVV Non-Agency", "5d50b3ed-671b-4e97-9d5e-87f8b755dfe2"),
("Ohio", "ST - OH EVV ODM Agency Provider", "0c8efefc-364b-4971-b376-030493611b0d"),
("Ohio", "ST - OH ODM AGENCY PROVIDER ALT EVV", "838c0923-43b4-48bd-8011-00fd0411c68f"),
("Pennsylvania", "ST - PA DHS", "24c85122-aa00-4ce2-ad9b-70bb9c0f3f2f"),
("Rhode Island", "ST - Rhode Island EOHHS", "e52fd639-bf63-4840-b8bc-2e6a6f11560e"),

View File

@ -1,40 +1,39 @@
import tmp
data = webhook_payload:
[
webhook_payload = {
"payload": {
"array": [
{
"id": "e134030d-a2a9-4de2-b4d5-87081feee18a",
"email": "gwalden@sandata.com",
"type": "person_properties",
"attributes": {
"properties": {
"agency_name": "Test 2",
"agency_id": "Test 2",
"medicaid_id": "54321",
"provider_id": "0987654321",
"learner_role": "Agency Billing",
"learner_state": "Tennessee",
"oh_group_name": "ST - OH ODM Agency Provider",
"evv_alt_for_ca_oh": "",
"successfully_completed_secondary_registration": True,
"cal_evv_id": None
}
}
}
]
},
"params": {}
}
{
id: dc9aafe3-eee7-4d50-a480-3bd9831b893a,
email: it,
type: person_properties,
attributes:
{
properties:
{
agency_name: 32,
agency_id: 323,
medicaid_id: 22222,
provider_id: 2123231234,
learner_role: Agency Billing,
learner_state: Ohio,
oh_group_name: EVV,
ca_group_name: None,
cal_evv_id: None,
successfully_completed_secondary_registration: true
}
}
}
]
for item in webhook_payload['payload']['array']:
evv = item['attributes']['properties']['evv_alt_for_ca_oh']
evv = item['attributes']['properties']['oh_group_name']
state = item['attributes']['properties']['learner_state']
group_result = [ref_state for ref_state in tmp.REF if state in ref_state]
if len(group_result) > 1:
for group in group_result:
if evv in group:
print(group)
group_uuid = group[2]
print(group_uuid)
else:
group_uuid = group_result[0][2]
print(group_uuid)

View File

@ -219,3 +219,7 @@ message](https://northpasshq.slack.com/archives/C04RER4PH09/p1709147957374999?th
## 04-18-2024
- [X] Chubb - Looker, Learner Full name - what is it pulling?
## 04-19-2024
- [ ] Anthology - Extract CSV of all Courses & UUIDs.