Julia Longtin has incorporated a form signature method into her xml generator code. Figured it would be better to incorporate the ‘signature’ table directly into OpenEMR rather than have a the form builder create the table (then run risk of incompatible tables if tables are modified by future form builder code.
Actually, here’s a better description of table taken from the script:
CREATE TABLE IF NOT EXISTS `signatures` (
/* a unique ID for each entry */
id bigint(20) NOT NULL auto_increment,
/* the name of the directory containing the form being signed */
formname varchar(255) NOT NULL,
/* the field to be checked */
fieldname varchar(64) NOT NULL,
/* how to check the field */
relationship varchar(20) NOT NULL,
/* what to check it against */
constant varchar(255) NOT NULL,
/* evaluation level */
level tinyint(4) default NULL,
/* how to compare this item to others of its level */
peerrelationship varchar(20) default NULL,
/* how to compare this item to items of the previous level */
subordinaterelationship varchar(20) default NULL,
PRIMARY KEY (id)
) TYPE=InnoDB;
INSERT INTO `signatures` set formname=‘communication_log’,
fieldname=‘signature_box’,
relationship=‘not-equal’,
constant=’’,
level=‘0’,
peerrelationship=‘AND’,
subordinaterelationship=‘AND’;
I tried to model this so that you can use any set of AND and OR operations (and translate them to SQL… makes my head hurt) to represent a set of signature relationships required on a form.
Signing a form was required, so that i could ‘promote’ a form, and make it the active form, visible from a link in the left hand nav. this, some database changes (the ‘extended’ type), and adding a link effectively made a form function identically to the ‘history’ form.
Signing a form to make it authoritative is a powerful tool, which I’m still building more form functionality on top of. I’ve tried to document this on the wiki in the xml form generator documentation… but there is a lot of functionality to document.
1. Are signatures only used in the extended mode to show which saved form to use? What if more than one is signed?
2. Can this mechanism be used to have a hierarchy of signatures (ie. med student, resident, attending) with it only official after a certain signature?
3. Can this mechanism be used to freeze the form after signature from the highest level (ie. attending in above example)? For example, only allow an addendum.
Or have I misunderstood this functionality completely?
1: yes, and if more than one form is signed, you get the most recent signed one.
2: absolutely. the specific case i have is “nurse AND clinician, OR doctor”. separate fields for each role.
3: yes, although i have not implemented that function, for testing purposes. its simple to make edit link to view, and make save refuse to save this form again, if its been signed.
part of the model i’m looking at is a clinician working on a form in the EMR, hitting save in the encounter, going back later, finishing their work (due to a note), and asking their boss to sign off on it. it then becomes the authoritative form covering service provided to this client during a period.
in the case of the ‘history form target’, this means a history form gets an effective date field, that if present makes it authoritative, and show up outside the encounter.
I’ve forgotten some of how i implemented the date range code, or whether thats finished… but i know the rest works.
Sounds useful. If you can find the time, can you put the table into database.sql and the upgrade script and put it on your gitorious repo. Then can begin doing some live testing on it. Would be nice to keep it in it’s current form for commit to the main codebase, since users of xmlgenerator may of already brought this table into their local databases (By having it in the main codebase will stabilize it and avoid nasty incompatibilities down the road). If I had the time, I’d prepare the database mods, but I don’t.