-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed subscription for substance administrations. Updated small bug o…
…n long view. Added code to SQLite report datasource to output SQL to be run
- Loading branch information
Justin Fyfe
committed
Feb 15, 2018
1 parent
7839fe5
commit 541007b
Showing
6 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
OpenIZ.Mobile.Core/Configuration/Data/Migrations/SubscribePrimaryLocationUpdate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using OpenIZ.Core.Model.Acts; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace OpenIZ.Mobile.Core.Configuration.Data.Migrations | ||
{ | ||
/// <summary> | ||
/// Subscribe to primary location update | ||
/// </summary> | ||
class SubscribePrimaryLocationUpdate : IDbMigration | ||
{ | ||
/// <summary> | ||
/// Description | ||
/// </summary> | ||
public string Description | ||
{ | ||
get | ||
{ | ||
return "Updates subscriptions to include all data the location authored"; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Gets id of the update | ||
/// </summary> | ||
public string Id | ||
{ | ||
get | ||
{ | ||
return "update-subscription-primary-location"; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Install the migration | ||
/// </summary> | ||
public bool Install() | ||
{ | ||
|
||
var syncSection = ApplicationContext.Current.Configuration.GetSection<SynchronizationConfigurationSection>(); | ||
|
||
// Un-subscribe to SubstanceAdministration | ||
syncSection.SynchronizationResources.RemoveAll(o => o.ResourceType == typeof(SubstanceAdministration)); | ||
|
||
// Re-add substance administrations | ||
syncSection.SynchronizationResources.Add(new SynchronizationResource() | ||
{ | ||
Always = false, | ||
Filters = syncSection.Facilities.SelectMany(o=> new String[] { | ||
$"participation[RecordTarget].player.relationship[DedicatedServiceDeliveryLocation|IncidentalServiceDeliveryLocation].target={o}", | ||
$"participation[Location|InformationRecipient|EntryLocation].player={o}&participation[RecordTarget].player.relationship[DedicatedServiceDeliveryLocation|IncidentalServiceDeliveryLocation].target=!{o}" | ||
}).ToList(), | ||
ResourceType = typeof(SubstanceAdministration), | ||
Triggers = SynchronizationPullTriggerType.Always | ||
}); | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters