diff --git a/models/staging/edfi_3/base/base_ef3__student_competency_objectives.sql b/models/staging/edfi_3/base/base_ef3__student_competency_objectives.sql new file mode 100644 index 0000000..1daf241 --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__student_competency_objectives.sql @@ -0,0 +1,65 @@ +{ + "id": "string", + "gradingPeriodReference": { + "gradingPeriodDescriptor": "string", + "periodSequence": 0, + "schoolId": 0, + "schoolYear": 0, + "link": { + "rel": "string", + "href": "string" + } + }, + "objectiveCompetencyObjectiveReference": { + "educationOrganizationId": 0, + "objective": "string", + "objectiveGradeLevelDescriptor": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "studentReference": { + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "competencyLevelDescriptor": "string", + "diagnosticStatement": "string", + "generalStudentProgramAssociations": [ + { + "generalStudentProgramAssociationReference": { + "beginDate": "2024-07-22", + "educationOrganizationId": 0, + "programEducationOrganizationId": 0, + "programName": "string", + "programTypeDescriptor": "string", + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + } + } + ], + "studentSectionAssociations": [ + { + "studentSectionAssociationReference": { + "beginDate": "2024-07-22", + "localCourseCode": "string", + "schoolId": 0, + "schoolYear": 0, + "sectionIdentifier": "string", + "sessionName": "string", + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + } + } + ], + "_etag": "string" + } \ No newline at end of file diff --git a/models/staging/edfi_3/base/base_ef3__student_cte_program_associations.sql b/models/staging/edfi_3/base/base_ef3__student_cte_program_associations.sql new file mode 100644 index 0000000..9f325f2 --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__student_cte_program_associations.sql @@ -0,0 +1,73 @@ +{ + "id": "string", + "beginDate": "2024-07-22", + "educationOrganizationReference": { + "educationOrganizationId": 0, + "link": { + "rel": "string", + "href": "string" + } + }, + "programReference": { + "educationOrganizationId": 0, + "programName": "string", + "programTypeDescriptor": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "studentReference": { + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "ctePrograms": [ + { + "careerPathwayDescriptor": "string", + "cipCode": "string", + "cteProgramCompletionIndicator": true, + "primaryCTEProgramIndicator": true + } + ], + "cteProgramServices": [ + { + "cteProgramServiceDescriptor": "string", + "cipCode": "string", + "primaryIndicator": true, + "serviceBeginDate": "2024-07-22", + "serviceEndDate": "2024-07-22" + } + ], + "endDate": "2024-07-22", + "nonTraditionalGenderStatus": true, + "participationStatus": { + "participationStatusDescriptor": "string", + "designatedBy": "string", + "statusBeginDate": "2024-07-22", + "statusEndDate": "2024-07-22" + }, + "privateCTEProgram": true, + "programParticipationStatuses": [ + { + "participationStatusDescriptor": "string", + "statusBeginDate": "2024-07-22", + "designatedBy": "string", + "statusEndDate": "2024-07-22" + } + ], + "reasonExitedDescriptor": "string", + "servedOutsideOfRegularSession": true, + "services": [ + { + "serviceDescriptor": "string", + "primaryIndicator": true, + "serviceBeginDate": "2024-07-22", + "serviceEndDate": "2024-07-22" + } + ], + "technicalSkillsAssessmentDescriptor": "string", + "_etag": "string" + } \ No newline at end of file diff --git a/models/staging/edfi_3/base/base_ef3__student_gradebook_entries.sql b/models/staging/edfi_3/base/base_ef3__student_gradebook_entries.sql new file mode 100644 index 0000000..640333a --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__student_gradebook_entries.sql @@ -0,0 +1,35 @@ +{ + "id": "string", + "gradebookEntryReference": { + "dateAssigned": "2024-07-22", + "gradebookEntryTitle": "string", + "localCourseCode": "string", + "schoolId": 0, + "schoolYear": 0, + "sectionIdentifier": "string", + "sessionName": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "studentSectionAssociationReference": { + "beginDate": "2024-07-22", + "localCourseCode": "string", + "schoolId": 0, + "schoolYear": 0, + "sectionIdentifier": "string", + "sessionName": "string", + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "competencyLevelDescriptor": "string", + "dateFulfilled": "2024-07-22", + "diagnosticStatement": "string", + "letterGradeEarned": "string", + "numericGradeEarned": 0, + "_etag": "string" + } \ No newline at end of file diff --git a/models/staging/edfi_3/base/base_ef3__student_intervention_associations.sql b/models/staging/edfi_3/base/base_ef3__student_intervention_associations.sql new file mode 100644 index 0000000..0aee442 --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__student_intervention_associations.sql @@ -0,0 +1,38 @@ +{ + "id": "string", + "cohortReference": { + "cohortIdentifier": "string", + "educationOrganizationId": 0, + "link": { + "rel": "string", + "href": "string" + } + }, + "interventionReference": { + "educationOrganizationId": 0, + "interventionIdentificationCode": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "studentReference": { + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "diagnosticStatement": "string", + "dosage": 0, + "interventionEffectivenesses": [ + { + "diagnosisDescriptor": "string", + "gradeLevelDescriptor": "string", + "populationServedDescriptor": "string", + "interventionEffectivenessRatingDescriptor": "string", + "improvementIndex": 0 + } + ], + "_etag": "string" + } \ No newline at end of file diff --git a/models/staging/edfi_3/base/base_ef3__student_intervention_attendance_events.sql b/models/staging/edfi_3/base/base_ef3__student_intervention_attendance_events.sql new file mode 100644 index 0000000..e69de29 diff --git a/models/staging/edfi_3/base/base_ef3__student_migrant_education_program_associations.sql b/models/staging/edfi_3/base/base_ef3__student_migrant_education_program_associations.sql new file mode 100644 index 0000000..f32154b --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__student_migrant_education_program_associations.sql @@ -0,0 +1,62 @@ +{ + "id": "string", + "beginDate": "2024-07-22", + "educationOrganizationReference": { + "educationOrganizationId": 0, + "link": { + "rel": "string", + "href": "string" + } + }, + "programReference": { + "educationOrganizationId": 0, + "programName": "string", + "programTypeDescriptor": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "studentReference": { + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "continuationOfServicesReasonDescriptor": "string", + "eligibilityExpirationDate": "2024-07-22", + "endDate": "2024-07-22", + "lastQualifyingMove": "2024-07-22", + "migrantEducationProgramServices": [ + { + "migrantEducationProgramServiceDescriptor": "string", + "primaryIndicator": true, + "serviceBeginDate": "2024-07-22", + "serviceEndDate": "2024-07-22" + } + ], + "participationStatus": { + "participationStatusDescriptor": "string", + "designatedBy": "string", + "statusBeginDate": "2024-07-22", + "statusEndDate": "2024-07-22" + }, + "priorityForServices": true, + "programParticipationStatuses": [ + { + "participationStatusDescriptor": "string", + "statusBeginDate": "2024-07-22", + "designatedBy": "string", + "statusEndDate": "2024-07-22" + } + ], + "qualifyingArrivalDate": "2024-07-22", + "reasonExitedDescriptor": "string", + "servedOutsideOfRegularSession": true, + "stateResidencyDate": "2024-07-22", + "usInitialEntry": "2024-07-22", + "usInitialSchoolEntry": "2024-07-22", + "usMostRecentEntry": "2024-07-22", + "_etag": "string" + } \ No newline at end of file diff --git a/models/staging/edfi_3/base/base_ef3__student_neglected_or_delinquent_program_associations.sql b/models/staging/edfi_3/base/base_ef3__student_neglected_or_delinquent_program_associations.sql new file mode 100644 index 0000000..07ad23f --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__student_neglected_or_delinquent_program_associations.sql @@ -0,0 +1,56 @@ +{ + "id": "string", + "beginDate": "2024-07-22", + "educationOrganizationReference": { + "educationOrganizationId": 0, + "link": { + "rel": "string", + "href": "string" + } + }, + "programReference": { + "educationOrganizationId": 0, + "programName": "string", + "programTypeDescriptor": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "studentReference": { + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "elaProgressLevelDescriptor": "string", + "endDate": "2024-07-22", + "mathematicsProgressLevelDescriptor": "string", + "neglectedOrDelinquentProgramDescriptor": "string", + "neglectedOrDelinquentProgramServices": [ + { + "neglectedOrDelinquentProgramServiceDescriptor": "string", + "primaryIndicator": true, + "serviceBeginDate": "2024-07-22", + "serviceEndDate": "2024-07-22" + } + ], + "participationStatus": { + "participationStatusDescriptor": "string", + "designatedBy": "string", + "statusBeginDate": "2024-07-22", + "statusEndDate": "2024-07-22" + }, + "programParticipationStatuses": [ + { + "participationStatusDescriptor": "string", + "statusBeginDate": "2024-07-22", + "designatedBy": "string", + "statusEndDate": "2024-07-22" + } + ], + "reasonExitedDescriptor": "string", + "servedOutsideOfRegularSession": true, + "_etag": "string" + } \ No newline at end of file diff --git a/models/staging/edfi_3/base/base_ef3__student_program_attendance_events.sql b/models/staging/edfi_3/base/base_ef3__student_program_attendance_events.sql new file mode 100644 index 0000000..632dd5c --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__student_program_attendance_events.sql @@ -0,0 +1,73 @@ +with student_program_attendance_events as ( + {{ source_edfi3('student_program_attendance_events') }} +), + +renamed as ( + select + -- generic columns + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:attendanceEventCategoryDescriptor::string as attendance_event_category_descriptor, + v:eventDate::date as event_date + v:educationOrganizationReference:educationOrganizationId::integer as ed_org_id, + v:educationOrganizationReference:link:rel::string as ed_org_type, + v:programReference:educationOrganizationId::integer as program_ed_org_id, + v:programReference:programName::string as program_name, + v:studentReference:studentUniqueId::string as student_id, + v:attendanceEventReason::string as attendance_event_reason, + v:educationalEnvironmentDescriptor::string as educational_environment_descriptor, + v:eventDuration::integer as event_duration, + v:programAttendanceDuration::integer as program_attendance_duration, + + -- descriptors + {{ extract_descriptor('v:programReference:programTypeDescriptor::string') }} as program_type, + + -- references + v:educationOrganizationReference as education_organization_reference, + v:programReference as program_reference, + v:studentReference as student_reference + + from source_stu_programs +) + +select * from renamed + { + "id": "string", + "attendanceEventCategoryDescriptor": "string", + "eventDate": "2024-07-22", + "educationOrganizationReference": { + "educationOrganizationId": 0, + "link": { + "rel": "string", + "href": "string" + } + }, + "programReference": { + "educationOrganizationId": 0, + "programName": "string", + "programTypeDescriptor": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "studentReference": { + "studentUniqueId": "string", + "link": { + "rel": "string", + "href": "string" + } + }, + "attendanceEventReason": "string", + "educationalEnvironmentDescriptor": "string", + "eventDuration": 0, + "programAttendanceDuration": 0, + "_etag": "string" + } \ No newline at end of file diff --git a/models/staging/edfi_3/base/base_ef3__survey_question_responses.sql b/models/staging/edfi_3/base/base_ef3__survey_question_responses.sql index b7ecc2b..55f92d4 100644 --- a/models/staging/edfi_3/base/base_ef3__survey_question_responses.sql +++ b/models/staging/edfi_3/base/base_ef3__survey_question_responses.sql @@ -18,7 +18,7 @@ renamed as ( v:surveyResponseReference:surveyResponseIdentifier::string as survey_response_id, v:comment::string as comment, v:noResponse::boolean as no_response, - --references + -- references v:surveyQuestionReference as survey_question_reference, v:surveyResponseReference as survey_response_reference, -- lists diff --git a/models/staging/edfi_3/base/base_ef3__survey_questions.sql b/models/staging/edfi_3/base/base_ef3__survey_questions.sql index 7002436..ab7e2bf 100644 --- a/models/staging/edfi_3/base/base_ef3__survey_questions.sql +++ b/models/staging/edfi_3/base/base_ef3__survey_questions.sql @@ -19,7 +19,7 @@ renamed as ( v:questionText::string as question_text, -- descriptors {{ extract_descriptor('v:questionFormDescriptor::string') }} as question_form, - --references + -- references v:surveyReference as survey_reference, v:surveySectionReference as survey_section_reference, -- lists diff --git a/models/staging/edfi_3/base/base_ef3__survey_response_education_organization_target_associations_v2.sql b/models/staging/edfi_3/base/base_ef3__survey_response_education_organization_target_associations_v2.sql new file mode 100644 index 0000000..5508450 --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__survey_response_education_organization_target_associations_v2.sql @@ -0,0 +1,24 @@ +with survey_response_education_organization_target_associations as ( + {{ source_edfi3('survey_response_education_organization_target_associations') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:educationOrganizationId:educationOrganizationId::string as education_organization_id, + v:surveyResponseReference:surveyIdentifier::string as survey_id, + v:surveyResponseReference:surveyResponseIdentifier::string as survey_response_id, + -- references + v:educationOrganizationReference as educationOrganizationReference, + v:surveyResponseReference as surveyResponseReference, + + from survey_response_education_organization_target_associations +) +select * from renamed diff --git a/models/staging/edfi_3/base/base_ef3__survey_section_associations.sql b/models/staging/edfi_3/base/base_ef3__survey_section_associations.sql new file mode 100644 index 0000000..567554c --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__survey_section_associations.sql @@ -0,0 +1,24 @@ +with survey_section_associations as ( + {{ source_edfi3('survey_section_associations') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:sectionReference::sectionIdentifier::string as section_id, + v:sectionReference::sessionName::string as session_name, + v:sectionReference::schoolId::string as school_id, + v:sectionReference::schoolYear::string as school_year, + -- references + v:sectionReference as sectionReference + v:surveyReference as surveyReference + from survey_section_response_education_organization_target_associations +) +select * from renamed diff --git a/models/staging/edfi_3/base/base_ef3__survey_section_response_education_organization_target_associations.sql b/models/staging/edfi_3/base/base_ef3__survey_section_response_education_organization_target_associations.sql new file mode 100644 index 0000000..b51a0ea --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__survey_section_response_education_organization_target_associations.sql @@ -0,0 +1,22 @@ +with survey_section_response_education_organization_target_associations as ( + {{ source_edfi3('survey_section_response_education_organization_target_associations') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:surveySectionResponseReference::surveyIdentifier::string as survey_id, + v:surveySectionResponseReference::surveySectionTitle::string as survey_section_title, + -- references + v:educationOrganizationReference as educationOrganizationReference + v:surveySectionResponseReference as surveySectionResponseReference + from survey_section_response_education_organization_target_associations +) +select * from renamed diff --git a/models/staging/edfi_3/base/base_ef3__survey_section_response_staff_target_associations.sql b/models/staging/edfi_3/base/base_ef3__survey_section_response_staff_target_associations.sql new file mode 100644 index 0000000..8a04c58 --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__survey_section_response_staff_target_associations.sql @@ -0,0 +1,21 @@ +with survey_section_aggregate_responses as ( + {{ source_edfi3('survey_section_aggregate_responses') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:surveySectionResponseReference::surveyIdentifier::string as survey_id, + v:surveySectionResponseReference::surveySectionTitle::string as survey_section_title, + -- references + v:staffReference as staff_reference + from survey_section_aggregate_responses +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__persons.sql b/models/staging/tpdm/base/base_tpdm__persons.sql index 4937abc..8bd864f 100644 --- a/models/staging/tpdm/base/base_tpdm__persons.sql +++ b/models/staging/tpdm/base/base_tpdm__persons.sql @@ -7,10 +7,14 @@ renamed as ( api_year, pull_timestamp, last_modified_timestamp, - filename, file_row_number, + filename, is_deleted, - ??? + + v:id::string as record_guid, + v:personId::string as person_id, + -- descriptors + {{ extract_descriptor('v:sourceSystemDescriptor::string') }} as source_system from persons ) select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__survey_section_response_person_target_associations.sql b/models/staging/tpdm/base/base_tpdm__survey_section_response_person_target_associations.sql new file mode 100644 index 0000000..6107524 --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__survey_section_response_person_target_associations.sql @@ -0,0 +1,23 @@ +with survey_section_response_person_target_associations as ( + {{ source_edfi3('survey_section_response_person_target_associations') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:personReference:personId::string as person_id, + v:surveySectionResponseReference:surveyIdentifier::string as survey_id, + v:surveySectionResponseReference:surveyResponseIdentifier::string as survey_response_id, + -- references + v:surveySectionResponseReference as survey_section_response_reference, + v:personReference as person_reference + from survey_response_person_target_associations +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__survey_section_responses.sql b/models/staging/tpdm/base/base_tpdm__survey_section_responses.sql deleted file mode 100644 index 78bb06f..0000000 --- a/models/staging/tpdm/base/base_tpdm__survey_section_responses.sql +++ /dev/null @@ -1,23 +0,0 @@ -with section_responses as ( - {{ source_edfi3('section_responses') }} -), -renamed as ( - select - tenant_code, - api_year, - pull_timestamp, - last_modified_timestamp, - file_row_number, - filename, - is_deleted, - - v:id::string as record_guid, - v:surveyResponseReference:surveyResponseIdentifier::string as survey_response_id, - v:surveySectionReference:surveyIdentifier::string as survey_id, - v:sectionRating::decimal(9,3) as section_rating, - -- references - v:surveyResponseReference as survey_response_reference, - v:surveySectionReference as survey_section_reference - from section_responses -) -select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__survey_sections.sql b/models/staging/tpdm/base/base_tpdm__survey_sections.sql deleted file mode 100644 index 9b40ea5..0000000 --- a/models/staging/tpdm/base/base_tpdm__survey_sections.sql +++ /dev/null @@ -1,21 +0,0 @@ -with survey_sections as ( - {{ source_edfi3('survey_sections') }} -), -renamed as ( - select - tenant_code, - api_year, - pull_timestamp, - last_modified_timestamp, - file_row_number, - filename, - is_deleted, - - v:id::string as record_guid, - v:surveyReference::surveyIdentifier::string as survey_id, - v:surveySectionTitle::string as survey_section_title, - -- references - v:surveyReference as survey_reference - from survey_sections -) -select * from renamed