Skip to content

Commit

Permalink
tidy up adds
Browse files Browse the repository at this point in the history
  • Loading branch information
JFriel committed Nov 13, 2023
1 parent bb1d2a8 commit d044a46
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions Rdmp.Dicom/ExternalApis/SemEHRConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Newtonsoft.Json.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Text.Json.Nodes;

namespace Rdmp.Dicom.ExternalApis
{
Expand Down Expand Up @@ -288,22 +289,28 @@ public JObject GetQueryJson()
termsArray.Add(termsObj);

//Set the filter
dynamic filterObj = new JObject();
var filterObj = new JObject();
if (UseStartDate)
filterObj.start_date = StartDate.ToString(StartEndDateFormat);
filterObj.Add("start_date", StartDate.ToString(StartEndDateFormat));
//filterObj.start_date = StartDate.ToString(StartEndDateFormat);
if (UseEndDate)
filterObj.end_date = EndDate.ToString(StartEndDateFormat);
filterObj.Add("end_date", EndDate.ToString(StartEndDateFormat));
//filterObj.end_date = EndDate.ToString(StartEndDateFormat);
if (Modalities.Count > 0)
filterObj.modalities = new JArray(Modalities);
filterObj.Add("modalities", new JArray(Modalities));
//filterObj.modalities = new JArray(Modalities);

//Create API JSON
dynamic apiCallJson = new JObject();
apiCallJson.terms = termsArray;
apiCallJson.filter = filterObj;
var apiCallJson = new JObject();
apiCallJson.Add("terms", termsArray);
apiCallJson.Add("filter", filterObj);
//apiCallJson.terms = termsArray;
//apiCallJson.filter = filterObj;
/*if (ReturnFields.Count > 0)
apiCallJson.returnFields = new JArray(ReturnFields);*/
if (!string.IsNullOrWhiteSpace(ReturnField))
apiCallJson.returnFields = new JArray(ReturnField);
apiCallJson.Add("returnFields", new JArray(ReturnField));
//apiCallJson.returnFields = new JArray(ReturnField);

return apiCallJson;
}
Expand Down

0 comments on commit d044a46

Please sign in to comment.