HCLS/ClinicalObservationsInteroperability/ContradictionRule

From W3C Wiki

Detecting Contradiction in Eligibility Criteria Using Rules and Proofs

When expressing and encoding eligibility criteria for a clinical trial, contradiction and unsatisfiable conditions can be entered into the system. The following is a simple example

  • male patient underwent hysterectomy

A reasoning engine can detect such contradiction using the following rules

#contradiction 1: hysterectomy can not be performed on male
:Hysterectomy :hasRestriction  [  :hasGender :Male].

{ ?P :hasProcedure ?O.
     :hasGender  ?G;
  ?O :hasRestriction  ?A.
  ?A :hasGender   ?G.  
 } => 
{?P :contraIndication ?O}.

Given a set of triples (facts) about patient Peter, for example

#patient information
:peter :hasGender  :Male;
       :hasProcedure :Hysterectomy.

:jane  :hasGender  :Female;
       :hasProcedure :Hysterectomy.

Asking all facts that have "contradictions", we will get

:peter  :contraIndication  :Hysterectomy.

The proof of this conclusion is generated

[ a r:Proof, r:Conjunction;
 r:component [ a r:Inference; r:gives {<http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_peter> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_contraIndication> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Hysterectomy>}; r:evidence (
  [ a r:Inference; r:gives {<http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_peter> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_contraIndication> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Hysterectomy>}; r:evidence (
   [ a r:Extraction; r:gives {<http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_peter> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_hasProcedure> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Hysterectomy>}; r:because [ a r:Parsing; r:source <.\coi\CTRule.n3>]]
   [ a r:Extraction; r:gives {<http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_peter> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_hasGender> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Male>}; r:because [ a r:Parsing; r:source <.\coi\CTRule.n3>]]
   [ a r:Extraction; r:gives {@forSome var:e1. <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Hysterectomy> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_hasRestriction> var:e1}; r:because [ a r:Parsing; r:source <.\coi\CTRule.n3>]]
   [ a r:Extraction; r:gives {@forSome var:e1. var:e1 <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_hasGender> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Male>}; r:because [ a r:Parsing; r:source <.\coi\CTRule.n3>]]);
   r:binding [ r:variable [ n3:uri "http://localhost/var#x0"]; r:boundTo [ n3:uri "http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_peter"]];
   r:binding [ r:variable [ n3:uri "http://localhost/var#x1"]; r:boundTo [ n3:uri "http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Hysterectomy"]];
   r:binding [ r:variable [ n3:uri "http://localhost/var#x2"]; r:boundTo [ n3:uri "http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Male"]];
   r:binding [ r:variable [ n3:uri "http://localhost/var#x3"]; r:boundTo [ a r:Existential; n3:nodeId "http://localhost/var#e1"]];
   r:rule [ a r:Extraction; r:gives {@forAll var:x0, var:x1, var:x2, var:x3. {var:x0 <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_hasProcedure> var:x1. var:x0 <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_hasGender> var:x2. var:x1 <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_hasRestriction> var:x3. var:x3 <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_hasGender> var:x2} => {var:x0 <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_contraIndication> var:x1}}; r:because [ a r:Parsing; r:source <.ciCTRule.n3>]]]);
  r:binding [ r:variable [ n3:uri "http://localhost/var#x0"]; r:boundTo [ n3:uri "http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_peter"]];
  r:binding [ r:variable [ n3:uri "http://localhost/var#x1"]; r:boundTo [ n3:uri "http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Hysterectomy"]];
  r:rule [ a r:Extraction; r:gives {@forAll var:x0, var:x1. {var:x0 <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_contraIndication> var:x1} => {var:x0 <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_contraIndication> var:x1}}; r:because [ a r:Parsing; r:source <.ciCTRuleQ.n3>]]];
 
 r:gives {
  <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_peter> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_contraIndication> <http://www.w3.org/2008/04/DiabeticPatientsDataSet/ClinicalPracticeOntology-Version3.owl#_Hysterectomy>.
 }].
 

This proof can be translated to PML and then use PML-tools to visualize the proofs, see example

More Generic and Elegant Expression of Contradiction in Logic Model

The same contradiction example can be expressed explicitly as a false model

{ ?A ?B :Hysterectomy. ?A ?D :Male. } => false.

This is telling the reasoner that :Hysterectomy and :Male can not coexist (disjoint). In this case you do not need to declare :ContraIndication specifically which simplifies the rule writing (of course you do lose some information: you do not know the "why" carried e.g. by the concept :Contraindication). In this way, we can write a set of nicely formed and easy-to-read rules that can be applied to any numbers of eligibility criteria, across different trials.

The proof looks like this

[ e:falseModel true
; e:because [ e:integrityConstraint {{:peter :hasProcedure :Hysterectomy. :peter :hasGender :Male} => false}
  ; e:selected [ e:triple {:peter :hasProcedure :Hysterectomy}
    ; e:falseAncestors true
    ; e:falseDescendents true
    ; e:assertedAncestors [ e:triples true
      ; e:selected [ e:ancestor true
        ; e:inferredDescendents true
        ]
      ]
    ]
  ; e:selected [ e:triple {:peter :hasGender :Male}
    ; e:falseAncestors true
    ; e:falseDescendents true
    ; e:assertedAncestors [ e:triples true
      ; e:selected [ e:ancestor true
        ; e:inferredDescendents true
        ]
      ]
    ]
  ]