Home

An example

image

Contents

1. indexing description Super class for enum classes author Sam Lightstone date SDate revision SRevision deferred class interface ENUM_MAP feature ANY clear_map unsets th numerator ensure is_set false get_enum INTEGER returns an INTEGER enumerator require is_set true ensure Result enum get_formatted_string STRING Returns a human readable string representing an enumerated typ require is set true is set BOOLEAN Has the enumerator been set make creation ensure postl is set false max enumerator INTEGER the max enumerator supported by each class of type ENUM MAP invariant end is set implies is set implies is set implies class ENUM MAP enum 0 string void string count gt 0 37 EVENT MAP Ancestor ENUM MAP indexing description Types of medical events and their features author Sam Lightstone date SDate revision Revision class interface EVENT MAP create make feature ANY is diagnosis BOOLEAN return TRUE if diagnosis require is set ensure postli enum enum diagnosis implies Result is triage BOOLEAN return TRUE if TRIAGE require perl is set ensure psotl enum enum triage implies Result Max enumerator INTEGER is 3 maximum enumerator for this class set diagnosis sets th vent type to diagnosi
2. set_practitioner_from_enum enum_in INTEGER sets th numerated map given an enumerator this will do a sanity check ont he enum set the human readable format string and mark the object as being set is set TRUE require enum in 0 enum in max enumerator 58 ensure enu is set invariant enum in true m invariant_claus class PRACTITION num lt max enumerator end ER MAP 59 QUERY PANEL Ancestor INTERFACE indexing description UI panel provides selections for patient queiries author Sam Lightstone date SDate revision Revision class interface QUERY_PANEL create make feature Initialization make repository in PATIENT DATA REPOSITORY Creation routine ensure postl specialty enum void end class QUERY PANEL 60 APPENDIX D COMPLETE SYSTEM SOURCE CODE APPLICATION indexing description The root class for the medical DB project author Sam Lightstone date SDate revision SRevision class APPLICATION create make feature make is allocate app with n states and m possible choices instantiate transition and state arrays then traverse the state transitions until the exit state is traversed local m INTEGER db name STRING do io putstring intro text db name io new line io new line io putstring SNSNThis program requir
3. HNE WHIP OHIP Hale is cor T ot ise type 2 ter 21 PARALLEL PROCESSING POWER Currently MHDCS runs on top of IBM s popular DB2 Universal Database Database Management System v6 1 This database software provides the MHDCS software you are running with super runtime support for parallel processing through Symmetric Multiprocessors or Massively Parallel Processors As well you may configure your database to perform extensive parallel I O using multiple disks Please refer to your database management system s user manuals for explicit set up and tuning instructions CRASH RECOVERY AND FAULT TOLERANCE The MHDCS software is designed to perform all of its persistent data operations through the DB2 database management system Note that all transactions operations to the database performed by MHDCS for INSERT operations are committed immediately As such all system fault recovery is performed by the underlying DBMS MHDCS is therefore fully crash recoverable For additional system failure security consider taking database backups at regular intervals using the DB2 Backup facility 22 OPERATING LIMITS Storage capacity for MHDCS is currently limited by the table capacity of the underlying database management system The current version of this software is a prototype and runs exclusively on the database server under the ID of the database administrator No additional level of user authentication or security is provided
4. 72 local end get any key is control string esc char CHARA zero char blac control string STRING CTER k char white char yellow char zero char 0 esc char zero char 21 black char 0 white char 7 yellow char 3 control string put esc char 1 control string put s 2 control string put 3 control string put yellow char 4 control string put 5 control string put at 6 control string put black char 7 control string put m 8 io putstring control string io putstring string control string put esc char 1 control string put E 2 control string put 3 control string put uniten char 4 control string put 5 control string put at 6 control string put black char 7 control string put m 8 io putstring control string mapping routine for getch since note that i external C stdio h alias getch end determine age require local ensure end years between dates require local ensure date time given a star current age date time vo current sys tim duration DATE_ create current create duration current sys tim duration Result duration year postl Result lt 135 post2 Result gt 0 datel date2 DATE TIME given two dates between them prel datel pre2 date2 duration DATE create duration date2 rel
5. Mapping class author Sam Lightstone date SDate revision Revision class interface MEDICAL_EVENT create make feature make feature ANY absolute date DATE_TIME comment STRING complaint STRING event type INTEGER final diagnosis STRING hospital name STRING medical specialty INTEGER patient ohip num INTEGER practitioner name practitioner type STRING INTEGER reset patient ohip num EVENTS for repositories associated with table MEDICAL resets the patient ohip num attribute to 0 ensure patient ohip num 0 set attributes complaint in ohip num in specialty in require prel pre2 pre3 pract type in event type in INTEGER date time in ohip num in 0 pract name in count hospital name in co pred vent type in gt 0 pre5 pre6 pre ensure postl post2 post3 post4 post5 date time in voi specialty in gt 0 pract type in gt 0 patient ohip num complaint void medical specialty practitioner name practitioner type gt 0 unt 0 d ohip num in Specialty in void pract type in 48 pract name in hospital name in diagnosis in comment in DAT E TIM E STRING post6 absolute date date time in post7 hospital name void post8 final di
6. e OVERVIEW PANEL A help panel providing textual information about the nature of the MHDCS system e HOME PANEL The initial UI panel providing basic navigation through the system e QUERY PANEL The UI panel for requesting database queries of medical consultations diagnosis patient and patient relatives medical histories e LIST USERS PANEL The UI panel for listing known OHIP users NEW EVENT PANEL The UI panel for entering new data and possibly new OHIP users into the system The Database Repositories cluster This cluster is structured around a high level class named PATIENT DATA REPOSITORY and several utility classes which it uses This cluster and in particular the PATIENT DATA REPOSITORY class are the primary interface for the rest of the system into database operations This cluster is built on top of EiffelStore The cluster s class set includes e PATIENT DATA REPOSITORY The primary interface for database operations in the system This class is a client to the EiffelStore EiffelTime and Enumated maps clusters e OHIP USER a mapping class used in conjunction with the EiffelStore DB REPOSITORY class This class follows the EiffelStore double matching rule for the relational table OHIP USERS e MEDICAL EVENT a mapping class used in conjunction with the EiffelStore DB REPOSITORY class This class follows the EiffelStore double matching rule for the relational table MEDICAL EVENTS This class can be used to hold
7. feature ANY absolute date DATE_TIME Date and time of a medical consultation bind out last ohip user bind out the last ohip user we queried inserted if there was one Otherwise just NOP ensure postl ohip user patient ohip num gt 0 implies is valid ohip user data post2 ohip user patient ohip num 0 implies cur patient ohip num ohip user patient ohip num comment STRING Comments from the medical practitioner complaint STRING patient s complaint that caused them to visit the hospital connected ok BOOLEAN did we connect tot he database ok dad ohip num INTEGER patient s father s OHIP date of birth DATE TIME Patient s date of birth db query in prog BOOLEAN Is a query currently in progress event map EVENT MAP type of consultation triage diagnosis etc final diagnosis STRING The final diagnosis from the attending medical practitioner 54 gender map GENDER MAP gender of the patient given names STRING patient given names hospital name STRING the name of the hospital where the current medical consultation took place is patient in ohip repository ohip num INTEGER BOOLEAN determine if this user exists in the ohip repository or not require prel ohip num gt 0 ensure ohip user patient ohip num gt 0 implies Result tru is val
8. io putstring io putstring patient data repository surname end age years between dates patient data repository date of birth oatient data repository absolute date io putstring NAge io putint age if patient data repository surname void then io putstring OHIP 4 io putint patient data repository patient ohip num end end io putstring NConsultation type io putstring patient data repository event map get formatted string io putstring Area io putstring patient data repository specialty map get formatted string if patient data repository complaint void and patient data repository complaint count gt 1 then io putstring SNPatient concern io putstring patient data repository complaint end io putstring NPractitioner 76 io putstring patient data repository practitioner name io putstring io putstring patient data repository practitioner map get formatted string io putstring NHospital io putstring patient data repository hospital name if patient data repository comment void and patient data repository comment count gt 1 then io putstring NPractitioner comments io putstring patient data repository comment end if patient data repository final diagnosis void and oatient data repository final diagnosis count 1 then io putstring NDiagnosis io putstring patient data repository final diagnosis end io p
9. session control connect if session control is connected then is connected true end end is connected BOOLEAN session control DB CONTROL db cleanup is normal garbage collection isn t quite enough in this application If we are connect to a database we need to disconnect explicitly require session control void do if session control is connected then Session control disconnect end ensure not session control is connected end session ok BOOLEAN is require session control void do Result session control is ok end invariant session control void end class MEDICAL DATABASE 86 MEDICAL EVENT indexing description Mapping class author Sam Lightstone date SDate revision SRevision class MEDICAL EVENT create make feature make is do complaint practitioner name hospital name final diagnosis comment patient ohip num 0 create absolute date make end feature ANY patient ohip num INTEGER complaint STRING medical specialty INTEGER practitioner name STRING practitioner type INTEGER absolute date DATE TIME hospital name STRING final diagnosis STRING comment STRING event type INTEGER reset patient ohip num is for repositories associated with table MEDICAL EVENTS 1999 l 20727 30 Dj resets the patient ohip num attribute to 0 do patient ohip num
10. 0 ensure patient ohip num 0 end set attributes complaint in Specialty in pract type in event type in pract name in INTEGER date time in hospital name in diagnosis in DATE TIME is require prel ohip num in 0 pre2 pract name in count 0 pre3 hospital name in count 0 pre4 event type in gt 0 87 comment in STRING ohip num in pred pre6 pre patient ohip num complaint medical specialty practitioner name practitioner type clone date time in void specialty in gt 0 pract type in gt 0 ohip num in complaint in specialty in clone pract name in pract type in absolut hospital name final diagnosis comment event t ensure post post2 post3 post4 postb5 post post post8 post9 post10 end invariant patient ohip num gt 0 absolute date void end class MEDICAL EVENT date time in clone hospital name in clone diagnosis in clone comment in event type in e date ype patient ohip num complaint void medical specialty specialty in practitioner name void practitioner type pract type in absolute date date time in hospital name void final diagnosis void comment void event type event type in ohip num in 88 NEW EVENT PANEL Ancestor INTERFACE indexing description Panel for user to enter new patient events data after a patient consultation author Sam
11. 2 8 panel transitions put 3 3 1 panel transitions put 3 3 2 panel transitions put 3 3 3 panel transitions put 1 3 4 panel transitions put 1 4 1 panel transitions put 1 5 1 this feature intializes the application panel transition array with a references to each panel this app may need 63 get db name ensure end local do end pplication ui panels enter home panel 1 pplication ui panels enter query panel 2 pplication ui panels enter new event panel 3 pplication ui panels enter all users panel 4 pplication ui panels enter overview panel 5 ooo om o pplication_ui_panels item 1 home_panel pplication_ui_panels item 2 query_panel pplication ui panels item 3 new event panel pplication ui panels item 4 all users panel pplication ui panels item 5 overview panel ooo STRING is Prompt user for db name and return db name string temp string STRING io putstring NPlease enter the name of the database you expect MHDCS to connect to io readline temp string clone io laststring Result temp string start db session is Intro text local end prompt user for DB name and instantiate the patient data repository object db name STRING db name db name get db name create patient data repository make db name if patient data repository connected ok then io putstring N N Una
12. Sam Lightstone date SDate revision SRevision deferred class INTERFACE feature ANY make interface require do ensure end get selection do ensure end repository in PATIENT DATA REPOSITORY is the generic make routine useful to all INTERFACE objects repository in void Il patient_data_repository selection 0 panel_selection 0 selection_prompt_string repository_in request_selection_string postl patient data repository repository in post2 selection 0 post3 panel selection 0 INTEGER is returns the current user selection Result panel selection postl Result panel selection process panel is display a new UI panel deferred end feature NONE selection INTEGER the user selection from any request panel selection INTEGER the user selection from a UI panel min selection value INTEGER minimum expected selection max selection value INTEGER nmax expected selection min panel selection value INTEGER minimum expected selection max panel selection value INTEGER nmax expected selection patient data repository PATIENT DATA REPOSITORY display header reference to object providing basic DB operations string string STRING is prints a string to stdio in a colour designated for headers Not currently used since ANSI colour not supported on all NT configurations
13. is sets medical specialty to psychiatry enum enum psychiatry string psychiatry string is set true postl is set true post2 enum enum psychiatry 83 feature set oncology is do ensure end set triage is do ensure end set specialty f require do ensure end Max enumerator NONE Enum_obstetrics Enum_cardiology Enum ophthalmol Enum psychiatry Enum oncology Enum triage IN sets medical specialty to oncology enum enum oncology string oncology string is set true postl is set true post2 enum enum oncology sets medical specialty to triage enum enum triage string triage string is set true postl is set true post2 enum enum triage rom enum enum in INTEGER is sets medical specialty from an enum value The enum value passed should have been previously obtained from features of this class This will also set the external string representation prel enum in 0 pre2 enum in max enumerator is set false if enum in enum obstetrics then set obstetrics elseif enum in enum cardiology then set cardiology elseif enum in enum ophthalmology then set ophthalmology elseif enum in enum psychiatry then set psychiatry elseif enum in enum oncology then set oncology elseif enum in enum triage then set triage end postl enum enum in post2 is set true I
14. require 55 prel is valid ohip user obj new user ensure postl update ok implies is patient in ohip repository cur patient ohip num post2 cur patient ohip num new user patient ohip num post3 ohip user patient ohip num new user patient ohip num next medical event fetch the next medical event in a query of the medical event table require prel db query in prog ensure postl not results exhausted implies db query in prog post2 not results exhausted implies is valid event medical event next ohip user fetch the next ohip user in a query of ohip users table require prel db query in prog ensure postl not results exhausted implies db query in prog post2 not results exhausted implies is valid ohip user obj ohip user patient ohip num INTEGER patient OHIP practitioner map PRACTITIONER MAP Type of practitioner nurse docutor etc practitioner name STRING The practitioner s name Nurse or Doctor query all patients List all patients by name and OHIP number ensure postl query ok query children Retrieve the set of children who have the current patient as a parent require prel is patient in ohip repository cur patient ohip num ensure postl query ok query ok BOOLEAN Did the last query run ok query patient complete history List a complete medical history for a patient require prel is pati
15. self documentation and design by contract The use of OOD in this design is expected to also demonstrate the open closed principle and the uniform access principle HIGH LEVEL SYSTEM DESIGN AND CLUSTER OVERVIEW The notion of a data repository in EiffelStore EiffelStore the Eiffel cluster for interfacing to database systems including relational and object oriented databses includes the notion of a data repository A data repository maps directly to a single relational table This abstractions provides a powerful and easy machanism for performing table operations select insert delete through Eiffel objects The repository capability is encapsulated in the EiffelStore class named DB REPOSITORY Aside from providing a mechanism for Eiffel application developers to access relational database services at a table level repositories have the outstanding feature of mapping Eiffel objects directly to relational tables This makes it possible with very few programming steps to insert the attributes of an Eiffel object directly into corresponding table columns or alternatively to select directly from a relational table into an Eiffel object It is important to note that this capability of object table mapping is a special and notable feature of EiffelStore and not at all an industry standard ODBC or RDBMS capability Mapping between Eiffel objects and relational tables is performed through the DB REPOSITORY services and is dependant on
16. 23 FUNCTIONAL VERIFICATION TEST PLAN TEST METHODOLOGY This test plan assumes the reader and tester has a comprehensive knowledge of the MHDCS User s Guide The purpose of these tests are to test the MHDCS system against the system specifications The plan coverage is divided into two test categories 1 Functional Correctness tests These tests verify the correct behaviour of the system functions against the requirements defined in the system functional specification 2 Robustness tests These tests verify the behaviour of the system under abnormal runtime situations such as system abend invalid user input etc 24 TEST SYSTEM SPECIFICATION The test system is an Intel P200 Installed software includes 1 2 NT 4 0 Workstation DB2 Universal Database Version 6 1 Medical History Database and Correlation System version 1 0 The test database is a default DB2 database created using System Manages Space containers All application tables are created in USERSPACE1 according to the database design requirements outlined in the MHDCS User Manual The test database is preloaded with 58 OHIP patients and 5 5 thousand consultation records This data was generated using a simulation program and is pseudo randomized This consultationn data includes medical consultations for each of triage intermediate consultation and diagnosis Note that the test data does not generate medical consultation data for children under 5 year
17. APPENDIX A BUSINESS OBJECT NOTATION BON SYSTEM DIAGRAM eese ees enean ena tns tns tn sns tatnen tn sna tnn 34 APPENDIX B GLOSSARY OF CLASSES eese anoa a aan anoa aa a aa sentia a aa a ta aa aa a anoa aa senses ensis ensis enata ens en naa onen sensns en ens enn 35 APPENDIX C SHORT FORM OF SYSTEM CLASSES eee ooe aa aan aa aa a ttn tns aan aan aan sensns enses estas nona anoa a anoa manan0snen 36 APPLICATION is 5 i Recte ite t ssist it t ee RE i Set en 36 ENUM MAP uice etit BUR UO EOD OUI EEEE E nte ERI PUO wales 37 EVENT MAP tr e EO RODEO OO EO RT RO RR ERE IT HERD HUE REICH TEU EEE CERE EO 38 GENDERZM AD trt t hr RERO URDU RO BOO D RUBRI IRIURE CETERO UTR ETHER DERE ERE CR EE RE 40 HOME PANEL nnt RE RERO ERE RR O ROBORE RTT RO ETE PIT RED CERT eee 42 I gbudg lel En 43 EIST S SERS PANEL onssas HER n ERR ERRAT ERO ID RO DEO ERR ERECTO EE EET ERE EORR TE 44 MED SPECIALTY MAP iro ER ER E ERR ERE RECEN ERU ERO EO RU QUTD UC RE DERE UHR RT 45 MEDICAL DATABASE 3 et t REED TERRE TERRE ERO TAS eaalmeaetu E N S eva iu ATA VAT TE E EET EEE LOTTE 47 MEDICAL EVEN D e a d aa t OUR PRECEDENTE ORE LUMI E a ES EEE USERS 48 NEW EVENT PANED osissa es e E E E RUD EO a REPRE HET RE EO EEE LASIA 50 eSI MUN EE 51 OVERVIEW PANEL tet eer hr ETHER RETE EEG EO ERE RU ERE REMIT HR EE TERR PETERE ERU 53 PATIENT DATA REPOSITORY tnr he tbt t C RE a RO ERR E RECO RE ET REL REESE teense e PER UUT
18. current ohip num INTEGER process panel is Routine to run the panel local ohip user exists BOOLEAN do panel selection 0 clear screen display panel header io putstring 1 Display a patient s last hospital visit N io putstring Complete patient history N io putstring Patient history by diagnosis N io putstring Patient history by diagnosis for medical specialty N io putstring Patient history by medical specialty N io putstring Family history by diagnosis 2N io putstring Family history by diagnosis for medical specialty N io putstring 8 Back to home N J O 01 amp W N min panel selection value 1 max panel selection value 8 min selection value 1 max selection value 8 request panel selection if panel selection 8 then current ohip num request ohip num 109 ohip user exists patient data repository is patient in ohip repository current ohip num if not ohip user exists then invalid ohip user msg io putstring NZN NZN please continue else patient data repository bind out last ohip user end end if ohip user exists then if selection 1 then display last visit please continue elseif selection 2 then display_complete_history please_continue elseif selection 3 then display_history_by_diagnosis false please_continue elseif selection 4 then request_medical_specialty specialty_enum display_history_for_specia
19. database INSERT UPDATE successful BOOLEAN did we connect tot he database ok STRING is Creation routine Instantiate the medical repository and other reference objects date time string create medical database make db name in if medical database is connected then connected ok true end if connected ok then create base selection make create store make create medical event make create create create create create create ohip user make gender map make event map make practitioner map make specialty map make event repository make create ohip repository make create my cursor make event repository load ohip repository load if event repository exists then tables conform true event table name ohip table name else tables conform false end 98 if ohip repository exists then tables conform true else tables conform false end end end feature ANY last query had result BOOLEAN any values returned form last query given names STRING patient given names surname STRING patient surname patient ohip num INTEGER patient OHIP mom ohip num INTEGER patient s mother s OHIP dad ohip num INTEGER patient s father s OHIP f date of birth DATE TIME Patient s date of birth complaint STRING patient s complaint that caused them to visit the hospital practitioner_name STRING The practitioner s name Nurse or Doctor
20. do if given names count gt 0 and surname count gt 0 and mom ohip num gt 0 and dad ohip num gt 0 anc date of birth void and patient ohip num gt 0 and gender map is set then valid true end Result valid end is_patient_in_ohip_repository ohip_num INTEGER BOOLEAN is determine if this user exists in the ohip repository or not require prel ohip num O0 do ohip user reset patient ohip num Select string select user from ohip repository base selection set map name ohip num predicate ohip num run query if not base selection exhausted then my cursor fill in base selection object convert ohip user base selection cursor to object cur patient ohip num ohip num end base selection reset cursor my cursor base selection terminate medical database session control commit results exhausted true db query in prog false if ohip user patient ohip num 0 then last query had result true end base selection unset map name predicate ohip num Result last query had result ensure ohip user patient ohip num gt 0 implies Result true end new patient new user OHIP USER is Enters a new patient in the ohip users respository Insert is amazingly easy using Eiffel object to repository mapping require prel is valid ohip user obj new user do update ok false store set repository ohip repository Store put new user if medical database sessio
21. enum ophthalmology set psychiatry sets medical specialty to psychiatry ensure postl is set true post2 enum enum psychiatry set specialty from enum enum in INTEGER sets medical specialty from an enum value The enum value passed should have been previously obtained from features of this class This will also set the external string representation 45 require prel enum in gt 0 pre2 enum in max enumerator ensure postl enum enum in post2 is set true set triage sets medical specialty to triage ensure postl is set true post2 enum enum triage invariant invariant clause num max enumerator end class MED SPECIALTY MAP 46 MEDICAL DATABASE Ancestor RDB HANDLE indexing description Database layer for DB level not table ops author Sam Lightstone date SDate revision Revision class interface MEDICAL_DATABAS ins create make feature db cleanup normal garbage collection isn t quite enough in this application If we are connect to a database we need to disconnect explicitly require session control void ensure not session control is connected is connected BOOLEAN make db name in STRING session control DB CONTROL session ok BOOLEAN require session control void invariant session control void end class MEDICAL DATABASE 47 MEDICAL EVENT indexing description
22. local valid BOOLEAN do if panel selection in gt min panel selection value and panel selection in lt nax panel selection value then valid true end Result valid end display_event hide_identity BOOLEAN is displays a single medical event to the user interface The client is required to hide data not appropriate for viewing by marking attributes as void empty output format is based on the following template Date date patient name Patient age age OHIP 4 ohip gt Gender gender Consultation type consult string Area med specialty Patient concern complaint Practitioner name type string Hospital hosp name Practitioner comments comments Practitioner diagnosis diagnosis blank line require prel is valid event data pre2 not hide identity implies patient data repository is valid ohip user data local age INTEGER month INTEGER do io putstring NDate io putint patient data repository absolute date year i o putstring j month patient data repository absolute date month io putstring patient data repository absolute date months text item month io putstring io putint patient data repository absolute date day if not hide identity then if patient data repository surname void then io putstring NName io putstring patient data repository given names
23. mex lOl x eee EIPPEL PROTOTYPE OF PRILENI DMIRNBIXE ee Enter triage data is then hit enter 19 After entering the new consultation data you will return back to this same panel in case you wish to enter data for another patient or anther consultation for the same patient Option 4 takes you back to the home panel ENTERING A NEW OHIP USER TO THE SYSTEM A user of MHDCS need not be aware that the consultation data they wish to enter is for a new user To enter data for a new user in the system proceed as though you were entering consultation for a preexisting user in the database As described above select option 3 from the home panel which takes you to the consultation entry panel You will be prompted for the patient s OHIp number and MHDCS will automatically query the system to determine if this user is currently known in the database If the OHIP number is not currently found in the system the application will ask you whether this is a new user or a typo as shown below meddb Of x Please entar the patient s OHIP number 12 5 BMG 1 waz hot Found in IET EET 2 E anni gt then hit enter If this is a new user you ll be prompted for all the required attributes such as name date of birth gender and OHIP numbers of the patient s parents is known After entering this data this application will display the data you have entered and ask you for confirmation of its correctness 20 Fo 1 Loss 5
24. panel header io new line io putstring overview textl io new line please continue clear screen io putstring overview text2 io new line please continue clear screen io putstring overview text3 io new line please continue 96 end Overview textl STRING is Overview text part I SNSNSNSNSNSNSNSNSNSN This program is a prototype Its aim is to show how patient information from regional hospitals can be organized in a computer database yielding a number of important sbenefits to patient care These benefits include N N N N N o o oe zu o oe oe oe NSN NSN Overview text2 STRING is Overview text part II oe z oe 1 The ability to maintain and present patient histories Sacross regional hospitals oe Z oe The ability to query patient histories in entirety r by medical specialty o oe oe ON oe oe oe The ability to correlate patient medical histories with hose of close family members while keeping the full dentity of these family members anonymous Close relatives can share common genetic and possibly environmental characteristics However medical histories may not be known between family members By storing and correlating family medical histories in a database it is possible to d t o oe oe oe ct W H W oe oe oe oe de oe 222222424 o o9 oe oe oo z oe oe z oe iscover medical relationships unknown to the patients SNS hemsleves SNS o oe o
25. set request comment STRING is local do end prompt the user to enter a comment temp string STRING temp string io putstring NPlease enter any comments you have for this consultation io new line temp string get user string Result temp string request diagnosis STRING is 79 prompt the user to enter a diagnosis string local temp string STRING do temp string io putstring NPlease enter your official diagnosis and treatment io new line temp string get user string Result temp string end request complaint STRING is prompt the user to enter the patient s medical complaint local temp string STRING do temp string io putstring NPlease enter the patient s complaint symptom io new line temp string get user string Result temp string end request hospital name STRING is prompt the user to enter the name of the hospital where the met the patient for the consultation local temp string STRING do temp string io putstring NPlease enter the name of your hospital io new line temp string get user string Result temp string end get user string STRING is get a string from the user local temp string STRING do io readline temp string clone io laststring Result temp string end Bad selection string STRING is NYour selection is out of range Please try again N Bad oh
26. user end end display event auery results hide identity BOOLEAN is display the results of a query for medical events require prel patient data repository query ok 78 local do end counter INTEGER clear screen display panel header patient data repository next medical event from until patient data repository results exhausted true loop display event hide identity counter counter 1 if counter 2 then counter 0 please_continue clear_screen display_panel_header end patient_data_repository next_medical_event end invalid_ohip_user_msg is do end write a message indicating patient not found in our DB io putstring bad ohip user string request practitioner name STRING is local do ensure end temp string STRING temp string io putstring NPlease enter you full professional title io new line temp string get user string Result temp string postl Result count gt 0 request practitioner type practitioner map PRACTITIONER MAP is require do ensure end prompt the user for their practitioner type practitioner map void io putstring NIf please enter 1 if you are a doctor or 2 if you are a nurse io new line min selection value 1 max selection value 2 request user selectio if selection 1 then practitioner map set doctor else practitioner map set nurse end practitioner map is
27. KUNPA SES 54 PRACTITIONER MAP 4e ese e exi rr ERREUR NUN ORI RE I TER FRE UTERE ENT RUE UE ERES 58 QUERY PAINE eet ee ERRORS ERI QEON CURE UN ae dn n a RR D RS 60 APPENDIX D COMPLETE SYSTEM SOURCE CODE eeeeeeee esee eaa aa a enses statu statu senses sts tn stats susto sis aeon sensns tn sn sean 61 APPEICATION 5 5i ete ctetu tette RU IR ISTE I Ere tiet den evm stt eR mi Sem ss 61 ENUM MAPS mau UR UH ESOS OI EE E E nen REPRE UO UU 65 EVENT MAP R ettet E E eben et KINK tee i e RE N Is n 67 GENDER MAP accitis ENTER HREUCU E 69 HOME SPANEL tette eU OEC REUS SSS N tti tei et TOi 71 INTERFACE ss tie o s I EUER ee Lee aula ve va tete i its ER ERRORS 72 LIST USERS PANEL e tete ET ORE atte n IIN SE te D e aa ERO 81 MEDUSPECIAETY MA P eene Reiten ERR eei A RA RRR AR it E UOU setin 83 MEDICAL DATABASE e RD TERRE RERO ED ERE EO DRE QUERIT ERE E EE TEO EEE ED EE Ene 86 MEDICAL EMENT 5 t ttr EROR PEE REIR ED ERO ED EO ERR UE BU ERREUR E EE ERE TUI E O EI NAI CR SERE 87 NEW EVENTZPANEL 5t n RE EE ER REPE TERRE QOO EE BUDE RES ETE RO ETE Te EE CREE DRE 89 eSI MUN dE 94 OVERVIEW CPANEL teet e er EROTIC TRO EE EROR RU ERE EE CI TERRE ERE TERRE THERE EE u 96 PATIENT DATA REPOSITORY rh ert ER TER RR RE RE ER ERE EO REEL ER EHE Roco IR ETE PE bye bna ndn 98 PRACTITIONER MAP niet EE HERRERA EOD ER TU EGRE IHR ER Ee Uo Pe p E eaa ERR 107 QUERY PANED eit ERE ERE EE RO T EDO E OR ERU A Me RITE tive re Pet E Er Usan 109 STA
28. LIST USERS PANEL Ancestor INTERFACE indexing description UI Panel for listing all ohip users in our system author Sam Lightstone date SDate S revision Revision class interface LIST_USERS_PANEL create make feature Initialization make repository in PATIENT DATA REPOSITORY Creation routine process panel Routine to run the panel displayus all known OHIP users in the system sorted by last then first name ensure then postl patient data repository db query in prog false post2 valid panel selection panel selection end class LIST USERS PANEL 44 MED SPECIALTY MAP Ancestor ENUM MAP indexing description Types of medical specialties we support author Sam Lightstone date Date revision Revision class interface MED_SPECIALTY_MAP create make feature ANY Max_enumerator INTEGER is 6 the max enumerator supported in the class set cardiology sets medical specialty to cardiology ensure postl is set true post2 enum enum cardiology set obstetrics sets medical specialty to obstetrics ensure postl is set true post2 enum enum obstetrics set oncology sets medical specialty to oncology ensure postl is set true post2 enum enum oncology set ophthalmology sets medical specialty to ophthalmology ensure postl is set true post2 enum
29. Lightstone date Date revision SRevision class NEW EVENT PANEL inherit INTERFACE create make feature Initialization make repository in PATIENT DATA REPOSITORY is Creation routine do make interface repository in create specialty map make create event map make create gender map make create practitioner map make create cur date time make 1999 1 20 2 30 0 create new user dob2 make 1999 1 20 2 30 0 ensure then postl specialty map void post2 event map void post3 gender map void post4 practitioner map void post5 cur date time void end feature NONE Implementation Specialty map MED SPECIALTY MAP Map object for medical specialty enumerated type event map EVENT MAP Map object for consultation type gender map GENDER MAP Map objec for gender type practitioner map PRACTITIONER MAP Map object for practitioner type process panel is Routine to run the pane Displays the panel for entering new consultation data This may have the side effect of entering a new OHIP user in the system require else prel patient data repository db query in prog false local btimetoexit BOOLEAN do clear screen display panel header io putstring 1 Enter triage data N io putstring 2 Enter intermediate consultation N io putstring 3 Enter diagnosis and treatment N io putstring 4 Back to home N min panel s
30. Medical History Database and Correlation System MHDCS A framework for demonstrating BON Eiffel Object Oriented software design and development methodologies Final Report Sam Sampson Lightstone Light ca ibm com July 23 1999 TABLE OF CONTENTS STATEMENT OF PURPOSE AND REQUIREMENTS ee eeeee eee reete eee tenes tne etae stan eese aa taa esses senes eese ene eene eene senes tne eS 4 DESIGN OVERVIEW c H T eaa 5 AUDIENCE AND ASSUMPTIONS cccccsssssccsssssccsssssccssscsccessecesscsccescsccesssccessusececsusecessssccecsesececsusececssseceesusececusececusesecessusecesusececsuseseesess 5 METHODOEOGJXY 55 25 ted a eee et ves kytt reote ED ero S EE EO EpL dee eo ta Prisa Dres tea Dea PEE Homa PE td Leos aban ATIS PILE NSA MV tite eed eof tee 6 HIGH LEVEL SYSTEM DESIGN AND CLUSTER OVERVIEW cccecsccsssssccsssssccesscsccsscsessssccessssccessesccessusccesssececsusecessusesesassceesssceeeatsess 6 The notion of a data repository in EiffelStore eee esee eese esee a a a aa a enne a nete a a tette a a ete a a a a a a enne 6 OA AULA VSEE PPP BOE TM T HERRERA M ET 6 DESIGN VIO VA MN 7 The Application and P nel clusters osassa ansa reete she eee ree Ka Okaan A EASE RE RR ERE SERERE SAT Ea eR Ree eR TE KAAT 7 The Database Repositories cluster eese a a a a nitens a a a aa ka a a aa naa a aa Ka eser nennen enne 7 The Enumer
31. NTEGER is 6 the max enumerator supported in the class INTEGER is 1 enum value for obstetrics INTEGER is 2 enum value for cardiology ogy INTEGER is 3 enum value for ophthalmology INTEGER is 4 enum value for psychiatry INTEGER is 5 enum value for oncology TEGER is 6 enum value for triage 84 Obstetrics string STRING is Obstetrics external string representation Cardiology string STRING is Cardiology external string representation Ophthalmology string STRING is Ophthalmology external string representation Psychiatry string STRING is Psychiatry external string representation Oncology string STRING is Oncology external string representation Triage string STRING is Emergency ER external string representation invariant invariant clause enum max enumerator end class MED SPECIALTY MAP for for for for for for 85 obstetrics cardiology ophthalmology psychiatry oncology triage MEDICAL DATABASE Ancestor RDB HANDLE indexing description Database layer for DB level not table ops author Sam Lightstone date SDate revision SRevision class MEDICAL DATABASE inherit RDB HANDLE create make feature make db_name_in STRING is local tmp_string STRING do set data source db name in login n n ud set base create session control make
32. SITORIES UI panel for displaying product Interface to medical repositories and PATIENT DATA REPUSITORY their ops DATABASE REPOSITORIES IPRACTITIONER MAP Types of practitioners ENUMERATED MAPS UI panel provides selections for 35 APPENDIX C SHORT FORM OF SYSTEM CLASSES APPLICATION indexing description The root class for the medical DB project author date Sam Lightstone SDate revision class interface APPLICATION create make feature SRevision db problems BOOLEAN make allocate app with n states and m possible choices instantiate transition and state arrays then traverse the state transitions until the exit state is traversed ensure postl application ui panels void implies state number invariant invl patient data repository void inv2 not db problems implies home panel void inv3 not db problems implies new event panel void inv4 not db problems implies query panel void inv5 not db problems implies all users panel void inv6 not db problems implies overview panel void inv7 not db problems implies panel transitions void inv8 not db problems implies application ui panels void inv9 not db problems implies state number 0 invl10 not db problems implies state number lt max state end class APPLICATION DB ok for this app 36 0 ENUM MAP
33. TEMENT OF PURPOSE AND REQUIREMENTS For a complete description of the project requirements please see Prototype For Inter Hospital Patient Database Medical History Database and Correlation System MHDCS Functional Requirements dated May 6 1999 A brief summary of the high level goals for this system is repeated here Due to the importance of personal and family medical histories in providing patient care the ability to maintain patient hospital events and correlate medical histories of blood relatives is extremely important Few hospitals today maintain structured computerised patient histories and there is little data collected from patients regarding family histories related illnesses between relatives Most records are maintained in paper files with hand written notes Entries are frequently illegible and out of sequence making review of patient history difficult and error prone Moreover in many cases due to the private nature of personal illness it is common for individuals to be uninformed regarding medical histories of relatives Therefore while close relatives may have highly relevant medical histories that can reveal important considerations in patient treatment it is frequently the case that such relationships go undiscovered The MHDCS software shows a simple programmatic solution for solving both of these issues 1 Comprehensive maintenance and query capability of patient medical histories 2 Correlation
34. _screen display_panel_header io put_string list_of_users_header end patient_data_repository next_ohip_user end please_continue ensure then postl patient data repository db query in prog false post2 valid panel selection panel selection end feature NONE Implementation 81 List of users header STRING is N N list of known OHIP users registered in our system Header text for listing all known OHIP users Your invariant here end class LIST USERS PANEL 82 MED SPECIALTY MAP Ancestor ENUM MAP indexing description Types of medical specialties we support author Sam Lightstone date Date st revision Revision class MED_SPECIALTY_MAP inherit ENUM_MAP create make feature ANY set_obstetrics do ensure end set_cardiology do ensure end is sets medical specialty to obstetrics enum enum obstetrics string obstetrics string is set true postl is set true post2 enum enum obstetrics is sets medical specialty to cardiology enum enum cardiology string cardiology string is set true postl is set true post2 enum enum cardiology set ophthalmology is do ensure end set psychiatry do ensure end sets medical specialty to ophthalmology enum enum ophthalmology string ophthalmology string is set true postl is set true post2 enum enum ophthalmology
35. absolute date DATE TIME Date and time of a medical consultation hospital name STRING the name of the hospital where the current medical consultation took place final diagnosis STRING The final diagnosis from the attending medical practitioner comment STRING Comments from the medical practitioner Specialty map MED SPECIALTY MAP Current medical specialty obstetrics oncology etc event map EVENT MAP type of consultation triage diagnosis etc practitioner map PRACTITIONER MAP Type of practitioner nurse docutor etc gender map GENDER MAP gender of the patient results exhausted BOOLEAN Any remaining data to fetch for this query repository cleanup is garbage collection may not handle DB teardown We should add this explicitly do medical database db cleanup end bind out last ohip user is bind out the last ohip user we queried inserted if there was one Otherwise just NOP 99 if ohip user patient ohip num 0 then bind out ohip user cur patient ohip num ohip user patient ohip num end ensure postl ohip user patient ohip num 0 implies is valid ohip user data post2 ohip user patient ohip num 0 implies cur patient ohip num ohip user patient ohip num end is valid ohip user data BOOLEAN is sanity check ohip user data require prel given names void pre2 surname void pre3 gender map void local valid BOOLEAN
36. agnosis void post9 comment void postl0 event type event type in invariant patient ohip num gt 0 absolute date void end class MEDICAL EVENT 49 NEW EVENT PANEL vents Ancestor INTERFACE indexing description Panel for user to enter new patient author Sam Lightstone date Date revision Revision class interface NEW_EVENT_PANEL create make feature Initialization make repository in PATIENT DATA REPOSITORY Creation routine ensure then postl specialty map void post2 event map void post3 gender map void post4 practitioner map void post5 cur date time void invariant Specialty map void event map void gender map void practitioner map void end class NEW EVENT PANEL 50 data after a patient consultation OHIP USER Mapping class for repositories related to table OHIP USE indexing description author Sam Lightstone date SDate revision Revision class interface OHIP_USER create make feature make feature ANY dad_ohip_num INTEGER date_of_birth DATE TIME gender INTEGER given_names mom_ohip_num STRING INTEGER patient_ohip_num INTEGER reset_patient_ohip_num resets the patient_ohip_num attribute to 0 ensure patient_ohip_num 0 s
37. al new user OHIP USER do create new user make new user set attributes new user first names new user last name new user mom ohip num new user dad ohip num new user gender get enum new user dob2 92 2 N cur ohip num patient data repository new patient new user ensure postl patient data repository db query in prog false end insert new event data is require patient data repository patient ohip num 0 patient data repository db query in prog false local event MEDICAL EVENT create event make event set attributes complaint string practitioner name hospital name diagnosis string comment string patient data repository patient ohip num specialty map get enum practitioner map get enum event map get enum cur date time patient data repository new medical event event ensure postl patient data repository db query in prog false end request date of birth is prompt a user for date of birth information year of birth require new user dob2 void do io putstring SNPlease enter the year as a four digit value N min selection value 1850 max selection value 2200 request user value year of birth selection io putstring NPlease enter the month as a number between 1 and 12 N min selection value 1 max selection value 12 request user value month of birth selection io putstring Please enter the day of the month as a number between 1 and 31 N min selec
38. ated Maps cluster iiis n Ka N e a RO ER a ana Nasta N A TONNE ASS EE RE EP REP EE RES Rehd 8 Auxilliary clusters EiffelStore and EiffelTime reused from Eiffel libraries eene 8 DATABASE DESIGN C deett Ge UI rero c e ee et t i aere pc ed cuire o od caf rer ete eet tede ted hee e ete RAT 9 ODBC as interface to relational database management systems eee ees esee eese e n a na nne na nennen enne nnen enne 9 Doatabasesschemu tke ts coe ossa IO DER RIN DA SEARS OEE ESES tuU Ote KANE VOE ed 9 OBIA Taoa ZINOT IAS EAR ENET NNER AER EAR AANEEN KANS LAE TEE DERE RE Re RETA Die RO AENEAN RTP 10 DATABASE SOFTWARE amp INITIAL DATABASE POPULATION ccsccccssssscsessssccecsssccessssccsssecessusccssssececsesececsesecessesecesusececssseesessseceesess 10 DATA INTEGRITY CONSIDERATIONS 7 iederien iE e deve tetra eec reo vec eee eec a etes deseo tere Diener eve ite e ete 10 USER MANUAL proe a st 11 ABOUT THIS MANUAL cccccccssssscecsssscsesecsccesscscecsessessescsessusesessusesessusceessuscseseusesessusecessusscessusecessusscessusecessusesscessusecessusecessusecessusecesusecsuss 11 SYSTEM REQUIREMENTS cesses eene enne Pens a a aa Teur UEN eaa eaa aa aa aa eaa aa aa aa eaa aan esses etras eaa enaa enaa eaa eaa nana a seas ssa 12 SOFTWARE SUPPORT AND TRAINING SERVICES 0 ccccssssccsssssccessssccesesccssssecesecessuseceescsecessesececsssececsssececsesececeseceeesececsusececseseces
39. ative duration duration Result durat DATE o readchar conio h TIME t date in years id e DATE TIME TIME DURATION sys time make make 1999 e make now void void TIME DURATION make 1999 ion year INTEGER is calculates the the 1989 1 1 20 20 Eiffel has no comparable routines is busted 1 9 20 5 9 45 current sys time relative duration INTEGER is caculate the num years 9 5 45 datel 73 CHARACTER 0 0 date time postl Result 500 post2 Result gt 0 end clear screen is clear the screen local icounter INTEGER do from io new line until icounter 100 loop io new line icounter icounter 1 end end display_panel_header is A header for all user panels that wish to use it do io new line io new line io putstring EIFFEL PROTOTYPE OF PATIENT DATABASE N NZN end display ohip user is displays an OHIP user s meta characteristics in viewable form to screen require prel patient data repository is valid ohip user data pre2 valid ohip num patient data repository patient ohip num local pad spaces INTEGER name chars INTEGER width of name field INTEGER counter INTEGER do width of name field 30 name chars patient data repository surname count oatient data repository given names count io putstring N io putstring patient data re
40. ble to connect to the database you specified io putstring NPlease try again later end STRING is NN EIFFEL PROTOTYPE OF N MEDICAL HISTORY DATABASE amp CORRELATION SYSTEM N N SN Welcome to the Medical History and Data Correlation System MHDCS ST N This system is a proof of concept prototype for capturing N medical consultation data in a relational database and performing N subsequent data processing for medical histories of patients and their N relatives invariant invi patient data repository void inv2 not db problems implies home panel void inv3 not db problems implies new event panel void inv4 not db problems implies query panel void inv5 not db problems implies all users panel void inv6 not db problems implies overview panel void inv7 not db problems implies panel transitions void inv8 not db problems implies application ui panels void inv9 not db problems implies state number gt 0 invl0 not db problems implies state number lt max state end class APPLICATION 64 ENUM MAP indexing description Super class for enum classes author Sam Lightstone date Date revision SRevision deferred class ENUM MAP feature ANY make is creation do enum 0 string ensure postl is set false end is set BOOLEAN Has the enumerator been set clear map is unsets the enumerator do is set false strin
41. bsolute date void and svent hospital name count gt 0 and event event type lt event map max enumerator then end feature NONE is ok true end Result is ok fetch once BOOLEAN base selection DB SELECTION selection class event repository DB REPOSITORY Eiffel repositoryy interface to relational table ohip repository DB REPOSITORY Eiffel repositoryy interface to relational table store DB STORE Store object for DB INSERT my cursor DB RESULT Cursor for DB selects ohip user OHIP USER medical event Mapping class for repository operations with the OHIP USERS table MEDICAL EVENT Mapping class for repository operations with the MEDICAL EVENTS table cur patient ohip num INTEGER select string OHIP of current patient STRING string containing SQL syntax for selects date time string STRING Date and time in external string format medical database MEDICAL DATABASE run query is require do A high level database class for DB not table operations This command executes a query specified in the select string string prel db query in prog false last query had result false query ok false results exhausted true base selection reset cursor my cursor base selection terminate base selection object convert ohip repository base selection query select string 104 gt gt if base sel
42. choice of the Database System Administrator for examples choice of logging technique number of disks assignment of tables and indexes to various storage containers etc Similarly database tuning parameters such as sort heap size bufferpool etc are all independent of this design and fall under the purview of the Database System Administrator Database Name The MHDCS software is intentionally designed to be connectable to any ODBC compliant database As a result the database name is an input parameter provided by the user upon startup This enables the user to run the system against multiple data warehouses or data marts as required DATABASE SOFTWARE amp INITIAL DATABASE POPULATION The prototype is designed to operate on top of commercially available database software For broadest possible DBMS support with EiffelStore database interaction for event insert query and display is being designed using the EiffelStore ODBC handle All database transactions query insert update have been designed to comply with ODBC level 1 interfaces for maximum compatibility with other database vendors For initial data population of the system bulk insertion of data prior to the system going online native DBMS utilities are assumed as per the project specification i e Import Load etc DATA INTEGRITY CONSIDERATIONS The prototype design is demonstrates data integrity characteristics by detection partial page I O and ensuring crash re
43. covery capabilities through database restart or backup restore and rollforward recovery By design these capabilities are assumed provided by the underlying database software upon which the prototype is constructed 10 USER MANUAL ABOUT THIS MANUAL The MHDCS user s guide is a comprehensive guide that contains all of the procedures you need to work with MHDCS To help you learn and use MHDCS efficiently this manual is organized by task beginning with the most common MHDCS features The MHDCS software has been designed for ease of use and if you are an experienced computer user you may find many of its features self explanatory If you d like to get hands on experience right a way install and start MHDCS as described in the Getting started chapter of this book and follow the directions on your screen 11 SYSTEM REQUIREMENTS CPU Intel 486 DX 133 MHz CPU system or higher RAM 16 MB minimum Disk 600KB plus database storage Operating System NT 4 0 or higher either Workstation or Server Database management system DB2 UDB v6 1 or higher 12 SOFTWARE SUPPORT AND TRAINING SERVICES For service help with MHDCS or for information about training and consultation please contact our support group MHDCS Systems Support 1150 Eglinton Avenue East Toronto Ontario Canada M3C 2G4 e mail light ca ibm com Telephone 416 448 3665 FAX 416 448 4414 13 GETTING STARTED Database schema creating a database and
44. d on both last and first names S PFEL PROTOTYPE OF PATIENT HIP HIP HIP HIP HIP it H H H i H H i it H H H i H H H it if be to continue 16 Once the listing of OHIP users is complete the software will automatically return you to the home panel THE PRODUCT OVERVIEW PANEL Selection 5 from the home panel bring up the product overveiw panbel This panel provides an easy to read english language overview of the MHDCS software its goals and features Hit any key to continue 1 The ability to maintain and present patient hi across FPeqione ospital The ability historis ed ical nedical in a def ine fi region in mui y literature as 4 T l feature For T a 1 7 pal pent Lage Hit any kes to cont imit 2 Once the text of the product overview is completely displayed the software returns you directly to the home panel 17 QUERYING PATIENT MEDICAL HISTORY Option 2 from the home panel will bring up the query panel This panel provides options for querying patient and patient relative s medical histories After each query you will return to the query panel in case you wish to run subsequent queries Selecting option 8 will return you to the home panel eee EIFFEL PROTOTYPE OF PATIENT DATAD hospital wisit hy diannc bent iste by di Lent i anily his Fanily his by dias Sis for medical specialty k to ha fase enter your selection then hit enter This next sl
45. data representing a single record in the repository MEDICAL DATABASE a class encapsulating database level data and operations This class operates on the database as a whole and not on individual tables It is used by the PATIENT DATA REPOSITORY class for performing login database connection disconnect logoff session monitoring for success or failure and other session based operations The Enumerated Maps cluster The need for this cluster grows from the single choice principle Whenever a software system must support a set of alternatives one and only one module in the system should know their exhaustive list In the MHDCS project there are several enumerated type which must maintains a persistent enumeration throughout the system since they can be stored inside the relational database Examples include types of medical specialties types of patient consultations etc The single choice principle leads to a design requirement to decouple the interface representations and persistent storage representations of data types Had these representations not been de coupled then an exhaustive list of choices would need to be maintained across clusters The single choice principle requires a central module for these logical mappings As a result this cluster was designed to help reduce the inter dependancy of the Panel cluster and the Database Repository cluster and provide modular ADTs for mapping enumerated types The cluster includes classes fo
46. dicate ohip num select string select patient diagnosis history run query base selection unset map name predicate ohip num postl query ok query patient history by specialty specialty enum MED SPECIALTY MAP diagnosis only BOOLEAN is require local do ensure end query siblings require do For a given medical specifalty retrieve a patient s medical history listing only the final diagnosis for each problem prel is patient in ohip repository cur patient ohip num Spec enum val INTEGER Spec enum val specialty enum get enum base selection set map name cur patient ohip num predicate ohip num base selection set map name spec enum val predicate specialty enum if diagnosis only then select string select patient diagnosis history by specialty else Select string select patient history by specialty end run query base selection unset map name predicate ohip num base selection unset map name predicate specialty enum query ok is Retrieve the set of siblings for the current patient prel is patient in ohip repository cur patient ohip num if mom ohip num default ohip num then mom ohip num invalid ohip num end 101 ensure end query children require local ensure end if dad ohip num default ohip num then dad ohip num invalid ohip num end base selection set map name mom ohip num mom predicate ohip num base
47. e initial state num INTEGER is define the state number for the intial UI panel 1 lt initial state num initial state num lt max state initial initial state num initial initial state num source target label INTEGER is enter transition label from state number source to state number target 1 lt source Source max state 0 lt target target max state panel transitions put source label target panel transitions ARRAY2 INTEGER 2 dimensional array of state transitions application ui panels ARRAY INTERFACE array of state objects init panel transitions is do end init ui panels do initialize the two dimensional array of panel state transitions First element is the target state second element is the current state and the third element is the selection index States are as follows State 1 HOME PANEL State 2 QUERY PANEL State 3 NEW EVENT PANEL State 4 LIST USERS PANEL State 5 OVERVIEW PANEL panel transitions put 0 1 1 panel transitions put 2 1 2 panel transitions put 3 1 3 panel transitions put 4 1 4 panel transitions put 5 1 5 panel transitions put 2 2 1 panel transitions put 2 2 2 panel transitions put 2 2 3 panel transitions put 2 2 4 panel transitions put 2 2 5 panel transitions put 2 2 6 panel transitions put 2 2 7 panel transitions put 1
48. e AP AP oe SNS 4 The ability to query a patient s last known SNS hospital visit anywhere in a defined medical region SNS Sreported in nursing literature as a useful feature for SNS Spatient triage Overview text3 STRING is Overview text part III SNSNSN NSNSN This system provides for both patient query as well as SNS Sinsert of new patients and new consultation data SNS SNS In a production system patients personal OHIP information is N Sencoded on the magnetic strip of the patient s OHIP card After N Sadmission to the hospital the data is replicated in a bar code N Slocated on the patient s wrist band NSN In the long run this system may form the backbone of a large N medical datamining data warehouse which could be used SNS Sto discover medical relationships between diseases SNS o previously unrecognized in professional medical research N SNSNSNS NS NSNSNZN end class OVERVIEW PANEL 97 PATIENT DATA REPOSITORY indexing description Interface to medical repositories and their ops author Sam Lightstone date SDate revision SRevision class PATIENT DATA REPOSITORY create make feature ANY tables_conform BOOLEAN Does a required table exist db query in prog BOOLEAN Is a query currently in progress query ok BOOLEAN Did the last query run ok update ok BOOLEAN connected ok make db name in Was the last
49. ection is ok then query ok true db query in prog true base selection reset cursor my cursor results exhausted false end ensure postl not results exhausted implies db query in prog post2 not results exhausted implies query ok end bind out medical event is move values in medical event to externally viewable features for the class Note clients of this feature are expected to validate the bound out data after bindout this routine intentionally does a blind bind out i e it does not check for correctness of the data Thereforem the assertions are are intentionally weak require medical event void do complaint clone medical event complaint practitioner name clone medical event practitioner name absolute date clone medical event absolute date hospital name clone medical event hospital name final diagnosis clone medical event final diagnosis comment clone medical event comment event map set event from enum medical event event type practitioner map set practitioner from enum medical event practitioner type Specialty map set specialty from enum medical event medical specialty end bind out ohip user is move values in ohip user to externally viewable features for the class Note clients of this feature are expected to validate the bound out data after bindout this routine intentionally does a blind bind out i e it does not check for correctnes
50. el store this check is currently not performed The EiffelStore cluster appears to have a major problem handling warning conditions from some database operations Thus some database operations that complete successfully but with minor warnings returned from ODBC may cause unpredictable results in EiffelStore 32 FUTURE ENHANCEMENTS The following enhancements should be considered in future development work and prototyping 1 Extend the system prototype to include concurrent remote clients with full authentication and privilege checking Expand the diagnosis consultation data into diagnosis by technical medical terminology and a separate field to proposed treatments Extend the consultation types currently triage intermediate consultation and diagnosis to include follow up consultations where treatment progress can be tracked The current system does not present any patient characteristics when presenting consultation recorsds for family members i e name gender age are masked Despite the importance of patient privacy there may be valid reasons to display patient age gender when presenting this data For example if a patient has a heart condition at age 80 this may be far less significant than a patient demonstrating cardiac problem in their teens Therefore age and possibly gender may be reguired in order for user of MHDCS to make sense of the patient s relatives medical history data Initial prototyping of the
51. election value 1 89 max panel selection value 4 min selection value 1 max selection value 4 request panel selection if panel selection 4 then if selection 1 then event map set triage elseif selection 2 then event map set intermediate elseif selection 3 then event map set diagnosis end establish ohip user request event data insert new event data end ensure then postl patient data repository db query in prog false post2 valid panel selection panel selection end practitioner name STRING hospital name STRING diagnosis string STRING comment string STRING complaint string STRING cur date time DATE TIME cur ohip num INTEGER establish ohip user is establish which ohip user we are entering data for This may be a new user Redundancy Prompt user for typos require prel patient data repository db query in prog false local user happy BOOLEAN new ohip user BOOLEAN ohip user exists BOOLEAN do from until user happy loop io putstring SNSNPlease enter the patient s OHIP number N cur ohip num fetch ohip num true io new line ohip user exists patient data repository is patient in ohip repository cur ohip num if not ohip user exists then new ohip user prompt for new user if new ohip user then request ohip user info insert new user data patient data repository bind out last ohip user user happy true end else patient da
52. ent in ohip repository cur patient ohip num ensure postl query ok query patient diagnosis history Retrieve a patient s medical history listing only the final diagnosis for each problem require prel is patient in ohip repository cur patient ohip num ensure postl query ok query patient history by specialty specialty enum MED SPECIALTY MAP diagnosis only BOOLI For a given medical specifalty retrieve a patient s 56 EAN medical history listing only the final diagnosis for each problem require prel is patient in ohip repository cur patient ohip num ensure query ok query patient last visit List the last recorded medical event for a patient in the database require prel is patient in ohip repository cur patient ohip num ensure postl query ok query relatives diagnosis history by specialty For a given medical specialty retrieve the medical histories listing only the final diagnosis for each problem for apatient s relatives i e Parents amp children require prel is patient in ohip repository cur patient ohip num ensure postl query ok query siblings Retrieve the set of siblings for the current patient require prel is patient in ohip repository cur patient ohip num ensure postl query ok repository cleanup garbage collection may not handle DB teardown We should add this explicitly results exhausted BOOLEAN Any remai
53. enum enum diagnosis string diagnosis string is set true ensure is set true enum enum diagnosis end Set event from enum enum in INTEGER is sets the map data based on an input enumerator previously generated by an onject of this class This will also set the external string representation for the object require prel enum in gt 0 pre2 enum in max enumerator do is set false 67 if enum in enum triage then set triage elseif enum in enum intermediate then set intermediate elseif enum in enum diagnosis then set diagnosis end ensure postl enum enum in post2 is set true end is triage BOOLEAN is return TRUE if TRIAGE require perl is set do if enum enum triage then Result true end ensure psotl enum enum triage implies Result end is diagnosis BOOLEAN is return TRUE if diagnosis require is set do if enum enum diagnosis then Result true end ensure postl enum enum diagnosis implies Result end Max enumerator INTEGER is 3 maximum enumerator for this class feature NONE INTEGER is 1 enumerated value for triage Enum triage Enum intermediate INTEGER is 2 enumerated value for intermediate INTEGER is 3 enumerated value for diagnosis Enum diagnosis STRING is Triage external string representation Triage string Intermediate string STRING is Consultation external string representatio
54. es a connection to a relation database io putstring NPlease enter the name of the database you expect MHDCS to connect to N io readline db name clone io laststring create patient data repository make db name if not patient data repository connected ok then db problems true io putstring NUnable to connect to the specified database io putstring NThe database may not exist or may be locked by another application io putstring NPlease try again later elseif not patient data repository tables conform then db problems true io putstring NThe database tables do not conform the required specification io putstring NPlease contact the database administrator for help end create home panel make patient data repository create new event panel make patient data repository create query panel make patient data repository create all users panel make patient data repository create overview panel make patient data repository create panel transitions make max state max panel choices 61 feature create application ui panels make init ui panels init panel transitions sele if n end ensure post end db problems ct initial state ot db problems then execute 1 application ui panels void implies state number 0 BOOLEAN DB ok for this app NONE state_number INTEGER 1 Ub the set of UI panels we will use each of these i
55. et_attributes name_in INTEGER dob_in require prel pre2 pre3 pred pre5 ensure postl post2 post3 post4 postb5 post post surname STRING invariant lastname in STRING DATE TIME ohip num in gt 0 name in count gt 0 lastname in count gt 0 name in count gt 0 dob in void given names void surname void patient ohip num ohip num in mom ohip num mom num in dad ohip num dad num in gender sex in date of birth dob in 51 ohip num in mom num in RS dad num in Sex in surname void given names void date of birth void patient ohip num gt 0 end class OHIP USER 52 OVERVIEW PANEL Ancestor INTERFACE indexing description UI panel for displaying product overview author Sam Lightstone date Date revision Revision class interface OVERVIEW_PANEL create make feature Initialization make repository in PATIENT DATA REPOSITORY creation routine process_panel routine to run the panel ensure then valid panel selection panel selection end class OVERVIEW PANEL 53 PATIENT DATA REPOSITORY indexing description Interface to medical repositories and their ops author Sam Lightstone date SDate revision Revision class interface PATIENT_DATA_REPOSITORY create make
56. fier FCT12 Test objectives New event panel test insert of triage data for new OHIP patient currently not recognised in the MHDCS system Test operations From the home panel select the Enter new consultation data From the new event panel select enter triage 27 data When prompted enter the OHIP number of an OHIP user not currently represented in the database i e not in the ohip users table Expected outcome The system should indicate that the user is not found in the current OHIP users set and ask if this is truly a new user If so you will be prompted for OHIP user data such as name gender date of birth Following this data entry the system should display your choices and ask you to confirm they are correct If so the new data will be update in ohip users and the data entry will proceed with entry of triage attributes Test case identifier FCT13 Test objectives New event panel test insert of intermediate consultation data Test operations Repeat steps of FCT11 but choose intermediate consultation rather than triage from the new event panel Expected outcome After the consultation data is entered select a complete medical history on this user and the intermediate consultation should appear as the last consultation in this patient s history When displayed the consultation record should be clearly marked as being intermediate rat
57. g void enum 0 ensure is_set false end get_enum INTEGER is returns an INTEGER enumerator require is_set true do Result enum ensure Result enum end get_formatted_string STRING is Returns a human readable string representing an enumerated type require is_set true do Result string end max_enumerator INTEGER is the max enumerator supported by each class of type ENUM_MAP deferred end feature NONE enum INTEGER The enumerated value string STRING the human readable representation of the enumerated type invariant 65 end is set implies enum gt 0 is set implies string void is set implies string count gt 0 class ENUM MAP 66 EVENT MAP Ancestor ENUM MAP indexing description Types of medical events and their features author Sam Lightstone date Date revision SRevision class EVENT MAP inherit ENUM MAP create make feature ANY set_triage is sets the event type to triage do enum enum_triage string triage_string is_set true ensure is_set true enum enum_triage end set_intermediate is sets the event type to intermediate neither triage nor diagnosis do enum enum intermediate string intermediate string is set true ensure is set true enum enum intermediate end set diagnosis is sets the event type to diagnosis final consult do
58. her than triage or diagnosis Test case identifier FCT14 Test objectives New event panel test insert of diagnosis data Test operations Repeat steps of FCT11 but choose intermediate consultation rather than triage from the new event panel Expected outcome After the consultation data is entered select the patient s medical history by diagnosis The diagnosis data entered in this test case should appear as the final entry Test case identifier FCTI15 Test objectives New event panel test transition back to home panel Test operations Enter new triage data for a user by repeating FCT11 Afterwards select the Back to home option Expected outcome The HOME panel should appear Test case identifier FCT16 Test objectives New event panel test transition back to home panel Test operations Enter new triage data for a new user Use date of birth with boundary condition Repeat with several interesting birth dates Jan 1 May 31 Leap years etc Afterwards run two queries for each patient 1 List all users and 28 ensure the new patient appears with the correct age and 2 Query last patient visit ensure correct consultation data is returned Expected outcome Correct display of ages and dates Correct query of patient data and consultation data 29 ROBUSTNESS TESTS Test case identif
59. hip num and EVENT TYPE 1 order by ABSOLUTE DATE DESC select string for querying a patient s last hospital visit Select patient diagnosis history STRING is select from medical events where EVENT TYPE 3 and PATIENT OHIP NUM predicate ohip num order by ABSOLUTE DATE select string for querying a patient s medical history diagnosis only 105 Select offspring from ohip repository STRING is select from ohip users where MOM OHIP NUM predicate ohip num or DAD OHIP NUM predicate ohip num order by DATE OF BIRTH select string for querying all of a patient s children select from ohip users where DAD OHIP NUM predicate ohip num order by DATE OF BIRTH Select siblings from ohip repository STRING is select from ohip users where MOM OHIP NUM mom predicate ohip num or DAD OHIP NUM dad predicate ohip num order by DATE OF BIRTH select string for querying all of a patient s brothers and sisters select from ohip users where DAD OHIP NUM dad predicate ohip num order by DATE OF BIRTH Select user from ohip repository STRING is select from ohip users where PATIENT OHIP NUM predicate ohip num select string for querying a single user from known OHIP users Event table name STRING is medical events Name of the relational tabl holding event data for medical consultations Ohip table name STRING is ohip users Name
60. id event event MEDICAL EVENT BOOLEAN check if medicalevent data we ve bound out is reasonable require event void is valid ohip user data BOOLEAN sanity check ohip user data require prel given names void pre2 surname void pre3 gender map void is valid ohip user obj usr OHIP USER BOOLEAN verify that usr obj reprsents a reasonable OHIP USER require usr void last_query_had_result BOOLEAN any values returned form last query make db name in STRING Creation routine Instantiate the medical repository and other reference objects mom ohip num INTEGER patient s mother s OHIP new medical event event MEDICAL EVENT Enters a new medical event into the DB Requires the patient exist in the ohip repository Insert is amazingly easy using Eiffel object to repository mapping require prel is patient in ohip repository cur patient ohip num pre2 event medical specialty lt specialty map max enumerator pre3 event practitioner name count 0 pred event practitioner type lt practitioner map max enumerator pre5 event absolute date void pre6 event hospital name count 0 pre7 event event type event map max enumerator new patient new user OHIP USER Enters a new patient in the ohip users respository Insert is amazingly easy using Eiffel object to repository mapping
61. ide shows an example of query output for a patient query Note that the patient s name age gender and OHIP number are displayed along with the consultation data and the attending medical practitioner s identity o meddb M x www EIFFEL PEOTOTYFE OF PATIENT DATABASE mmu 27080861 diagna Ares Oncology th AD OR Oncology ir Bh i HE Mount Jiasnosis Patient remission CHit any key to continue 3 18 QUERYING PATIENT HISTORIES FOR CLOSE RELATIVES Selection 2 from the home panel brings up the query panel where you may choose to query patient information or information about a patients relatives Note that the system considers the names ages and OHIP numbers of patient relatives to be confidential and will not display these to you when displaying formatted query results The following diagram is a sample of the query output for diagnosis information of family members Observe that the patient name age gender and OHIP number are not displayed EIPFEL PHOTOTYPE OF PATIENT DATABASE Date 1948 AUG F Consultation type Final diagnos i Area Ophthalmology J I MD DOCTOR a Ophthalas logy Diagnosis Hearse ighted T jo Glasses Hit any key to cont inwe ENTERING NEW CONSULTATION DATA Option 3 from the home panel will bring up a panel that allows you to enter new consultation data This includes data for each of the three supported consultation types triage intermediate consultation and diagnosis
62. ier RTI Test objectives Test handling of missing database Test operations When the MHDCS application mhdcs exe is started it will prompt the user for a database name Specify the name of an unknown database Expected outcome The application should detect the missing database and report this to the user through a console message Test case identifier RT2 Test objectives Test handling of missing relational tables Test operations When the MHDCS application mhdcs exe is started it will prompt the user for a database name Specify the name of an existing database that does not have the reguired MHDCS tables Expected outcome The application should detect the missing relational tables and report this to the user through a console message Test case identifier RT3 Test objectives Home panel test user selection out of range Test operations From the home panel specify a selection that is out of range e g 213 Expected outcome The application should detect the invalid user selection notify the user of their mistake via a console message and prompt the user to retry Test case identifier RT4 Test objectives Home panel test user selection non numeric Test operations From the home panel specify a selection that is not a vlaid numeric e g eyt7f Expected outcome The application should detect the invalid use
63. ip user string STRING is NI m sorry this OHIP user is not found in our database NPlease double check the number and try again Request selection string STRING is Please enter your selection then hit enter Request value string STRING is Please enter a numeric value then hit enter invariant invi patient data repository void inv2 selection gt 0 end class INTERFACE 80 LIST USERS PANEL Ancestor INTERFACE indexing description UI Panel for listing all ohip users in our system author Sam Lightstone date SDate revision SRevision class LIST USERS PANEL inherit INTERFACE create make feature Initialization make repository in PATIENT DATA REPOSITORY is Creation routine do make interface repository in end process panel is Routine to run the panel displayus all known OHIP users in the system sorted by last then first name local counter INTEGER is found BOOLEAN new user OHIP USER dob DATE TIME counter 0 max panel selection value 1 min panel selection value 1 max selection value 1 min selection value 1 panel selection 1 clear screen display panel header patient data repository query all patients patient data repository next ohip user from until patient data repository results exhausted loop display ohip user counter counter 1 if counter 18 then counter 0 please_continue clear
64. ives Home panel test transition to query panel Test operations Proceed to home panel Sleect patient query Expected outcome The patient query panel should pop up and prompt the user with several new query options Test case identifier FCTS Test objectives Home panel test transition to new event panel Test operations From the home panel select 3 Expected outcome Query panel is displayed Test case identifier FCT6 Test objectives Query panel list patient s last visit Test operations Select patient s last visit from query panel specify a known OHIP user Expected outcome Patient s last hospital triage record should be displayed Test case identifier FCT7 Test objectives Query panel query patient complete medical history 26 Test operations Select patient s complete medical history from the query panel specify a known OHIP user Expected outcome The consultation records for this patient triage intermediate consultation and diagnosis should be displayed in chronological order Test case identifier FCTS Test objectives Query panel query patient history by medical specialty Test operations Select patient s history for in a medical speciality from query panel specify a known OHIP user Repeat this for each of the 6 supported specialities ER oncology ophthalmology cardiology
65. le external string representation for male Female string STRING is Female external string representation for female invariant invariant clause enum max enumerator end class GENDER MAP 70 HOME PANEL Ancestor INTERFACE indexing description author Sam Lightstone date SDate revision SRevision class HOME PANEL inherit INTERFACE create make feature make repository_in Creation routine do make interface end process panel is PATIENT DATA REPOSITORY UI panel for the main screen is repository in Routine to run the panel local time to exit BOOLEAN do panel selection 0 from time to exit false until time to exit true loop clear screen display panel header io putstring 1 Exit this program N io putstring 2 Query patient medical information N io putstring 3 Enter patient medical event N io putstring 4 List all patients N io putstring 5 Product overview N min panel selection value 1 max panel selection value 5 min selection value 1 max selection value 5 request panel selection if valid panel selection panel selection then time to exit true end end ensure then valid panel selection end end class HOME PANEL panel selection 71 INTERFACE indexing description Deferred class for standard I O ops used by app panels author
66. lty false true please_continue elseif selection 5 then request_medical_specialty specialty_enum display_history_for_specialty false false please_continue elseif selection 6 then display_family_history_by_diagnosis please_continue elseif selection 7 then request_medical_specialty specialty_enum display_family_history_for_specialty please_continue end end ensure then valid_panel_selection panel_selection end display_last_visit is display info on this patients last regional hospital visit require patient data repository db query in prog false local found event BOOLEAN do patient data repository query patient last visit if patient data repository last query had result then clear screen display panel header display event false else io putstring NNo consultation history for this patient in the current database end ensure patient data repository db query in prog false end display complete history is display the complete medical history for this patient require patient data repository db query in prog false do patient data repository query patient complete history display event query results false ensure patient data repository db query in prog false end display history by diagnosis hide identity BOOLEAN is 110 require do ensure end display a patient s medical history by d patient data repository db query in p
67. ly ohip nums i display history for specialty true true i i 1 end patient data repository db query in prog false build list of family ohip numbers is require build a linked list of OHIP numbers for all close re latives of our current patient 111 diagnosis only local ensure end patient data repository db query in prog false index INTEGER index 1 if family ohip nums void then create family ohip nums make 1 max num family ohip nums end if patient data repository mom ohip num 0 then family ohip nums put patient data repository mom ohip num index index index 1 end if patient data repository dad ohip num 0 then family ohip nums put patient data repository dad ohip num index index index 1 end patient data repository query children patient data repository next ohip user from until patient data repository results exhausted true loop patient data repository bind out last ohip user family ohip nums put patient data repository patient ohip num index index index 1 patient_data_repository next_ohip_user end set_current_ohip_user current_ohip_num patient_data_repository query_siblings patient_data_repository next_ohip_user from until patient_data_repository results_exhausted true loop patient_data_repository bind_out_last_ohip_user if current_ohip_num patient_data_repository patient_ohip_num then family_ohip_nu
68. me in surname clone lastname in patient ohip num ohip num in mom ohip num mom num in dad ohip num dad num in gender sex in date of birth dob in ensure postl given names void post2 surname void post3 patient ohip num ohip num in post4 mom ohip num mom num in post5 dad ohip num dad num in post6 gender sex in post7 date of birth dob in 94 end invariant surname void given names void date of birth void patient ohip num gt 0 end class OHIP USER 95 OVERVIEW PANEL Ancestor INTERFACE indexing description UI panel for displaying product overview author Sam Lightstone date Date revision Revision class OVERVIEW_PANEL inherit INTERFACE create make feature Initialization make repository in PATIENT DATA REPOSITORY is do end creation routine make interface repository in process panel is do routine to run the panel min panel selection value 1 max panel selection value 1 min selection value 1 max selection value 1 panel selection 1 display program overview ensure then end valid panel selection panel selection feature NONE Implementation display program overview is require do routine to display the product overview text overview textl count overview text2 count overview text3 count VV M OEC Clear screen display
69. ment systems Open Database Connectivity ODBC is a widely accepted application programming interface API for database access It is based on the Call Level Interface CLI specifications from X Open and ISO IEC for database APIs and uses Structured Query Language SQL as its database access language This interface standard is supported by a large set of database vendors particularly those supporting Windows NT platforms Unlike SQL ODBC is API driven and generally more conducive to database application development Developing MHDCS using an ODBC interface ensures smooth support for a variety of database management systems including most of the world s leading vendors such as Oracle DB2 Sybase and Microsoft SOLServer The design choice to use ODBC was also motivated by a development limitation In particular EiffelStore provides interface support for only three database server types These include Oracle Sybase and ODBC However the development environment available requires the use of DB2 Universal Database Therefore in order to use DB2 as a DBMS for the MHDCS system it was necessary to use the ODBC interface provided by EiffelStore Database schema The database is designed using two relational tables and associated table indexes for fast searching One table hold sthe complete of all known OHIP users and their associated meta data while the other table contains records for medical events or medical consultations which are e
70. ms put patient_data_repository patient_ohip_num index index index 1 end patient_data_repository next_ohip_user end set_current_ohip_user current_ohip_num patient_data_repository bind_out_last_ohip_user num_family_members index 1 patient_data_repository db_query_in_prog false family_ohip_nums ARRAY INTEGER Max num family constant for max number of family members We will collect ohip numbers for parents siblings and children 200 is more than a safe upper bound for this Contracts will protect us if the scope of collected ohip numbers changes ohip nums INTEGER is 200 num family members INTEGER the number of family members we find set current ohip user user ohip num INTEGER is require local do ensure end set the current ohip user in the patient data repository to be user ohip num and bind out his attributes prel valid ohip num user ohip num user exists BOOLEAN user exists patient data repository is patient in ohip repository user ohip num patient data repository bind out last ohip user postl patient data repository is valid ohip user data 112 end class QUERY PANEL 113
71. n Diagnosis string STRING is Final diagnosis external string representation invariant invariant clause enum lt max enumerator end class EVENT MAP for triage for intermediate consult for final diagnosis 68 GENDER MAP Ancestor ENUM MAP indexing description Mapping for gender author Sam Lightstone date SDate revision SRevision class GENDER MAP inherit ENUM MAP create make feature ANY set_male is do ensure end set_female is do ensure end sets the gender type to male enum enum male string male string is set true enum enum male string male string is set true sets the gender type to female enum enum female string female string is set true enum enum female string female string is set true set gender from enum enum in INTEGER is require do ensure end Max enumerator sets the gender type based on input enumerator This will sanity cehck the enum in as well as set the formatted string representation enum in 0 enum in max enumerator if enum in enum male then set male else set female end is set true INTEGER is 2 max enumerator supported in this class feature NONE implementation 69 Enum male INTEGER is 1 enum value for male Enum female INTEGER is 2 enum value for female Male string STRING is Ma
72. n ok then medical database session control commit if medical database session ok then update ok true end end cur patient ohip num new user patient ohip num 100 ensure end ohip user clone new user postl update ok implies is patient in ohip repository cur patient ohip num post2 cur patient ohip num new user patient ohip num post3 ohip user patient ohip num new user patient ohip num new medical event event MEDICAL EVENT is require end Enters a new medical event into the DB Requires the patient exist in the ohip repository Insert is amazingly easy using Eiffel object to repository mapping prel is patient in ohip repository cur patient ohip num pre2 event medical specialty lt specialty map max enumerator pre3 event practitioner name count 0 pre4 event practitioner type practitioner map max enumerator pre5 event absolute date void pre6 event hospital name count gt 0 pre7 event event type event map max enumerator update ok false store set repository event repository store put event if medical database session ok then update ok true end query patient diagnosis history is require do ensure end Retrieve a patient s medical history listing only the final diagnosis for each problem prel is patient in ohip repository cur patient ohip num base selection set map name cur patient ohip num pre
73. new user dad ohip num fetch ohip num false SNor enter 0 to indicate SNor enter 0 to indicate io putstring NPlease enter 1 if the patient is male or 2 if the patient is female N min selection value 1 max selection value 2 request user selection if selection 1 then new user gender set male else new user gender set female end io putstring io putstring io putstring lo putstring 4 io putstring new user last name io putstring NDate of birth io putstring new user dob out io putstring NOHIP 4 io putint cur ohip num io putstring NMother s OHIP 4 io putint new user mom ohip num io putstring NFather s OHIP 4 io putint new user dad ohip num io putstring NGender io putstring new user gender get formatted string io putstring SNSNIf this is correct please type 1 otherwise type min selection value 1 max selection value 2 request user selection if selection 2 then request ohip user info end ensure postl new user last name count 1 post2 new user first names count 1 post3 valid ohip num cur ohip num post4 new user dad ohip num 0 post5 new user mom ohip num 0 post6 new user dob void post7 new user dob2 void post8 new user gender is set end insert new user data is insert a new OHIP user into the db require prel patient data repository db query in prog false loc
74. ning data to fetch for this query specialty map MED SPECIALTY MAP Current medical specialty obstetrics oncology etc surname STRING patient surname tables_conform BOOLEAN Does a required tabl xist update ok BOOLEAN Was the last database INSERT UPDATE successful T invariant invl medical database void inv2 tables conform implies base selection void inv3 tables conform implies store void inv4 tables conform implies medical event void inv5 tables conform implies ohip user void inv6 tables conform implies gender map void inv7 tables conform implies event map void inv8 tables conform implies practitioner map void inv9 tables conform implies specialty map void inv10 tables conform implies my cursor void end class PATIENT DATA REPOSITORY 57 PRACTITIONER MAP Ancestor ENUM MAP indexing description Types of practitioners author Sam Lightstone date Date revision Revision class interface PRACTITIONER_MAP create make feature Max_enumerator INTEGER is 2 max enumerator allowed in this class set_doctor sets the prectitioner type to doctor ensure enum enum_doctor string doctor_string is_set true set_nurse sets the practitioner type to nurese ensure enum enum_nurse string nurse_string is_set true
75. ntered in the database by medical practitioners The table and index definitions are defined as follows described below in SQL data definition language syntax table medical events patient ohip num INTEGER NOT NULL complaint medical specialty practitioner name practitioner type absolute date hospital name final diagnosis comment event type index medevent inx1 on medical events table ohip users given names surname patient ohip num mom ohip num dad ohip num date of birth gender patient ohip num ASC varchar 200 INTEGER varchar 100 INTEGER TIMESTAMP NOT NULL varchar 70 varchar 200 varchar 200 INTEGER NOT NULL absolute date ASC varchar 51 NOT NULL varchar 35 NOT NULL INTEGER NOT NULL INTEGER INTEGER DATE NOT NULL INTEGER NOT NULL create unique index ohipinx1 on ohip users patient ohip num ASC create index ohipinx2 on ohip users surname given names ASC It is a fundamental requirement of the MHDCS system that these tables exist with precisely these definitions and field names Upon starting the MHDCS software will examine the database for the existence and conformance of these tables The system will not proceed without asserting the existence and conformity of these tables The storage layout and recovery scheme of the database is independent of the software system and is therefore assumed to be a design
76. obstetrics psychiatry Expected outcome The consultation records should be displayed in chronological order exclusively for the medical speciality specified Test case identifier FCT9 Test objectives Query panel query medical history in medical speciality of patient relatives Test operations Query histor of patient relatives from query panel specify a known OHIP user Expected outcome Consultation records should be displayed for the patient s relatives The age gender and name of the relatives should not be displayed Test case identifier FCT10 Test objectives Query panel test transition back to home panel Test operations Select the back to home option from the query panel Expected outcome The home panel should be re displayed Test case identifier FCTI11 Test objectives New event panel test insert of triage data of patient currently known in the MHDCS system Test operations From the home panel select the Enter new consultation data From the new event panel select enter triage data When prompted enter the OHIP number of a known OHIP user in the system Add consulation data Expected outcome The steps above should proceed without error After insertion of the new data proceed to the guery panel and query the patient s last visit The new triage data should be displayed Test case identi
77. of patient medical issues with those of close family relatives The development of database software for maintaining and correlating patient relative medical histories across regional hospitals would be an invaluable asset in providing superior medical care As well over time a broad collection of data would enable data mining which may surface unexpected medical relationships previously unrecognised Use of this data for data mining could lead to advances in medical treatments and patient care The purpose of this project is to design and develop a prototype of this system sufficient for demonstration purposes as a proof of concept entity This prototype may be used as a demonstration vehicle for marketing and sales of MHDCS DESIGN OVERVIEW AUDIENCE AND ASSUMPTIONS This document describes the high and low level design details of the prototype system for the Medical History Database And Correlation System MHDCS The prototype system has been designed in the Eiffel language Readers of this document are presumed to be fluent in Eiffel and BON and have a background in Object Oriented software construction METHODOLOGY MHDCS has been designed using standard Object Oriented software construction methodologies through the Eiffel suite of development tools produced by Interactive Software Engineering Inc Santa Barbara California An emphasis is placed on software reuse particularly through use of EiffelTime and EiffelStore clusters
78. of the relational table holding data for the list of known OHIP users Default ohip num INTEGER is 0 ohip value in DB when unknown Invalid ohip num INTEGER is 999999999 guranteed not to match in DB event repository conforms medical event EiffelStore bug Still not working ohip repository conforms ohip user EiffelStore bug Still not working invariant invi medical database void inv2 tables conform implies base selection void inv3 tables conform implies store void inv4 tables conform implies medical event void inv5 tables conform implies ohip user void inv6 tables conform implies gender map void inv7 tables conform implies event map void inv8 tables conform implies practitioner map void inv9 tables conform implies specialty map void invi10 tables conform implies my cursor void end class PATIENT DATA REPOSITORY 106 PRACTITIONER MAP Ancestor ENUM MAP indexing description Types of practitioners author Sam Lightstone date SDate revision SRevision class PRACTITIONER MAP inherit ENUM MAP create make feature set_doctor is sets the prectitioner type to doctor do enum enum doctor string doctor string is set true ensure enum enum doctor string doctor string is set true end set nurse is sets the practitioner type to nurese do enum enum nurse string nurse string is
79. of these clusters is described in greater detail below DESIGN RATIONALE This section briefly describes the design principles for each cluster in the MHDCS system The Application and Panel clusters This cluster is modeled after the multi panel interactive system described in B Meyer Object Oriented Software Construction 2 Ed Prentice Hall 1997 chapter 20 pp 675 694 The Application maintains both an array of instantiated user interface panels as well as a two dimensional array of state transitions which can be navigated based on user selection Similarly the Panel cluster contains class definitions of user interface panels In this cluster there is a single deferred class named INTERFACE from which all user panel classes derive Each panel is considered a state in the state transition model The application class requires knowledge of the state transitions that should be made based on user selections from any given panel which is encoded into the two dimensional state transition array indexed by user selection After each transition the application invokes the process panel feature of the panel object referenced by the new target state This process continues until the target state is state 0 which by convention requests application exit The PANEL cluster contains a deferred class INTERFACE as well as five implemented panel classes Each panel class represents a UI for a specific encapsulation of data These classes include
80. ould be able to restart the application without incident Test case identifier RT8 Test objectives Test crash recovery during update Test operations While performing a database update insert of new consultation data terminate the application abnormally through either ctrl C or by exiting the DOS session under which the application is running Note in order to abnormally terminate the system in the middle of an update transaction you may need to test this through a debugger or enable software hooks since the timing opportunity is slight on the order of millisecond Expected outcome Your should be able to restart the application without incident The database should not have any partial consultation records guaranteed feature of the DBMS Test case identifier RT9 Test objectives Test crash recovery after update Test operations Repeat RT8 but terminate the system just following the consultation insertion Expected outcome Your should be able to restart the application without incident The database should not have any partial consultation records guaranteed feature of the DBMS 31 SYSTEM LIMITATIONS AND FUTURE IMPROVEMENTS DESIGN IMPROVEMENTS The current design could be improved by further decomposition of the PATIENT DATA REPOSITORY class In particular it is recommended that this class be decomposed into PATIENT QUERY and PATIENT UPDATE cla
81. pop up a dialog box and prompt you for the name of a program to run Enter the full path to where you have installed MHDCS followed by the executable name mhdcs as follows 14 Run RIES Type the name of a program folder or document and Windows will open it for you Open d congese ood meddb eifgen f_code meddb IM Bonin Seperate Memon Space This will launch MHDCS and bring up the initial program screen with a brief introduction and a request for a database name wee EIFFEL eee MED GAL HIS Y DATABASE amp GORKELATIOMN SYSTEM se Mateo Ht ore inig and their HUTLTIE Ded Eon Type the name of the database you wish to use then hit enter MHDCS will then connect to the database and bring up the HOME panel You are then ready to run queries and insert new data 15 NAVIGATING THE MHDCS USER PANELS After connecting to the target database the home panel will be displayed This panel is the central hub of the MHDCS user interface From this panel you can make selections that will direct you to the features of the MHDCS software m 2 5 eee EIFFEL PROTOTYPE OF PAIIENI DATABASE this progranm iral information ical event selection then hit enter LISTING ALL KNOWN OHIP USERS Selection 4 from the home panel lists all known OHIP uses in the system A sample of the system output from this panel is shown here Note that the output is sorted by name in ascending order keye
82. pository surname io putstring io putstring patient data repository given names if name chars width of name field then pad spaces width of name field name chars from counter 0 until counter pad spaces 1 loop io putstring counter counter 1 end end io putstring OHIP io putint patient_data_repository patient_ohip_num io putstring Age io putint determine_age patient_data_repository date_of_birth end is_valid_event_data BOOLEAN is sanity check medical event data local valid BOOLEAN do if patient_data_repository absolute_date void and patient_data_repository date_of_birth void and patient_data_repository practitioner_name void and patient_data_repository practitioner_map void and oatient data repository gender map void and patient_data_repository gender_map is_set and oatient data repository practitioner map is set true and patient data repository event map void and oatient data repository event map is set true then valid true 74 end Result valid end selection prompt string STRING prompt string to use with request user selection request user value is geta numeric value from the user reuse code from request user selection but change the prompt string Remember to put the default string back when we re done require request value string void request selection string void do selection prompt st
83. r mapping types of practitioners gender medical consultations and fields of medical specialty Auxilliary clusters EiffelStore and EiffelTime reused from Eiffel libraries MHDCS expliots the EiffelStore and EiffelTime clusters provided by interactive Software Engineering Inc which are available as part of the Eiffel installable software that ships with Eiffel v4 3023 used in this system EIFFELSTORE EiffelStore is the principal interface between Eiffel and Database Management Systems DBMS relational or object oriented It enables organizations to combine the power of Eiffel object oriented development with the need to access existing databases and use them to store objects The EiffelStore Application Programming Interface API is DBMS independent so that you can use the same source code with a wide range of actual database products From the ISE Web page at http www tools com products store html In the MHDCS system interfaces to the EiffelStore classes in encapsulated in the DATABASE_REPOSITORIES cluster EIFFELTIME The EiffelTime cluster is used as a mechanism for performing date and time operation Standard operations used in the MHDCS project include time stamping medical consultations calculation of current date time determining the current age of a patient and mapping between ODBC time date timestamp values and EiffelTime DATE TIME classes DATABASE DESIGN ODBC as interface to relational database manage
84. r selection notify the user of their mistake via a console message and prompt the user to retry Test case identifier RT5 Test objectives Patient guery test invalid OHIP number valid OHIP number must be 9 digits not starting with 0 Test operations Proceed to the query panel Query patient s last hospital visit and specify an OHIP number for the patient that is less than 9 digits Repeat this for a number with more than 9 digits Repeat again with a number that is 9 digits and begins with 0 Expected outcome The application should detect the invalid user input notify the user of their mistake via a console message 30 and prompt the user to retry Test case identifier RT6 Test objectives Patient query test valid OHIP number of patient not found in the current MHDCS system Test operations Proceed to the query panel Query patient s last hospital visit and specify an OHIP number that is known not to exit in the ohip users table Expected outcome The system should display no consultation records and continue processing normally Test case identifier RT7 Test objectives Test crash recovery during query Test operations While a database query is running terminate the application abnormally through either ctrl C or by exiting the DOS session under which the application is running Expected outcome Your sh
85. ring request value string request user selection selection prompt string request selection string ensure selection prompt string request selection string end request user selection is routine to prompt a user for a choice selection the user is expected to enter an integer representing one of the posted choices require prel min selection value gt 0 pre2 max selection value gt min selection value local input ok BOOLEAN do from input ok false until input ok true loop io putstring selection prompt string io new line io new line io readint selection io lastint if not valid selection selection then io putstring bad selection string else input ok true end end Clear screen ensure postl valid selection selection rescue io putstring bad selection string retry end request panel selection is request user selection to UI panel do request user selection panel selection selection ensure valid selection panel selection panel selection selection end valid selection selection in INTEGER BOOLEAN is check whether the current user selection is valid local valid BOOLEAN do if selection in gt min selection value and selection in lt max selection value then 75 valid true end Result valid end valid_panel_selection panel_selection_in INTEGER BOOLEAN is check whether the current user s panel selection is valid
86. rog iagnosis false patient data repository query patient diagnosis history display event query results patient data repository db query in prog display history for specialty display a patient s medical history in a display display hide identity false hide identity diagnosis only BOOLEAN is given medical specialty require patient data repository db query in prog false do patient data repository query patient history by specialty specialty enum display event query results hide identity ensure patient data repository db query in prog false end family history by diagnosis is display the patient histories diagnosis only for close relatives of a patient require patient data repository db query in prog false local i INTEGER do build list of family ohip numbers from i 1 until i gt num family members loop set current ohip user family ohip nums i display history by diagnosis true i s i 1 end ensure patient_data_repository db_query_in_prog false end family_history_for_specialty is require local do ensure end display the patient data re i INTEGER diagnosis only of a patient patient histories in a medical specialty for close relatives pository db query in prog false build list of family ohip numbers from i 1 until i gt num family members loop set current ohip user fami
87. s final consult ensure is set true enum enum diagnosis set event from enum enum in INTEGER sets the map data based on an input enumerator previously generated by an onject of this class This will also 38 set th xternal string representation for the object require prel enum in 0 pre2 enum in max enumerator ensure postl enum enum in post2 is set true set intermediat sets th vent type to intermediate neither triage nor diagnosis ensure is set true enum enum intermediate set triage sets th vent type to triage ensure is set true enum enum triage invariant invariant clause enum lt max enumerator end class EVENT MAP 39 GENDER MAP Ancestor ENUM MAP indexing description Mapping for gender author Sam Lightstone date Date revision Revision class interface GENDER_MAP create make feature ANY Max_enumerator INTEGER is 2 max enumerator supported in this class set female sets the gender type to femal ensure enum enum female string female string is set true set gender from enum enum in INTEGER sets the gender type based on input enumerator This will sanity cehck the enum in as well as set the formatted string representation require enum in 0 enum in max enumerator ensure is set true set male set
88. s associated with a home panel H new event panel N query panel SAP all users panel L PI overview panel uum dq INTEGER gt mi Max_state Max_panel_choices n application state HOME PANEL ome panel UI NEW EVENT PANEL ew consultation UI QUERY PANEL atient query UI ST USERS PANEL ist fo OHIP users UI OVERVIEW PANEL roduct overvewi UI is 5 ax state allowed int INTEGER is 8 max state he application max num slections for any panel initial INTEGER zen E umber of the initial state patient data repository PATIENT DATA REPOSITORY highest level class for interface to DB operations execute is perform a user session panel INTERFACE state number riant initial 0 lt state number state number lt max state 1 state_number 0 cur_panel cur_panel process_panel state_number e_number 0 1 INTERFACE state_num INTEGER enter state with index sn local eur do from inva unti loop end ensure stat end put_state ref_pane require 1 lt stat state_number e num lt max state 62 application ui panels item panel transitions item is state number state number cur panel get selection do end select initial require do ensure end put transition require do end application ui panels put ref panel state num stat
89. s of age The test system will not generate obstetrics data for any men or for women under 18 The sample data generated by this test system includes 40 medical practitioners 7 hospitals 6 medical specialities Emergency Obstetrics Ophthalmology Oncology Psychiatry Cardiology 20 practitioner comments 10 medical conditions in each medical speciality 10 patient complaints in each medical speciality 10 diagnosis statements in each medical speciality e 999999 25 FUNCTIONAL CORRECTNESS TESTS Test case identifier FCT1 Test objectives Home panel test exit Test operations Got home panel Select program exit Expected outcome MHDCS application exists normally Test case identifier FCT2 Test objectives Home panel test transition to overview panel Test operations Proceed to home panel Select program overview Expected outcome Overview is clearly displayed in three screens followed by immediate return to home panel Test case identifier FCT3 Test objectives Home panel test transition to list all patients Test operations Proceed to home panel Select list all OHIP users Expected outcome All OHIP users are listed in alphabetic order sorted first by last name then by first OHIP and age and gender should also be displayed Followed by transition back to home panel Test case identifier FCT4 Test object
90. s of the data Therefore the assertions are intentionally weak do given names clone ohip user given names surname clone ohip user surname mom ohip num ohip user mom ohip num dad ohip num ohip user dad ohip num date of birth clone ohip user date of birth patient ohip num ohip user patient ohip num gender map set gender from enum ohip user gender end Select all patients STRING is select from ohip users order by SURNAME GIVEN NAMES amp select string for querying all known OHIP users Select patient complete history STRING is select from medical events where PATIENT OHIP NUM predicate ohip num order by ABSOLUTE DATE select string for querying the complete medical history of a patient Select patient history by specialty STRING is select from medical events where PATIENT OHIP NUM predicate ohip num and MEDICAL SPECIALTY predicate specialty enum order by ABSOLUTE DATE select string for querying a patient history n a given medical specialty Select patient diagnosis history by specialty STRING is select from medical events where EVENT TYPE 3 and PATIENT OHIP NUM predicate ohip num and MEDICAL SPECIALTY predicate specialty enum order by ABSOLUTE DATE select string for querying a patient history n a given medical specialty Select patient last visit STRING is select from medical events where PATIENT OHIP NUM predicate o
91. s the gender type to male ensure enum enum male string male string is set true invariant invariant clause enum lt max enumerator end class GENDER MAP 40 41 HOME PANEL Ancestor INTERFACE indexing description UI panel for the main screen author Sam Lightstone date SDate revision Revision class interface HOME_PANEL create make feature make repository_in PATIENT_DATA_REPOSITORY Creation routine process panel Routine to run the panel ensure then valid panel selection panel selection end class HOME PANEL 42 INTERFACE indexing description Deferred class for standard I O ops used by app panels author Sam Lightstone date SDate revision SRevision deferred class interface INTERFACE feature ANY get selection INTEGER returns the current user selection ensure postl Result panel selection make interfac repository in PATIENT DATA REPOSITORY the generic make routine useful to all INTERFACE objects require repository in void ensure postl patient data repository repository in post2 selection 0 post3 panel selection 0 process panel display a new UI panel invariant invl patient data repository void inv2 selection gt 0 end class INTERFACE 43
92. se end postl not results exhausted implies db query in prog post2 not results exhausted implies is valid event medical event is fetch the next ohip user in a query of ohip users table prel db query in prog if not base selection exhausted then last query had result true my cursor fill in base selection object convert ohip user base selection cursor to object bind out ohip user base selection next else results exhausted true db query in prog false end postl not results exhausted implies db query in prog post2 not results exhausted implies is valid ohip user obj ohip user is valid ohip user obj usr OHIP USER BOOLEAN is require local do verify that usr obj reprsents a reasonable gt OHIP USER usr void is_ok BOOLEAN 103 sr mom ohip num gt 0 if usr given names count 1 and usr surname count 1 and usr patient ohip num 0 and and usr dad ohip num gt 0 and usr date of birth void and usr gender gt 0 and usr gender lt gender map max enumerator then end is valid event require local do is ok true end Result is ok event MEDICAL EVENT BOOLEAN is check if medicalevent data we ve bound out is reasonable event void is ok BOOLEAN if event medical specialty lt specialty map max enumerator and event practitioner name count 0 and event practitioner type lt practitioner map max enumerator and event a
93. selection set map name dad ohip num dad predicate ohip num Select string select siblings from ohip repository run query base selection unset map name mom predicate ohip num base selection unset map name dad predicate ohip num postl query ok is Retrieve the set of children who have the current patient as a parent prel is patient in ohip repository cur patient ohip num ohipl INTEGER ohip2 INTEGER ohipl cur patient ohip num ohip2 cur patient ohip num base selection set map name ohipl predicate ohip num select string select offspring from ohip repository run query base selection unset map name predicate ohip num postl query ok query relatives diagnosis history by specialty is require do ensure end For a given medical specialty retrieve the medical histories listing only the final diagnosis for each problem for apatient s relatives i e Parents amp children prel is patient in ohip repository cur patient ohip num postl query ok query patient last visit is require do ensure end List the last recorded medical event for a patient in the database prel is patient in ohip repository cur patient ohip num select string select patient last visit base selection set map name cur patient ohip num predicate ohip num run query if not base selection exhausted then my cursor fill in base selection object conver
94. set true ensure enum enum nurse string nurse string is set true end set practitioner from enum enum in INTEGER is sets the enumerated map given an enumerator this will do a sanity check ont he enum set the human readable format string and mark the object as being set is set TRUE require enum in 0 enum in lt max enumerator do if enum in enum doctor then set doctor else set nurse end ensure enum enum in is set true end Max enumerator INTEGER is 2 max enumerator allowed in this class feature NONE Enum doctor INTEGER is 1 enum value for doctors 107 Enum nurse INTEGER is 2 enum value for nurses Nurse string STRING is NURSE string representation for nurses Doctor string STRING is DOCTOR string representation for doctors invariant invariant clause enum max enumerator end class PRACTITIONER MAP 108 QUERY PANEL Ancestor INTERFACE indexing description UI panel provides selections for patient queiries author Sam Lightstone date SDate revision SRevision class QUERY PANEL inherit INTERFACE create make feature Initialization make repository in PATIENT DATA REPOSITORY is Creation routine do make interface repository in create specialty enum make ensure postl specialty enum void end feature NONE Implementation Specialty enum MED SPECIALTY MAP
95. sses This would provide better encapsulation of data and superior modularity within the cluster Similarly the current implementation of PATIENT DATA REPOSITORY contains a set of attributes of consultation bind out characteristics These are the consultation characteristics including both OHIP user details and consultation data as they are to be viewed by client classes The bind out attributes would be better encapsulated in their own class such as EXTERN CONSULTATION ATTRIBS The new BON diagram for the cluster would look as follows ohip user Note that these changes would not incur changes to the client interfaces since the PATIENT DATA REPOSITORY would inherit from classes the features it conmtains in the current implementation design This rearchitecture is likely inexpensive since it predominantly involves moving features from PATIENT DATA REPOSITORIES into new classes rather than the creation of new features FUNCTIONAL LIMITATIONS The current system software is unable to detect a relational table with incorrect definitions EiffelStore currently has a defect in the conforms feature of the DB REPOSITORY class This feature is intended to assert the correct specification of a relational table against an Eiffel mapping object The intent of the designer is to use this feature to test the ohip users and medical events relational table and ensure they contain the expected column types Due to the defect in Eiff
96. sssccssscsecesscsecsssecessssececesecsesusececeseceeeseceesessceeseseceesussceeseseceessseseessecessees 20 PARALLEL PROGESSING POW ER 2 ettet tere creto tie NAATIN KITAAN ANA ALIN ana 22 CRASH RECOVERY AND FAULT TOLERANCE ccsssscsssscccssssccccsscsccssscessscsocssncsovsnscsccssuceccsssceecseucesvanscssossueesossscesossneesonssessonssessesenss 22 OPERATING LIMITS rette eerte tete EK E atta ates OSes bate N ete KK ARA det ite eee niv ns 23 FUNCTIONAL VERIFICATION TEST PLAN sicsscssccssccsscssscnssesescssencscntscsssesed sedeetecbectesudsessedosedsseascesesdedsencsentesedsvesedececsssecsesesens 24 LEST METHODOLOGY ivessccesceisestedovecehs a ne SANA Gad waa BAKA din edidic candad nidduue eene 24 TEST SYSTEM SPECIFICATION osisssa a as S Sab SG HAAS aE SAS SAS Sad Saeed dod c ned te een 25 FUNETIONAL CORRECINESS TESTS enge teeth rr haha e bara rd re dai erp c div cd ore Naumanen 26 ROBUSTNESS TESTIS Anreise Tametsi ONE ih dr ph ee mh d f en te rcc raran e hs 30 SYSTEM LIMITATIONS AND FUTURE IMPROVEMENT cscccsssssssssssssscessscsssscsssscssscccsssccssscsscesscsssssessssssssssssscesssnes 32 DESIGN IMPROVEMENTS cei dare etiara e eee tee opere t excel eee ete ve er aN ve FU e Ie E E ete STK Tn 32 BUNGHONAE PIMIT TIONS nm aa vetaa Foren ties e Ferte rv eor OE Ther Puer rte thn cue ta advan antes eset etu ene Taa 32 FUTURE ENH NGEMENTS zero a maan toon ue v erret er re ert Tree Peel eec n tup Cet Rr E E tee eta Feet Pentin 33
97. stetrics 2 Cardiology 3 Ophthalmology io putstring N4 Psychiatry 5 Oncology 6 Emergency io new line io new line min selection value 1 max selection value 6 request user selection if selection 1 then specialty enum set obstetrics elseif selection 2 then Specialty enum set cardiology elseif selection 3 then specialty enum set ophthalmology elseif selection 4 then specialty_enum set_psychiatry elseif selection 5 then Specialty enum set oncology else Specialty enum set triage end ensure postl selection 0 post2 selection 6 post3 specialty enum is set end valid ohip num ohip num in INTEGER BOOLEAN is test whether an ohip number is syntactically valid All ohip s must be 9 digit integers which means the valid range is 100000000 to 999999999 local valid BOOLEAN do if ohip num in 99999999 then if ohip num in 1000000000 then valid true end end Result valid end display ohip user query results is display the results of a query for ohip users require prel patient data repository query ok local counter INTEGER do Clear screen display panel header patient data repository next ohip user from until patient data repository results exhausted loop display ohip user counter counter 1 if counter 18 then counter 0 please continue clear screen display panel header end patient data repository next ohip
98. string if event map is diagnosis then diagnosis string request diagnosis Clear screen elseif event map is triage then complaint string request complaint Clear screen end cur date time make now ensure postl practitioner name count 0 post2 event map is diagnosis implies diagnosis string count 3 post3 event map is triage implies complaint string count 3 end new user last name STRING new user first names STRING new user dad ohip num INTEGER new user mom ohip num INTEGER new user dob DATE new user dob2 DATE TIME new user gender GENDER MAP day of birth INTEGER month of birth INTEGER year of birth INTEGER 91 request ohip user info is query info about a new ohip user currently not foudn in our DB local day month year INTEGER do clear screen create new user gender make io putstring SNYou will now be asked to enter information about this OHIP user io putstring NPlease enter the patients last name N new user last name get user string io putstring NPlease enter the patients first names N new user first names get user string io putstring NThe patient s date of bith is required N request date of birth io putstring NPlease enter the patient s mother s OHIP number it is not known N new user mom ohip num fetch ohip num false io putstring NPlease enter the patient s father s OHIP number it is not known N
99. system using commercially available data mining software several such packages are available for DB2 Universal Database today should be attempted This will provide an initial examination of the possible data mining value of this system Initial testing will almost certainly surface recommendations for database definition changes such as table structures to enhance the data mining potential of MHDCS 33 APPENDIX A BUSINESS OBJECT NOTATION BON SYSTEM DIAGRAM 34 APPENDIX B GLOSSARY OF CLASSES Name of Class Belongs to Cluster The root class for the medical DB Classes for date and time handling IFFELTIME Classes for database and relational table access IDB IENUM_MAP Super class for enum classes ENUMERATED MAPS Types of medical events and their features IENUMERATED_MAPS GENDER MAP apping for gender NUMERATED MAPS IHOME PANEL UI panel for the main screen PANELS Deferred class for standard I O ops pues used by app Panels IPANELS UI Panel for listing all ohip users in Database layer for DB level not VS DIERUM table ops IDATABASE_REPOSITORIES Mapping class for repositories MEDICAL EVENT associated with table DICAL EVENTS DATABASE REPOSITORIES Types of medical specialities we Marec ane NUMERATED MAP Panel for user to enter new patient INEW_EVENT_PANEL event data after a patient PANELS consultation apping class for repositories QHIE USER related to table OHIP USERS DATABASE REPO
100. t medical event base selection cursor to object bind out medical event last query had result true end base selection reset cursor my cursor base selection terminate medical database session control commit results exhausted true db query in prog false base selection unset map name predicate ohip num postl query ok query patient complete history is require do List a complete medical history for a patient prel is patient in ohip repository cur patient ohip num base selection set map name cur patient ohip num predicate ohip num 102 ensure end select string select patient complete history run query base selection unset map name predicate ohip num postl query ok query all patients is do ensure end List all patients by name and OHIP number Select string select all patients run query postl query ok next medical event is require do ensure end next ohip user require do ensure end fetch the next medical event in a query of the medical event table prel db query in prog if not base selection exhausted then last query had result true my cursor fill in base selection object convert medical event base selection cursor to object bind out medical event base selection next if fetch once then medical database session control commit fetch once false end else results exhausted true db query in prog fal
101. ta repository bind out last ohip user io putstring SNYou are updating records for the following patient io putstring Y io putstring patient data repository given names io putstring io putstring patient data repository surname io putstring NIf this is correct enter 1 otherwise enter 2 N min selection value 1 max selection value 2 request user selection 90 if selection 1 then user happy true end end end ensure postl patient data repository db query in prog false end prompt for new user BOOLEAN is ask user if the ohip number they requested which we did not find in the DB is a new user or a typo return TRUE if they intend to add a new user to the db do io putstring N NThe ohip user you requested was not found in the database io putstring NType 1 if this is a new ohip user or 2 if you d like to try again N min selection value 1 max selection value 2 request user selection if selection 1 then Result true end ensure Result implies selection 1 end request event data is fetch a pile of event characteristics from the user do request medical specialty specialty map Clear screen practitioner name request practitioner name clear screen request practitioner type practitioner map clear screen hospital name request hospital name clear screen comment string request comment clear screen diagnosis string complaint
102. the conformance to the repository double matching rule The double matching rule reads as follows 1 A table column and an object attribute must match in name 2 Atable column and an object attribute must be compatible in type Overview MHDCS is designed using four essential native clusters These include e An application cluster APPLICATION which includes instantiation of the three additional clusters and which controls state transitions for the application e An interface cluster PANEL containing classes for UIs and handshaking with lower level clusters for performing database services e A data repository cluster DATABASE REPOSITORIES which performs database operations including connection session monitoring repository operations such as table query and table insert e A cluster containing mapping classes ENUMERATED MAPS for enumerated types such as gender medical specialty practitioner consultation type These mapping classes help encapsulate typing and mapping 6 between enumerators numbers and external representations strings or enumerated values as they may appear in a UL which are completely unrelated to internal enumerators These classes help de couple the application cluster from the repository cluster Aside from the four native clusters described above MHDCS re uses the EiffelStore cluster for database interfacing and the EiffelTime cluster for date and time manipulation Use
103. the required tables You may use MHDCS with any DB2 UDB v6 1 or greater database provided it contains the required relational tables with the required table definitions The tables required are as follows described here using SQL definition syntax table medical events patient ohip num INTEGER NOT NULL complaint varchar 200 medical specialty INTEGER practitioner name varchar 100 practitioner type INTEGER absolute date TIMESTAMP NOT NULL hospital name varchar 70 final diagnosis varchar 200 comment varchar 200 event type INTEGER NOT NULL table ohip users given names varchar 51 NOT NULL surname varchar 35 NOT NULL patient ohip num INTEGER NOT NULL mom ohip num INTEGER dad ohip num INTEGER date of birth DATE NOT NULL gender INTEGER NOT NULL Table indexes are recommended on both tables for the OHIP number columns and date columns Installing the product MHDCS is easy to install and use Copy the mhdcs exe file to any directory on your computer Setting up your environment MHDCS requires a version of DB2 Universal Database Server to be installed and running prior to beginning the MHDCS program The DB2 UDB v6 1 is the minimum supported database level Starting the program To start MHDCS proceed to the start menu of the Windows action bar Click on the Astan menu This will ao Fun pop up a menu list From this list click on the menu item This will
104. tion value 1 max selection value 31 request user value day of birth selection create new user dob make day month year day of birth month of birth new user dob2 set date new user dob ensure new user dob void new user dob2 void determine age new user dob2 135 rescue io putstring NThe date value you have provided is not valid retry end invariant specialty map void event map void gender map void practitioner map void end class NEW EVENT PANEL 93 OHIP USER indexing description Mapping class for repositories related to table OHIP USERS author Sam Lightstone date Date revision SRevision class OHIP USER create make feature make is do surname given names patient ohip num 0 create date of birth make 1999 1 20 2 30 0 end feature ANY given names STRING surname STRING patient ohip num INTEGER mom ohip num INTEGER dad ohip num INTEGER date of birth DATE TIME gender INTEGER reset patient ohip num is resets the patient ohip num attribute to O0 do patient ohip num 0 ensure patient ohip num 0 end set attributes name in lastname in STRING ohip num in mom num in dad num in sex in INTEGER dob in DATE TIME is require prel ohip num in 0 pre2 name in count 0 pre3 lastname in count 0 pre4 name in count 0 pre5 dob in void do given names clone na
105. users 13 GETTING STARTEDSs m teta a a s IN S ITA m Mea M I NA N PIN Sets su RARE 14 Database schema creating a database and the required tables eese a ea a e e a a na a na nne 14 Installing the pFOdHGl A ii eee ette ee RR PR RR ENONERONDUDMPN IEEE 14 Setting UP your environment stet ire Re em tm erem PR ERROR DUE HR 14 Starting Tes PV OSTA ie adem met e Ee es ASA SANAN SAAN NSA 14 NAVIGATING THE MHDCS USER PANELS cccccccessssccesssscceccsccessesccsssecesscsecsesusececsesecesssececusececesececsesececseseceessssceesssecesssseceesenseeeess 16 LISTING ALL KNOWN OHIP USERS ccccccesscsccsssssccsssssccesscsccessecessesccecusecscsesececsusecsessececsusececsesscecsssececsesecsesssececsesacecseseseceessseseesseceess 16 THE PRODUCT OVERVIEW PANEL ccccccccessssccessssccescsccesscsccsssecessusecseusececsssecsesesececsesecsesusececusscecusececeseceesesececssseceeessssceessecessseceees 17 QUERYING PATIENT MEDICAL HISTORY cccccessssesssessscessecessecessccsssessecessecssscessecessecessecessecesscessecessecesseceasecesecessecesseceaseceaseessesecesseesaees 18 QUERYING PATIENT HISTORIES FOR CLOSE RELATIVES cccccessccssscessecessecessecssscesssessecssscessecessecessecessccssecesecessecessecesscessecensesessecenseees 19 ENTERING NEW CONSULTATION DATA eite vetet eeee ette edere eve t aee ec ee tere reote eee eee oet tree nie treo Decoder deo tee eoru esee e et eve eee 19 ENTERING A NEW OHIP USER TO THE SYSTEM ccccccesscsccss
106. utstring N end please continue is prompt the user with a please hit any key to continue msg do io putstring N Hit any key to continue N get any key end request ohip num INTEGER is prompt the user for an OHIP number and return it local ohip num INTEGER input ok BOOLEAN do io putstring NPlease enter the patient s OHIP then hit enter N Result fetch ohip num true ensure postl valid ohip num Result end fetch ohip num must be known BOOLEAN INTEGER is fetch a valid OHIP number from the user local ohip num INTEGER input ok BOOLEAN do from input ok false until input ok true loop io readint ohip num io lastint input ok valid ohip num ohip num if not input ok then if must be known then io putstring NI m sorry this is not a valid OHIP number io putstring NA valid OHIP number is a 9 digit number that does not start with 0 io new line io putstring SNPlease enter a vlid OHIP number io new line elseif ohip num 0 then input ok true end end end Result ohip num ensure postl must be known implies valid ohip num Result post2 Result 0 implies must be known false end request medical specialty specialty enum MED SPECIALTY MAP is prompt user for medical specialty returns an enum for medical specialty io putstring NPlease select a medical specialty from the following list TI io putstring N1 Ob

Download Pdf Manuals

image

Related Search

Related Contents

  Norge 1200 GT 8V - Manual de Servicio - 01/2011  Water SPA & Diamond & Spray 3 in 1  忠注意 外形図  Manuel d`utilisation  MODE D`EMPLOI UTILISATEUR  RESUME DES CARACTERISTIQUES DU PRODUIT 1  Halsey Taylor 8744083084 Use and Care Manual  Philips PAL coax cable MWV2900T  

Copyright © All rights reserved.
Failed to retrieve file