A Notation for a Medical Query Language Based
A Notation for a Medical Query Language Based on a Medical Object Model 6/16/2021 © 2002, Intermountain Health Care 1
The General Idea Variable : = Patient(). Find( with. Concept(“HL 7 Concept”)). real. Value() WBC : = Patient(). Find(with. Concept(“Lab Results”). with. Concept(“White Blood Count”)). real. Value() 6/16/2021 © 2002, Intermountain Health Care 2
More Dot Constructs • Object Selection – – – and() ascending() descending() not() or() with. Code() with. Date() with. Int() with. Real() with. Text() with. Unit() Etc. – – • Object Manipulation • Data Extraction/Manipulation – date. Value() – int. Value 6/16/2021 long. Value() real. Value() text. Value Etc. – – – – add() find() create() is. Valid() remove() set. Concept() Etc. © 2002, Intermountain Health Care 3
Constructing Queries: Simple Queries Arden Syntax (data) last_creat : = read last {"Creatinine level"}; last_BUN : = read last {"BUN level"}; GELLO Quantitative. Observation last_creat : = last(select obs from Quantitative. Observation as obs where obs. coded_concept. equals(new Concept("MTH", "C 0600061")) order by ascending obs. recording_time); Quantitative. Observation last_BUN : = last(select obs from Quantitative. Observation as obs where obs. coded_concept. equals(new Concept("MTH", "C 0005845")) order by ascending obs. recording_time); last_creatinine : = patient(). find(with. Concept("Lab Result*"). with. Concept(“serum creatinine*”). ascending(). with. Restriction(last)). real. Value(); last_BUN : = patient(). find(with. Concept("Lab Result*"). with. Concept(“serum BUN*”). ascending(). with. Restriction(last)). real. Value(); 6/16/2021 © 2002, Intermountain Health Care 4
Constructing Queries: More Complex Queries Data for data: Evoking /* the storage of a calcium value evokes this MLM */ storage_of_calcium : = event {‘ 06210519’, ’ 06210669’} ; Data at the /* total calcium in mg/d. L */ time of calcium : = read last {‘ 06210519’, ’ 06210669’; ’CALCIUM’} Evoking /* albumin in g/d. L */ evoking_albumin : = read last {‘ 06210669’; ’ALBUMIN’ where evoking} ; /* albumin in g/d. L; not necessarily from same test as Ca */ Data with Time last_albumin : = read last ({‘ 06210669’; ’ALBUMIN’} Constraints where it occurred within the past 2 weeks) ; /* creatinine in mg/d. L; not necessarily from same test as Ca */ creatinine : = read last ({‘ 06210669’, ’ 06210545’, ’ 06000545’; ’CREAT’} where it occurred within the past 2 weeks) ; ; ; 6/16/2021 © 2002, Intermountain Health Care 5
More Complex Queries with Dot-Notation Data for Evoking? Storage_of_calcium : = patient(). find(with. Concept("Lab Result*"). with. Concept(“serum calcium*”)). storage. Event() Calcium_value : = patient(). find(with. Concept("Lab Result*"). with. Concept(“serum calcium*”)). realvalue() Evoking_albumin : = patient(). find(with. Concept("Lab Data at the time of Evoking Result*"). with. Concept(“serum albumin*”). at. Timeof(Storage_of_calcium)). realvalue() last_albumin : = patient(). find(with. Concept("Lab Result*"). with. Concept(“serum Data with Time Constraints albumin*”). with. Restriction(last). with. Date( back( 2, WEEKS), Now)). realvalue() last_creatinine : = patient(). find(with. Concept("Lab Result*"). with. Concept(“serum creatinine*”). with. Restriction(last). with. Date( back( 2, WEEKS), Now)). realvalue() 6/16/2021 © 2002, Intermountain Health Care 6
A Blood. Pressure Battery 6/16/2021 © 2002, Intermountain Health Care 7
The Systolic BP from the Right Arm SBP : =the patient(). find(with. Concept(“Patient. Measurements”) Retrieve Systolic Blood Pressure. . with. Concept(“Systolic BP”)). real. Value Right_Arm_SBP patient(). find(with. Concept(“Patient. Measurements”) Retrieve the: =Systolic Blood Pressure from the Right Arm. . with. Concept(“Body Location”). with. Code(“Right Arm”). with. Concept(“Systolic BP”)). real. Value Right_Arm_SBP : = patient(). find(with. Concept(“Patient. Measurements”) Retrieve the Systolic Blood Pressure from the Right Arm. with. Concept(“Body Location”). with. Code(“Right Arm”) with the Patient Sitting. . with. Concept(“pat. Position”). with. Code(“Sitting”). with. Concept(“Systolic BP”)). real. Value Right_Arm_SBP : = patient(). find(with. Concept(“Patient. Measurements”) Retrieve the Systolic Blood Pressure from the Right Arm. with. Concept(“Body Location”). with. Code(“Right Arm”) During the Last 2 Days with the Patient Sitting. . with. Concept(“pat. Position”). with. Code(“Sitting”). with. Concept(“Systolic BP”). with. Date(back( 2, WEEKS), Now )). real. Value(); 6/16/2021 © 2002, Intermountain Health Care 8
Blood Pressure Examples (Continued) Right_Arm_SBP : = patient(). find(with. Concept(“Patient. Measurements”) Retrieve the. with. Concept(“Body Systolic Blood Pressure from the Right Arm”) Location”). with. Code(“Right with the Patient Sitting During the Last 2 Days that was. with. Concept(“pat. Position”). with. Code(“Sitting”) less than 80. . with. Concept(“Systolic BP”). with. Int(LT, 80, mm. Hg). with. Date(back( 2, WEEKS), Now )). real. Value(); Arm_SBP : = patient(). find(with. Concept(“Patient. Measurements”) Location”). (with. Code(“Right Retrieve the. or(with. Concept(“Body Systolic Blood Pressure from the Right Arm or. Arm”), with. Concept(“Body Location”). (with. Code(“Right Arm”)) Left Arm During the Last 2 Days. . with. Concept(“Systolic BP”). with. Date(back( 2, WEEKS), Now )). real. Value(); 6/16/2021 © 2002, Intermountain Health Care 9
Implications for a “User Friendly” Language WBC : = Patient(). Find(with. Concept(“Lab Results”). with. Concept(“White Blood Count”)). real. Value(); WBC : = Read Value of “Lab Results”. ” Results White Blood Count”; Count 6/16/2021 © 2002, Intermountain Health Care 10
Examples 2 last_creatinine : = patient(). find(with. Concept("Lab Result*"). with. Concept(“serum creatinine*”). ascending(). with. Restriction(last)). real. Value(); last_creatinine : = read last value of reverse sort(TIME, “Lab Results”. ”serum creatinine”); Right_Arm_SBP : = patient(). find(with. Concept(“Patient. Measurements”). with. Concept(“Body Location”). with. Code(“Right Arm”). with. Concept(“pat. Position”). with. Code(“Sitting”). with. Concept(“Systolic BP”). with. Date(back( 2, WEEKS), Now )). real. Value(); Right_Arm_SBP : = read value of Patient. Measurements. systolic. BP where Patient. Measurements. Body_Location = “Right Arm” and Patient. Measurements. pat. Position = “Sitting” and Patient. Measurements. eventtime is within the past 2 weeks; 6/16/2021 © 2002, Intermountain Health Care 11
- Slides: 11