-
Notifications
You must be signed in to change notification settings - Fork 0
/
US006-CancelOrderCompletely.cs
51 lines (43 loc) · 2.33 KB
/
US006-CancelOrderCompletely.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/***********************************************************************************
* Project: Linked Care AP5
* Component: LINCA FHIR SDK and Demo Client
* Copyright: 2023 LOIDL Consulting & IT Services GmbH
* Authors: Annemarie Goldmann, Daniel Latikaynen
* Purpose: Sample code to test LINCA and template for client prototypes
* Licence: BSD 3-Clause
* ---------------------------------------------------------------------------------
* The Linked Care project is co-funded by the Austrian FFG
***********************************************************************************/
using Lc.Linca.Sdk.Client;
namespace Lc.Linca.Sdk.Specs.ActorCare;
internal class US006_CancelOrderCompletely : Spec
{
public const string UserStory = @"
User Walter Specht (DGKP) is a caregiver in the inpatient care facility Haus Vogelsang.
He has already placed a collective order for prescription medication for several clients on LINCA.
Now, he needs to cancel the complete order due to a major mistake.
He submits a delete request on the order number, providing a reason for cancellation, such as a human error.
Then,
either the whole order will be cancelled by the LINCA system, if for none of its positions the designated
practitioner has already issued a prescription and the status is set to 'revoked' by LINCA,
or the whole order will remain active if for any of its positions the designated practitioner
has already issued a prescription. And positions for which the designated practitioner has not yet issued a prescription,
will be promoted to the status 'cancelled' by the LINCA system";
public US006_CancelOrderCompletely(LincaConnection conn) : base(conn)
{
Steps = new Step[]
{
new("Cancel order(s) completely", DeleteRequestOrchestration)
};
}
private bool DeleteRequestOrchestration()
{
LinkedCareSampleClient.CareInformationSystemScaffold.PseudoDatabaseRetrieve();
(var oo, var deleted) = LincaDataExchange.DeleteRequestOrchestration(Connection, $"{LinkedCareSampleClient.CareInformationSystemScaffold.Data.LcIdVogelsang}");
foreach (var item in oo.Issue)
{
Console.WriteLine($"Details: {item.Details.Text}");
}
return deleted;
}
}