Date: Fri, 29 Mar 2024 07:24:12 +1000 (AEST) Message-ID: <368810078.1140.1711661052732@dsp-kbconf-01.ad.medicalobjects.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1139_2086467441.1711661052709" ------=_Part_1139_2086467441.1711661052709 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
We will move on to write two new GELLO modules. In the first we will do = a simple result that returns a text message for flagging an asthmatic patie= nt receiving too many "reliever" metered aerosol puffers in a space of time= and suggesting additional 'preventer' therapy. The second will make = use of the Past history class in the VMR in the diagnosis of a unilateral r= ed eye.
The time has come to use a larger data file. Save the following as t= hirdTest.xml . Note we are adding flesh to the bones of this patient's= EHR/VMR and now we have two illnesses and some medications. [The VMR allow= s both a problem list and a past history list. We will stick with Past Hist= ory for now but we could equally be populating the problem list if we prefe= rred.]
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<singlePatient xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"
= xsi:noNamespaceSchemaLocation=3D"./iso-21090-datatypes.x= sd">
<patient>
<patientID
root= =3D"1.2.36.174030967"
exten= sion=3D"1234567892"
relia= bility=3D"VRF"
scope= =3D"OBJ"/>
<patientName>
<p= art type=3D"GIV" value=3D"Alice" />
<p= art type=3D"GIV" value=3D"A." />
<p= art type=3D"FAM" value=3D"Someone" />
</patientName>
<dob value=3D"19550621"/&g= t;
<gender code=3D"248152002"=
codeS= ystem=3D"2.16.840.1.113883.6.96"
codeS= ystemName=3D"SNOMED-CT">
<d= isplayName value =3D "Female" />
</gender>
<ssn value=3D"987-65-4320"= />
<address use=3D"WP">
<p= art type=3D"AL" value=3D"1050 W Wishard Blvd" />
<p= art type=3D"CTY" value=3D"Indianapolis" />
<p= art type=3D"STA" value=3D"IN" />
<p= art type=3D"ZIP" value=3D"46240" />
</address>
</patient>
= <allergies>
= &nb= sp; <allergenType code=3D"373873005"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "pharm= aceutical / biologic product" />
= &nb= sp; </allergenType>
= &nb= sp; <allergenCode code=3D"111088007"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "latex= (product)" />
= &nb= sp; </allergenCode>
= &nb= sp; <allergySeverity code=3D"24484000"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "sever= e" />
= &nb= sp; </allergySeverity>
= &nb= sp; <allergyReaction code=3D"39579001"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "anaph= ylaxis" />
= &nb= sp; </allergyReaction>
= &nb= sp; <identificationDate value=3D"1980"/>
= </allergies>
= <allergies>
= &nb= sp; <allergenType code=3D"373873005"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "pharm= aceutical / biologic product" />
= &nb= sp; </allergenType>
= &nb= sp; <allergenCode code=3D"27658006"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "Amoxi= cillin" />
= &nb= sp; </allergenCode>
= &nb= sp; <allergySeverity code=3D"24484000"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "sever= e" />
= &nb= sp; </allergySeverity>
= &nb= sp; <allergyReaction code=3D"39579001"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "anaph= ylaxis" />
= &nb= sp; </allergyReaction>
= &nb= sp; <identificationDate value=3D"1980"/>
= </allergies>
= <historyOfPastIllness>
= &nb= sp; <pastIllness code=3D"302914006"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "Barre= tt's esophagus" />
= &nb= sp; </pastIllness>
= &nb= sp; <temporalContext code=3D"410587003"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "Past = - specified" />
= &nb= sp; </temporalContext>
= &nb= sp; <illnessDates>
= &nb= sp; = <!--IVL_TS -->
= &nb= sp; = <low value=3D"2000" />
= &nb= sp; </illnessDates>
= &nb= sp; <notesOnIllness></notesOnIllness>= p>
= </historyOfPastIllness>
= <historyOfPastIllness>
= &nb= sp; <pastIllness code=3D"195967001"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "Asthm= a" />
= &nb= sp; </pastIllness>
= &nb= sp; <temporalContext code=3D"410587003"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "Past = - specified" />
= &nb= sp; </temporalContext>
= &nb= sp; <illnessDates>
= &nb= sp; = <!--IVL_TS -->
= &nb= sp; = <low value=3D"2005" />
= &nb= sp; </illnessDates>
= &nb= sp; <notesOnIllness></notesOnIllness>= p>
= </historyOfPastIllness>
= <medications>
= &nb= sp; <currentMedications>
= &nb= sp; = <!--1-->
= &nb= sp; = <medicationCode code=3D"31733= 4001"
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "Esomeprazole 40mg tablet" />
= &nb= sp; = &nb= sp; <translation c= ode=3D"606731"
= &nb= sp; = &nb= sp; = co= deSystem=3D"2.16.840.1.113883.6.88"
= &nb= sp; = &nb= sp; = co= deSystemName=3D"RxNorm">
= &nb= sp; = &nb= sp; = &l= t;displayName value =3D "Esomeprazole 40 MG Delayed Release Oral Capsule [N= exium]" />
= &nb= sp; = &nb= sp; </translation&= gt;
= &nb= sp; = </medicationCode>
= &nb= sp; = <dosingSig code=3D"229797004"=
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "Once daily" />
= &nb= sp; = </dosingSig>
= &nb= sp; = <requestedGiveRate></re= questedGiveRate><!--PQ eg 100mls an hour-->
= &nb= sp; = <medicationStartDate value=3D= "20160128" />
= &nb= sp; = <medicationStopdate> </= medicationStopdate>
= &nb= sp; = <totalDailyDose> </tota= lDailyDose>
= &nb= sp; = <reasonForCessation> </= reasonForCessation>
= &nb= sp; = <indication code=3D"302914006= "
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "Barrett's esophagus" />
= &nb= sp; = </indication>
= &nb= sp; = <replacedBy> </replaced= By>
= &nb= sp; </currentMedications>
= &nb= sp; <!--2-->
= &nb= sp; <currentMedications>
= &nb= sp; = <medicationCode code=3D"37692= 8006"
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "Albuterol 90mcg/inh aerosol" />
= &nb= sp; = &nb= sp; = &l= t;translation code=3D"801905"
= &nb= sp; = &nb= sp; = co= deSystem=3D"2.16.840.1.113883.6.88"
= &nb= sp; = &nb= sp; = co= deSystemName=3D"RxNorm">
= &nb= sp; = &nb= sp; = &l= t;displayName value =3D "60 ACTUAT Albuterol 0.09 MG/ACTUAT Metered Dose In= haler [Ventolin]" />
= &n= bsp;  = ; &n= bsp; </translation>= p>
= &nb= sp; = </medicationCode>
= &nb= sp; = <dosingSig code=3D"25761000"<= /p>
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "As required" />
= &nb= sp; = </dosingSig>
= &nb= sp; = <medicationStartDate value=3D= "20160426" />
= &nb= sp; </currentMedications>
= &nb= sp; <!--3-->
= &nb= sp; <currentMedications>
= &nb= sp; = <medicationCode code=3D"37692= 8006"
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "Albuterol 90mcg/inh aerosol" />
= &nb= sp; = &nb= sp; <translation c= ode=3D"801905"
= &nb= sp; = &nb= sp; = co= deSystem=3D"2.16.840.1.113883.6.88"
= &nb= sp; = &nb= sp; = co= deSystemName=3D"RxNorm">
= &nb= sp; = &nb= sp; = &l= t;displayName value =3D "60 ACTUAT Albuterol 0.09 MG/ACTUAT Metered Dose In= haler [Ventolin]" />
= &nb= sp; = &nb= sp; </translation&= gt;
= &nb= sp; = </medicationCode>
= &nb= sp; = <dosingSig code=3D"25761000"<= /p>
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "As required" />
= &nb= sp; = </dosingSig>
= &nb= sp; = <medicationStartDate value=3D= "20160502" />
= &nb= sp; </currentMedications>
= &nb= sp; <!--4-->
= &nb= sp; <currentMedications>
= &nb= sp; = <medicationCode code=3D"37692= 8006"
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "Albuterol 90mcg/inh aerosol" />
= &nb= sp; = &nb= sp; <translation c= ode=3D"801905"
= &nb= sp; = &nb= sp; = co= deSystem=3D"2.16.840.1.113883.6.88"
= &nb= sp; = &nb= sp; = co= deSystemName=3D"RxNorm">
= &nb= sp; = &nb= sp; = &l= t;displayName value =3D "60 ACTUAT Albuterol 0.09 MG/ACTUAT Metered Dose In= haler [Ventolin]" />
= &nb= sp; = &nb= sp; </translation&= gt;
= &nb= sp; = </medicationCode>
= &nb= sp; = <dosingSig code=3D"25761000"<= /p>
= &nb= sp; = &nb= sp; codeSystem=3D"2.1= 6.840.1.113883.6.96"
= &nb= sp; = &nb= sp; codeSystemName=3D= "SNOMED-CT">
= &nb= sp; = &nb= sp; <displayName v= alue =3D "As required" />
= &nb= sp; = </dosingSig>
= &nb= sp; = <medicationStartDate value=3D= "20160516" />
= &nb= sp; </currentMedications>
= </medications>
</singlePatient>
Load this data into the editor as outlined in previous tutorials. Notice= the new data we have added.
Start as usual:
Context HL7_v2_VMR_V1::SinglePatient
Does the patient have asthma?:
Let Asthma:CD =3D factory.CD_SNOMED('195967001', 'Asthma')= pre>Let hasAsthma: Boolean =3D historyOfPastIllness -> exists= (pastIllness.implies(Asthma).value)[Note these two lines are subtly different to previous examples but work= just as well - there is more than one way to do things - can you spot the = differences?]
Look for albuterol ('reliever' puffer) scripts:
Let albuterol90_SCT:CD =3D factory.CD_SNOMED_CT('376928006')=Let allAbuterolScripts =3D medications.currentMedications-&g= t;select(medicationCode.implies(albuterol90_SCT).value)Get the medication start dates for these scripts:
Let allAlbuterolMAScriptdates: Sequence(TS) =3D allAbuterolS= cripts->select(medicationCode.implies(albute= rol90_SCT).value).medicationStartDateGet last two dates:
Let mostRecentAlbuterolDate: TS =3D allAlbuterolMAScriptdate= s->last()Let penultimateAlbuterolDate: TS =3D If mostRecentAlbu= terolDate.oclIsDefined() then= allAlbuterolMAScriptdates.excluding(mostRecentAlbuterolDate)->last= ()else nullendifGet the time between them:
Let timeGap:PQ =3D mostRecentAlbuterolDate - penultima= teAlbuterolDateLet timeGapInDays: PQ =3D timeGap.convert('d')Run the final expression that returns the message if any:
If timeGapInDays.oclIsDefined() thenIf timeGapInDays < factory.PQ(21,'d') = then 'Patient may be relying excessively on a reliever puffer, suggest cons= ider addition of a preventer medication'else ''endifelse ''endif
= The red eye
Now let=E2=80=99s consider an example whereby something in the patient= =E2=80=99s past history can assist in the diagnosis of a new problem. A com= mon problem for clinicians is that of the unilateral (one sided) red eye. A= s ever in medicine, often it is a simple issue such as irritation or the ea= rly phases of a virus infection such as adenovirus; but occasionally it=E2= =80=99s a serious disorder such as acute iritis, which can cause visi= on loss if not picked up. Let=E2=80=99s add some data to thirdTest.xml<= /em> and then do the worked example.
Add the following in between </patient> and
<allergies>, should be about line 28 (line 56 if your fil= e has become double spaced), save:
= <historyOfPresentingComplaint>
= &nb= sp; <chiefComplaint code=3D"75705005"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "red e= ye" />
= &nb= sp; </chiefComplaint>
= &nb= sp; <dateOfOnset value =3D"20160601" /> =
= &nb= sp; <notes value =3D " Presents with very painfu= l unilateral red eye and decreased vision. " ></notes>
= </historyOfPresentingComplaint>
And add this section to a space made just above <medications&= gt; and save:
= </historyOfPastIllness>
= &nb= sp; <historyOfPastIllness>
= &nb= sp; <pastIllness code=3D"64766004"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "ulcer= ative colitis" />
= &nb= sp; </pastIllness>
= &nb= sp; <temporalContext code=3D"410587003"
= &nb= sp; = codeSystem=3D"2.16.840.1.113883.= 6.96"
= &nb= sp; = codeSystemName=3D"SNOMED-CT">=
= &nb= sp; = <displayName value =3D "Past = - specified" />
= &nb= sp; </temporalContext>
= &nb= sp; <illnessDates>
= &nb= sp; = <!--IVL_TS -->
= &nb= sp; = <low value=3D"2008" />
= &nb= sp; </illnessDates>
= &nb= sp; <notesOnIllness></notesOnIllness>= p>
= </historyOfPastIllness>
Iritis is sometimes associated with other diseases including but not lim= ited to lupus, psoriatic arthritis, ankylosing spondylitis, sarcoidosis, in= flammatory bowel disease, rheumatoid arthritis, toxoplasmosis, histoplasmos= is, tuberculosis, syphilis and the presence of the HLAB27 antigen. So let= =E2=80=99s write some code that looks for these and in the presence of a re= d eye flags a warning. The result of this GELLO code will be a Tuple that i= ncludes a weighting on the importance of the warning message.
Here=E2=80=99s the code:
Context HL7_v2_VMR_V1::SinglePatientLet hasPastIllnessOfAssociatedIllnessOfIritis: Boolean =3D= pre>historyOfPastIllness->exists(pastIllness.implies(= factory.CD_SNOMED('200936003', 'lupus')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('156370= 009', 'psoriatic arthritis')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('901400= 2', 'psoriasis')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('963100= 8', 'ankylosing spondylitis')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('315410= 09', 'sarcoidosis')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('647660= 04', 'ulcerative colitis')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('340000= 06', 'crohns disease')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('698960= 04', 'rheumatoid arthritis')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('712680= 005', 'Human leukocyte antigen B27 test positive')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('187192= 000', 'toxoplasmosis')).value or&nb= sp; = pastIllness.implies(factory.CD_SNOMED('129620= 09', 'histoplasmosis')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('567170= 01', 'tuberculosis')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('762720= 04', 'syphilus')).value or&nbs= p; &= nbsp; pastIllness.implies(factory.CD_SNOMED('474000= 0', 'shingles')).value) &nbs= p; &= nbsp;Let presentingComplaintIsRedEyeOrSimilar : Boolean =3DhistoryOfPresentingComplaint.chiefCompla= int.implies(factory.CD_SNOMED('75705005', 'red eye')).value-- there are a few more choices in snomed ct, so keep going<= /pre>or historyOfPresentingComplaint.chiefC= omplaint.implies(factory.CD_SNOMED('703630003', 'red eye')).valueor historyOfPresentingComplaint.chiefC= omplaint.implies(factory.CD_SNOMED('78370002', 'scleritis')).valueor historyOfPresentingComplaint.chiefC= omplaint.implies(factory.CD_SNOMED('128473001', 'uveitis')).valueLet text: String =3D If presentingComplaintIsRedEyeOrSimilar= and hasPastIllnessOfAssociatedIllnessOfIritisthen 'past Illnes= s history and presenting complaint suggests acute iritis. Consider urgent o= phthalmological review.'else ''endifLet result =3D Tuple {warningImportance =3D 'high',&nbs= p; warningUrgency =3D 'urgent',&nbs= p; splashText =3D text<= /pre>}result
Now remember this example is simply that - an example, it would need mor= e refinement and many committee meetings with clinicians to get it right - = for example the shingles would need to be current or recent- and we could g= et at that by the illness dates. We won't touch the topic of laterality of = the concept in this tutorial either!
But the point of this second example is to illustrate the potential powe= r of a suite of hundreds of installed GELLO expressions, quietly running in= the background and then triggering a warning or a message when conditions = are ripe.
That's the end of this tutorial.