Purpose: This page decoding dates (periods) in Medication request.
DM:
[medication_requests] id | uuid | not null ... created_at | date | not null started_at | date| not null ended_at | date| not null dispense_valid_from | date| not null dispense_valid_to | date| not null ... inserted_at | timestamp | not null updated_at | timestamp | not null
Decoding:
- created_at : Date which medication request created.
- Now always created_at = current_date().
- started_at - ended_at: Period which describe life-time medication request. Is near in meaning with the period of prescribing by the doctor (treatment period).
- Now started_at = created_at.
- dispense_valid_from - dispense_valid_to : Period which describe life-time for medication dispense.
- Now dispense_valid_from = started_at , dispense_valid_to = ended_at
- inserted_at, updated_at : Internal(system) non-management attributes by API
Validating:
- Must be: ended_at >= started_at >= created_at
- Not validate (both separately and the program `DOSTYPNI LIKI`) what `Days(ended_at,started_at) in (30, 90)`. Not validate always (creating medication request, qualifying, dispensing).