我无法让我的 Flex 程序将结果输出到控制台,它只返回“no”

问题描述

我正在 flex(一种医院预约系统)中做一个小培训项目。我似乎无法将准入类型输出到控制台; (住院病人、门诊病人、日间病人、候补名单),根据规则。它只返回“否”,它应该返回“住院病人”、“日间病人”、“门诊病人”或“候补名单”,其他人能看到我遗漏了什么吗?它把我逼上墙...

question subject
'what is subject name?' ;
input name.

question patient_risk
'what is the patient risk?' ;
choose one of high,medium,low.

question condition_time
'how long have they had the condition for?' ;
choose one of months,weeks,days.

question clinical_trial
'is the trial justifiable?' ;
choose one of yes,no.

question antibody_count
'what is their antibody count?' ;
choose one of high,low.

question life_style 
'How do they live?' ;
choose one of sedentary,active.

question anaemia_state
'do they have anemia?' ;
choose one of yes,no.

question blood_pressure
'is their blood pressure raised?' ;
choose one of yes,no.
%ACTION---------------------------

action create ; %This action is to create 
do ask subject
and ask patient_risk
and ask condition_time
and ask clinical_trial
and ask antibody_count
and ask life_style
and ask anaemia_state
and ask blood_pressure
and check that Patient1 is subject
and subject is a new patient whose patient_risk is patient_risk
and whose condition is patient_condition
and whose lifestyle is life_style
and whose anaemia is anaemia_state
and invoke ruleset testing
and restart. %resets collected data

%ACTION---------------------------

%consider rulesets instead for admission types.

rule clinical_trial_not_ok
if patient_risk is high
then clinical_trial becomes no
and admission becomes daypatient
and write ( 'the recommended admission is ' )
and write ( admission ).

rule condition_months
if patient_risk is included in ( low,medium )
and condition_time is months
then antibody_count becomes high
and admission becomes daypatient
and write ( 'the recommended admission is ' )
and write ( admission ).

rule condition_days
if condition_time is days
then antibody_count becomes low
and admission becomes outpatient
and write ( 'the recommended admission is ' )
and write ( admission ).

rule active_not_anaemic
if patient_risk is included in ( low,medium )
and condition_time is weeks
and life_style is active
and anaemia_state is no
then admission becomes outpatient
and write ( 'the recommended admission is ' )
and write ( admission ).

rule sedentary_highblood_anaemic
if patient_risk is included in ( low,medium )
and life_style is sedentary
and anaemia_state is yes
and blood_pressure is yes
then admission becomes inpatient
and write ( 'the recommended admission is ' )
and write ( admission ).

rule active_and_anaemic
if patient_risk is included in ( low,medium )
and condition_time is weeks
and life_style is active
and anaemia_state is yes
then admission becomes waitlist
and write ( 'the recommended admission is ' )
and write ( admission ).

rule sedentary_fineblood_anaemic
if patient_risk is included in ( low,medium )
and life_style is sedentary
and anaemia_state is yes
and blood_pressure is no
then admission becomes waitlist
and write ( 'the recommended admission is ' )
and write ( admission ).

rule sedentary_not_anaemic
if patient_risk is included in ( low,medium )
and life_style is sedentary
and anaemia_state is no
then admission becomes waitlist
and write ( 'the recommended admission is ' )
and write ( admission ).

ruleset testing
contains all rules ;
select rule by first come first served.

frame patient ; %frame for base values of patients.
and default patient_risk is none %sets the risk to 'none'
and default condition_time is none
and default clinical_trial is none
and default antibody_count is none
and default life_style is none
and default anaemia_state is none

它应该通过提出问题并从问题中收集数据以满足规则来工作;当它们符合准入类型的条件时,在控制台上显示该准入。

  1. 如果抗体计数中等, 和久坐不动的生活方式, 并且临床试验是合理的, 并且存在贫血, 并且血压升高, 那么推荐的入院是住院。

  2. 如果抗体计数低, 或(没有贫血, 并且生活方式活跃), 那么推荐的入院是门诊。

  3. 如果抗体计数很高, 或临床试验不合理, 那么推荐的入院是日间病人。

如果推荐入院不是住院, 并且推荐的入院不是门诊, 并且推荐的入院不是日间病人, 那么推荐的入场是等待名单。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...