Skip to content

Commit

Permalink
#-wip-samples fixes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
annemgold committed Nov 21, 2023
1 parent f76b1cc commit 3ca960a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Lc.Linca.Sdk.Sample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ internal class Program
/// <summary>
/// In SDK, this always points to the development system
/// </summary>
internal const string FhirServerBaseUrl = "https://fhir5-d.linkedcare.at";
//internal const string FhirServerBaseUrl = "https://localhost:8084";
//internal const string FhirServerBaseUrl = "https://fhir5-d.linkedcare.at";
internal const string FhirServerBaseUrl = "https://localhost:8084";

private const int ExitCodeCouldNotConnect = 0xaca1;
private const int ExitCodeIdle = 0x1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public US007_GetOrderStatus(LincaConnection conn) : base(conn)

private bool GetProposalStatus()
{
(Bundle results, bool received) = LincaDataExchange.GetProposalStatus(Connection, "b044fc91570a4ec999e23392f6e46675");
(Bundle results, bool received) = LincaDataExchange.GetProposalStatus(Connection, "10c2b65780e944f08bab0a79e791655c");

if (received)
{
Expand Down
24 changes: 24 additions & 0 deletions Lc.Linca.Sdk/Sdk/LincaDataExchange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public static (RequestOrchestration createdRO, bool canCue) CreateRequestOrchest
return (new(), false);
}

/// <summary>
/// Post a new Linked Care order position
/// </summary>
public static (MedicationRequest postedOMR, bool canCue) PostProposalMedicationRequest(LincaConnection connection, MedicationRequest omr)
{
(var postedOMR, var canCue) = FhirDataExchange<MedicationRequest>.CreateResource(connection, omr, LincaEndpoints.LINCAProposalMedicationRequest);
Expand All @@ -80,6 +83,9 @@ public static (MedicationRequest postedOMR, bool canCue) PostProposalMedicationR
return (new(), false);
}

/// <summary>
/// Create a new Linked Care prescription
/// </summary>
public static (MedicationRequest postedPMR, bool canCue) CreatePrescriptionMedicationRequest(LincaConnection connection, MedicationRequest pmr)
{
(var postedPMR, var canCue) = FhirDataExchange<MedicationRequest>.CreateResource(connection, pmr, LincaEndpoints.LINCAPrescriptionMedicationRequest);
Expand All @@ -92,6 +98,9 @@ public static (MedicationRequest postedPMR, bool canCue) CreatePrescriptionMedic
return (new(), false);
}

/// <summary>
/// Create a new Linked Care medication dispense
/// </summary>
public static (MedicationDispense postedMD, bool canCue) CreateMedicationDispense(LincaConnection connection, MedicationDispense md)
{
(var postedMD, var canCue) = FhirDataExchange<MedicationDispense>.CreateResource(connection, md, LincaEndpoints.LINCAMedicationDispense);
Expand All @@ -104,6 +113,9 @@ public static (MedicationDispense postedMD, bool canCue) CreateMedicationDispens
return (new(), false);
}

/// <summary>
/// Revoke a Linked Care request orchestration and cancel all contained order positions
/// </summary>
public static bool DeleteRequestOrchestration(LincaConnection connection, string id)
{
var deleted = FhirDataExchange<RequestOrchestration>.DeleteResource(connection, id, LincaEndpoints.LINCARequestOrchestration);
Expand All @@ -116,6 +128,9 @@ public static bool DeleteRequestOrchestration(LincaConnection connection, string
return false;
}

/// <summary>
/// Get a all order chain links for the given lc_id
/// </summary>
public static (Bundle results, bool canCue) GetProposalStatus(LincaConnection connection, string id)
{
string operationQuery = $"{LincaEndpoints.proposal_status}?lc_id={id}";
Expand All @@ -129,6 +144,9 @@ public static (Bundle results, bool canCue) GetProposalStatus(LincaConnection co
return (new(), false);
}

/// <summary>
/// Get a all order chain links (order positions, prescriptions, dispenses) for the given lc_id
/// </summary>
public static (Bundle results, bool canCue) GetProposalsToPrescribe(LincaConnection connection)
{
(Bundle proposalChains, bool canCue) = FhirDataExchange<Bundle>.GetResource(connection, LincaEndpoints.proposals_to_prescribe);
Expand All @@ -141,6 +159,9 @@ public static (Bundle results, bool canCue) GetProposalsToPrescribe(LincaConnect
return (new(), false);
}

/// <summary>
/// Get all prescriptions to dispense (the complete order chains)
/// </summary>
public static (Bundle results, bool canCue) GetPrescriptionsToDispense(LincaConnection connection)
{
(Bundle proposalChains, bool canCue) = FhirDataExchange<Bundle>.GetResource(connection, LincaEndpoints.prescriptions_to_dispense);
Expand All @@ -153,6 +174,9 @@ public static (Bundle results, bool canCue) GetPrescriptionsToDispense(LincaConn
return (new(), false);
}

/// <summary>
/// Get all Linked Care prescriptions which are connected to the given id
/// </summary>
public static (Bundle results, bool canCue) GetPrescriptionToDispense(LincaConnection connection, string id)
{
string operationQuery = $"{LincaEndpoints.prescription_to_dispense}?id={id}";
Expand Down
3 changes: 3 additions & 0 deletions Lc.Linca.Sdk/Sdk/ResourceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public static class LincaEndpoints
/// </summary>
public static string prescription_to_dispense = "$prescription-to-dispense";

/// <summary>
/// Get the profiled name of a standard Fhir resource
/// </summary>
public static string GetProfiledResourceName(this Resource resource)
{
if(resource is Patient)
Expand Down

0 comments on commit 3ca960a

Please sign in to comment.