Krankenpflegeplanung

Stellen Sie sich vor, dass Sie in einer bestimmten Abteilung in einem Krankenhaus eine Krankenschwesterplanung haben. Jeden Tag gibt es drei 12-Stunden-Schichten, die um 7 Uhr, 13 Uhr und 19 Uhr beginnen. Der geplante Horizont beträgt vier Tage, ab dem 01.05.2023, also insgesamt 12 Schichten. Es gibt vier registrierte Pflegekräfte, die diesen Schichten zugewiesen werden können, mit dem Ziel, zu jeder Zeit zwei Pflegekräfte in der Abteilung zu haben. Die Deckungsanforderung ist obligatorisch.

Alle Pflegekräfte müssen sich zwischen den Schichten mindestens 12 Stunden (720 Minuten) und höchstens 36 Stunden (2.160 Minuten) im festgelegten Planungshorizont befinden. Diese Einschränkungen haben eine hohe bzw. mittlere Priorität.

Mehrere Schichten pro Tag

Drei Schichten pro Tag werden als drei unabhängige Schichten dargestellt. Verschiebungen am ersten Tag (von vier Tagen) am Standort „Abteilung“ werden beispielsweise so dargestellt:

  {
    "shifts": [{
      "id": "2023-05-01 7hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 7
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 19
      }
    }, {
      "id": "2023-05-01 13hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 13
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 2,
        "hours": 1
      }
    }, {
      "id": "2023-05-01 19hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 19
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 2,
        "hours": 7
      }
    },
    ...
    ]
  }

Beispiel mit 12 Schichten (vier Tage mit drei Schichten pro Tag)


    {
      "shifts": [{
      "id": "2023-05-01 7hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 7
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 19
      }
    }, {
      "id": "2023-05-01 13hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 13
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 2,
        "hours": 1
      }
    }, {
      "id": "2023-05-01 19hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 19
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 2,
        "hours": 7
      }
    }, {
      "id": "2023-05-02 7hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 2,
        "hours": 7
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 2,
        "hours": 19
      }
    }, {
      "id": "2023-05-02 13hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 2,
        "hours": 13
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 3,
        "hours": 1
      }
    }, {
      "id": "2023-05-02 19hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 2,
        "hours": 19
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 3,
        "hours": 7
      }
    }, {
      "id": "2023-05-03 7hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 3,
        "hours": 7
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 3,
        "hours": 19
      }
    }, {
      "id": "2023-05-03 13hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 3,
        "hours": 13
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 4,
        "hours": 1
      }
    }, {
      "id": "2023-05-03 19hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 3,
        "hours": 19
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 4,
        "hours": 7
      }
    }, {
      "id": "2023-05-04 7hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 4,
        "hours": 7
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 4,
        "hours": 19
      }
    }, {
      "id": "2023-05-04 13hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 4,
        "hours": 13
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 5,
        "hours": 1
      }
    }, {
      "id": "2023-05-04 19hr",
      "locationId": "department",
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 4,
        "hours": 19
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 5,
        "hours": 7
      }
    }]
  }
  

Ruhezeit zwischen Schichten

Verwenden Sie das Feld minimumRestMinutes aus einer Planungseinschränkung, um den Rest zwischen Schichten für einen Mitarbeiter darzustellen. Mit den Start- und Endzeiten der Einschränkung wird bestimmt, welche Schichten zu berücksichtigen sind. Daher sollten sie mit einem Planungshorizont übereinstimmen, indem sie sich mit allen Schichten überschneiden. Die Ruhezeit wird in Minuten (720) angegeben und die Priorität ist PRIORITY_HIGH, wie oben angegeben. Die erste Krankenschwester (Adam) wird folgendermaßen dargestellt:

  {
    "employees": [{
      "id": "Adam",
      "roleIds": ["Registered Nurse"],
      "schedulingConstraints": [{
        "priority": "PRIORITY_HIGH",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 7
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 5,
          "hours": 7
        },
        "minimumRestMinutes": 720
      }]
    }
  }

Maximale Arbeitszeit

Die maximale Arbeitszeit eines Mitarbeiters wird mithilfe des Felds maximumMinutes auch mit einer Planungseinschränkung dargestellt. Die maximale Arbeitszeit in diesem Beispiel beträgt 2.160 Minuten. Die Start- und Endzeiten der Einschränkung sollten auf den gesamten Planungshorizont abgestimmt sein. Die entsprechende Darstellung für die erste Krankenschwester (Adam) kann so aktualisiert werden:

  {
    "employees": [{
      "id": "Adam",
      "roleIds": ["Registered Nurse"],
      "schedulingConstraints": [{
        "priority": "PRIORITY_HIGH",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 7
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 5,
          "hours": 7
        },
        "minimumRestMinutes": 720
      }, {
        "priority": "PRIORITY_MEDIUM",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 7
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 5,
          "hours": 7
        },
        "maximumMinutes": 2160
      }]
    }
  }

Beispiel mit allen vier Mitarbeitern


  {
      "employees": [{
        "id": "Adam",
        "roleIds": ["Registered Nurse"],
        "schedulingConstraints": [{
          "priority": "PRIORITY_HIGH",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "minimumRestMinutes": 720
        }, {
          "priority": "PRIORITY_MEDIUM",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "maximumMinutes": 2160
        }]
      }, {
        "id": "Grace",
        "roleIds": ["Registered Nurse"],
        "schedulingConstraints": [{
          "priority": "PRIORITY_HIGH",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "minimumRestMinutes": 720
        }, {
          "priority": "PRIORITY_MEDIUM",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "maximumMinutes": 2160
        }]
      }, {
        "id": "James",
        "roleIds": ["Registered Nurse"],
        "schedulingConstraints": [{
          "priority": "PRIORITY_HIGH",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "minimumRestMinutes": 720
        }, {
          "priority": "PRIORITY_MEDIUM",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "maximumMinutes": 2160
        }]
      }, {
        "id": "Alonso",
        "roleIds": ["Registered Nurse"],
        "schedulingConstraints": [{
          "priority": "PRIORITY_HIGH",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "minimumRestMinutes": 720
        }, {
          "priority": "PRIORITY_MEDIUM",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "maximumMinutes": 2160
        }]
      }]
  }
  

Abdeckung für registrierte Pflegekräfte

Die Abdeckung von zwei registrierten Pflegekräften im jeweiligen Moment unterliegt einer Pflicht. Insbesondere wurde roleRequirements mit einer Rolle erfüllt, für die roleId auf „Registrierte Krankenschwester“ festgelegt ist, targetEmployeeCount auf 2 und priority auf PRIORITY_MANDATORY gesetzt ist. Die Start- und Endzeiten der Abdeckungsanforderung sollten sich bei jeder Schicht überschneiden. Das Feld locationId ist auf „Abteilung“ gesetzt, sodass nur Schichten an diesem Ort berücksichtigt werden.

  {
    "coverageRequirements": [{
      "startDateTime": {
        "year": 2023,
        "month": 5,
        "day": 1,
        "hours": 7
      },
      "endDateTime": {
        "year": 2023,
        "month": 5,
        "day": 5,
        "hours": 7
      },
      "locationId": "department",
      "roleRequirements": [{
        "roleId": "Registered Nurse",
        "targetEmployeeCount": 2,
        "priority": "PRIORITY_MANDATORY"
      }]
    }],
    "roleIds": ["Registered Nurse"],
    "locationIds": ["department"]
  }

Beispiel für eine vollständige Anfrage


    {
      "employees": [{
        "id": "Adam",
        "roleIds": ["Registered Nurse"],
        "schedulingConstraints": [{
          "priority": "PRIORITY_HIGH",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "minimumRestMinutes": 720
        }, {
          "priority": "PRIORITY_MEDIUM",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "maximumMinutes": 2160
        }]
      }, {
        "id": "Grace",
        "roleIds": ["Registered Nurse"],
        "schedulingConstraints": [{
          "priority": "PRIORITY_HIGH",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "minimumRestMinutes": 720
        }, {
          "priority": "PRIORITY_MEDIUM",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "maximumMinutes": 2160
        }]
      }, {
        "id": "James",
        "roleIds": ["Registered Nurse"],
        "schedulingConstraints": [{
          "priority": "PRIORITY_HIGH",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "minimumRestMinutes": 720
        }, {
          "priority": "PRIORITY_MEDIUM",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "maximumMinutes": 2160
        }]
      }, {
        "id": "Alonso",
        "roleIds": ["Registered Nurse"],
        "schedulingConstraints": [{
          "priority": "PRIORITY_HIGH",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "minimumRestMinutes": 720
        }, {
          "priority": "PRIORITY_MEDIUM",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 7
          },
          "maximumMinutes": 2160
        }]
      }],
      "shifts": [{
        "id": "2023-05-01 7hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 7
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 19
        }
      }, {
        "id": "2023-05-01 13hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 13
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 2,
          "hours": 1
        }
      }, {
        "id": "2023-05-01 19hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 19
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 2,
          "hours": 7
        }
      }, {
        "id": "2023-05-02 7hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 2,
          "hours": 7
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 2,
          "hours": 19
        }
      }, {
        "id": "2023-05-02 13hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 2,
          "hours": 13
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 3,
          "hours": 1
        }
      }, {
        "id": "2023-05-02 19hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 2,
          "hours": 19
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 3,
          "hours": 7
        }
      }, {
        "id": "2023-05-03 7hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 3,
          "hours": 7
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 3,
          "hours": 19
        }
      }, {
        "id": "2023-05-03 13hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 3,
          "hours": 13
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 4,
          "hours": 1
        }
      }, {
        "id": "2023-05-03 19hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 3,
          "hours": 19
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 4,
          "hours": 7
        }
      }, {
        "id": "2023-05-04 7hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 4,
          "hours": 7
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 4,
          "hours": 19
        }
      }, {
        "id": "2023-05-04 13hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 4,
          "hours": 13
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 5,
          "hours": 1
        }
      }, {
        "id": "2023-05-04 19hr",
        "locationId": "department",
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 4,
          "hours": 19
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 5,
          "hours": 7
        }
      }],
      "coverageRequirements": [{
        "startDateTime": {
          "year": 2023,
          "month": 5,
          "day": 1,
          "hours": 7
        },
        "endDateTime": {
          "year": 2023,
          "month": 5,
          "day": 5,
          "hours": 7
        },
        "locationId": "department",
        "roleRequirements": [{
          "roleId": "Registered Nurse",
          "targetEmployeeCount": 2,
          "priority": "PRIORITY_MANDATORY"
        }]
      }],
      "roleIds": ["Registered Nurse"],
      "locationIds": ["department"]
    }
    

Beispiel für eine Antwort

Die Antwort des Rechners umfasst die Zuweisung von Pflegekräften zu Schichten und den Status des Optimierungsverfahrens. Die Schichten, die dem ersten Mitarbeiter zugewiesen sind, werden beispielsweise so zurückgegeben:

  {
    "solutionStatus": "OPTIMAL",
    "shiftAssignments": [
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-01 7hr",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-02 7hr",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-03 7hr",
        "roleId": "Registered Nurse"
      },
      {
        "employeeId": "Adam",
        "shiftId": "2023-05-04 7hr",
        "roleId": "Registered Nurse"
      },
      ... ]
  }

Beispiel für eine vollständige Antwort


    {
      "solutionStatus": "OPTIMAL",
      "shiftAssignments": [
        {
          "employeeId": "Adam",
          "shiftId": "2023-05-01 7hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Adam",
          "shiftId": "2023-05-02 7hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Adam",
          "shiftId": "2023-05-03 7hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Adam",
          "shiftId": "2023-05-04 7hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Grace",
          "shiftId": "2023-05-01 19hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Grace",
          "shiftId": "2023-05-02 19hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Grace",
          "shiftId": "2023-05-03 19hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Grace",
          "shiftId": "2023-05-04 19hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "James",
          "shiftId": "2023-05-01 19hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "James",
          "shiftId": "2023-05-02 19hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "James",
          "shiftId": "2023-05-03 19hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "James",
          "shiftId": "2023-05-04 19hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Alonso",
          "shiftId": "2023-05-01 7hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Alonso",
          "shiftId": "2023-05-02 7hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Alonso",
          "shiftId": "2023-05-03 7hr",
          "roleId": "Registered Nurse"
        },
        {
          "employeeId": "Alonso",
          "shiftId": "2023-05-04 7hr",
          "roleId": "Registered Nurse"
        }
      ]
    }