# Upgrade Baltique OS Core 0.78.5

## Przed wdrożeniem

1. Zrób backup plików aplikacji.
2. Zrób pełny dump bazy MySQL.
3. Wypakuj paczkę ZIP do katalogu głównego Baltique OS.
4. Nadpisz pliki z paczki.
5. Zaloguj się jako administrator.

## Uruchomienie upgrade'u

Uruchom:

```text
/upgrade_0_78_5.php
```

Nie trzeba osobno uruchamiać wcześniejszych upgrade'ów `0.78.2`, `0.78.3` ani `0.78.4`. Upgrade 0.78.5 wykonuje wymagane odświeżenia kompatybilności.

## Co robi upgrade

- odświeża Runtime Preflight z gałęzi 0.78.x,
- odświeża Enterprise Shell i Module Registry,
- uruchamia Version Guard bez cofania wersji,
- weryfikuje schemat Enterprise Case Spine,
- tworzy tabele Journey Orchestrator,
- seeduje blueprint `operative_patient_journey`,
- rejestruje moduł `enterprisejourneyorchestrator`,
- seeduje scenariusz acceptance test,
- ewaluje istniejące sprawy z `enterprise_case_spine`,
- zapisuje migrację `090_core_0_78_5_enterprise_journey_orchestrator`,
- ustawia wersję systemu na `0.78.5`,
- uruchamia post-upgrade Runtime Preflight, jeżeli dostępny jest preflight engine.

## Po upgrade

Otwórz kolejno:

```text
/system_journey_orchestrator.php
/system_runtime_preflight.php
/system_enterprise_shell.php
/system_case_spine.php
```

Oczekiwane checki Runtime Preflight:

```text
core_version_0785 — OK
migration_090_applied — OK
enterprise_journey_orchestrator_schema — OK
enterprise_journey_orchestrator_module — OK
enterprise_journey_orchestrator_coverage — OK albo NOT_APPLICABLE przy pustej bazie spraw
```

## Pusta baza pacjentów

Jeżeli w systemie nie ma jeszcze realnych pacjentów i spraw, brak rekordów w `enterprise_case_journey_state` jest prawidłowy. Po dodaniu pierwszej sprawy do Case Spine kliknij w panelu Journey Orchestrator:

```text
Ewaluuj sprawy
```
