Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/server/API/Controllers/ConfigController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public ActionResult<ConfigDTO> Get()
},
Client = new ClientOptionsDTO
{
FindPatients = new ClientOptionsDTO.FindPatientsDTO
{
AllowEmptyConcepts = clientOptions.FindPatients.AllowEmptyConcepts
},
Map = new ClientOptionsDTO.MapOptionsDTO
{
Enabled = clientOptions.Map.Enabled,
Expand Down
6 changes: 6 additions & 0 deletions src/server/API/DTO/Compiler/ConceptDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class ConceptDTO : ConceptRefDTO
public bool IsParent { get; set; }
public bool IsEncounterBased { get; set; }
public bool IsPatientCountAutoCalculated { get; set; }
public bool IsQueryable { get; set; }
public bool IsSpecializable { get; set; }
public string UiDisplayName { get; set; }
public string UiDisplayText { get; set; }
Expand Down Expand Up @@ -58,6 +59,11 @@ public ConceptDTO(Concept c) : base(c)
UiDisplayEventName = c.UiDisplayEventName;
UiNumericDefaultText = c.UiNumericDefaultText;
EventTypeId = c.EventTypeId;

// A field is queryable by default, but can be considered ineligible for querying
// if it doesn't have query fields (WHERE and numeric) defined.
IsQueryable = !(string.IsNullOrWhiteSpace(c.SqlFieldNumeric)
&& string.IsNullOrWhiteSpace(c.SqlSetWhere));
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/server/API/DTO/Config/ConfigDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,17 @@ public class AttestationCreditsDTO

public class ClientOptionsDTO
{
public FindPatientsDTO FindPatients = new FindPatientsDTO();
public MapOptionsDTO Map = new MapOptionsDTO();
public VisualizeOptionsDTO Visualize = new VisualizeOptionsDTO();
public TimelinesOptionsDTO Timelines = new TimelinesOptionsDTO();
public PatientListOptionsDTO PatientList = new PatientListOptionsDTO();
public HelpOptionsDTO Help = new HelpOptionsDTO();

public class FindPatientsDTO
{
public bool AllowEmptyConcepts { get; set; }
}
public class MapOptionsDTO
{
public bool Enabled { get; set; }
Expand Down
5 changes: 5 additions & 0 deletions src/server/API/Options/Config.Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public partial class Config
{
public static class Client
{
public static class FindPatients
{
public const string Section = @"Client:FindPatients";
public const string AllowEmptyConcepts = @"Client:FindPatients:AllowEmptyConcepts";
}
public static class Map
{
public const string Section = @"Client:Map";
Expand Down
3 changes: 3 additions & 0 deletions src/server/API/Options/StartupExtensions.Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ static IServiceCollection ConfigureClientOptions(this IServiceCollection service
{
services.Configure<ClientOptions>(opts =>
{
// Find Patients
opts.FindPatients.AllowEmptyConcepts = config.GetValue<bool>(Config.Client.FindPatients.AllowEmptyConcepts);

// Map
opts.Map.Enabled = config.GetValue<bool>(Config.Client.Map.Enabled);
opts.Map.TileURI = config.GetValue<string>(Config.Client.Map.TileURI);
Expand Down
3 changes: 3 additions & 0 deletions src/server/API/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
}
},
"Client": {
"FindPatients": {
"AllowEmptyConcepts": true
},
"Map": {
"Enabled": true,
"TileURI": "https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}"
Expand Down
6 changes: 6 additions & 0 deletions src/server/Model/Options/ClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ namespace Model.Options
{
public class ClientOptions
{
public FindPatientsOptions FindPatients = new FindPatientsOptions();
public MapOptions Map = new MapOptions();
public VisualizeOptions Visualize = new VisualizeOptions();
public TimelinesOptions Timelines = new TimelinesOptions();
public PatientListOptions PatientList = new PatientListOptions();
public HelpOptions Help = new HelpOptions();

public class FindPatientsOptions
{
public bool AllowEmptyConcepts { get; set; }
}

public class MapOptions
{
public bool Enabled { get; set; }
Expand Down
Loading