View keybase.md

Keybase proof

I hereby claim:

  • I am krisleech on github.
  • I am krisleech (https://keybase.io/krisleech) on keybase.
  • I have a public key ASAZreLYPIXpsQV6gtgNV7aficJb7qfNPIbSoHvOVrvWqQo

To claim this, I am signing this object:

View dispatch-handler.md

We can set the URL using a string (event dispatch). This will end up calling a function with the same name as the string (an event handler). The function handler can then update the state.

;; state
(def state (atom { :content "" }))
(def session (atom { :page "home" }))

;; handlers
;;
(defn about [] (clojure.core/swap! state assoc :content "About us"))
View sequel.rb
bq=db[:studies___s].select{[:s__id, :s__name, `"boolean" as type`, :bd__key___key, :b__value]}.left_join(:booleans___b, { :b__study_id => :s__id }).left_join(:boolean_definitions___bd, { :b__boolean_definition_id => :bd__id}).where(:bd__key => 'is_nihr').or(:bd__key => 'is_commercial')
tfq=db[:studies___s].select{[:s__id, :s__name, `"text" as type`, :tfd__key___key, :tf__value]}.left_join(:text_fields___tf, { :tf__study_id => :tf__id }).left_join(:text_field_definitions___tfd, { :tf__text_field_definition_id => :tfd__id}).where(:tfd__key => 'eudract_number').or(:tfd__key => 'portfolio_number')
eq=db[:studies___s].select{[:s__id, :s__name, `"enum" as type`, :e__key___key, :es__name___value]}.left_join(:enumeration_values___ev, { :ev__study_id => :s__id }).left_join(:enumerations___e, { :ev__enumeration_id => :e__id}).join(:enumeration_states___es, { :es__enumeration_id => :e__id }).where(:e__key => 'iras').or(:e__key => 'phase')
dq=db[:studies___s].select{[:s__id, :s__name, `"date" as type`, :sdd__key___key
View reporting.md

Reporting

The aim of this gem is to standardise reporting. It also allow registration of reports and have them appear in the UI.

It will be used for reports which can not otherwise be produced with the data grid.

To register a report:

Reporting.register(name:   'BRU Recruitment Report', 
View configuration.rb
require 'dry/container'
require 'logger'
module Oxygen
class Configuration
extend Dry::Container::Mixin
# default configuration
register('reports', [])
register('utils.logger', Logger.new($stdout))
View pull.rb
# DoSomething has dependency on Configuration and pulls default from Configuration
#
module MyThingy
class DoSomething
def call(input, suffix = nil)
input + (suffix || default_suffix)
end
private
View reagent.md

ReAgent

Reagent binds components to data using an atom. An atom is a ClojureScript reference type. An atom references an immutable value, but the reference itself is mutable, it can be changed using reset! and swap! to reference a different imumtable value. Changes to atom's are atomic.

The value can be retrived by dereferencing the atom using deref or the @ prefix.

Functions can be attached to atoms to watch for changes, the function will get the atoms old and new state as arguments.

Reagent provides its own atom, reagent/atom, which has watches setup to rerender compontents which reference the atom.

View dyna_model.md
require 'mongo'

class DynaModel
  include Virtus.model

  def save
    connection.insert(self.attributes)
  end
View stack
Testing documas-cljs.routing-test
Ran 8 tests containing 9 assertions.
0 failures, 0 errors.
Tests succeeded.
Compiling "target/testable.js" failed.
java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol
RT.java:505 clojure.lang.RT.seqFrom
RT.java:486 clojure.lang.RT.seq
core.clj:133 clojure.core/seq
View pres.rb
# given these models
class Study < AR::Base
class Site < AR::Base
class Visit < AR::Base
end
end
end
Study::Site::Visit