Penjadwalan Perawat dengan Kompensasi Lembur

Contoh ini dibuat berdasarkan contoh penjadwalan perawat untuk memodelkan kompensasi reguler dan lembur, sesuai dengan persyaratan anggaran. Selain kendala penjadwalan untuk perawat, ada anggaran $10.000 untuk periode perencanaan 4 hari. Semua perawat dibayar dengan tarif dasar per jam sebesar $50/jam dan ada diferensial shift per jam sebesar $10/jam untuk shift yang dimulai pada 19 jam. Setiap jam yang bekerja setelah 40 jam dibayar 1,5x lipat dari tarif per jam dasar rata-rata (yaitu, ($50+$60)/2=$55).

Kompensasi reguler dan lembur

Tarif per jam dasar, diferensial shift, dan pengali lembur direpresentasikan dengan kolom hourlyContract di karyawan. Dalam kontrak per jam, baseHourlyRate dan hourlyRateShiftDifferentials memodelkan kompensasi untuk pekerjaan reguler (non-lembur). Nilai ini juga digunakan untuk memperkirakan tarif dasar per jam rata-rata untuk kompensasi lembur saat overtimePeriods diberikan. Biasanya periode lembur adalah cocok dengan seminggu, dan beberapa periode lembur dapat diberikan selama tidak tumpang-tindih. Kontrak per jam untuk perawat pertama (Adam), direpresentasikan sebagai:

  {
    "employees": [{
      "id": "Adam",
      "roleIds": ["Registered Nurse"],
      ...
        scheduling constraints
      ...
      "hourlyContract": {
        "baseHourlyRate": 50,
        "hourlyRateShiftDifferentials": {
          "2023-05-01 19hr": 10,
          "2023-05-02 19hr": 10,
          "2023-05-03 19hr": 10,
          "2023-05-04 19hr": 10
        },
        "overtimePeriods": [
          {
            "overtimeMultiplier": 1.5,
            "startDateTime": {
              "year": 2023,
              "month": 5,
              "day": 1
            },
            "endDateTime": {
              "year": 2023,
              "month": 5,
              "day": 5
            },
            "maximumRegularHours": 40
          }
        ]
      }
    }
  }

Contoh dengan keempat karyawan dan kontrak per jam mereka


  {
      "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
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "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
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "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
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "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
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        }
    ]
  }
  

Persyaratan anggaran

Total anggaran sebesar $10.000 diwakili dengan persyaratan anggaran. Waktu mulai dan waktu berakhir bersifat opsional, dan jika diberikan, hanya periode waktu lembur dan lembur dalam jangka waktu ini yang akan dipertimbangkan untuk batasan anggaran ini. Representasi yang sesuai untuk perawat pertama (Adam) dapat diperbarui menjadi:

  {
    "totalBudget": 10000,
    "priority": "PRIORITY_HIGH"
  }

Contoh permintaan lengkap


    {
      "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
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "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
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "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
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        },
        {
          "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
            }
          ],
          "hourlyContract": {
            "baseHourlyRate": 50,
            "hourlyRateShiftDifferentials": {
              "2023-05-01 19h": 10,
              "2023-05-02 19h": 10,
              "2023-05-03 19h": 10,
              "2023-05-04 19h": 10
            },
            "overtimePeriods": [
              {
                "overtimeMultiplier": 1.5,
                "startDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 1
                },
                "endDateTime": {
                  "year": 2023,
                  "month": 5,
                  "day": 5
                },
                "maximumRegularHours": 40
              }
            ]
          }
        }
      ],
      "shifts": [
        {
          "id": "2023-05-01 7h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 19
          }
        },
        {
          "id": "2023-05-01 13h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 13
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 1
          }
        },
        {
          "id": "2023-05-01 19h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 1,
            "hours": 19
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 7
          }
        },
        {
          "id": "2023-05-02 7h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 19
          }
        },
        {
          "id": "2023-05-02 13h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 13
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 1
          }
        },
        {
          "id": "2023-05-02 19h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 2,
            "hours": 19
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 7
          }
        },
        {
          "id": "2023-05-03 7h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 19
          }
        },
        {
          "id": "2023-05-03 13h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 13
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 1
          }
        },
        {
          "id": "2023-05-03 19h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 3,
            "hours": 19
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 7
          }
        },
        {
          "id": "2023-05-04 7h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 7
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 19
          }
        },
        {
          "id": "2023-05-04 13h",
          "locationId": "department",
          "startDateTime": {
            "year": 2023,
            "month": 5,
            "day": 4,
            "hours": 13
          },
          "endDateTime": {
            "year": 2023,
            "month": 5,
            "day": 5,
            "hours": 1
          }
        },
        {
          "id": "2023-05-04 19h",
          "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"
      ],
      "budgetRequirements": [
        {
          "totalBudget": 10000,
          "priority": "PRIORITY_HIGH"
        }
      ]
    }
    

Contoh respons

Respons pemecah masalah berisi penugasan perawat untuk melakukan shift dan status prosedur pengoptimalan. Misalnya, shift yang ditetapkan ke karyawan pertama ditampilkan sebagai:

  {
    "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"
      },
      ... ]
  }

Contoh respons lengkap


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