namespace Pluto.Api { using System; using System.Collections; using System.Collections.Generic; using System.Linq; using RemObjects.SDK; using RemObjects.SDK.Types; using RemObjects.SDK.Server; using RemObjects.SDK.Server.ClassFactories; using PlutoServer.PracticeChoice; [RemObjects.SDK.Server.ClassFactories.StandardClassFactory()] [RemObjects.SDK.Server.Service(Name = "Medication", InvokerClass = typeof(Medication_Invoker), ActivatorClass = typeof(Medication_Activator))] public class Medication : RemObjects.SDK.Server.Service, IMedication { private System.ComponentModel.Container components = null; public Medication() : base() { this.InitializeComponent(); } private void InitializeComponent() { } protected override void Dispose(bool aDisposing) { if(aDisposing) { if((this.components != null)) { this.components.Dispose(); } } base.Dispose(aDisposing); } public virtual MedicationInfo1[] Search(string apiKey, string searchString) { if(Utility.IsAPIKeyValid(apiKey)) { var authToken = (string)this.Session[SessionKeys.AuthToken]; var medication = new PlutoServer.PracticeChoice.Core.Medication(); var medsList = medication.Search(authToken, searchString); return medsList.ToArray(); } else { return null; } } } }