Showing posts with label Ruby. Show all posts
Showing posts with label Ruby. Show all posts

Monday, April 20, 2009

Cash Transactions : Care Continuity

In programming major applications such as finance there is a need to ensure within the transactions and the database operations that mistakes do not occur.

The classic example is a transfer between two accounts:
def transfer(from, to, amount)
from.debit(amount)
to.credit(amount)
end
It is vital that the above method (example provided by Tate and Hibbs) does not fail after the debit. In Rails the transaction method help to prevent 'digital accidents' as follows:
def transfer(from, to, amount)
Account.transaction do
from.debit(amount)
to.credit(amount)
end
end
transaction is itself a method built into Rail's Active Record that helps to maintain the integrity of transactions. Which brings me to 'care'. ...

There are several blog posts here since you reach a stage in your career when the hard fought lessons of yesteryear have to be faced again but this time like after dinner wind.
There are many possible care transactions that arise.

Many have a specific context and frequently these are conjoined:
  • timing
  • relationships - trust
  • responsibility - transfer
  • care environment
  • record (paper, electronic)
As to care transaction consider these:
def transfer(from, to, care_plan)
Care.transaction do
from.hospital(care_plan)
to.community(care_plan)
end
end

def transfer(from, to, day_care)
Care.transaction do
from.home(day_care)
to.day_center(day_care)
end
end
Wherever, whenever, whatever and whoever your transactions involve, take care of them and remember in health and social care (esp.) outcomes add up.

Don't forget to look after the however: the information, the knowledge, the promises ....
def transfer(from, to, promise_plan_of_action)
Care.transaction do
from.nurse(promise_plan_of_action)
to.carer(promise_plan_of_action)
end
end
Reference: Bruce Tate, Curt Hibbs (2006) Ruby on Rails: Up and Running, O'Reilly, p.35.

Friday, April 17, 2009

Nursing as reverse engineering...

At Scotland on Rails last month one of the sessions included an example of Ruby code outlining a 'morning routine'. It comprised a series of tasks and sub-tasks all of which led to getting to work.

Much of the vital essentials of the code I cannot understand beyond some tentative inklings, but in the hope of learning I've re-hashed the accessible bits and turned it into a NursingRoutine. The output looks like this....

Nursing....
"Non-judgmental attitude"
"Universal positive regard"
"Basic counselling skills"
"Open mind"
"Meet person"
"Receive referral"
"assess person utilizing Hodges model"
"Create care plan"
"Meet physical needs"
"Meet interpersonal needs"
"Meet political care needs"
"Meet social care needs"
"Holistic care"
"Evaluate physical needs"
"Evaluate interpersonal needs"
"Evaluate social care needs"
"Evaluate political care needs"
"Evaluate care"
"caring..."

Something like nursing is obviously a much more complex routine than that implied above - that is because:
  • nursing is not [some - 'thing'];
  • nursing can be represented as a routine BUT;
  • nursing seeks to transcend the routine: emphasizing the personal, unique, the humanistic;
  • nursing is parallel and sequential;
In addition now we are about collaborative, multidisciplinary care that must factor in agreement (the care plan...), and patient reported outcome measures (PROMS). ...

In the meantime I need to exercise care trying to understand the program that produced the output (that could also be easily printed as a list). While this is not an example there is such a thing as obfuscated code, but surely not obfuscated nursing care?

Tuesday, March 31, 2009

Scotland on Rails 2009

1 April mmm... while it is not yet self evident I should by now have an all singing and dancing website. In fact maybe I should have two, since the conference score is currently:

DRUPAL :1 (Drupalcon Szeged 2008) Ruby and Rails :2 (Scotland on Rails 2008 & 2009)

Having just returned from Edinburgh and three days of presentation magic - not only were the speakers experts and leaders they all knew how to present - it's time for me to reflect a little.

Jim WeirichI took something away from ALL the presentations as I attended 'a full stream' mostly the sessions in the main hall. Jim Weirich's session on Building Blocks of Modularity was very interesting informatically, holistically and clinically as he explained and referenced “connascence”:

An examination of the concept of “connascence” and building modular programs.

Connascence: n.
* The common birth of two or more at the same time; production of two or more together.
* That which is born or produced with another.
* The act of growing together.


Connascence: undoubtedly a concept to add to 'consilience'.

Whether using Drupal or Ruby - Rails I'm conscious that you can create a website very quickly. As already ack. here last summer in Hungary Dan and James advised that I get something together and publish the beta. On Saturday Steven A Bristol stressed the same:
  1. Identify the essential thing you have to offer through a website / application;
  2. do not wait until it is 'finished';
  3. - speaking of which are you a techie or designer? Find the partner(s) you need, people are rarely both;
  4. ensure you include a feedback mechanism - not just e-mail;
  5. and 'get it out there'.
In their session Kevin McDonagh and Joseph Wright added that it is a waste of time appealing to the World. Of course Kevin did not realise how painful it was for me to hear that, but since this is certainly true - I have appealed to the world - it was very therapeutic. Unlike Kevin and Joseph's Green Map as a Community Project I'm not sure if whether I can appeal to the local community (despite an interest in ecology).

Dave Thomas of the Pragmatic Programmers by Fraser Spiers at SoR 2009Like Drupal the Ruby community is just a terrific group of people - welcoming, supportive, cohesive - a bunch of real humans. The charity tutorial day raised £7,000 for CHAS the Children’s Hospice Association Scotland.

After Dave Thomas presented a fascinating keynote on the Ruby Object Model, Erin Staniland and Tim Harding confirmed I've the basic building blocks in place to create and execute a Rails application on my MacBook.

Peter Jones at SoR March 2009 image by Fraser SpeirsI am hooked on Drupal and Ruby. Some of the keywords and structures in Ruby are dangerous in their appeal - more on this to follow...

Driving (ironically) back to NW England I realised Earth Hour was in progress, hopefully there will be another one. That night Orion was beautiful chasing a fresh smiling new moon along the way...

Images: thanks to SoR site and Fraser Spiers
http://www.flickr.com/photos/fraserspeirs/tags/scotlandonrails2009/

P.S. Kevin - I owe you a beer towards the taxi Friday night!

Thursday, March 12, 2009

Update on h2cm, books, Drupal, Ruby and that website....

I have not posted anything on where things are up to here for a long time. Largely because as you've guessed not much IS happening. There are a few things afoot though ....

Scotland on Rails
Later this month I'll be travelling up to Edinburgh again. A once a year event plus some reading / tinkering in-between is not the best way to learn, but I'm a nurse (still)....

This time I'm there for the full duration and the first day is dedicated to beginners:
Charity tutorial news
Friday, March 06, 2009

A big thanks goes to Ron Jeffries for donating $500 (USD) towards the charity tutorial room hire; this is huge help.

We have now booked the main conference hall for the tutorial on Thursday March 26, and now have space for around 20 more people. This is a great chance to learn Ruby from two of the top names in the community – Rails-core alumnus and Pragmatic Studio instructor Marcel Molina Jnr, and Pragmatic studio Rails and Ruby instructor Chad Fowler. In return we suggest a £75 (minimum) donation to the Children’s Hospice Association Scotland here.


Drupal
All things being equal I hope to attend Drupalcon in Paris this September. There are a few people from Manchester planning to travel over. Drupalcon 2008 Szeged was great and I'm still convinced that the learning there will pay dividends in time. I do still wonder "WHAT AM I DOING THIS FOR", but I'm still also convinced that Hodges' model as a conceptual framework for global health and informatics is worthy of the effort.

Drupal and books
As mentioned quite awhile ago (and Packt the publishers have been in touch) I am reading Drupal for Education and E-Learning by Bill Fitzgerald. I have been looking forward to this for three reasons:
  1. My early programming efforts were based on programs for nursing education using the BBC micro;
  2. I am intrigued as to the content and 'educational' scope of this book and what it might suggest about where Drupal sits in relation to Moodle.
  3. In creating a new website I need to focus on a specific audience or user community - at least in the first instance - this book might help with some early decisions.
Up to page 144 I'll have this finished for the month end [or mid-April ;-) ], before then though I will have tinkered with Views and a few other key Drupal bits-and-pieces. I must say the chapter on Views makes me appreciate why established Drupallers have it in their 'must have' module lists.

The Website Redesign
I'm not so much sleeping on the question of content types for Hodges' model as in a state suspended animation. Whatever the spell is, whatever the cause - my physical / mental state, Drupal's complexity or the 'problem domain' which in this case comprises:

Hodges model AND.....

holistic care, integrated care, collaborative care, care perspectives, care precepts, user community, accessibility, Web 2.0 - 3.0 - all chasing educational, informatics, health and social care policy....

Well, when I wake up the beta site will appear and the prospective ingredients will be a sweet after taste, that hopefully gets sweeter with further revision and development!

Once again as noted previously it would be helpful to field a poll, survey here to help decide on the future content - especially what the priorities are for different users? Thinking back to Szeged though the best source is to get a site up and running...

I've decided on NetBeans as my editor and I am impressed (with the editor). To get to grips with it I'm looking afresh at the links pages to revise them so that the row categories can be expanded and collapsed using jQuery.

Hodges model application
There are some developments regarding Hodges model and its use within forensic mental health services. I hope to report on this in the near future.

Next book chapter

As noted last month there is another exciting project with a paper on Hodges' model, Substance Misuse and Mental Health in preparation.

The paper on h2cm and conceptual spaces drawing on Gardenfors is not forgotten - an update on that maybe in the summer...?

Additional links:

The Science Collaboration Framework (SCF)

Tuesday, September 30, 2008

Reflection: programming and caring II

Reflection: (Ruby Pocket Reference, O'Reilly, 2007, p. 147.)

The ability of a language such as Ruby
to examine and manipulate itself.
For example, the reflection method class from Object
returns an object's class ("hello".class # => String).

Reflection within health and social care - is there a further definition ...?

Well yes, there are several, but there may be another ...?

The ability of a health and social care model such as Hodges' model
to examine and manipulate itself *
in response to an individual's (and family's)
care situation and context.
For example, the reflection method class from Object
returns an object's class (Intrapersonal.class # => Domain)#.


*This would require of course that Hodges' model is represented as a programming language or formalised conceptual space of some sort....
#Or something like this....

Saturday, September 27, 2008

Composability: programming and caring

Composability: (Ruby Pocket Reference, O'Reilly, 2007)

The degree to which you can express logic
by combining and recombining
parts of a language
(p. 136).

Composability within health and social care - is there a further definition...?

The degree to which you can express care situations
by combining and recombining
the parts of a language encompassed within a health and social care model,
(a dedicated conceptual space).