Skip to main content
. 2023 Feb 15;11(4):585. doi: 10.3390/healthcare11040585
Algorithm 1 The algorithm used in the engine for argument interpretation and linking.
Argumentation-Engine()
  • 1

    model = Model-Factory-Read()

  • 2

    Candidates = Selector(model, Property.decision)

  • 3

    Map < Candidate, Arguments > map

  • 4

    fori = 0 to Candidates. length by 1

  • 5

      Arguments = Selector(Candidates[i],consist-of ”)

  • 6

      for j = 0 to Arguments. length by 1

  • 7

        Statements = Selector(Arguments[j],include”)

  • 8

        A[Argument][weight] = Verify-Argument(Statements)

  • 9

      map. put(Candidate[i],

    Collect(A[Argument],Calculate(A[Arguments][weight])))

  • 10

       if (linking-request)

  • 11

       Link-Argument(map, linking-request. getMap())

  • 12

    return  map

Verify-Argument(Statements)
  • 1

    OrStatements = Split(Statements, “or”)

  • 2

    i = j = 0

  • 3

    fork =0 to OrStatements. length by 1

  • 4

      AndStatements = Split(OrStatement[k], “and”)

  • 5

      for m =0 to AndStatements. length by 1

  • 6

        if (Judge-Patient-Data(AndStatements[m]))

  • 7

          j = j + 1

  • 8

      if (j == m)

  • 9

         i = i + 1

  • 10

         statement = OrStatement[k]

  • 11

         Break

  • 12

    if (i > 0)

  • 13

       A[Argument][weight] =Add(statement,Selector(statement, “weight”))

  • 14

    returnA[Argument][weight]

Link-Argument(map, map’)
  • 1

    fori = 0 to map. size() by 1

  • 2

    for j = 0 to map’. size() by 1

  • 3

      if (map. get(Candidate[i]).equals(map’. get(Candidate[j])))

  • 4

       map. merge(Candidate[j], map’. get (A[Argument]),

    Calculate(map. get (A[Arguments][weight]), map’. get

    (A[Arguments][weight])))

  • 5

    return  map