Initial Commit
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Pluto.Api;
|
||||
using McKesson.PPS.Fusion.Schedule.Business;
|
||||
using McKesson.PPS.Fusion.Authentication.Business;
|
||||
using McKesson.PPS.Fusion.Business.Common.Context;
|
||||
|
||||
namespace PlutoServer.PracticeChoice.Scheduling {
|
||||
public class Calendar {
|
||||
public IList<AppointmentInfo1> GetAppointments(string authToken, ProviderInfo1 providerInfo, int calendarId, DateTime startDateTime, DateTime endDateTime) {
|
||||
IList<AppointmentInfo1> apptList = null;
|
||||
MagicIdentity identity = MagicIdentity.FromCookieString(authToken);
|
||||
if(identity.IsAuthenticated) {
|
||||
MagicPrincipal principal = new MagicPrincipal(identity);
|
||||
|
||||
//Logger.Write(string.Format("MagicIdentity authenticated is {0}", identity.IsAuthenticated));
|
||||
Csla.ApplicationContext.User = principal;
|
||||
var userContext = UserContext.GetInstance();
|
||||
|
||||
var providerId = (providerInfo == null ? identity.Name : providerInfo.UserId);
|
||||
|
||||
if(calendarId < 1) {
|
||||
calendarId = this.GetProviderDefaultCalendar(providerId);
|
||||
}
|
||||
if(calendarId > 0) {
|
||||
var criteria = new CalendarDataCriteria() { CalendarID = calendarId, StartDateTime = startDateTime, EndDateTime = endDateTime };
|
||||
var apptInfoList = AppointmentList.GetAppointmentList(criteria);
|
||||
if(null != apptInfoList) {
|
||||
apptList = (from ai in apptInfoList
|
||||
where ai.CalendarId == calendarId
|
||||
select new AppointmentInfo1() {
|
||||
EndDateTime = ai.EndDate,
|
||||
Id = ai.Id,
|
||||
Reason = ai.Reason,
|
||||
StartDateTime = ai.StartDate,
|
||||
Patient = new PatientInfo1() {
|
||||
DOB = DateTime.Parse(ai.Patient.DOB),
|
||||
FirstName = ai.Patient.FirstName,
|
||||
Id = ai.Patient.PersonID,
|
||||
LastName = ai.Patient.LastName,
|
||||
ChartId = ai.Patient.ChartID
|
||||
}
|
||||
}).ToList<AppointmentInfo1>();
|
||||
}
|
||||
}
|
||||
}
|
||||
return apptList;
|
||||
}
|
||||
|
||||
private int GetProviderDefaultCalendar(string providerId) {
|
||||
int calendarId = 0;
|
||||
var calInfolist = CalendarInfoList.GetCalendarInfoList(pageIndex: 1, pageSize: 100);
|
||||
if(null != calInfolist) {
|
||||
//foreach(var calInfo in calInfolist) {
|
||||
// System.Diagnostics.Debug.WriteLine(string.Format("Calendar: {0}, Default Provider Id: {1}", calInfo.CalendarName, calInfo.DefaultProviderId));
|
||||
//}
|
||||
var calendar = (from ci in calInfolist
|
||||
where (string.Compare(ci.DefaultProviderId, providerId, StringComparison.InvariantCultureIgnoreCase) == 0)
|
||||
select ci).FirstOrDefault();
|
||||
if(calendar != null) {
|
||||
calendarId = calendar.Id;
|
||||
}
|
||||
}
|
||||
return calendarId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{24B30553-0E52-479C-93A0-FEA2CC512A58}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PlutoServer.PracticeChoice.Scheduling</RootNamespace>
|
||||
<AssemblyName>PlutoServer.PracticeChoice.Scheduling</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\Target\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Authentication.Business">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Authentication.Business.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Business.BusinessBase">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Business.BusinessBase.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Business.Common">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Business.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Business.Common.Security">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Business.Common.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Csla">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Csla.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RemObjects.SDK">
|
||||
<HintPath>..\..\3rdParty\RemObjects\Server\RemObjects.SDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Schedule.Business">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Schedule.Business.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Schedule.Data">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Schedule.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Schedule.DataAccess">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Schedule.DataAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Schedule.Resources.Server">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Schedule.Resources.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Calendar.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PlutoServer.PracticeChoice.Interfaces\PlutoServer.PracticeChoice.Interfaces.csproj">
|
||||
<Project>{77B7DE2F-677F-49E7-A452-D60FC4D27944}</Project>
|
||||
<Name>PlutoServer.PracticeChoice.Interfaces</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("PlutoServer.PracticeChoice.Scheduling")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PlutoServer.PracticeChoice.Scheduling")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("2adf1655-a6e0-4520-97f1-5d146d9992d1")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Reference in New Issue
Block a user