View source with raw comments or as raw
    1:- module(pas_rules,
    2          [ chose/1,
    3            discarded/1
    4          ]).    5:- use_module(library(scasp)).    6:- use_module('PAS_guide').    7:- use_module('PAS_patient').    8
    9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   10%%                                        %%
   11%%     The Physician advisory system      %%
   12%%                                        %%
   13%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   14
   15:- pred chose('T') :: '@(T:treatment) has been chosen'.   16:- pred recommendation('T') :: 'it is a recommendation to use @(T)'.   17:- pred discarded('T') :: '@(T) is discarded'.   18:- pred available('T') :: 'available holds for @(T)'.   19:- pred exclude('T') :: '@(T:treatment) is excluded'.   20
   21:- show chose/1, recommendation/1, discarded/1.   22:- show not contraindication/1.   23:- show not evidence/1, not history/1, not diagnosis/1.   24:- show not exclude/1, not discarded/1.   25
   26%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   27%% The doctor need to select certain treatments
   28%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   29
   30chose(X) :- recommendation(X),  not exclude(X), not discarded(X).
   31
   32discarded(X) :- not available(X).
   33available(X) :- not discarded(X).
   34
   35%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   36%% There are some rules to chose/recommentd treatments
   37%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   44recommendation(T) :-
   45    reason(T),
   46    not contraindication(T).
   52recommendation(T) :-
   53    reason(T),
   54    -contraindication(T).
   65recommendation(T2) :-
   66    second_line(T1,T2),
   67    reason(T1),
   68    contraindication(T1),
   69    not contraindication(T2).
   75exclude(T0) :-
   76    concomitant(T0,T),
   77    recommendation(T),
   78    not chose(T).
   84exclude(T0) :-
   85    indispensable(T0,T),
   86    not chose(T).
   91exclude(T2) :-
   92    incompatibility(T1,T2),
   93    not discarded(T1).
   94exclude(T1) :-
   95    incompatibility(T1,T2),
   96    not discarded(T2)