private void MapInput(IServiceInput serviceInput) { if (_activeDataList.ActiveDataList != null) { MapInputToActiveDatalist(serviceInput); } }
private static async Task <PopulationResult> CallService(IService <IServiceInput, IServiceOutput> focusedService, IServiceInput serviceInput, string expandableKey = null) { IServiceOutput output = null; switch (focusedService.Type) { case ServiceType.DatabaseCall: break; case ServiceType.HttpCall: if (!(focusedService is HttpService service)) { throw new Exception($"Invalid HttpService defined for service {focusedService.ServiceName}"); } output = await service.InvokeAsync(serviceInput as HttpServiceOptions); if (expandableKey != null) { output.KeyPrefix = expandableKey; } break; } return(output.PopulationResult); }
private static void MapInput(IServiceInput serviceInput) { if (DataListSingleton.ActiveDataList != null) { MapInputToActiveDatalist(serviceInput); } }
private void MapInputToActiveDatalist(IServiceInput serviceInput) { if (!serviceInput.IsObject) { MapToScalar(serviceInput); } else { MapToObject(serviceInput); } }
private void MapToScalar(IServiceInput serviceInput) { if (_activeDataList.ActiveDataList.ScalarCollection != null) { var value = serviceInput.Name; if (value != null) { var variable = DataListUtil.AddBracketsToValueIfNotExist(value.Split('(').First().TrimEnd(' ')); serviceInput.Value = variable; } } }
public IServiceResult Update(IServiceInput input) { var vm = input as UpdatePatientVM; // map patient var patient = UpdatePatientVMMapper.MapToPatient(vm); // call core method var retval = Update(patient); // return mapped result return(PatientMapper.MapToUpdatePatientVM(retval)); }
public IServiceResult Search(IServiceInput input) { var vm = input as SearchForPatientVM; // map patient var patient = SearchForPatientVMMapper.MapToPatient(vm); // call core method var retval = Retrieve(patient); //return mapped result return(PatientMapper.MapToSearchForPatientVM(retval)); }
public IServiceResult Create(IServiceInput input) { var vm = input as CreatePatientVM; // map patient Patient patient = CreatePatientVMMapper.MapToPatient(vm); // call core method CreatePatientResult retval = Create(patient, vm.DepartmentID); // return mapped result return(PatientMapper.MapToCreatePatientVM(patient, retval)); }
private void MapToObject(IServiceInput serviceInput) { if (_activeDataList.ActiveDataList.ComplexObjectCollection != null) { var value = serviceInput.Name; if (value != null) { value = value.Split('(').First().TrimEnd(' '); var objectName = "@" + value; var variable = DataListUtil.AddBracketsToValueIfNotExist(objectName); serviceInput.Value = variable; } } }
private void AddWarewolfAtomResults(List <IDebugItem> results, IServiceInput serviceInput, CommonFunctions.WarewolfEvalResult tmpEntry, DebugItem itemToAdd) { if (tmpEntry is CommonFunctions.WarewolfEvalResult.WarewolfAtomResult warewolfAtomResult) { var variableName = serviceInput.Value; if (DataListUtil.IsEvaluated(variableName)) { AddDebugItem(new DebugItemWarewolfAtomResult(warewolfAtomResult.Item.ToString(), DataListUtil.AddBracketsToValueIfNotExist(variableName), ""), itemToAdd); } else { AddDebugItem(new DebugItemStaticDataParams(warewolfAtomResult.Item.ToString(), ""), itemToAdd); } } results.Add(itemToAdd); }
private void AddWarewolfAtomListResults(List <IDebugItem> results, IServiceInput serviceInput, CommonFunctions.WarewolfEvalResult tmpEntry, DebugItem itemToAdd) { if (tmpEntry is CommonFunctions.WarewolfEvalResult.WarewolfAtomListresult warewolfAtomListResult) { var variableName = serviceInput.Value; if (DataListUtil.IsValueRecordset(variableName)) { AddDebugItem(new DebugItemWarewolfAtomListResult(warewolfAtomListResult, "", "", DataListUtil.AddBracketsToValueIfNotExist(variableName), "", "", "="), itemToAdd); } else { var warewolfAtom = warewolfAtomListResult.Item.Last(); AddDebugItem(new DebugItemWarewolfAtomResult(warewolfAtom.ToString(), DataListUtil.AddBracketsToValueIfNotExist(variableName), ""), itemToAdd); } } results.Add(itemToAdd); }
public IServiceResult Create(IServiceInput input) { var vm = input as CreateAppointmentVM; //var providers = providerService.Search(new ProviderSearchInput()); //TODO: pass in provider ID var apptReasons = GetAppointmentReasons(vm.ProviderID); //var apptSlots = GetAppointmentSlots(); // map patient Appointment appointment = CreateAppointmentVMMapper.MapToAppointment(vm); // call core method CreateAppointmentResult retval = Create(appointment, vm.DepartmentID); // return mapped result return(AppointmentMapper.MapToCreateAppointmentVM(appointment, retval)); }
void ViewObjectsResultForParameterInput(IServiceInput input) { JsonObjectsView?.ShowJsonString(JSONUtils.Format(input.Dev2ReturnType)); }
void AddInput(int update, IWarewolfListIterator itrCollection, ICollection <IWarewolfIterator> itrs, IServiceInput sai) { var val = sai.Name; string toInject = null; if (val != null) { toInject = sai.Value; } else { if (!sai.EmptyIsNull) { toInject = ""; } } var paramIterator = new WarewolfIterator(DataObj.Environment.Eval(toInject, update)); itrCollection.AddVariableToIterateOn(paramIterator); itrs.Add(paramIterator); }
public IServiceResult Update(IServiceInput input) { throw new NotImplementedException(); }
public IServiceResult Search(IServiceInput input) { JToken providers = GetProviders(); return(ProviderMapper.MapJTokenToProviderSearchResult(providers)); }
public static async Task <PopulationResultCollection> CollectData <T>(AnalyticalObject <T> focusedObject, IServiceInput serviceInput) { if (focusedObject.ServiceName == null) { throw new Exception("Root analyzer object must have a service defined."); } if (!FluentOlapConfiguration.ServiceDefinitions.ContainsKey(focusedObject.ServiceName)) { throw new Exception($"Service {focusedObject.ServiceName} not defined."); } IService <IServiceInput, IServiceOutput> focusedService = FluentOlapConfiguration.ServiceDefinitions[focusedObject.ServiceName]; PopulationResultCollection results = new PopulationResultCollection(); PopulationResult rootResult = await CallService(focusedService, serviceInput); results.Add(rootResult); foreach (var expandable in focusedObject.ExpandableChildren) { if (expandable.Value.ServiceName == null) { throw new Exception("Child analyzer object must have a service defined."); } if (!FluentOlapConfiguration.ServiceDefinitions.ContainsKey(expandable.Value.ServiceName)) { throw new Exception($"Service {expandable.Value.ServiceName} not defined."); } IService <IServiceInput, IServiceOutput> expandableService = FluentOlapConfiguration.ServiceDefinitions[expandable.Value.ServiceName]; IServiceInput input = null; switch (expandableService.Type) { case ServiceType.HttpCall: HttpService expandableHttpService = expandableService as HttpService; IDictionary <string, string> parameters = new Dictionary <string, string>(); foreach (string innerParam in expandableHttpService.GetRequiredParameters()) { JToken parsedRoot = JToken.Parse(rootResult.Raw); parameters.Add(innerParam, parsedRoot[innerParam].Value <string>()); } input = new HttpServiceOptions { PrefixKey = expandable.Value.NodeName, Parameters = parameters }; await expandableHttpService.InvokeAsync((HttpServiceOptions)input); break; } results.Add(await CallService(expandableService, input)); } return(results); }
private void ViewJsonObjects(IServiceInput input) { JsonObjectsView?.ShowJsonString(JSONUtils.Format(JSONUtils.Format(input.Dev2ReturnType))); }