Archive

Archive for March, 2009

The corporate Beast and Veterinary Science

March 19th, 2009 Comments off

Corporate Veterinary Medicine has been an issue that has been growing for veterinarians world wide.   America was probably the first country to have to face this issue and it has never really gone away.  Australia is now facing the first of what will probably be a few corporate buys.   As always there are two sides to every coin and I hope to examine the issues facing both the veterinary client and the veterinarian.

Issues facing Veterinarians…..

I am 55, I have been the sole owner of a two man practice for the last 15-20 years.  The practice has a nice annual turnover and I do okay.  BUT.  I am the sole provider for my family,  I have put 2 kids through school and I live in a nice suburb in an average to good house, which I don’t own yet but I am pretty close.  I have about $300,000 in super which has recently taken a massive beating on the stock market to half in value!

While this is completely fabricated, there is a certain reality to it that will ring true in a number of veterinary owners.   What options do they have?  They can ask the associate if they would like to buy into the partnership, and then plan a sucession.  They can sell the practice outright.

Selling outright has its issues with the transfer of goodwill and the valuation.  The partnership process can be stressful and owners used to answering only to themselves can find the concept of shared decision making affronting.    Plus associates now days leave university with massive debts to repay from their education and find it hard to cover the funds that veterinary practice owners expect to receive.   Enter the Coporation…..they are often flush with cash and have motivation in buying certain practices beyond the turn over of the individual practice.   Who can blame the overworked, stressed out and tired practitioner taking the money and running…..

….The Veterinary Employee….

So I need a job….I have a 70k debt from uni….I want a practice that will support my development and provide good working conditions, I am not particular fond of working after hours.

The sole practitioner looking for an associate is going to have a hard time convincing this person to work for them…they need and expect a associate to put in the same hours and hard work they did…its a rite of passage to owning a practice…..

The corporate beast however can offer excellent working hours…with no after hours or very minimal as they can spread the load across their clinics.

Where would you go…..

Issues for the Client…..

So what do we lose.

We lose the community nature of veterinary practice….the local vet was a member of the community.  He usually was found supporting the community after all they represented his income…

We lose the continuity of care a sole practitioner could provide, the unique rapport  they develop with clients.  Sure the corporate practices are not going anywhere but I would say they normally experience a moderate amount of staff turn over so the vet you saw last year may not be there next year.

We lose market competition.  You can argue what you like but there is no doubt that the trend to large corporate owned supermarkets has lead to less competition and increasing prices in the consumer experience.  It’s not hard to see how that can be applied to any industry.   There is no doubt we will see market pressure applied to smaller practices to force them out….

I could go on….

I am seeing a number of clients leaving the corporates to go back to the local practitioner who runs a solo practice, but in the same breath I see people who in this consumerist society don’t give it a second thought and in the process of yearly and routine checkups it wont really affect them…but when the cookie crunches and there pet is sick and they need to find the compassion financially they are going to be left with a bitter taste.

In the end it will be a community and public decision voted with feet.  Where would you prefer your pet get treated?

Share
Categories: vet Tags: , , ,

Sending Mail from Powershell 2.0 CTP3 with Attachments

March 14th, 2009 Comments off

I had seen a number of scripts detailing how to send mail from Powershell v2.0, but the limitation that always seemed to appear was that they used SMTP to do so and didnt allow complex mail formation… So I investigated .Net to see if it was possible, low and behold I came accross the following Class….

System.net.mail Namespace

and then more specifically

System.net.mail.mailmessage Class

It was this mail message class I based the following script on

#Collect Events from That are errors and report
$A = Get-date -hour 0 -minute 0 -Second 0
$logfile = $env:Temp,"applog.html" -join ""
$logfile2 = $env:Temp,"syslog.html" -join ""
$SmtpClient = new-object system.net.mail.smtpClient
$SmtpServer = "smtp.domain.com.au"
$SmtpClient.host = $SmtpServer
$log2 = Get-EventLog -LogName System -After $a -EntryType Error
$log = Get-EventLog -LogName Application -After $a -EntryType Error
If (($log.count + $log2.count) -gt 0)
{
$MailMessage = new-object system.net.mail.Mailmessage -Args "system@domain.com.au","user@domain.com.au"
$MailMessage.From = "System Log <ystem@domain.com.au>"
$MailMessage.Subject = "Syslogs for $a"
If ($log.count -gt 0){
$log | convertto-html -Property index, TimeGenerated, InstanceID, Source, Message   -Title "Application Log for $a" > $logfile
$mailmessage.attachments.add($logfile)
}
if ($log2.count -gt 0){
$log2 | convertto-html -Property index, TimeGenerated, InstanceID, Source, Message   -Title "System Log for $a" > $logfile2
$mailmessage.attachments.add($logfile2)
}
$SmtpClient.send($mailmessage)
$mailmessage.finalize
$mailmessage.dispose()
$SmtpClient.finalize
If (Test-Path $logfile){Remove-Item -Force -Path $logfile}
If (Test-Path $logfile2){Remove-Item -Force -Path $logfile2}
}

So thats the entire script…now onto a breakdown

So we start with this

$logfile = $env:Temp,"applog.html" -join ""
$logfile2 = $env:Temp,"syslog.html" -join ""

Here I declare two objects containing two temporary files I intend to fill with information and then attach to an email. $env:temp simply takes the default temp directory path and appends it two the file name with a join. A new cmdlet is planned called new-path which I think will be a better alternative here.

$SmtpClient = new-object system.net.mail.smtpClient
$SmtpServer = "smtp.domain.com.au"
$SmtpClient.host = $SmtpServer

This section declares a new object as a net smtpclient – this object will send my mail a little later.

$log2 = Get-EventLog -LogName System -After $a -EntryType Error
$log = Get-EventLog -LogName Application -After $a -EntryType Error

Here I am getting some info to send my self  – in this case I am asking for any errors in the application and system logs that have occured today. I define a$ previously as

$A = Get-date -hour 0 -minute 0 -Second 0

Basically a time call.  Okay now I need to process my data a little do some checking to ensure I am not processing nothing and then send the mail.

If (($log.count + $log2.count) -gt 0)
{

This just checks that one of the logs actually returned some entries otherwise we are wasting our time and I dont need empty emails!

$MailMessage = new-object system.net.mail.Mailmessage -Args "system@domain.com.au","user@domain.com.au"
$MailMessage.From = "System Log <ystem@domain.com.au>"
$MailMessage.Subject = "Syslogs for $a"

Now this part is the message.   I created a new object based on the Mailmessage class.  You need to specify the from and to address’s as args as the class property of  “to” is readonly and if you tried to declare it like

$mailmessage.to ="user@domain.com"

You would get an error stating the property was readonly.

Now some more error checking to ensure  which log returned values.  Then only attach that result.

If ($log.count -gt 0){
$log | convertto-html -Property index, TimeGenerated, InstanceID, Source, Message   -Title "Application Log for $a" > $logfile
$mailmessage.attachments.add($logfile)
}

Here we see I parse the result to a html file.  It makes for a nice easy read.  Then I call the Add method of the mailmessage.attachment property and add the log file to the message.

The attachments property is actually a collection and you can use a single command to add more that 1 file as long as you delimit each file with a comma.

I repeated the process for log2

$SmtpClient.send($mailmessage)

And then I send the message

Now I need to clean up. This part is really important particularly if the script is executed in a continually running powershell session rather than a 1 off instance.  For two reasons.  The mail message class once you add a file locks it.  Even once the script ends the file will remain locked.  It will only unlock after the powershell instance ends.  Thats too late as you cant remove your temp files and clean up after yourself which is just rude!

So I need to call two methods, firstly I finalize mailmessage, I am not sure if this was actually neccessary but reading the technet docs it seemed the smart way to go.  Then I dispose of the mailmessage object.  This unhooks it and leaves the files that you added open to removal.  I think after going a bit of reading net objects have a habit of doing this and it is probably good policy to always dispose the objects once you are finished if its possble.

So her goes

$mailmessage.finalize
$mailmessage.dispose()
$SmtpClient.finalize
If (Test-Path $logfile){Remove-Item -Force -Path $logfile}
If (Test-Path $logfile2){Remove-Item -Force -Path $logfile2}
}

And we are done.  One last comment

I hate errors, so I test for the existence of each logfile before removing them …just to avoid errors in case I never created them.

The Script above is based on
Windows Powershell 2.o CTP2
.NET Framework 3.5
It may not work onother .NET versions.
Upgrade to the latest version if possible.
Windows PowerShell 2.0 includes several significant features that extend its use, improve its usability, and allow you to control and manage Windows-based environments more easily and comprehensively. Windows PowerShell 2.0 is backward compatible. Cmdlets, providers, snap-ins, scripts, functions, and profiles that were designed for Windows PowerShell 1.0 work in Windows PowerShell 2.0 without changes.
Share