Skip to content

Instantly share code, notes, and snippets.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET NOCOUNT ON
GO
IF (OBJECT_ID('RebuildIndexes') IS NOT NULL)
DROP PROCEDURE RebuildIndexes
GO
@Romiko
Romiko / DicomQueryManager.cs
Last active August 29, 2015 14:03
DICOM Query Wrapper
using System;
using System.Linq;
using DicomObjects;
using DicomObjects.Enums;
namespace Dicom
{
public class DicomQueryManager : IDicomQueryManager
{
public string CurrentServer { get; set; }
@Romiko
Romiko / KillProcesses.cs
Last active August 29, 2015 14:04
Kill Process for current user
public static void KillProcesses(string processName, bool currentUserOnly, Process excludeMe = null)
{
var processes = new ManagementObjectSearcher(string.Format("SELECT * FROM Win32_Process WHERE Name='{0}'", processName)).Get();
foreach (var o in processes)
{
var process = (ManagementObject)o;
var processId = int.Parse(process["ProcessId"].ToString());
if (process["ExecutablePath"] == null) continue;
if (excludeMe != null && processId == excludeMe.Id) continue;
var ownerInfo = new object[2];
@Romiko
Romiko / PowerscribeStatus.cs
Created August 1, 2014 01:15
PowerscribeStatus
namespace Powerscribe.Client
{
public enum PowerscribeStatus
{
/// <summary>
/// Specifies that a report was created and then discarded.
/// </summary>
Discarded = -1,
/// <summary>
@Romiko
Romiko / ReportChanged.cs
Created August 1, 2014 01:40
PowerScribe Status
private void ReportChanged(string siteName, string accessionNumbers, int radWhereReportStatus, bool isaddendum, string plaintext, string richtext)
{
Logger.Debug("Report {0} Site:{1} AccessionNumber: {2} Status: {3}", ReportEvent.Changed, siteName, accessionNumbers, (RadWhereReportStatus)radWhereReportStatus);
if (PowerscribeStatus.UnknownOrPending == (PowerscribeStatus)radWhereReportStatus)
return;
Hub.Publish(HubEvents.DictationSystem.PSInterop.ReportChanged);
}
source 'https://rubygems.org'
gem 'paperclip'
gem 'aws-sdk'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
@Romiko
Romiko / RebuildIndexes
Created November 24, 2014 22:19
Rebuild Indexes
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET NOCOUNT ON
GO
IF (OBJECT_ID('RebuildIndexes') IS NOT NULL)
DROP PROCEDURE RebuildIndexes
GO
@Romiko
Romiko / FormBoundToScreen
Last active August 29, 2015 14:15
Windows Form - Keep bounded within the viewable part of a multiple screen/monitor configuration
private void DockFormIfOutOfViewableArea()
{
var widthTolerance = Location.X + (Width / 2);
var heightTolerance = Location.Y + (Height / 2);
Screen.AllScreens.OrderBy(r => r.WorkingArea.X).ForEach(screen =>
{
if (!IsOnThisScreen(screen)) return;
if (heightTolerance > screen.WorkingArea.Height)
Location = new Point(screen.WorkingArea.X, screen.Bounds.Height - Height + screen.Bounds.Y);
@Romiko
Romiko / InstallNServicebus.ps1
Created February 17, 2015 00:51
Powershell install NServicebus
#requires -version 2.0
param (
[parameter(Mandatory=$true)] [string]$password,
[string]$type = "Release",
[string]$profile = "NServiceBus.Production",
[string]$userName = "IPO\ServiceBus",
[array]$binfolders = @("SB.Pacs.Pollers","SB.Orders.ScannedDocuments", "SB.Billing.SaveOrderParts", "SB.OrderService.SaveOrders", "SB.Orders.ProcessDicomImages"), #The Order is important!
[bool]$sideBySide = $false #Install multiple version, won't uninstall existing service.
)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using DicomObjects;
using DicomObjects.Enums;
namespace SB.Shared.Dicom
{
public class DicomQueryManager : IDicomQueryManager
{