Posted by rick
Thu, 06 Jul 2006 18:43:00 GMT
For those of you who are fans of Martin Fowler’s Analysis Patterns tome of wisdom, and who are curious about the COSMOS clinical process model project that inspired much of that book, you may be interested in reading the documents linked below.
When Charles and I went to RailsConf this year to speak about the success we’ve been having building a comprehensive research-friendly health record, we were approached by Adam Cavan from the audience who was interested in our project. He asked how much of the COSMOS documentation we’d read before embarking upon our project. We were sad to say that we’d never been able to actually acquire a copy of the documents, as no one seemed to have kept them around, nor were they to be found online any more.
“Oh,” said Adam, “I’ve got a copy—would you like to see them?” Would we ever. And he was as good as his word. Thanks to his kindness we’re also making those documents, with all their amazing insights, available here. By the way, you can reach Adam here: acavan (at) suika (dot) com.
Note we don’t pretend to own these documents, but given that they were at one time available on the web we hope our posting will be looked upon kindly as a service to the software and medical care communities.
Without further verbage, here are .doc and .pdf versions of the documents we received:
UPDATE: Added better versions of the “clean” PDFs—also added attribution to our previously pseudo-anonymous friend who found these documents. Tahnks Adam!
Tags cosmos
Posted by charles
Sun, 26 Feb 2006 23:08:00 GMT
The rewrite project has us needing to support three different databases: Oracle, postgresql and SQLServer. Rather than take the approach of using MySQL as seen in “Agile Web Development with Rails” I decided to setup rails to use postgreSQL on my freebsd desktop and laptop. Installing this FLPR environment (freebsd, lighttpd, postgreSQL and rails) turned out to be straightforward despite some sketchy documentation. Those of you using freebsd may want to give this a try. As always it is important to become root to update the ports collection, then checking to see if any currently installed ports need to be upgraded before beginning.
Having done that, then as root cd to
/usr/ports/databases/postgresql81-server/
and do
make all && make install && make clean
This will install both the postgres server and client ports, and it will also have created a pgsql user along with a /usr/local/pgsql directory. This user will own all the data files and must also own the server process. Now the databse files and inital tablespaces need to be created. So, su to the pgsql user and then do
/usr/local/bin/initdb
If you want postgreSQL to start at boot, then make sure that postgresql_enable=”YES” appears in /etc/rc.conf. Don’t start an instance of the databse just yet, but rather exit back to being root and install the rails port. Just cd to /usr/ports/www/rubygem-rails and do the usual
make all && make install && make clean
Then cd to /usr/ports/www/rubygem-redcloth and do the same make sequence.
Next the C source code adapter needs to be installed. Unfortunately, neither the rails install nor the postgreSQL install will correctly set the lib path for building the adapter, so you need to set an environment variable otherwise the build will fail. So, as root do
setenv POSTGRES_INCLUDE /usr/local/include/
follwed by
gem install postgres
Now, a database instance can be started, so, su to the pgsql user and do
/usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
You will need to create yourself as a database user (actually, as a superuser). Here is how I did myself
/usr/local/bin/createuser charles
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
CREATE USER
If you feel more comfortable with a gui-interface for database administration, consider installing the pgadmin3 port.
Lastly, when you create your rails app, you will need to modify the config/database.yml file by commenting out all the lines except the postgreSQL entries and then modify those using the names of the three databases you need (ehr_* in my case):
development:
adapter: postgresql
database: ehr_development
username: charles
password:
host: 127.0.0.1
port: 5432
test:
adapter: postgresql
database: ehr_test
username: charles
password:
host: 127.0.0.1
port: 5432
production:
adapter: postgresql
database: ehr_production
username: charles
password:
host: 127.0.0.1
port: 5432
Using postgreSQL in a tiered environment is only slightly more complicated, and I’ll do a post about that sometime in the future.
Posted in ruby on rails | Tags charles, freebsd, lighttpd, postgresql, rails
Posted by corey
Fri, 24 Feb 2006 20:25:00 GMT
I’ve only been here a few days, so I’m still trying to come up to speed on how everything is working. They’re using CIA to do their continuous integrations after each svn commit. They then have a bot on our local irc server that announces whether the build is broken after the recent commit. While it’s nice to know whether the build is broken or not, I wanted to know the commit message and what files were touched. Enter Kevin Ballard’s svnbot. They used to use this in typo but they’ve apparently stopped in the last few months. The major bonus here is not having to go to our local trac server to see what files were modified and what the other developer had to say about the code they just committed.
Posted in subversion | Tags integration, rbot, svn, svnbot
Posted by rick
Mon, 20 Feb 2006 20:46:00 GMT
Check this out. Jonas Bengtsson has released a new screencast showing how to integrate Ruby and Selenium for browser-based acceptance testing. Bonuses include use of the Selenium IDE, Ruby test authoring, and automation of both IE and Firefox (on Windows, granted, but it’ll be cross-platform shortly, I have a feeling).
Very cool.
Posted in ruby on rails, testing | Tags automation, ie, rails, rick, ruby, selenium, testing
Posted by rick
Sat, 18 Feb 2006 18:46:00 GMT
There’s been some interest from people who want to set up “IE on Linux” as we mentioned we were doing to help with automating IE testing. As you’ll see, the process is merely a testament to the hard work done by others to make this not only possible but easy.
First off, make sure you’ve got licenses for the software you’re installing. I’m not pretending to be a lawyer, not pretending to interpret the Microsoft EULAs that might apply. I think it’s safe to say you’d better have licenses on hand.
I’ll be assuming you don’t already have Wine installed and that you don’t already have a ~/.wine directory already. If you do you’ll need to take that into account. I’m installing on Debian (unstable), but I’ll be installing from tarballs, so as long as you’ve got the dependencies needed to compile wine you should be ok.
Ok, it’s just this simple:
- download the 0.9.7 Wine
tarball here
- tar xvj wine-0.9.7.tar.bz2
- cd wine-0.9.7
- ./tools/wineinstall
- cd ..
- tar xvfz winetools-0.9jo-III.tar.gz
- cd winetools-0.9jo-III
- su
- ./install
- exit
- cd ..
- wt
- do Base Config
- create a Fake Windows Drive
- Install TrueTypeFont Arial
- Install DCOM 98
- Install Microsoft Foundation Classes 4.x
- Install Internet Explorer SP1 English
Now, if like us you are behind a proxying firewall, you’ll have a headache when trying to install IE since the installer doesn’t typically see your proxy. To install from behind the proxy you’ll need to do the following:
- Wait for the download to eventually time out and fail.
- Click “Advanced”
- Click the proxy checkbox, then fill in our proxy IP and port.
- (For some reason I had problems typing in the proxy info boxes and had to use cut-and-paste to get the info in there(?!).
When you’re done, exit out of Winetools. Now you’ve got a .wine/ directory with a “C drive” with IE6 installed. I’d advise backing up .wine/ so you can recreate this configuration with a one-liner (now, don’t you wish that working with Windows was always this easy? Heh.)
To run IE now, simply run IE:
% wine ”$HOME/.wine/c/Program Files/Internet Explorer/IEXPLORE.EXE”
You can append arguments for IE to the end of the command-line.
I’ve verified that Javascript does indeed work, but PNG support is still missing. I haven’t had a chance to try the things mentioned in this forum yet to see if I can get PNGs working. Any feedback on that issue is welcome.
Posted in testing | Tags ie, linux
Posted by rick
Thu, 16 Feb 2006 21:22:00 GMT
We ran into a problem once we installed the RJS templates plugin. Turns out the problem isn’t just in the plugin, but also in edge rails. We wrote up a quick patch that fixed the problem and then wanted to pass the info upstream.
After talking briefly with the maintainer of the RJS templates plugin (Cody Fauser) we were pointed to the proper Rails file to put our test in. So we wrote up a quick actionpack unit test for the problem and tried it out. Yep, there it was.
So we filed a ticket with a patch & unit test: #3861.
Posted in ruby on rails | Tags 3861, patch, rick, rjs, templates
Posted by rick
Tue, 14 Feb 2006 22:22:00 GMT
Taking the advice of Peter Merel from the last post, we're beginning to pursue the automation of browser-based testing for the project. Automation to me means Linux (no way in hell I'm going to try this on Windows, that's just a rabbit hole), so I set up Microsoft Internet Explorer 6 on Linux this afternoon. I'm not sure if this is sacrilege or making the best of a bad lot.
Either way, here's proof:
Posted in testing | Tags ie, linux
Posted by rick
Wed, 08 Feb 2006 21:31:00 GMT
Ruby on Rails is big on testing. There’s support for unit testing cooked right in—every time you create a model you get the unit testing framework built for free—just fill in the blanks. Similarly, whenever you create a new controller, you get the functional testing framework built for free—just fill in the blanks. Seems like view testing (with Selenium and OpenQA) is moving forward, and I wonder if some sort of automated support for those won’t come from the Rails framework itself soon…
That said, there’s very little talk about testing helpers—those bits of Ruby code that are made available for use by the view, but which aren’t in the templates themselves. Helpers aid reuse, and are a valuable use of Ruby behind the template.
Certain helpers can be tested with test/unit, just like unit tests for models. Some helpers, though, call functionality in the view libraries: a really common idiom is to provide various foo_link() methods that will generate links to certain types of objects. Rather than repeating the same detailed ActionView link_to() call everywhere, the code is factored out to a helper method which assembles the appropriate information and calls link_to() for you. Then you’ve got a single point of change whenever you want to change how comment links, story links, user links, whatever, behave.
Testing this sort of code should require a functional test, since you’ll actually want to have the view instantiated. There’s seemingly zero documentation on how to do this, and, checking around on some existing Ruby projects, I see people writing these sorts of helpers, but I see noone actually testing them.
We’ve jumped back for a moment and are relying on “stub” code to allow us to get a primitive, but less than ideal, test of our link helper (and other similar helpers that call ActionView functionality). We’re now looking for guidance from the Rails community.
To that end, we’ve posted Rails ticket #3775.
Posted in ruby on rails, testing | Tags bug, helpers, rails, rick, ruby, testing, ticket
Posted by greg
Mon, 06 Feb 2006 19:46:00 GMT
We had a brief introduction session about RJS templates (a way to automate AJAX actions for Rails) recently. The HOWTO document appears below.
We've also provided an mp3 download of the
audio from the presentation we had for the team.
Read more...
Posted in ruby on rails | Tags greg, rails, rjs, ruby, template
Posted by rick
Mon, 06 Feb 2006 15:11:00 GMT
Jon Tirsen pointed out that there’s what appears to be a full-featured Selenium on Rails plugin now available. We’ve been eyeing Selenium to help us with automating browser tests and acceptance tests, but have been sort of waiting for the dust to settle to see which approach at Rails integration is going to be the best. This plugin wasn’t even on our radar, but it looks really promising.
UPDATE: Speaking of not on our radar—there’s also a new Selenium IDE that’s a Firefox extension for (among other things) writing Selenium tests. Crazy.
Posted in testing, ruby on rails | Tags rails, rick, selenium, testing