Skip to content

Instantly share code, notes, and snippets.

@stopfstedt
Last active August 29, 2015 14:02
Show Gist options
  • Save stopfstedt/320066673988a686b5ca to your computer and use it in GitHub Desktop.
Save stopfstedt/320066673988a686b5ca to your computer and use it in GitHub Desktop.
ilios curriulum inventory managment brain dump.

Some Background

Q: What does it do?

It generates a report of curricular information for a given program in a given year.

Q: What does the report cover?

  • when it gets taught (program, year)
  • what gets taught (competencies/objectives)
  • how it gets taught (courses/sessions)
  • how much gets taught (hours from offerings/ilms)

But not!

  • who teaches
  • who gets taught

The AAMC CI model vs Ilios

whiteboard time

AAMC side:

  • report info (year, id, etc)
  • competency framework (PECRS, objectives, methods)
  • events
  • sequence blocks

Ilios side:

  • program
  • objectives/competencies
  • courses/sessions/offerings

Implementation

Schema

  • curriculum_inventory_* tables
  • curriculum_inventory_institution --> school
  • curriculum_inventory_report --> program
  • curriculum_inventory_sequence (1 per report)
  • curriculum_inventory_sequence_block --> course
  • curriculum_inventory_academic_level (10 per report)
  • curriculum_inventory_export (1 per report)
  • aamc_pcrs
  • aamc_method
  • session_type_x_aamc_method
  • competency_x_aamc_pcrs

Configuration

  • ilios.php config script
  • aamc_ tables AND assoc. JOIN tables
  • curriculum_inventory_institution

Server-side

Controller

  • Curriculum_Inventory_Manager
  • CRUD for report and sequence blocks.
  • d/l and finalize methods for report.
  • lightweight, deals with routing, input validation and some output (pre)formatting
  • heavy lifting in business logic and model components

Business Logic

  • third_party/Ilios/Curriculum_Inventory/Exporter.php
  • deals with report data aggregation and xml export generation
  • should really be two classes

Model/Data Access

  • various Curriculum_Inventory_* classes
  • most of them are Table Data Gateways, only one (Curriculum__Inventory) is a true Data Access Object.
  • heredoc notation for SQL queries preferred, CodeIgniter query builder used where applicable (where_in())
  • of note: Curriculum_Inventory and Curriculum_Inventory_Sequence_Block

View

  • index.php page template
  • various *_dialog.inc.php templates for dialog markup
  • report_details_view.inc.php view template
  • The rest of the markup gets generated dynamically via JavaScript DOM methods.

Client Side

  • namespace ilios.cim
  • YUI2 - Y U no MVC?
  • Model/View/???
  • application/views/curriculum_inventory/js dir
  • work with the framework, not against it
  • no dirty state! ever!!!!
  • reuse as little of the pre-existing JS shit components as possible

Application

  • ilios.cim.js
  • single ilios.cim.App object
  • application container, event broker, application lifecycle manager
  • no routing
  • Controller?
  • event driven

Data Source

  • talks to server backend via XHR calls
  • deals with finalizing/deleting/exporting reports.
  • deals with sequence block deletion.
  • custom events YAHOO.util.CustomEvent

Views Map

  • collection management of views components
  • where does it belong?

Models

  • ilios.cim.model.js
  • namespace ilios.cim.model
  • Data models and Collections

ilios.cim.model.BaseModel

  • meant for reusability (TODO: refactor out into common namespace)
  • auto-generated client side id
  • extends YAHOO.util.AttributeProvider
  • fires change event on attribute change
  • read-only attribute support

ilios.cim.model.ObjectMap

  • associative array implementation
  • add/remove/list/exists/get/walk/size methods

ilios.cim.model.CourseRepository

  • extends ilios.cim.model.ObjectMap
  • adds checkin/checkout capabilities

Views

  • ilios.cim.view.js
  • "A View is a display element backed by a model.
  • extends "YAHOO.util.Element`
  • listens to model changes - updates itself accordingly
  • may listen to application wide events as well (e.g. lock/unlock report during finalization or d/l)
  • may be container for other page elements (such as buttons), and sub-views (e.g. nested sequence blocks)
  • for reference: http://www.yuiblog.com/blog/2008/06/24/buildingwidgets/

Widgets

  • all dialogs and toolbars

  • ilios.cim.widget.js

  • built on YAHOO.util.Element (toolbars) and YAHOO.widget.Dialog

  • dialogs for changing model, form submissions/XHR POSTS directly to server backend. custom events firing on success/failure response

  • toolbars - containers for buttons

Odds'n'Ends

TODO

  • server-side tests
  • client-side tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment